1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: /usr/share/vpp/api/core/ipip.api.json
7 // Package ipip contains generated bindings for API file ipip.api.
16 api "git.fd.io/govpp.git/api"
17 interface_types "git.fd.io/govpp.git/binapi/interface_types"
18 ip_types "git.fd.io/govpp.git/binapi/ip_types"
19 tunnel_types "git.fd.io/govpp.git/binapi/tunnel_types"
20 codec "git.fd.io/govpp.git/codec"
23 // This is a compile-time assertion to ensure that this generated file
24 // is compatible with the GoVPP api package it is being compiled against.
25 // A compilation error at this line likely means your copy of the
26 // GoVPP api package needs to be updated.
27 const _ = api.GoVppAPIPackageIsVersion2
32 VersionCrc = 0xa095e728
35 // IpipTunnel defines type 'ipip_tunnel'.
36 type IpipTunnel struct {
37 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
38 Src ip_types.Address `binapi:"address,name=src" json:"src,omitempty"`
39 Dst ip_types.Address `binapi:"address,name=dst" json:"dst,omitempty"`
40 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
41 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
42 Flags tunnel_types.TunnelEncapDecapFlags `binapi:"tunnel_encap_decap_flags,name=flags" json:"flags,omitempty"`
43 Mode tunnel_types.TunnelMode `binapi:"tunnel_mode,name=mode" json:"mode,omitempty"`
44 Dscp ip_types.IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
47 // Ipip6rdAddTunnel defines message 'ipip_6rd_add_tunnel'.
48 type Ipip6rdAddTunnel struct {
49 IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
50 IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
51 IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
52 IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
53 IP4Src ip_types.IP4Address `binapi:"ip4_address,name=ip4_src" json:"ip4_src,omitempty"`
54 SecurityCheck bool `binapi:"bool,name=security_check" json:"security_check,omitempty"`
55 TcTos uint8 `binapi:"u8,name=tc_tos" json:"tc_tos,omitempty"`
58 func (m *Ipip6rdAddTunnel) Reset() { *m = Ipip6rdAddTunnel{} }
59 func (*Ipip6rdAddTunnel) GetMessageName() string { return "ipip_6rd_add_tunnel" }
60 func (*Ipip6rdAddTunnel) GetCrcString() string { return "56e93cc0" }
61 func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType {
62 return api.RequestMessage
65 func (m *Ipip6rdAddTunnel) Size() int {
70 size += 4 // m.IP6TableID
71 size += 4 // m.IP4TableID
72 size += 1 * 16 // m.IP6Prefix.Address
73 size += 1 // m.IP6Prefix.Len
74 size += 1 * 4 // m.IP4Prefix.Address
75 size += 1 // m.IP4Prefix.Len
76 size += 1 * 4 // m.IP4Src
77 size += 1 // m.SecurityCheck
81 func (m *Ipip6rdAddTunnel) Marshal(b []byte) ([]byte, error) {
84 buf = codec.NewBuffer(make([]byte, m.Size()))
86 buf = codec.NewBuffer(b)
88 buf.EncodeUint32(uint32(m.IP6TableID))
89 buf.EncodeUint32(uint32(m.IP4TableID))
90 buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
91 buf.EncodeUint8(uint8(m.IP6Prefix.Len))
92 buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
93 buf.EncodeUint8(uint8(m.IP4Prefix.Len))
94 buf.EncodeBytes(m.IP4Src[:], 4)
95 buf.EncodeBool(m.SecurityCheck)
96 buf.EncodeUint8(uint8(m.TcTos))
97 return buf.Bytes(), nil
99 func (m *Ipip6rdAddTunnel) Unmarshal(b []byte) error {
100 buf := codec.NewBuffer(b)
101 m.IP6TableID = buf.DecodeUint32()
102 m.IP4TableID = buf.DecodeUint32()
103 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
104 m.IP6Prefix.Len = buf.DecodeUint8()
105 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
106 m.IP4Prefix.Len = buf.DecodeUint8()
107 copy(m.IP4Src[:], buf.DecodeBytes(4))
108 m.SecurityCheck = buf.DecodeBool()
109 m.TcTos = buf.DecodeUint8()
113 // Ipip6rdAddTunnelReply defines message 'ipip_6rd_add_tunnel_reply'.
114 type Ipip6rdAddTunnelReply struct {
115 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
116 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
119 func (m *Ipip6rdAddTunnelReply) Reset() { *m = Ipip6rdAddTunnelReply{} }
120 func (*Ipip6rdAddTunnelReply) GetMessageName() string { return "ipip_6rd_add_tunnel_reply" }
121 func (*Ipip6rdAddTunnelReply) GetCrcString() string { return "5383d31f" }
122 func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType {
123 return api.ReplyMessage
126 func (m *Ipip6rdAddTunnelReply) Size() int {
131 size += 4 // m.Retval
132 size += 4 // m.SwIfIndex
135 func (m *Ipip6rdAddTunnelReply) Marshal(b []byte) ([]byte, error) {
136 var buf *codec.Buffer
138 buf = codec.NewBuffer(make([]byte, m.Size()))
140 buf = codec.NewBuffer(b)
142 buf.EncodeUint32(uint32(m.Retval))
143 buf.EncodeUint32(uint32(m.SwIfIndex))
144 return buf.Bytes(), nil
146 func (m *Ipip6rdAddTunnelReply) Unmarshal(b []byte) error {
147 buf := codec.NewBuffer(b)
148 m.Retval = int32(buf.DecodeUint32())
149 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
153 // Ipip6rdDelTunnel defines message 'ipip_6rd_del_tunnel'.
154 type Ipip6rdDelTunnel struct {
155 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
158 func (m *Ipip6rdDelTunnel) Reset() { *m = Ipip6rdDelTunnel{} }
159 func (*Ipip6rdDelTunnel) GetMessageName() string { return "ipip_6rd_del_tunnel" }
160 func (*Ipip6rdDelTunnel) GetCrcString() string { return "f9e6675e" }
161 func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType {
162 return api.RequestMessage
165 func (m *Ipip6rdDelTunnel) Size() int {
170 size += 4 // m.SwIfIndex
173 func (m *Ipip6rdDelTunnel) Marshal(b []byte) ([]byte, error) {
174 var buf *codec.Buffer
176 buf = codec.NewBuffer(make([]byte, m.Size()))
178 buf = codec.NewBuffer(b)
180 buf.EncodeUint32(uint32(m.SwIfIndex))
181 return buf.Bytes(), nil
183 func (m *Ipip6rdDelTunnel) Unmarshal(b []byte) error {
184 buf := codec.NewBuffer(b)
185 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
189 // Ipip6rdDelTunnelReply defines message 'ipip_6rd_del_tunnel_reply'.
190 type Ipip6rdDelTunnelReply struct {
191 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
194 func (m *Ipip6rdDelTunnelReply) Reset() { *m = Ipip6rdDelTunnelReply{} }
195 func (*Ipip6rdDelTunnelReply) GetMessageName() string { return "ipip_6rd_del_tunnel_reply" }
196 func (*Ipip6rdDelTunnelReply) GetCrcString() string { return "e8d4e804" }
197 func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType {
198 return api.ReplyMessage
201 func (m *Ipip6rdDelTunnelReply) Size() int {
206 size += 4 // m.Retval
209 func (m *Ipip6rdDelTunnelReply) Marshal(b []byte) ([]byte, error) {
210 var buf *codec.Buffer
212 buf = codec.NewBuffer(make([]byte, m.Size()))
214 buf = codec.NewBuffer(b)
216 buf.EncodeUint32(uint32(m.Retval))
217 return buf.Bytes(), nil
219 func (m *Ipip6rdDelTunnelReply) Unmarshal(b []byte) error {
220 buf := codec.NewBuffer(b)
221 m.Retval = int32(buf.DecodeUint32())
225 // IpipAddTunnel defines message 'ipip_add_tunnel'.
226 type IpipAddTunnel struct {
227 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
230 func (m *IpipAddTunnel) Reset() { *m = IpipAddTunnel{} }
231 func (*IpipAddTunnel) GetMessageName() string { return "ipip_add_tunnel" }
232 func (*IpipAddTunnel) GetCrcString() string { return "a9decfcd" }
233 func (*IpipAddTunnel) GetMessageType() api.MessageType {
234 return api.RequestMessage
237 func (m *IpipAddTunnel) Size() int {
242 size += 4 // m.Tunnel.Instance
243 size += 1 // m.Tunnel.Src.Af
244 size += 1 * 16 // m.Tunnel.Src.Un
245 size += 1 // m.Tunnel.Dst.Af
246 size += 1 * 16 // m.Tunnel.Dst.Un
247 size += 4 // m.Tunnel.SwIfIndex
248 size += 4 // m.Tunnel.TableID
249 size += 1 // m.Tunnel.Flags
250 size += 1 // m.Tunnel.Mode
251 size += 1 // m.Tunnel.Dscp
254 func (m *IpipAddTunnel) Marshal(b []byte) ([]byte, error) {
255 var buf *codec.Buffer
257 buf = codec.NewBuffer(make([]byte, m.Size()))
259 buf = codec.NewBuffer(b)
261 buf.EncodeUint32(uint32(m.Tunnel.Instance))
262 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
263 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0)
264 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
265 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0)
266 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
267 buf.EncodeUint32(uint32(m.Tunnel.TableID))
268 buf.EncodeUint8(uint8(m.Tunnel.Flags))
269 buf.EncodeUint8(uint8(m.Tunnel.Mode))
270 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
271 return buf.Bytes(), nil
273 func (m *IpipAddTunnel) Unmarshal(b []byte) error {
274 buf := codec.NewBuffer(b)
275 m.Tunnel.Instance = buf.DecodeUint32()
276 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
277 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
278 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
279 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
280 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
281 m.Tunnel.TableID = buf.DecodeUint32()
282 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
283 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
284 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
288 // IpipAddTunnelReply defines message 'ipip_add_tunnel_reply'.
289 type IpipAddTunnelReply struct {
290 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
291 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
294 func (m *IpipAddTunnelReply) Reset() { *m = IpipAddTunnelReply{} }
295 func (*IpipAddTunnelReply) GetMessageName() string { return "ipip_add_tunnel_reply" }
296 func (*IpipAddTunnelReply) GetCrcString() string { return "5383d31f" }
297 func (*IpipAddTunnelReply) GetMessageType() api.MessageType {
298 return api.ReplyMessage
301 func (m *IpipAddTunnelReply) Size() int {
306 size += 4 // m.Retval
307 size += 4 // m.SwIfIndex
310 func (m *IpipAddTunnelReply) Marshal(b []byte) ([]byte, error) {
311 var buf *codec.Buffer
313 buf = codec.NewBuffer(make([]byte, m.Size()))
315 buf = codec.NewBuffer(b)
317 buf.EncodeUint32(uint32(m.Retval))
318 buf.EncodeUint32(uint32(m.SwIfIndex))
319 return buf.Bytes(), nil
321 func (m *IpipAddTunnelReply) Unmarshal(b []byte) error {
322 buf := codec.NewBuffer(b)
323 m.Retval = int32(buf.DecodeUint32())
324 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
328 // IpipDelTunnel defines message 'ipip_del_tunnel'.
329 type IpipDelTunnel struct {
330 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
333 func (m *IpipDelTunnel) Reset() { *m = IpipDelTunnel{} }
334 func (*IpipDelTunnel) GetMessageName() string { return "ipip_del_tunnel" }
335 func (*IpipDelTunnel) GetCrcString() string { return "f9e6675e" }
336 func (*IpipDelTunnel) GetMessageType() api.MessageType {
337 return api.RequestMessage
340 func (m *IpipDelTunnel) Size() int {
345 size += 4 // m.SwIfIndex
348 func (m *IpipDelTunnel) Marshal(b []byte) ([]byte, error) {
349 var buf *codec.Buffer
351 buf = codec.NewBuffer(make([]byte, m.Size()))
353 buf = codec.NewBuffer(b)
355 buf.EncodeUint32(uint32(m.SwIfIndex))
356 return buf.Bytes(), nil
358 func (m *IpipDelTunnel) Unmarshal(b []byte) error {
359 buf := codec.NewBuffer(b)
360 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
364 // IpipDelTunnelReply defines message 'ipip_del_tunnel_reply'.
365 type IpipDelTunnelReply struct {
366 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
369 func (m *IpipDelTunnelReply) Reset() { *m = IpipDelTunnelReply{} }
370 func (*IpipDelTunnelReply) GetMessageName() string { return "ipip_del_tunnel_reply" }
371 func (*IpipDelTunnelReply) GetCrcString() string { return "e8d4e804" }
372 func (*IpipDelTunnelReply) GetMessageType() api.MessageType {
373 return api.ReplyMessage
376 func (m *IpipDelTunnelReply) Size() int {
381 size += 4 // m.Retval
384 func (m *IpipDelTunnelReply) Marshal(b []byte) ([]byte, error) {
385 var buf *codec.Buffer
387 buf = codec.NewBuffer(make([]byte, m.Size()))
389 buf = codec.NewBuffer(b)
391 buf.EncodeUint32(uint32(m.Retval))
392 return buf.Bytes(), nil
394 func (m *IpipDelTunnelReply) Unmarshal(b []byte) error {
395 buf := codec.NewBuffer(b)
396 m.Retval = int32(buf.DecodeUint32())
400 // IpipTunnelDetails defines message 'ipip_tunnel_details'.
401 type IpipTunnelDetails struct {
402 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
405 func (m *IpipTunnelDetails) Reset() { *m = IpipTunnelDetails{} }
406 func (*IpipTunnelDetails) GetMessageName() string { return "ipip_tunnel_details" }
407 func (*IpipTunnelDetails) GetCrcString() string { return "53236d75" }
408 func (*IpipTunnelDetails) GetMessageType() api.MessageType {
409 return api.ReplyMessage
412 func (m *IpipTunnelDetails) Size() int {
417 size += 4 // m.Tunnel.Instance
418 size += 1 // m.Tunnel.Src.Af
419 size += 1 * 16 // m.Tunnel.Src.Un
420 size += 1 // m.Tunnel.Dst.Af
421 size += 1 * 16 // m.Tunnel.Dst.Un
422 size += 4 // m.Tunnel.SwIfIndex
423 size += 4 // m.Tunnel.TableID
424 size += 1 // m.Tunnel.Flags
425 size += 1 // m.Tunnel.Mode
426 size += 1 // m.Tunnel.Dscp
429 func (m *IpipTunnelDetails) Marshal(b []byte) ([]byte, error) {
430 var buf *codec.Buffer
432 buf = codec.NewBuffer(make([]byte, m.Size()))
434 buf = codec.NewBuffer(b)
436 buf.EncodeUint32(uint32(m.Tunnel.Instance))
437 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
438 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0)
439 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
440 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0)
441 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
442 buf.EncodeUint32(uint32(m.Tunnel.TableID))
443 buf.EncodeUint8(uint8(m.Tunnel.Flags))
444 buf.EncodeUint8(uint8(m.Tunnel.Mode))
445 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
446 return buf.Bytes(), nil
448 func (m *IpipTunnelDetails) Unmarshal(b []byte) error {
449 buf := codec.NewBuffer(b)
450 m.Tunnel.Instance = buf.DecodeUint32()
451 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
452 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
453 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
454 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
455 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
456 m.Tunnel.TableID = buf.DecodeUint32()
457 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
458 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
459 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
463 // IpipTunnelDump defines message 'ipip_tunnel_dump'.
464 type IpipTunnelDump struct {
465 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
468 func (m *IpipTunnelDump) Reset() { *m = IpipTunnelDump{} }
469 func (*IpipTunnelDump) GetMessageName() string { return "ipip_tunnel_dump" }
470 func (*IpipTunnelDump) GetCrcString() string { return "f9e6675e" }
471 func (*IpipTunnelDump) GetMessageType() api.MessageType {
472 return api.RequestMessage
475 func (m *IpipTunnelDump) Size() int {
480 size += 4 // m.SwIfIndex
483 func (m *IpipTunnelDump) Marshal(b []byte) ([]byte, error) {
484 var buf *codec.Buffer
486 buf = codec.NewBuffer(make([]byte, m.Size()))
488 buf = codec.NewBuffer(b)
490 buf.EncodeUint32(uint32(m.SwIfIndex))
491 return buf.Bytes(), nil
493 func (m *IpipTunnelDump) Unmarshal(b []byte) error {
494 buf := codec.NewBuffer(b)
495 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
499 func init() { file_ipip_binapi_init() }
500 func file_ipip_binapi_init() {
501 api.RegisterMessage((*Ipip6rdAddTunnel)(nil), "ipip_6rd_add_tunnel_56e93cc0")
502 api.RegisterMessage((*Ipip6rdAddTunnelReply)(nil), "ipip_6rd_add_tunnel_reply_5383d31f")
503 api.RegisterMessage((*Ipip6rdDelTunnel)(nil), "ipip_6rd_del_tunnel_f9e6675e")
504 api.RegisterMessage((*Ipip6rdDelTunnelReply)(nil), "ipip_6rd_del_tunnel_reply_e8d4e804")
505 api.RegisterMessage((*IpipAddTunnel)(nil), "ipip_add_tunnel_a9decfcd")
506 api.RegisterMessage((*IpipAddTunnelReply)(nil), "ipip_add_tunnel_reply_5383d31f")
507 api.RegisterMessage((*IpipDelTunnel)(nil), "ipip_del_tunnel_f9e6675e")
508 api.RegisterMessage((*IpipDelTunnelReply)(nil), "ipip_del_tunnel_reply_e8d4e804")
509 api.RegisterMessage((*IpipTunnelDetails)(nil), "ipip_tunnel_details_53236d75")
510 api.RegisterMessage((*IpipTunnelDump)(nil), "ipip_tunnel_dump_f9e6675e")
513 // Messages returns list of all messages in this module.
514 func AllMessages() []api.Message {
515 return []api.Message{
516 (*Ipip6rdAddTunnel)(nil),
517 (*Ipip6rdAddTunnelReply)(nil),
518 (*Ipip6rdDelTunnel)(nil),
519 (*Ipip6rdDelTunnelReply)(nil),
520 (*IpipAddTunnel)(nil),
521 (*IpipAddTunnelReply)(nil),
522 (*IpipDelTunnel)(nil),
523 (*IpipDelTunnelReply)(nil),
524 (*IpipTunnelDetails)(nil),
525 (*IpipTunnelDump)(nil),