1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package udp contains generated bindings for API file udp.api.
15 api "git.fd.io/govpp.git/api"
16 ip_types "git.fd.io/govpp.git/binapi/ip_types"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
29 VersionCrc = 0xb827bf4f
32 // UDPEncap defines type 'udp_encap'.
33 type UDPEncap struct {
34 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
35 SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
36 DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"`
37 SrcIP ip_types.Address `binapi:"address,name=src_ip" json:"src_ip,omitempty"`
38 DstIP ip_types.Address `binapi:"address,name=dst_ip" json:"dst_ip,omitempty"`
39 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
42 // UDPEncapAdd defines message 'udp_encap_add'.
43 type UDPEncapAdd struct {
44 UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
47 func (m *UDPEncapAdd) Reset() { *m = UDPEncapAdd{} }
48 func (*UDPEncapAdd) GetMessageName() string { return "udp_encap_add" }
49 func (*UDPEncapAdd) GetCrcString() string { return "61d5fc48" }
50 func (*UDPEncapAdd) GetMessageType() api.MessageType {
51 return api.RequestMessage
54 func (m *UDPEncapAdd) Size() (size int) {
58 size += 4 // m.UDPEncap.TableID
59 size += 2 // m.UDPEncap.SrcPort
60 size += 2 // m.UDPEncap.DstPort
61 size += 1 // m.UDPEncap.SrcIP.Af
62 size += 1 * 16 // m.UDPEncap.SrcIP.Un
63 size += 1 // m.UDPEncap.DstIP.Af
64 size += 1 * 16 // m.UDPEncap.DstIP.Un
65 size += 4 // m.UDPEncap.ID
68 func (m *UDPEncapAdd) Marshal(b []byte) ([]byte, error) {
70 b = make([]byte, m.Size())
72 buf := codec.NewBuffer(b)
73 buf.EncodeUint32(m.UDPEncap.TableID)
74 buf.EncodeUint16(m.UDPEncap.SrcPort)
75 buf.EncodeUint16(m.UDPEncap.DstPort)
76 buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af))
77 buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
78 buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af))
79 buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16)
80 buf.EncodeUint32(m.UDPEncap.ID)
81 return buf.Bytes(), nil
83 func (m *UDPEncapAdd) Unmarshal(b []byte) error {
84 buf := codec.NewBuffer(b)
85 m.UDPEncap.TableID = buf.DecodeUint32()
86 m.UDPEncap.SrcPort = buf.DecodeUint16()
87 m.UDPEncap.DstPort = buf.DecodeUint16()
88 m.UDPEncap.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
89 copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
90 m.UDPEncap.DstIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
91 copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
92 m.UDPEncap.ID = buf.DecodeUint32()
96 // UDPEncapAddReply defines message 'udp_encap_add_reply'.
97 type UDPEncapAddReply struct {
98 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
99 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
102 func (m *UDPEncapAddReply) Reset() { *m = UDPEncapAddReply{} }
103 func (*UDPEncapAddReply) GetMessageName() string { return "udp_encap_add_reply" }
104 func (*UDPEncapAddReply) GetCrcString() string { return "e2fc8294" }
105 func (*UDPEncapAddReply) GetMessageType() api.MessageType {
106 return api.ReplyMessage
109 func (m *UDPEncapAddReply) Size() (size int) {
113 size += 4 // m.Retval
117 func (m *UDPEncapAddReply) Marshal(b []byte) ([]byte, error) {
119 b = make([]byte, m.Size())
121 buf := codec.NewBuffer(b)
122 buf.EncodeInt32(m.Retval)
123 buf.EncodeUint32(m.ID)
124 return buf.Bytes(), nil
126 func (m *UDPEncapAddReply) Unmarshal(b []byte) error {
127 buf := codec.NewBuffer(b)
128 m.Retval = buf.DecodeInt32()
129 m.ID = buf.DecodeUint32()
133 // UDPEncapDel defines message 'udp_encap_del'.
134 type UDPEncapDel struct {
135 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
138 func (m *UDPEncapDel) Reset() { *m = UDPEncapDel{} }
139 func (*UDPEncapDel) GetMessageName() string { return "udp_encap_del" }
140 func (*UDPEncapDel) GetCrcString() string { return "3a91bde5" }
141 func (*UDPEncapDel) GetMessageType() api.MessageType {
142 return api.RequestMessage
145 func (m *UDPEncapDel) Size() (size int) {
152 func (m *UDPEncapDel) Marshal(b []byte) ([]byte, error) {
154 b = make([]byte, m.Size())
156 buf := codec.NewBuffer(b)
157 buf.EncodeUint32(m.ID)
158 return buf.Bytes(), nil
160 func (m *UDPEncapDel) Unmarshal(b []byte) error {
161 buf := codec.NewBuffer(b)
162 m.ID = buf.DecodeUint32()
166 // UDPEncapDelReply defines message 'udp_encap_del_reply'.
167 type UDPEncapDelReply struct {
168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
171 func (m *UDPEncapDelReply) Reset() { *m = UDPEncapDelReply{} }
172 func (*UDPEncapDelReply) GetMessageName() string { return "udp_encap_del_reply" }
173 func (*UDPEncapDelReply) GetCrcString() string { return "e8d4e804" }
174 func (*UDPEncapDelReply) GetMessageType() api.MessageType {
175 return api.ReplyMessage
178 func (m *UDPEncapDelReply) Size() (size int) {
182 size += 4 // m.Retval
185 func (m *UDPEncapDelReply) Marshal(b []byte) ([]byte, error) {
187 b = make([]byte, m.Size())
189 buf := codec.NewBuffer(b)
190 buf.EncodeInt32(m.Retval)
191 return buf.Bytes(), nil
193 func (m *UDPEncapDelReply) Unmarshal(b []byte) error {
194 buf := codec.NewBuffer(b)
195 m.Retval = buf.DecodeInt32()
199 // UDPEncapDetails defines message 'udp_encap_details'.
200 type UDPEncapDetails struct {
201 UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
204 func (m *UDPEncapDetails) Reset() { *m = UDPEncapDetails{} }
205 func (*UDPEncapDetails) GetMessageName() string { return "udp_encap_details" }
206 func (*UDPEncapDetails) GetCrcString() string { return "87c82821" }
207 func (*UDPEncapDetails) GetMessageType() api.MessageType {
208 return api.ReplyMessage
211 func (m *UDPEncapDetails) Size() (size int) {
215 size += 4 // m.UDPEncap.TableID
216 size += 2 // m.UDPEncap.SrcPort
217 size += 2 // m.UDPEncap.DstPort
218 size += 1 // m.UDPEncap.SrcIP.Af
219 size += 1 * 16 // m.UDPEncap.SrcIP.Un
220 size += 1 // m.UDPEncap.DstIP.Af
221 size += 1 * 16 // m.UDPEncap.DstIP.Un
222 size += 4 // m.UDPEncap.ID
225 func (m *UDPEncapDetails) Marshal(b []byte) ([]byte, error) {
227 b = make([]byte, m.Size())
229 buf := codec.NewBuffer(b)
230 buf.EncodeUint32(m.UDPEncap.TableID)
231 buf.EncodeUint16(m.UDPEncap.SrcPort)
232 buf.EncodeUint16(m.UDPEncap.DstPort)
233 buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af))
234 buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
235 buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af))
236 buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16)
237 buf.EncodeUint32(m.UDPEncap.ID)
238 return buf.Bytes(), nil
240 func (m *UDPEncapDetails) Unmarshal(b []byte) error {
241 buf := codec.NewBuffer(b)
242 m.UDPEncap.TableID = buf.DecodeUint32()
243 m.UDPEncap.SrcPort = buf.DecodeUint16()
244 m.UDPEncap.DstPort = buf.DecodeUint16()
245 m.UDPEncap.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
246 copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
247 m.UDPEncap.DstIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
248 copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
249 m.UDPEncap.ID = buf.DecodeUint32()
253 // UDPEncapDump defines message 'udp_encap_dump'.
254 type UDPEncapDump struct{}
256 func (m *UDPEncapDump) Reset() { *m = UDPEncapDump{} }
257 func (*UDPEncapDump) GetMessageName() string { return "udp_encap_dump" }
258 func (*UDPEncapDump) GetCrcString() string { return "51077d14" }
259 func (*UDPEncapDump) GetMessageType() api.MessageType {
260 return api.RequestMessage
263 func (m *UDPEncapDump) Size() (size int) {
269 func (m *UDPEncapDump) Marshal(b []byte) ([]byte, error) {
271 b = make([]byte, m.Size())
273 buf := codec.NewBuffer(b)
274 return buf.Bytes(), nil
276 func (m *UDPEncapDump) Unmarshal(b []byte) error {
280 func init() { file_udp_binapi_init() }
281 func file_udp_binapi_init() {
282 api.RegisterMessage((*UDPEncapAdd)(nil), "udp_encap_add_61d5fc48")
283 api.RegisterMessage((*UDPEncapAddReply)(nil), "udp_encap_add_reply_e2fc8294")
284 api.RegisterMessage((*UDPEncapDel)(nil), "udp_encap_del_3a91bde5")
285 api.RegisterMessage((*UDPEncapDelReply)(nil), "udp_encap_del_reply_e8d4e804")
286 api.RegisterMessage((*UDPEncapDetails)(nil), "udp_encap_details_87c82821")
287 api.RegisterMessage((*UDPEncapDump)(nil), "udp_encap_dump_51077d14")
290 // Messages returns list of all messages in this module.
291 func AllMessages() []api.Message {
292 return []api.Message{
294 (*UDPEncapAddReply)(nil),
296 (*UDPEncapDelReply)(nil),
297 (*UDPEncapDetails)(nil),
298 (*UDPEncapDump)(nil),