1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0
5 // source: /usr/share/vpp/api/core/udp.api.json
7 // Package udp contains generated bindings for API file udp.api.
19 api "git.fd.io/govpp.git/api"
20 ip_types "git.fd.io/govpp.git/binapi/ip_types"
21 codec "git.fd.io/govpp.git/codec"
24 // This is a compile-time assertion to ensure that this generated file
25 // is compatible with the GoVPP api package it is being compiled against.
26 // A compilation error at this line likely means your copy of the
27 // GoVPP api package needs to be updated.
28 const _ = api.GoVppAPIPackageIsVersion2
33 VersionCrc = 0x2d3db5fa
36 // UDPDecapNextProto defines enum 'udp_decap_next_proto'.
37 type UDPDecapNextProto uint32
40 UDP_API_DECAP_PROTO_IP4 UDPDecapNextProto = 1
41 UDP_API_DECAP_PROTO_IP6 UDPDecapNextProto = 2
42 UDP_API_DECAP_PROTO_MPLS UDPDecapNextProto = 3
46 UDPDecapNextProto_name = map[uint32]string{
47 1: "UDP_API_DECAP_PROTO_IP4",
48 2: "UDP_API_DECAP_PROTO_IP6",
49 3: "UDP_API_DECAP_PROTO_MPLS",
51 UDPDecapNextProto_value = map[string]uint32{
52 "UDP_API_DECAP_PROTO_IP4": 1,
53 "UDP_API_DECAP_PROTO_IP6": 2,
54 "UDP_API_DECAP_PROTO_MPLS": 3,
58 func (x UDPDecapNextProto) String() string {
59 s, ok := UDPDecapNextProto_name[uint32(x)]
63 return "UDPDecapNextProto(" + strconv.Itoa(int(x)) + ")"
66 // UDPDecap defines type 'udp_decap'.
67 type UDPDecap struct {
68 IsIP4 uint8 `binapi:"u8,name=is_ip4" json:"is_ip4,omitempty"`
69 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
70 NextProto UDPDecapNextProto `binapi:"udp_decap_next_proto,name=next_proto" json:"next_proto,omitempty"`
73 // UDPEncap defines type 'udp_encap'.
74 type UDPEncap struct {
75 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
76 SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"`
77 DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"`
78 SrcIP ip_types.Address `binapi:"address,name=src_ip" json:"src_ip,omitempty"`
79 DstIP ip_types.Address `binapi:"address,name=dst_ip" json:"dst_ip,omitempty"`
80 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
83 // UDPDecapAddDel defines message 'udp_decap_add_del'.
84 type UDPDecapAddDel struct {
85 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
86 UDPDecap UDPDecap `binapi:"udp_decap,name=udp_decap" json:"udp_decap,omitempty"`
89 func (m *UDPDecapAddDel) Reset() { *m = UDPDecapAddDel{} }
90 func (*UDPDecapAddDel) GetMessageName() string { return "udp_decap_add_del" }
91 func (*UDPDecapAddDel) GetCrcString() string { return "d155c6ac" }
92 func (*UDPDecapAddDel) GetMessageType() api.MessageType {
93 return api.RequestMessage
96 func (m *UDPDecapAddDel) Size() (size int) {
101 size += 1 // m.UDPDecap.IsIP4
102 size += 2 // m.UDPDecap.Port
103 size += 4 // m.UDPDecap.NextProto
106 func (m *UDPDecapAddDel) Marshal(b []byte) ([]byte, error) {
108 b = make([]byte, m.Size())
110 buf := codec.NewBuffer(b)
111 buf.EncodeBool(m.IsAdd)
112 buf.EncodeUint8(m.UDPDecap.IsIP4)
113 buf.EncodeUint16(m.UDPDecap.Port)
114 buf.EncodeUint32(uint32(m.UDPDecap.NextProto))
115 return buf.Bytes(), nil
117 func (m *UDPDecapAddDel) Unmarshal(b []byte) error {
118 buf := codec.NewBuffer(b)
119 m.IsAdd = buf.DecodeBool()
120 m.UDPDecap.IsIP4 = buf.DecodeUint8()
121 m.UDPDecap.Port = buf.DecodeUint16()
122 m.UDPDecap.NextProto = UDPDecapNextProto(buf.DecodeUint32())
126 // UDPDecapAddDelReply defines message 'udp_decap_add_del_reply'.
127 type UDPDecapAddDelReply struct {
128 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
131 func (m *UDPDecapAddDelReply) Reset() { *m = UDPDecapAddDelReply{} }
132 func (*UDPDecapAddDelReply) GetMessageName() string { return "udp_decap_add_del_reply" }
133 func (*UDPDecapAddDelReply) GetCrcString() string { return "e8d4e804" }
134 func (*UDPDecapAddDelReply) GetMessageType() api.MessageType {
135 return api.ReplyMessage
138 func (m *UDPDecapAddDelReply) Size() (size int) {
142 size += 4 // m.Retval
145 func (m *UDPDecapAddDelReply) Marshal(b []byte) ([]byte, error) {
147 b = make([]byte, m.Size())
149 buf := codec.NewBuffer(b)
150 buf.EncodeInt32(m.Retval)
151 return buf.Bytes(), nil
153 func (m *UDPDecapAddDelReply) Unmarshal(b []byte) error {
154 buf := codec.NewBuffer(b)
155 m.Retval = buf.DecodeInt32()
159 // UDPEncapAdd defines message 'udp_encap_add'.
160 type UDPEncapAdd struct {
161 UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
164 func (m *UDPEncapAdd) Reset() { *m = UDPEncapAdd{} }
165 func (*UDPEncapAdd) GetMessageName() string { return "udp_encap_add" }
166 func (*UDPEncapAdd) GetCrcString() string { return "f74a60b1" }
167 func (*UDPEncapAdd) GetMessageType() api.MessageType {
168 return api.RequestMessage
171 func (m *UDPEncapAdd) Size() (size int) {
175 size += 4 // m.UDPEncap.TableID
176 size += 2 // m.UDPEncap.SrcPort
177 size += 2 // m.UDPEncap.DstPort
178 size += 1 // m.UDPEncap.SrcIP.Af
179 size += 1 * 16 // m.UDPEncap.SrcIP.Un
180 size += 1 // m.UDPEncap.DstIP.Af
181 size += 1 * 16 // m.UDPEncap.DstIP.Un
182 size += 4 // m.UDPEncap.ID
185 func (m *UDPEncapAdd) Marshal(b []byte) ([]byte, error) {
187 b = make([]byte, m.Size())
189 buf := codec.NewBuffer(b)
190 buf.EncodeUint32(m.UDPEncap.TableID)
191 buf.EncodeUint16(m.UDPEncap.SrcPort)
192 buf.EncodeUint16(m.UDPEncap.DstPort)
193 buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af))
194 buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
195 buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af))
196 buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16)
197 buf.EncodeUint32(m.UDPEncap.ID)
198 return buf.Bytes(), nil
200 func (m *UDPEncapAdd) Unmarshal(b []byte) error {
201 buf := codec.NewBuffer(b)
202 m.UDPEncap.TableID = buf.DecodeUint32()
203 m.UDPEncap.SrcPort = buf.DecodeUint16()
204 m.UDPEncap.DstPort = buf.DecodeUint16()
205 m.UDPEncap.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
206 copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
207 m.UDPEncap.DstIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
208 copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
209 m.UDPEncap.ID = buf.DecodeUint32()
213 // UDPEncapAddReply defines message 'udp_encap_add_reply'.
214 type UDPEncapAddReply struct {
215 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
216 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
219 func (m *UDPEncapAddReply) Reset() { *m = UDPEncapAddReply{} }
220 func (*UDPEncapAddReply) GetMessageName() string { return "udp_encap_add_reply" }
221 func (*UDPEncapAddReply) GetCrcString() string { return "e2fc8294" }
222 func (*UDPEncapAddReply) GetMessageType() api.MessageType {
223 return api.ReplyMessage
226 func (m *UDPEncapAddReply) Size() (size int) {
230 size += 4 // m.Retval
234 func (m *UDPEncapAddReply) Marshal(b []byte) ([]byte, error) {
236 b = make([]byte, m.Size())
238 buf := codec.NewBuffer(b)
239 buf.EncodeInt32(m.Retval)
240 buf.EncodeUint32(m.ID)
241 return buf.Bytes(), nil
243 func (m *UDPEncapAddReply) Unmarshal(b []byte) error {
244 buf := codec.NewBuffer(b)
245 m.Retval = buf.DecodeInt32()
246 m.ID = buf.DecodeUint32()
250 // UDPEncapDel defines message 'udp_encap_del'.
251 type UDPEncapDel struct {
252 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
255 func (m *UDPEncapDel) Reset() { *m = UDPEncapDel{} }
256 func (*UDPEncapDel) GetMessageName() string { return "udp_encap_del" }
257 func (*UDPEncapDel) GetCrcString() string { return "3a91bde5" }
258 func (*UDPEncapDel) GetMessageType() api.MessageType {
259 return api.RequestMessage
262 func (m *UDPEncapDel) Size() (size int) {
269 func (m *UDPEncapDel) Marshal(b []byte) ([]byte, error) {
271 b = make([]byte, m.Size())
273 buf := codec.NewBuffer(b)
274 buf.EncodeUint32(m.ID)
275 return buf.Bytes(), nil
277 func (m *UDPEncapDel) Unmarshal(b []byte) error {
278 buf := codec.NewBuffer(b)
279 m.ID = buf.DecodeUint32()
283 // UDPEncapDelReply defines message 'udp_encap_del_reply'.
284 type UDPEncapDelReply struct {
285 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
288 func (m *UDPEncapDelReply) Reset() { *m = UDPEncapDelReply{} }
289 func (*UDPEncapDelReply) GetMessageName() string { return "udp_encap_del_reply" }
290 func (*UDPEncapDelReply) GetCrcString() string { return "e8d4e804" }
291 func (*UDPEncapDelReply) GetMessageType() api.MessageType {
292 return api.ReplyMessage
295 func (m *UDPEncapDelReply) Size() (size int) {
299 size += 4 // m.Retval
302 func (m *UDPEncapDelReply) Marshal(b []byte) ([]byte, error) {
304 b = make([]byte, m.Size())
306 buf := codec.NewBuffer(b)
307 buf.EncodeInt32(m.Retval)
308 return buf.Bytes(), nil
310 func (m *UDPEncapDelReply) Unmarshal(b []byte) error {
311 buf := codec.NewBuffer(b)
312 m.Retval = buf.DecodeInt32()
316 // UDPEncapDetails defines message 'udp_encap_details'.
317 type UDPEncapDetails struct {
318 UDPEncap UDPEncap `binapi:"udp_encap,name=udp_encap" json:"udp_encap,omitempty"`
321 func (m *UDPEncapDetails) Reset() { *m = UDPEncapDetails{} }
322 func (*UDPEncapDetails) GetMessageName() string { return "udp_encap_details" }
323 func (*UDPEncapDetails) GetCrcString() string { return "8cfb9c76" }
324 func (*UDPEncapDetails) GetMessageType() api.MessageType {
325 return api.ReplyMessage
328 func (m *UDPEncapDetails) Size() (size int) {
332 size += 4 // m.UDPEncap.TableID
333 size += 2 // m.UDPEncap.SrcPort
334 size += 2 // m.UDPEncap.DstPort
335 size += 1 // m.UDPEncap.SrcIP.Af
336 size += 1 * 16 // m.UDPEncap.SrcIP.Un
337 size += 1 // m.UDPEncap.DstIP.Af
338 size += 1 * 16 // m.UDPEncap.DstIP.Un
339 size += 4 // m.UDPEncap.ID
342 func (m *UDPEncapDetails) Marshal(b []byte) ([]byte, error) {
344 b = make([]byte, m.Size())
346 buf := codec.NewBuffer(b)
347 buf.EncodeUint32(m.UDPEncap.TableID)
348 buf.EncodeUint16(m.UDPEncap.SrcPort)
349 buf.EncodeUint16(m.UDPEncap.DstPort)
350 buf.EncodeUint8(uint8(m.UDPEncap.SrcIP.Af))
351 buf.EncodeBytes(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], 16)
352 buf.EncodeUint8(uint8(m.UDPEncap.DstIP.Af))
353 buf.EncodeBytes(m.UDPEncap.DstIP.Un.XXX_UnionData[:], 16)
354 buf.EncodeUint32(m.UDPEncap.ID)
355 return buf.Bytes(), nil
357 func (m *UDPEncapDetails) Unmarshal(b []byte) error {
358 buf := codec.NewBuffer(b)
359 m.UDPEncap.TableID = buf.DecodeUint32()
360 m.UDPEncap.SrcPort = buf.DecodeUint16()
361 m.UDPEncap.DstPort = buf.DecodeUint16()
362 m.UDPEncap.SrcIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
363 copy(m.UDPEncap.SrcIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
364 m.UDPEncap.DstIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
365 copy(m.UDPEncap.DstIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
366 m.UDPEncap.ID = buf.DecodeUint32()
370 // UDPEncapDump defines message 'udp_encap_dump'.
371 type UDPEncapDump struct{}
373 func (m *UDPEncapDump) Reset() { *m = UDPEncapDump{} }
374 func (*UDPEncapDump) GetMessageName() string { return "udp_encap_dump" }
375 func (*UDPEncapDump) GetCrcString() string { return "51077d14" }
376 func (*UDPEncapDump) GetMessageType() api.MessageType {
377 return api.RequestMessage
380 func (m *UDPEncapDump) Size() (size int) {
386 func (m *UDPEncapDump) Marshal(b []byte) ([]byte, error) {
388 b = make([]byte, m.Size())
390 buf := codec.NewBuffer(b)
391 return buf.Bytes(), nil
393 func (m *UDPEncapDump) Unmarshal(b []byte) error {
397 func init() { file_udp_binapi_init() }
398 func file_udp_binapi_init() {
399 api.RegisterMessage((*UDPDecapAddDel)(nil), "udp_decap_add_del_d155c6ac")
400 api.RegisterMessage((*UDPDecapAddDelReply)(nil), "udp_decap_add_del_reply_e8d4e804")
401 api.RegisterMessage((*UDPEncapAdd)(nil), "udp_encap_add_f74a60b1")
402 api.RegisterMessage((*UDPEncapAddReply)(nil), "udp_encap_add_reply_e2fc8294")
403 api.RegisterMessage((*UDPEncapDel)(nil), "udp_encap_del_3a91bde5")
404 api.RegisterMessage((*UDPEncapDelReply)(nil), "udp_encap_del_reply_e8d4e804")
405 api.RegisterMessage((*UDPEncapDetails)(nil), "udp_encap_details_8cfb9c76")
406 api.RegisterMessage((*UDPEncapDump)(nil), "udp_encap_dump_51077d14")
409 // Messages returns list of all messages in this module.
410 func AllMessages() []api.Message {
411 return []api.Message{
412 (*UDPDecapAddDel)(nil),
413 (*UDPDecapAddDelReply)(nil),
415 (*UDPEncapAddReply)(nil),
417 (*UDPEncapDelReply)(nil),
418 (*UDPEncapDetails)(nil),
419 (*UDPEncapDump)(nil),