X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=include%2Flttng%2Fnotification%2Fchannel-internal.h;fp=include%2Flttng%2Fnotification%2Fchannel-internal.h;h=e684a963397c410d3de084abc12614b5258a5046;hb=daa81f582a5374fd38efc416be0c1feeed659dff;hp=0000000000000000000000000000000000000000;hpb=d30b2041e3a5db2d1671219ea845057cb3dd3082;p=lttng-tools.git diff --git a/include/lttng/notification/channel-internal.h b/include/lttng/notification/channel-internal.h new file mode 100644 index 000000000..e684a9633 --- /dev/null +++ b/include/lttng/notification/channel-internal.h @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2017 - Jérémie Galarneau + * + * This library is free software; you can redistribute it and/or modify it + * under the terms of the GNU Lesser General Public License, version 2.1 only, + * as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this library; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H +#define LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H + +#include +#include +#include +#include + +enum lttng_notification_channel_message_type { + LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_SUBSCRIBE = 0, + LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_UNSUBSCRIBE = 1, + LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_COMMAND_REPLY = 2, + LTTNG_NOTIFICATION_CHANNEL_MESSAGE_TYPE_NOTIFICATION = 3, +}; + +struct lttng_notification_channel_message { + /* enum lttng_notification_channel_message_type */ + int8_t type; + /* size of the payload following this field */ + uint32_t size; + char payload[]; +} LTTNG_PACKED; + +struct lttng_notification_channel_command_reply { + /* enum lttng_notification_channel_status */ + int8_t status; +} LTTNG_PACKED; + +struct lttng_notification_channel { + /* FIXME Add mutex to protect the socket from concurrent uses. */ + int socket; +}; + +#endif /* LTTNG_NOTIFICATION_CHANNEL_INTERNAL_H */