nmsg  0.14.0
packet.pb-c.h
1 /* Generated by the protocol buffer compiler. DO NOT EDIT! */
2 /* Generated from: nmsg/base/packet.proto */
3 
4 #ifndef PROTOBUF_C_nmsg_2fbase_2fpacket_2eproto__INCLUDED
5 #define PROTOBUF_C_nmsg_2fbase_2fpacket_2eproto__INCLUDED
6 
7 #include <protobuf-c/protobuf-c.h>
8 
9 PROTOBUF_C__BEGIN_DECLS
10 
11 #if PROTOBUF_C_VERSION_NUMBER < 1000000
12 # error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
13 #elif 1000001 < PROTOBUF_C_MIN_COMPILER_VERSION
14 # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
15 #endif
16 
17 
18 typedef struct _Nmsg__Base__Packet Nmsg__Base__Packet;
19 
20 
21 /* --- enums --- */
22 
23 typedef enum _Nmsg__Base__PacketType {
24  NMSG__BASE__PACKET_TYPE__IP = 1
25  PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(NMSG__BASE__PACKET_TYPE)
26 } Nmsg__Base__PacketType;
27 
28 /* --- messages --- */
29 
30 struct _Nmsg__Base__Packet
31 {
32  ProtobufCMessage base;
33  Nmsg__Base__PacketType payload_type;
34  ProtobufCBinaryData payload;
35 };
36 #define NMSG__BASE__PACKET__INIT \
37  { PROTOBUF_C_MESSAGE_INIT (&nmsg__base__packet__descriptor) \
38  , 0, {0,NULL} }
39 
40 
41 /* Nmsg__Base__Packet methods */
42 void nmsg__base__packet__init
43  (Nmsg__Base__Packet *message);
44 size_t nmsg__base__packet__get_packed_size
45  (const Nmsg__Base__Packet *message);
46 size_t nmsg__base__packet__pack
47  (const Nmsg__Base__Packet *message,
48  uint8_t *out);
49 size_t nmsg__base__packet__pack_to_buffer
50  (const Nmsg__Base__Packet *message,
51  ProtobufCBuffer *buffer);
52 Nmsg__Base__Packet *
53  nmsg__base__packet__unpack
54  (ProtobufCAllocator *allocator,
55  size_t len,
56  const uint8_t *data);
57 void nmsg__base__packet__free_unpacked
58  (Nmsg__Base__Packet *message,
59  ProtobufCAllocator *allocator);
60 /* --- per-message closures --- */
61 
62 typedef void (*Nmsg__Base__Packet_Closure)
63  (const Nmsg__Base__Packet *message,
64  void *closure_data);
65 
66 /* --- services --- */
67 
68 
69 /* --- descriptors --- */
70 
71 extern const ProtobufCEnumDescriptor nmsg__base__packet_type__descriptor;
72 extern const ProtobufCMessageDescriptor nmsg__base__packet__descriptor;
73 
74 PROTOBUF_C__END_DECLS
75 
76 
77 #endif /* PROTOBUF_C_nmsg_2fbase_2fpacket_2eproto__INCLUDED */