5 #ifndef PROTOBUF_C__NO_DEPRECATED
6 #define PROTOBUF_C__NO_DEPRECATED
9 #include "nmsg/base/packet.pb-c.h"
10 void nmsg__base__packet__init
11 (Nmsg__Base__Packet *message)
13 static Nmsg__Base__Packet init_value = NMSG__BASE__PACKET__INIT;
14 *message = init_value;
16 size_t nmsg__base__packet__get_packed_size
17 (
const Nmsg__Base__Packet *message)
19 assert(message->base.descriptor == &nmsg__base__packet__descriptor);
20 return protobuf_c_message_get_packed_size ((
const ProtobufCMessage*)(message));
22 size_t nmsg__base__packet__pack
23 (
const Nmsg__Base__Packet *message,
26 assert(message->base.descriptor == &nmsg__base__packet__descriptor);
27 return protobuf_c_message_pack ((
const ProtobufCMessage*)message, out);
29 size_t nmsg__base__packet__pack_to_buffer
30 (
const Nmsg__Base__Packet *message,
31 ProtobufCBuffer *buffer)
33 assert(message->base.descriptor == &nmsg__base__packet__descriptor);
34 return protobuf_c_message_pack_to_buffer ((
const ProtobufCMessage*)message, buffer);
37 nmsg__base__packet__unpack
38 (ProtobufCAllocator *allocator,
42 return (Nmsg__Base__Packet *)
43 protobuf_c_message_unpack (&nmsg__base__packet__descriptor,
44 allocator, len, data);
46 void nmsg__base__packet__free_unpacked
47 (Nmsg__Base__Packet *message,
48 ProtobufCAllocator *allocator)
50 assert(message->base.descriptor == &nmsg__base__packet__descriptor);
51 protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
53 static const ProtobufCFieldDescriptor nmsg__base__packet__field_descriptors[2] =
58 PROTOBUF_C_LABEL_REQUIRED,
61 offsetof(Nmsg__Base__Packet, payload_type),
62 &nmsg__base__packet_type__descriptor,
70 PROTOBUF_C_LABEL_REQUIRED,
71 PROTOBUF_C_TYPE_BYTES,
73 offsetof(Nmsg__Base__Packet, payload),
80 static const unsigned nmsg__base__packet__field_indices_by_name[] = {
84 static const ProtobufCIntRange nmsg__base__packet__number_ranges[1 + 1] =
89 const ProtobufCMessageDescriptor nmsg__base__packet__descriptor =
91 PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
96 sizeof(Nmsg__Base__Packet),
98 nmsg__base__packet__field_descriptors,
99 nmsg__base__packet__field_indices_by_name,
100 1, nmsg__base__packet__number_ranges,
101 (ProtobufCMessageInit) nmsg__base__packet__init,
104 const ProtobufCEnumValue nmsg__base__packet_type__enum_values_by_number[1] =
106 {
"IP",
"NMSG__BASE__PACKET_TYPE__IP", 1 },
108 static const ProtobufCIntRange nmsg__base__packet_type__value_ranges[] = {
111 const ProtobufCEnumValueIndex nmsg__base__packet_type__enum_values_by_name[1] =
115 const ProtobufCEnumDescriptor nmsg__base__packet_type__descriptor =
117 PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
118 "nmsg.base.PacketType",
120 "Nmsg__Base__PacketType",
123 nmsg__base__packet_type__enum_values_by_number,
125 nmsg__base__packet_type__enum_values_by_name,
127 nmsg__base__packet_type__value_ranges,