Fawkes API Fawkes Development Version
net_messages.h
1
2/***************************************************************************
3 * config_messages.h - Fawkes Configuration Messages
4 *
5 * Created: Sat Jan 06 23:14:59 2007
6 * Copyright 2006-2007 Tim Niemueller [www.niemueller.de]
7 *
8 ****************************************************************************/
9
10/* This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version. A runtime exception applies to
14 * this software (see LICENSE.GPL_WRE file mentioned below for details).
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22 */
23
24#ifndef _FAWKES_CONFIG_MESSAGES_H_
25#define _FAWKES_CONFIG_MESSAGES_H_
26
27#include <netcomm/utils/dynamic_buffer.h>
28
29#include <stdint.h>
30
31#pragma pack(push, 4)
32
33namespace fawkes {
34
35#define MSG_CONFIG_GET_FLOAT 1
36#define MSG_CONFIG_GET_UINT 2
37#define MSG_CONFIG_GET_INT 3
38#define MSG_CONFIG_GET_BOOL 4
39#define MSG_CONFIG_GET_STRING 5
40#define MSG_CONFIG_GET_VALUE 6
41#define MSG_CONFIG_GET_COMMENT 7
42#define MSG_CONFIG_GET_DEFAULT_COMMENT 8
43#define MSG_CONFIG_GET_BEGIN MSG_CONFIG_GET_FLOAT
44#define MSG_CONFIG_GET_END MSG_CONFIG_GET_DEFAULT_COMMENT
45#define MSG_CONFIG_GET_ALL 9
46
47#define MSG_CONFIG_SET_FLOAT 10
48#define MSG_CONFIG_SET_UINT 11
49#define MSG_CONFIG_SET_INT 12
50#define MSG_CONFIG_SET_BOOL 13
51#define MSG_CONFIG_SET_STRING 14
52#define MSG_CONFIG_SET_COMMENT 15
53#define MSG_CONFIG_SET_DEFAULT_FLOAT 16
54#define MSG_CONFIG_SET_DEFAULT_UINT 17
55#define MSG_CONFIG_SET_DEFAULT_INT 18
56#define MSG_CONFIG_SET_DEFAULT_BOOL 19
57#define MSG_CONFIG_SET_DEFAULT_STRING 20
58#define MSG_CONFIG_SET_DEFAULT_COMMENT 21
59#define MSG_CONFIG_SET_BEGIN MSG_CONFIG_SET_FLOAT
60#define MSG_CONFIG_SET_END MSG_CONFIG_SET_DEFAULT_COMMENT
61#define MSG_CONFIG_ERASE_VALUE 22
62
63#define MSG_CONFIG_GET_TAGS 25
64#define MSG_CONFIG_LOAD_TAG 26
65#define MSG_CONFIG_SAVE_TAG 27
66#define MSG_CONFIG_INV_TAG 28
67#define MSG_CONFIG_DEL_TAG 29
68
69#define MSG_CONFIG_FLOAT_VALUE 30
70#define MSG_CONFIG_UINT_VALUE 31
71#define MSG_CONFIG_INT_VALUE 32
72#define MSG_CONFIG_BOOL_VALUE 33
73#define MSG_CONFIG_STRING_VALUE 34
74#define MSG_CONFIG_COMMENT_VALUE 35
75#define MSG_CONFIG_VALUE_BEGIN MSG_CONFIG_FLOAT_VALUE
76#define MSG_CONFIG_VALUE_END MSG_CONFIG_COMMENT_VALUE
77#define MSG_CONFIG_INV_VALUE 36
78#define MSG_CONFIG_VALUE_ERASED 37
79#define MSG_CONFIG_LIST 38
80
81#define MSG_CONFIG_SUBSCRIBE 50
82#define MSG_CONFIG_UNSUBSCRIBE 51
83
84/* Length definitions */
85#define CONFIG_MSG_PATH_LENGTH 128
86#define CONFIG_MSG_MAX_TAG_LENGTH 64
87
88/** Basic config descriptor.
89 * Path that defines a unique element in the configuration.
90 * It is part of most messages.
91 */
92typedef struct
93{
94 char path[CONFIG_MSG_PATH_LENGTH]; /**< path to config value. */
95 uint16_t is_default : 1; /**< 1 if value is a default value, 0
96 * otherwise, only for get response */
97 uint16_t reserved : 15; /**< Reserved for future use. */
98 uint16_t num_values; /**< Number of valus in list. */
100
101/** Get value message. */
102typedef struct
103{
104 config_descriptor_t cp; /**< value descriptor */
106
107/** Invalid value request message. */
108typedef struct
109{
110 config_descriptor_t cp; /**< value descriptor */
112
113/** Erase value request. */
114typedef struct
115{
116 config_descriptor_t cp; /**< value descriptor */
118
119/** Value erased message. */
120typedef struct
121{
122 config_descriptor_t cp; /**< value descriptor */
124
125/** String value header indicating the string length. */
126typedef struct
127{
128 uint16_t s_length; /**< Length of following string */
129 uint16_t reserved; /**< Reserved for future use */
131
132/** Comment message */
133typedef struct
134{
135 config_descriptor_t cp; /**< value descriptor */
136 uint16_t s_length; /**< Length of following string */
137 char s[2]; /**< comment, 0-terminated */
139
140/** Tag message. */
141typedef struct
142{
143 config_descriptor_t cp; /**< value descriptor */
144 char tag[CONFIG_MSG_MAX_TAG_LENGTH]; /**< tag */
146
147/** Config list message. */
148typedef struct
149{
150 dynamic_list_t config_list; /**< DynamicBuffer for list */
152
153/** Config list entity header. */
154typedef struct
155{
156 config_descriptor_t cp; /**< Config descriptor. */
157 uint32_t type : 8; /**< type of entity, uses MSG_CONFIG_*_VALUE message IDs */
158 uint32_t reserved : 24; /**< reserved for future use */
160
161} // end namespace fawkes
162
163#pragma pack(pop)
164
165#endif
Fawkes library namespace.
uint16_t s_length
Length of following string.
Definition: net_messages.h:136
config_descriptor_t cp
value descriptor
Definition: net_messages.h:135
Basic config descriptor.
Definition: net_messages.h:93
uint16_t reserved
Reserved for future use.
Definition: net_messages.h:97
uint16_t num_values
Number of valus in list.
Definition: net_messages.h:98
uint16_t is_default
1 if value is a default value, 0 otherwise, only for get response
Definition: net_messages.h:95
config_descriptor_t cp
value descriptor
Definition: net_messages.h:116
Get value message.
Definition: net_messages.h:103
config_descriptor_t cp
value descriptor
Definition: net_messages.h:104
Invalid value request message.
Definition: net_messages.h:109
config_descriptor_t cp
value descriptor
Definition: net_messages.h:110
Config list entity header.
Definition: net_messages.h:155
uint32_t type
type of entity, uses MSG_CONFIG_*_VALUE message IDs
Definition: net_messages.h:157
uint32_t reserved
reserved for future use
Definition: net_messages.h:158
config_descriptor_t cp
Config descriptor.
Definition: net_messages.h:156
Config list message.
Definition: net_messages.h:149
dynamic_list_t config_list
DynamicBuffer for list.
Definition: net_messages.h:150
String value header indicating the string length.
Definition: net_messages.h:127
uint16_t reserved
Reserved for future use.
Definition: net_messages.h:129
uint16_t s_length
Length of following string.
Definition: net_messages.h:128
config_descriptor_t cp
value descriptor
Definition: net_messages.h:143
config_descriptor_t cp
value descriptor
Definition: net_messages.h:122
Dynamic list type.