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 1002001 < 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  /*
25  * An IPv4 or IPv6 packet. The packet begins immediately with the IP
26  * header and contains the complete packet payload. Distinguishing between
27  * IPv4 and IPv6 packets is done by examining the IP version field in the
28  * IP header.
29  */
30  NMSG__BASE__PACKET_TYPE__IP = 1
31  PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(NMSG__BASE__PACKET_TYPE)
32 } Nmsg__Base__PacketType;
33 
34 /* --- messages --- */
35 
36 struct _Nmsg__Base__Packet
37 {
38  ProtobufCMessage base;
39  Nmsg__Base__PacketType payload_type;
40  ProtobufCBinaryData payload;
41 };
42 #define NMSG__BASE__PACKET__INIT \
43  { PROTOBUF_C_MESSAGE_INIT (&nmsg__base__packet__descriptor) \
44  , 0, {0,NULL} }
45 
46 
47 /* Nmsg__Base__Packet methods */
48 void nmsg__base__packet__init
49  (Nmsg__Base__Packet *message);
50 size_t nmsg__base__packet__get_packed_size
51  (const Nmsg__Base__Packet *message);
52 size_t nmsg__base__packet__pack
53  (const Nmsg__Base__Packet *message,
54  uint8_t *out);
55 size_t nmsg__base__packet__pack_to_buffer
56  (const Nmsg__Base__Packet *message,
57  ProtobufCBuffer *buffer);
58 Nmsg__Base__Packet *
59  nmsg__base__packet__unpack
60  (ProtobufCAllocator *allocator,
61  size_t len,
62  const uint8_t *data);
63 void nmsg__base__packet__free_unpacked
64  (Nmsg__Base__Packet *message,
65  ProtobufCAllocator *allocator);
66 /* --- per-message closures --- */
67 
68 typedef void (*Nmsg__Base__Packet_Closure)
69  (const Nmsg__Base__Packet *message,
70  void *closure_data);
71 
72 /* --- services --- */
73 
74 
75 /* --- descriptors --- */
76 
77 extern const ProtobufCEnumDescriptor nmsg__base__packet_type__descriptor;
78 extern const ProtobufCMessageDescriptor nmsg__base__packet__descriptor;
79 
80 PROTOBUF_C__END_DECLS
81 
82 
83 #endif /* PROTOBUF_C_nmsg_2fbase_2fpacket_2eproto__INCLUDED */