nmsg  0.9.0
email.pb-c.c
1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */
2 /* Generated from: nmsg/base/email.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/email.pb-c.h"
10 void nmsg__base__email__init
11  (Nmsg__Base__Email *message)
12 {
13  static Nmsg__Base__Email init_value = NMSG__BASE__EMAIL__INIT;
14  *message = init_value;
15 }
16 size_t nmsg__base__email__get_packed_size
17  (const Nmsg__Base__Email *message)
18 {
19  assert(message->base.descriptor == &nmsg__base__email__descriptor);
20  return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
21 }
22 size_t nmsg__base__email__pack
23  (const Nmsg__Base__Email *message,
24  uint8_t *out)
25 {
26  assert(message->base.descriptor == &nmsg__base__email__descriptor);
27  return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
28 }
29 size_t nmsg__base__email__pack_to_buffer
30  (const Nmsg__Base__Email *message,
31  ProtobufCBuffer *buffer)
32 {
33  assert(message->base.descriptor == &nmsg__base__email__descriptor);
34  return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
35 }
36 Nmsg__Base__Email *
37  nmsg__base__email__unpack
38  (ProtobufCAllocator *allocator,
39  size_t len,
40  const uint8_t *data)
41 {
42  return (Nmsg__Base__Email *)
43  protobuf_c_message_unpack (&nmsg__base__email__descriptor,
44  allocator, len, data);
45 }
46 void nmsg__base__email__free_unpacked
47  (Nmsg__Base__Email *message,
48  ProtobufCAllocator *allocator)
49 {
50  assert(message->base.descriptor == &nmsg__base__email__descriptor);
51  protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
52 }
53 static const ProtobufCFieldDescriptor nmsg__base__email__field_descriptors[9] =
54 {
55  {
56  "headers",
57  2,
58  PROTOBUF_C_LABEL_OPTIONAL,
59  PROTOBUF_C_TYPE_BYTES,
60  offsetof(Nmsg__Base__Email, has_headers),
61  offsetof(Nmsg__Base__Email, headers),
62  NULL,
63  NULL,
64  0, /* flags */
65  0,NULL,NULL /* reserved1,reserved2, etc */
66  },
67  {
68  "srcip",
69  3,
70  PROTOBUF_C_LABEL_OPTIONAL,
71  PROTOBUF_C_TYPE_BYTES,
72  offsetof(Nmsg__Base__Email, has_srcip),
73  offsetof(Nmsg__Base__Email, srcip),
74  NULL,
75  NULL,
76  0, /* flags */
77  0,NULL,NULL /* reserved1,reserved2, etc */
78  },
79  {
80  "srchost",
81  4,
82  PROTOBUF_C_LABEL_OPTIONAL,
83  PROTOBUF_C_TYPE_BYTES,
84  offsetof(Nmsg__Base__Email, has_srchost),
85  offsetof(Nmsg__Base__Email, srchost),
86  NULL,
87  NULL,
88  0, /* flags */
89  0,NULL,NULL /* reserved1,reserved2, etc */
90  },
91  {
92  "helo",
93  5,
94  PROTOBUF_C_LABEL_OPTIONAL,
95  PROTOBUF_C_TYPE_BYTES,
96  offsetof(Nmsg__Base__Email, has_helo),
97  offsetof(Nmsg__Base__Email, helo),
98  NULL,
99  NULL,
100  0, /* flags */
101  0,NULL,NULL /* reserved1,reserved2, etc */
102  },
103  {
104  "from",
105  6,
106  PROTOBUF_C_LABEL_OPTIONAL,
107  PROTOBUF_C_TYPE_BYTES,
108  offsetof(Nmsg__Base__Email, has_from),
109  offsetof(Nmsg__Base__Email, from),
110  NULL,
111  NULL,
112  0, /* flags */
113  0,NULL,NULL /* reserved1,reserved2, etc */
114  },
115  {
116  "rcpt",
117  7,
118  PROTOBUF_C_LABEL_REPEATED,
119  PROTOBUF_C_TYPE_BYTES,
120  offsetof(Nmsg__Base__Email, n_rcpt),
121  offsetof(Nmsg__Base__Email, rcpt),
122  NULL,
123  NULL,
124  0, /* flags */
125  0,NULL,NULL /* reserved1,reserved2, etc */
126  },
127  {
128  "type",
129  8,
130  PROTOBUF_C_LABEL_OPTIONAL,
131  PROTOBUF_C_TYPE_ENUM,
132  offsetof(Nmsg__Base__Email, has_type),
133  offsetof(Nmsg__Base__Email, type),
134  &nmsg__base__email_type__descriptor,
135  NULL,
136  0, /* flags */
137  0,NULL,NULL /* reserved1,reserved2, etc */
138  },
139  {
140  "bodyurl",
141  9,
142  PROTOBUF_C_LABEL_REPEATED,
143  PROTOBUF_C_TYPE_BYTES,
144  offsetof(Nmsg__Base__Email, n_bodyurl),
145  offsetof(Nmsg__Base__Email, bodyurl),
146  NULL,
147  NULL,
148  0, /* flags */
149  0,NULL,NULL /* reserved1,reserved2, etc */
150  },
151  {
152  "body",
153  10,
154  PROTOBUF_C_LABEL_OPTIONAL,
155  PROTOBUF_C_TYPE_BYTES,
156  offsetof(Nmsg__Base__Email, has_body),
157  offsetof(Nmsg__Base__Email, body),
158  NULL,
159  NULL,
160  0, /* flags */
161  0,NULL,NULL /* reserved1,reserved2, etc */
162  },
163 };
164 static const unsigned nmsg__base__email__field_indices_by_name[] = {
165  8, /* field[8] = body */
166  7, /* field[7] = bodyurl */
167  4, /* field[4] = from */
168  0, /* field[0] = headers */
169  3, /* field[3] = helo */
170  5, /* field[5] = rcpt */
171  2, /* field[2] = srchost */
172  1, /* field[1] = srcip */
173  6, /* field[6] = type */
174 };
175 static const ProtobufCIntRange nmsg__base__email__number_ranges[1 + 1] =
176 {
177  { 2, 0 },
178  { 0, 9 }
179 };
180 const ProtobufCMessageDescriptor nmsg__base__email__descriptor =
181 {
182  PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
183  "nmsg.base.Email",
184  "Email",
185  "Nmsg__Base__Email",
186  "nmsg.base",
187  sizeof(Nmsg__Base__Email),
188  9,
189  nmsg__base__email__field_descriptors,
190  nmsg__base__email__field_indices_by_name,
191  1, nmsg__base__email__number_ranges,
192  (ProtobufCMessageInit) nmsg__base__email__init,
193  NULL,NULL,NULL /* reserved[123] */
194 };
195 const ProtobufCEnumValue nmsg__base__email_type__enum_values_by_number[5] =
196 {
197  { "unknown", "NMSG__BASE__EMAIL_TYPE__unknown", 0 },
198  { "spamtrap", "NMSG__BASE__EMAIL_TYPE__spamtrap", 1 },
199  { "rej_network", "NMSG__BASE__EMAIL_TYPE__rej_network", 2 },
200  { "rej_content", "NMSG__BASE__EMAIL_TYPE__rej_content", 3 },
201  { "rej_user", "NMSG__BASE__EMAIL_TYPE__rej_user", 4 },
202 };
203 static const ProtobufCIntRange nmsg__base__email_type__value_ranges[] = {
204 {0, 0},{0, 5}
205 };
206 const ProtobufCEnumValueIndex nmsg__base__email_type__enum_values_by_name[5] =
207 {
208  { "rej_content", 3 },
209  { "rej_network", 2 },
210  { "rej_user", 4 },
211  { "spamtrap", 1 },
212  { "unknown", 0 },
213 };
214 const ProtobufCEnumDescriptor nmsg__base__email_type__descriptor =
215 {
216  PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
217  "nmsg.base.EmailType",
218  "EmailType",
219  "Nmsg__Base__EmailType",
220  "nmsg.base",
221  5,
222  nmsg__base__email_type__enum_values_by_number,
223  5,
224  nmsg__base__email_type__enum_values_by_name,
225  1,
226  nmsg__base__email_type__value_ranges,
227  NULL,NULL,NULL,NULL /* reserved[1234] */
228 };
nmsg_msgmod_type type
Module type.