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 = 0x4609caba
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 "b9ec1863" }
61 func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType {
62 return api.RequestMessage
65 func (m *Ipip6rdAddTunnel) Size() (size int) {
69 size += 4 // m.IP6TableID
70 size += 4 // m.IP4TableID
71 size += 1 * 16 // m.IP6Prefix.Address
72 size += 1 // m.IP6Prefix.Len
73 size += 1 * 4 // m.IP4Prefix.Address
74 size += 1 // m.IP4Prefix.Len
75 size += 1 * 4 // m.IP4Src
76 size += 1 // m.SecurityCheck
80 func (m *Ipip6rdAddTunnel) Marshal(b []byte) ([]byte, error) {
82 b = make([]byte, m.Size())
84 buf := codec.NewBuffer(b)
85 buf.EncodeUint32(m.IP6TableID)
86 buf.EncodeUint32(m.IP4TableID)
87 buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
88 buf.EncodeUint8(m.IP6Prefix.Len)
89 buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
90 buf.EncodeUint8(m.IP4Prefix.Len)
91 buf.EncodeBytes(m.IP4Src[:], 4)
92 buf.EncodeBool(m.SecurityCheck)
93 buf.EncodeUint8(m.TcTos)
94 return buf.Bytes(), nil
96 func (m *Ipip6rdAddTunnel) Unmarshal(b []byte) error {
97 buf := codec.NewBuffer(b)
98 m.IP6TableID = buf.DecodeUint32()
99 m.IP4TableID = buf.DecodeUint32()
100 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
101 m.IP6Prefix.Len = buf.DecodeUint8()
102 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
103 m.IP4Prefix.Len = buf.DecodeUint8()
104 copy(m.IP4Src[:], buf.DecodeBytes(4))
105 m.SecurityCheck = buf.DecodeBool()
106 m.TcTos = buf.DecodeUint8()
110 // Ipip6rdAddTunnelReply defines message 'ipip_6rd_add_tunnel_reply'.
111 type Ipip6rdAddTunnelReply struct {
112 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
113 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
116 func (m *Ipip6rdAddTunnelReply) Reset() { *m = Ipip6rdAddTunnelReply{} }
117 func (*Ipip6rdAddTunnelReply) GetMessageName() string { return "ipip_6rd_add_tunnel_reply" }
118 func (*Ipip6rdAddTunnelReply) GetCrcString() string { return "5383d31f" }
119 func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType {
120 return api.ReplyMessage
123 func (m *Ipip6rdAddTunnelReply) Size() (size int) {
127 size += 4 // m.Retval
128 size += 4 // m.SwIfIndex
131 func (m *Ipip6rdAddTunnelReply) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeInt32(m.Retval)
137 buf.EncodeUint32(uint32(m.SwIfIndex))
138 return buf.Bytes(), nil
140 func (m *Ipip6rdAddTunnelReply) Unmarshal(b []byte) error {
141 buf := codec.NewBuffer(b)
142 m.Retval = buf.DecodeInt32()
143 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
147 // Ipip6rdDelTunnel defines message 'ipip_6rd_del_tunnel'.
148 type Ipip6rdDelTunnel struct {
149 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
152 func (m *Ipip6rdDelTunnel) Reset() { *m = Ipip6rdDelTunnel{} }
153 func (*Ipip6rdDelTunnel) GetMessageName() string { return "ipip_6rd_del_tunnel" }
154 func (*Ipip6rdDelTunnel) GetCrcString() string { return "f9e6675e" }
155 func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType {
156 return api.RequestMessage
159 func (m *Ipip6rdDelTunnel) Size() (size int) {
163 size += 4 // m.SwIfIndex
166 func (m *Ipip6rdDelTunnel) Marshal(b []byte) ([]byte, error) {
168 b = make([]byte, m.Size())
170 buf := codec.NewBuffer(b)
171 buf.EncodeUint32(uint32(m.SwIfIndex))
172 return buf.Bytes(), nil
174 func (m *Ipip6rdDelTunnel) Unmarshal(b []byte) error {
175 buf := codec.NewBuffer(b)
176 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
180 // Ipip6rdDelTunnelReply defines message 'ipip_6rd_del_tunnel_reply'.
181 type Ipip6rdDelTunnelReply struct {
182 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
185 func (m *Ipip6rdDelTunnelReply) Reset() { *m = Ipip6rdDelTunnelReply{} }
186 func (*Ipip6rdDelTunnelReply) GetMessageName() string { return "ipip_6rd_del_tunnel_reply" }
187 func (*Ipip6rdDelTunnelReply) GetCrcString() string { return "e8d4e804" }
188 func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType {
189 return api.ReplyMessage
192 func (m *Ipip6rdDelTunnelReply) Size() (size int) {
196 size += 4 // m.Retval
199 func (m *Ipip6rdDelTunnelReply) Marshal(b []byte) ([]byte, error) {
201 b = make([]byte, m.Size())
203 buf := codec.NewBuffer(b)
204 buf.EncodeInt32(m.Retval)
205 return buf.Bytes(), nil
207 func (m *Ipip6rdDelTunnelReply) Unmarshal(b []byte) error {
208 buf := codec.NewBuffer(b)
209 m.Retval = buf.DecodeInt32()
213 // IpipAddTunnel defines message 'ipip_add_tunnel'.
214 type IpipAddTunnel struct {
215 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
218 func (m *IpipAddTunnel) Reset() { *m = IpipAddTunnel{} }
219 func (*IpipAddTunnel) GetMessageName() string { return "ipip_add_tunnel" }
220 func (*IpipAddTunnel) GetCrcString() string { return "2ac399f5" }
221 func (*IpipAddTunnel) GetMessageType() api.MessageType {
222 return api.RequestMessage
225 func (m *IpipAddTunnel) Size() (size int) {
229 size += 4 // m.Tunnel.Instance
230 size += 1 // m.Tunnel.Src.Af
231 size += 1 * 16 // m.Tunnel.Src.Un
232 size += 1 // m.Tunnel.Dst.Af
233 size += 1 * 16 // m.Tunnel.Dst.Un
234 size += 4 // m.Tunnel.SwIfIndex
235 size += 4 // m.Tunnel.TableID
236 size += 1 // m.Tunnel.Flags
237 size += 1 // m.Tunnel.Mode
238 size += 1 // m.Tunnel.Dscp
241 func (m *IpipAddTunnel) Marshal(b []byte) ([]byte, error) {
243 b = make([]byte, m.Size())
245 buf := codec.NewBuffer(b)
246 buf.EncodeUint32(m.Tunnel.Instance)
247 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
248 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
249 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
250 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
251 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
252 buf.EncodeUint32(m.Tunnel.TableID)
253 buf.EncodeUint8(uint8(m.Tunnel.Flags))
254 buf.EncodeUint8(uint8(m.Tunnel.Mode))
255 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
256 return buf.Bytes(), nil
258 func (m *IpipAddTunnel) Unmarshal(b []byte) error {
259 buf := codec.NewBuffer(b)
260 m.Tunnel.Instance = buf.DecodeUint32()
261 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
262 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
263 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
264 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
265 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
266 m.Tunnel.TableID = buf.DecodeUint32()
267 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
268 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
269 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
273 // IpipAddTunnelReply defines message 'ipip_add_tunnel_reply'.
274 type IpipAddTunnelReply struct {
275 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
276 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
279 func (m *IpipAddTunnelReply) Reset() { *m = IpipAddTunnelReply{} }
280 func (*IpipAddTunnelReply) GetMessageName() string { return "ipip_add_tunnel_reply" }
281 func (*IpipAddTunnelReply) GetCrcString() string { return "5383d31f" }
282 func (*IpipAddTunnelReply) GetMessageType() api.MessageType {
283 return api.ReplyMessage
286 func (m *IpipAddTunnelReply) Size() (size int) {
290 size += 4 // m.Retval
291 size += 4 // m.SwIfIndex
294 func (m *IpipAddTunnelReply) Marshal(b []byte) ([]byte, error) {
296 b = make([]byte, m.Size())
298 buf := codec.NewBuffer(b)
299 buf.EncodeInt32(m.Retval)
300 buf.EncodeUint32(uint32(m.SwIfIndex))
301 return buf.Bytes(), nil
303 func (m *IpipAddTunnelReply) Unmarshal(b []byte) error {
304 buf := codec.NewBuffer(b)
305 m.Retval = buf.DecodeInt32()
306 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
310 // IpipDelTunnel defines message 'ipip_del_tunnel'.
311 type IpipDelTunnel struct {
312 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
315 func (m *IpipDelTunnel) Reset() { *m = IpipDelTunnel{} }
316 func (*IpipDelTunnel) GetMessageName() string { return "ipip_del_tunnel" }
317 func (*IpipDelTunnel) GetCrcString() string { return "f9e6675e" }
318 func (*IpipDelTunnel) GetMessageType() api.MessageType {
319 return api.RequestMessage
322 func (m *IpipDelTunnel) Size() (size int) {
326 size += 4 // m.SwIfIndex
329 func (m *IpipDelTunnel) Marshal(b []byte) ([]byte, error) {
331 b = make([]byte, m.Size())
333 buf := codec.NewBuffer(b)
334 buf.EncodeUint32(uint32(m.SwIfIndex))
335 return buf.Bytes(), nil
337 func (m *IpipDelTunnel) Unmarshal(b []byte) error {
338 buf := codec.NewBuffer(b)
339 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
343 // IpipDelTunnelReply defines message 'ipip_del_tunnel_reply'.
344 type IpipDelTunnelReply struct {
345 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
348 func (m *IpipDelTunnelReply) Reset() { *m = IpipDelTunnelReply{} }
349 func (*IpipDelTunnelReply) GetMessageName() string { return "ipip_del_tunnel_reply" }
350 func (*IpipDelTunnelReply) GetCrcString() string { return "e8d4e804" }
351 func (*IpipDelTunnelReply) GetMessageType() api.MessageType {
352 return api.ReplyMessage
355 func (m *IpipDelTunnelReply) Size() (size int) {
359 size += 4 // m.Retval
362 func (m *IpipDelTunnelReply) Marshal(b []byte) ([]byte, error) {
364 b = make([]byte, m.Size())
366 buf := codec.NewBuffer(b)
367 buf.EncodeInt32(m.Retval)
368 return buf.Bytes(), nil
370 func (m *IpipDelTunnelReply) Unmarshal(b []byte) error {
371 buf := codec.NewBuffer(b)
372 m.Retval = buf.DecodeInt32()
376 // IpipTunnelDetails defines message 'ipip_tunnel_details'.
377 type IpipTunnelDetails struct {
378 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
381 func (m *IpipTunnelDetails) Reset() { *m = IpipTunnelDetails{} }
382 func (*IpipTunnelDetails) GetMessageName() string { return "ipip_tunnel_details" }
383 func (*IpipTunnelDetails) GetCrcString() string { return "d31cb34e" }
384 func (*IpipTunnelDetails) GetMessageType() api.MessageType {
385 return api.ReplyMessage
388 func (m *IpipTunnelDetails) Size() (size int) {
392 size += 4 // m.Tunnel.Instance
393 size += 1 // m.Tunnel.Src.Af
394 size += 1 * 16 // m.Tunnel.Src.Un
395 size += 1 // m.Tunnel.Dst.Af
396 size += 1 * 16 // m.Tunnel.Dst.Un
397 size += 4 // m.Tunnel.SwIfIndex
398 size += 4 // m.Tunnel.TableID
399 size += 1 // m.Tunnel.Flags
400 size += 1 // m.Tunnel.Mode
401 size += 1 // m.Tunnel.Dscp
404 func (m *IpipTunnelDetails) Marshal(b []byte) ([]byte, error) {
406 b = make([]byte, m.Size())
408 buf := codec.NewBuffer(b)
409 buf.EncodeUint32(m.Tunnel.Instance)
410 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
411 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
412 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
413 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
414 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
415 buf.EncodeUint32(m.Tunnel.TableID)
416 buf.EncodeUint8(uint8(m.Tunnel.Flags))
417 buf.EncodeUint8(uint8(m.Tunnel.Mode))
418 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
419 return buf.Bytes(), nil
421 func (m *IpipTunnelDetails) Unmarshal(b []byte) error {
422 buf := codec.NewBuffer(b)
423 m.Tunnel.Instance = buf.DecodeUint32()
424 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
425 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
426 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
427 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
428 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
429 m.Tunnel.TableID = buf.DecodeUint32()
430 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
431 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
432 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
436 // IpipTunnelDump defines message 'ipip_tunnel_dump'.
437 type IpipTunnelDump struct {
438 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
441 func (m *IpipTunnelDump) Reset() { *m = IpipTunnelDump{} }
442 func (*IpipTunnelDump) GetMessageName() string { return "ipip_tunnel_dump" }
443 func (*IpipTunnelDump) GetCrcString() string { return "f9e6675e" }
444 func (*IpipTunnelDump) GetMessageType() api.MessageType {
445 return api.RequestMessage
448 func (m *IpipTunnelDump) Size() (size int) {
452 size += 4 // m.SwIfIndex
455 func (m *IpipTunnelDump) Marshal(b []byte) ([]byte, error) {
457 b = make([]byte, m.Size())
459 buf := codec.NewBuffer(b)
460 buf.EncodeUint32(uint32(m.SwIfIndex))
461 return buf.Bytes(), nil
463 func (m *IpipTunnelDump) Unmarshal(b []byte) error {
464 buf := codec.NewBuffer(b)
465 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
469 func init() { file_ipip_binapi_init() }
470 func file_ipip_binapi_init() {
471 api.RegisterMessage((*Ipip6rdAddTunnel)(nil), "ipip_6rd_add_tunnel_b9ec1863")
472 api.RegisterMessage((*Ipip6rdAddTunnelReply)(nil), "ipip_6rd_add_tunnel_reply_5383d31f")
473 api.RegisterMessage((*Ipip6rdDelTunnel)(nil), "ipip_6rd_del_tunnel_f9e6675e")
474 api.RegisterMessage((*Ipip6rdDelTunnelReply)(nil), "ipip_6rd_del_tunnel_reply_e8d4e804")
475 api.RegisterMessage((*IpipAddTunnel)(nil), "ipip_add_tunnel_2ac399f5")
476 api.RegisterMessage((*IpipAddTunnelReply)(nil), "ipip_add_tunnel_reply_5383d31f")
477 api.RegisterMessage((*IpipDelTunnel)(nil), "ipip_del_tunnel_f9e6675e")
478 api.RegisterMessage((*IpipDelTunnelReply)(nil), "ipip_del_tunnel_reply_e8d4e804")
479 api.RegisterMessage((*IpipTunnelDetails)(nil), "ipip_tunnel_details_d31cb34e")
480 api.RegisterMessage((*IpipTunnelDump)(nil), "ipip_tunnel_dump_f9e6675e")
483 // Messages returns list of all messages in this module.
484 func AllMessages() []api.Message {
485 return []api.Message{
486 (*Ipip6rdAddTunnel)(nil),
487 (*Ipip6rdAddTunnelReply)(nil),
488 (*Ipip6rdDelTunnel)(nil),
489 (*Ipip6rdDelTunnelReply)(nil),
490 (*IpipAddTunnel)(nil),
491 (*IpipAddTunnelReply)(nil),
492 (*IpipDelTunnel)(nil),
493 (*IpipDelTunnelReply)(nil),
494 (*IpipTunnelDetails)(nil),
495 (*IpipTunnelDump)(nil),