nmsg  0.9.0
ncap.pb-c.c
1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */
2 /* Generated from: nmsg/base/ncap.proto */
3 
4 /* Do not generate deprecated warnings for self */
5 #ifndef PROTOBUF_C__NO_DEPRECATED
6 #define PROTOBUF_C__NO_DEPRECATED
7 #endif
8 
9 #include "nmsg/base/ncap.pb-c.h"
10 void nmsg__base__ncap__init
11  (Nmsg__Base__Ncap *message)
12 {
13  static Nmsg__Base__Ncap init_value = NMSG__BASE__NCAP__INIT;
14  *message = init_value;
15 }
16 size_t nmsg__base__ncap__get_packed_size
17  (const Nmsg__Base__Ncap *message)
18 {
19  assert(message->base.descriptor == &nmsg__base__ncap__descriptor);
20  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
21 }
22 size_t nmsg__base__ncap__pack
23  (const Nmsg__Base__Ncap *message,
24  uint8_t *out)
25 {
26  assert(message->base.descriptor == &nmsg__base__ncap__descriptor);
27  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
28 }
29 size_t nmsg__base__ncap__pack_to_buffer
30  (const Nmsg__Base__Ncap *message,
31  ProtobufCBuffer *buffer)
32 {
33  assert(message->base.descriptor == &nmsg__base__ncap__descriptor);
34  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
35 }
36 Nmsg__Base__Ncap *
37  nmsg__base__ncap__unpack
38  (ProtobufCAllocator *allocator,
39  size_t len,
40  const uint8_t *data)
41 {
42  return (Nmsg__Base__Ncap *)
43  protobuf_c_message_unpack (&nmsg__base__ncap__descriptor,
44  allocator, len, data);
45 }
46 void nmsg__base__ncap__free_unpacked
47  (Nmsg__Base__Ncap *message,
48  ProtobufCAllocator *allocator)
49 {
50  assert(message->base.descriptor == &nmsg__base__ncap__descriptor);
51  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
52 }
53 static const ProtobufCFieldDescriptor nmsg__base__ncap__field_descriptors[7] =
54 {
55  {
56  "type",
57  1,
58  PROTOBUF_C_LABEL_REQUIRED,
59  PROTOBUF_C_TYPE_ENUM,
60  0, /* quantifier_offset */
61  offsetof(Nmsg__Base__Ncap, type),
62  &nmsg__base__ncap_type__descriptor,
63  NULL,
64  0, /* flags */
65  0,NULL,NULL /* reserved1,reserved2, etc */
66  },
67  {
68  "payload",
69  2,
70  PROTOBUF_C_LABEL_REQUIRED,
71  PROTOBUF_C_TYPE_BYTES,
72  0, /* quantifier_offset */
73  offsetof(Nmsg__Base__Ncap, payload),
74  NULL,
75  NULL,
76  0, /* flags */
77  0,NULL,NULL /* reserved1,reserved2, etc */
78  },
79  {
80  "ltype",
81  3,
82  PROTOBUF_C_LABEL_OPTIONAL,
83  PROTOBUF_C_TYPE_ENUM,
84  offsetof(Nmsg__Base__Ncap, has_ltype),
85  offsetof(Nmsg__Base__Ncap, ltype),
86  &nmsg__base__ncap_legacy_type__descriptor,
87  NULL,
88  0, /* flags */
89  0,NULL,NULL /* reserved1,reserved2, etc */
90  },
91  {
92  "srcip",
93  4,
94  PROTOBUF_C_LABEL_OPTIONAL,
95  PROTOBUF_C_TYPE_BYTES,
96  offsetof(Nmsg__Base__Ncap, has_srcip),
97  offsetof(Nmsg__Base__Ncap, srcip),
98  NULL,
99  NULL,
100  0, /* flags */
101  0,NULL,NULL /* reserved1,reserved2, etc */
102  },
103  {
104  "dstip",
105  5,
106  PROTOBUF_C_LABEL_OPTIONAL,
107  PROTOBUF_C_TYPE_BYTES,
108  offsetof(Nmsg__Base__Ncap, has_dstip),
109  offsetof(Nmsg__Base__Ncap, dstip),
110  NULL,
111  NULL,
112  0, /* flags */
113  0,NULL,NULL /* reserved1,reserved2, etc */
114  },
115  {
116  "lint0",
117  6,
118  PROTOBUF_C_LABEL_OPTIONAL,
119  PROTOBUF_C_TYPE_UINT32,
120  offsetof(Nmsg__Base__Ncap, has_lint0),
121  offsetof(Nmsg__Base__Ncap, lint0),
122  NULL,
123  NULL,
124  0, /* flags */
125  0,NULL,NULL /* reserved1,reserved2, etc */
126  },
127  {
128  "lint1",
129  7,
130  PROTOBUF_C_LABEL_OPTIONAL,
131  PROTOBUF_C_TYPE_UINT32,
132  offsetof(Nmsg__Base__Ncap, has_lint1),
133  offsetof(Nmsg__Base__Ncap, lint1),
134  NULL,
135  NULL,
136  0, /* flags */
137  0,NULL,NULL /* reserved1,reserved2, etc */
138  },
139 };
140 static const unsigned nmsg__base__ncap__field_indices_by_name[] = {
141  4, /* field[4] = dstip */
142  5, /* field[5] = lint0 */
143  6, /* field[6] = lint1 */
144  2, /* field[2] = ltype */
145  1, /* field[1] = payload */
146  3, /* field[3] = srcip */
147  0, /* field[0] = type */
148 };
149 static const ProtobufCIntRange nmsg__base__ncap__number_ranges[1 + 1] =
150 {
151  { 1, 0 },
152  { 0, 7 }
153 };
154 const ProtobufCMessageDescriptor nmsg__base__ncap__descriptor =
155 {
156  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
157  "nmsg.base.Ncap",
158  "Ncap",
159  "Nmsg__Base__Ncap",
160  "nmsg.base",
161  sizeof(Nmsg__Base__Ncap),
162  7,
163  nmsg__base__ncap__field_descriptors,
164  nmsg__base__ncap__field_indices_by_name,
165  1, nmsg__base__ncap__number_ranges,
166  (ProtobufCMessageInit) nmsg__base__ncap__init,
167  NULL,NULL,NULL /* reserved[123] */
168 };
169 const ProtobufCEnumValue nmsg__base__ncap_type__enum_values_by_number[3] =
170 {
171  { "IPV4", "NMSG__BASE__NCAP_TYPE__IPV4", 0 },
172  { "IPV6", "NMSG__BASE__NCAP_TYPE__IPV6", 1 },
173  { "Legacy", "NMSG__BASE__NCAP_TYPE__Legacy", 2 },
174 };
175 static const ProtobufCIntRange nmsg__base__ncap_type__value_ranges[] = {
176 {0, 0},{0, 3}
177 };
178 const ProtobufCEnumValueIndex nmsg__base__ncap_type__enum_values_by_name[3] =
179 {
180  { "IPV4", 0 },
181  { "IPV6", 1 },
182  { "Legacy", 2 },
183 };
184 const ProtobufCEnumDescriptor nmsg__base__ncap_type__descriptor =
185 {
186  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
187  "nmsg.base.NcapType",
188  "NcapType",
189  "Nmsg__Base__NcapType",
190  "nmsg.base",
191  3,
192  nmsg__base__ncap_type__enum_values_by_number,
193  3,
194  nmsg__base__ncap_type__enum_values_by_name,
195  1,
196  nmsg__base__ncap_type__value_ranges,
197  NULL,NULL,NULL,NULL /* reserved[1234] */
198 };
199 const ProtobufCEnumValue nmsg__base__ncap_legacy_type__enum_values_by_number[3] =
200 {
201  { "UDP", "NMSG__BASE__NCAP_LEGACY_TYPE__UDP", 0 },
202  { "TCP", "NMSG__BASE__NCAP_LEGACY_TYPE__TCP", 1 },
203  { "ICMP", "NMSG__BASE__NCAP_LEGACY_TYPE__ICMP", 2 },
204 };
205 static const ProtobufCIntRange nmsg__base__ncap_legacy_type__value_ranges[] = {
206 {0, 0},{0, 3}
207 };
208 const ProtobufCEnumValueIndex nmsg__base__ncap_legacy_type__enum_values_by_name[3] =
209 {
210  { "ICMP", 2 },
211  { "TCP", 1 },
212  { "UDP", 0 },
213 };
214 const ProtobufCEnumDescriptor nmsg__base__ncap_legacy_type__descriptor =
215 {
216  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
217  "nmsg.base.NcapLegacyType",
218  "NcapLegacyType",
219  "Nmsg__Base__NcapLegacyType",
220  "nmsg.base",
221  3,
222  nmsg__base__ncap_legacy_type__enum_values_by_number,
223  3,
224  nmsg__base__ncap_legacy_type__enum_values_by_name,
225  1,
226  nmsg__base__ncap_legacy_type__value_ranges,
227  NULL,NULL,NULL,NULL /* reserved[1234] */
228 };