1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package ipip contains generated bindings for API file ipip.api.
15 api "git.fd.io/govpp.git/api"
16 interface_types "git.fd.io/govpp.git/binapi/interface_types"
17 ip_types "git.fd.io/govpp.git/binapi/ip_types"
18 tunnel_types "git.fd.io/govpp.git/binapi/tunnel_types"
19 codec "git.fd.io/govpp.git/codec"
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
31 VersionCrc = 0xa095e728
34 // IpipTunnel defines type 'ipip_tunnel'.
35 type IpipTunnel struct {
36 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
37 Src ip_types.Address `binapi:"address,name=src" json:"src,omitempty"`
38 Dst ip_types.Address `binapi:"address,name=dst" json:"dst,omitempty"`
39 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
40 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
41 Flags tunnel_types.TunnelEncapDecapFlags `binapi:"tunnel_encap_decap_flags,name=flags" json:"flags,omitempty"`
42 Mode tunnel_types.TunnelMode `binapi:"tunnel_mode,name=mode" json:"mode,omitempty"`
43 Dscp ip_types.IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"`
46 // Ipip6rdAddTunnel defines message 'ipip_6rd_add_tunnel'.
47 type Ipip6rdAddTunnel struct {
48 IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"`
49 IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"`
50 IP6Prefix ip_types.IP6Prefix `binapi:"ip6_prefix,name=ip6_prefix" json:"ip6_prefix,omitempty"`
51 IP4Prefix ip_types.IP4Prefix `binapi:"ip4_prefix,name=ip4_prefix" json:"ip4_prefix,omitempty"`
52 IP4Src ip_types.IP4Address `binapi:"ip4_address,name=ip4_src" json:"ip4_src,omitempty"`
53 SecurityCheck bool `binapi:"bool,name=security_check" json:"security_check,omitempty"`
54 TcTos uint8 `binapi:"u8,name=tc_tos" json:"tc_tos,omitempty"`
57 func (m *Ipip6rdAddTunnel) Reset() { *m = Ipip6rdAddTunnel{} }
58 func (*Ipip6rdAddTunnel) GetMessageName() string { return "ipip_6rd_add_tunnel" }
59 func (*Ipip6rdAddTunnel) GetCrcString() string { return "56e93cc0" }
60 func (*Ipip6rdAddTunnel) GetMessageType() api.MessageType {
61 return api.RequestMessage
64 func (m *Ipip6rdAddTunnel) Size() (size int) {
68 size += 4 // m.IP6TableID
69 size += 4 // m.IP4TableID
70 size += 1 * 16 // m.IP6Prefix.Address
71 size += 1 // m.IP6Prefix.Len
72 size += 1 * 4 // m.IP4Prefix.Address
73 size += 1 // m.IP4Prefix.Len
74 size += 1 * 4 // m.IP4Src
75 size += 1 // m.SecurityCheck
79 func (m *Ipip6rdAddTunnel) Marshal(b []byte) ([]byte, error) {
81 b = make([]byte, m.Size())
83 buf := codec.NewBuffer(b)
84 buf.EncodeUint32(m.IP6TableID)
85 buf.EncodeUint32(m.IP4TableID)
86 buf.EncodeBytes(m.IP6Prefix.Address[:], 16)
87 buf.EncodeUint8(m.IP6Prefix.Len)
88 buf.EncodeBytes(m.IP4Prefix.Address[:], 4)
89 buf.EncodeUint8(m.IP4Prefix.Len)
90 buf.EncodeBytes(m.IP4Src[:], 4)
91 buf.EncodeBool(m.SecurityCheck)
92 buf.EncodeUint8(m.TcTos)
93 return buf.Bytes(), nil
95 func (m *Ipip6rdAddTunnel) Unmarshal(b []byte) error {
96 buf := codec.NewBuffer(b)
97 m.IP6TableID = buf.DecodeUint32()
98 m.IP4TableID = buf.DecodeUint32()
99 copy(m.IP6Prefix.Address[:], buf.DecodeBytes(16))
100 m.IP6Prefix.Len = buf.DecodeUint8()
101 copy(m.IP4Prefix.Address[:], buf.DecodeBytes(4))
102 m.IP4Prefix.Len = buf.DecodeUint8()
103 copy(m.IP4Src[:], buf.DecodeBytes(4))
104 m.SecurityCheck = buf.DecodeBool()
105 m.TcTos = buf.DecodeUint8()
109 // Ipip6rdAddTunnelReply defines message 'ipip_6rd_add_tunnel_reply'.
110 type Ipip6rdAddTunnelReply struct {
111 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
112 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
115 func (m *Ipip6rdAddTunnelReply) Reset() { *m = Ipip6rdAddTunnelReply{} }
116 func (*Ipip6rdAddTunnelReply) GetMessageName() string { return "ipip_6rd_add_tunnel_reply" }
117 func (*Ipip6rdAddTunnelReply) GetCrcString() string { return "5383d31f" }
118 func (*Ipip6rdAddTunnelReply) GetMessageType() api.MessageType {
119 return api.ReplyMessage
122 func (m *Ipip6rdAddTunnelReply) Size() (size int) {
126 size += 4 // m.Retval
127 size += 4 // m.SwIfIndex
130 func (m *Ipip6rdAddTunnelReply) Marshal(b []byte) ([]byte, error) {
132 b = make([]byte, m.Size())
134 buf := codec.NewBuffer(b)
135 buf.EncodeInt32(m.Retval)
136 buf.EncodeUint32(uint32(m.SwIfIndex))
137 return buf.Bytes(), nil
139 func (m *Ipip6rdAddTunnelReply) Unmarshal(b []byte) error {
140 buf := codec.NewBuffer(b)
141 m.Retval = buf.DecodeInt32()
142 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
146 // Ipip6rdDelTunnel defines message 'ipip_6rd_del_tunnel'.
147 type Ipip6rdDelTunnel struct {
148 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
151 func (m *Ipip6rdDelTunnel) Reset() { *m = Ipip6rdDelTunnel{} }
152 func (*Ipip6rdDelTunnel) GetMessageName() string { return "ipip_6rd_del_tunnel" }
153 func (*Ipip6rdDelTunnel) GetCrcString() string { return "f9e6675e" }
154 func (*Ipip6rdDelTunnel) GetMessageType() api.MessageType {
155 return api.RequestMessage
158 func (m *Ipip6rdDelTunnel) Size() (size int) {
162 size += 4 // m.SwIfIndex
165 func (m *Ipip6rdDelTunnel) Marshal(b []byte) ([]byte, error) {
167 b = make([]byte, m.Size())
169 buf := codec.NewBuffer(b)
170 buf.EncodeUint32(uint32(m.SwIfIndex))
171 return buf.Bytes(), nil
173 func (m *Ipip6rdDelTunnel) Unmarshal(b []byte) error {
174 buf := codec.NewBuffer(b)
175 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
179 // Ipip6rdDelTunnelReply defines message 'ipip_6rd_del_tunnel_reply'.
180 type Ipip6rdDelTunnelReply struct {
181 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
184 func (m *Ipip6rdDelTunnelReply) Reset() { *m = Ipip6rdDelTunnelReply{} }
185 func (*Ipip6rdDelTunnelReply) GetMessageName() string { return "ipip_6rd_del_tunnel_reply" }
186 func (*Ipip6rdDelTunnelReply) GetCrcString() string { return "e8d4e804" }
187 func (*Ipip6rdDelTunnelReply) GetMessageType() api.MessageType {
188 return api.ReplyMessage
191 func (m *Ipip6rdDelTunnelReply) Size() (size int) {
195 size += 4 // m.Retval
198 func (m *Ipip6rdDelTunnelReply) Marshal(b []byte) ([]byte, error) {
200 b = make([]byte, m.Size())
202 buf := codec.NewBuffer(b)
203 buf.EncodeInt32(m.Retval)
204 return buf.Bytes(), nil
206 func (m *Ipip6rdDelTunnelReply) Unmarshal(b []byte) error {
207 buf := codec.NewBuffer(b)
208 m.Retval = buf.DecodeInt32()
212 // IpipAddTunnel defines message 'ipip_add_tunnel'.
213 type IpipAddTunnel struct {
214 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
217 func (m *IpipAddTunnel) Reset() { *m = IpipAddTunnel{} }
218 func (*IpipAddTunnel) GetMessageName() string { return "ipip_add_tunnel" }
219 func (*IpipAddTunnel) GetCrcString() string { return "a9decfcd" }
220 func (*IpipAddTunnel) GetMessageType() api.MessageType {
221 return api.RequestMessage
224 func (m *IpipAddTunnel) Size() (size int) {
228 size += 4 // m.Tunnel.Instance
229 size += 1 // m.Tunnel.Src.Af
230 size += 1 * 16 // m.Tunnel.Src.Un
231 size += 1 // m.Tunnel.Dst.Af
232 size += 1 * 16 // m.Tunnel.Dst.Un
233 size += 4 // m.Tunnel.SwIfIndex
234 size += 4 // m.Tunnel.TableID
235 size += 1 // m.Tunnel.Flags
236 size += 1 // m.Tunnel.Mode
237 size += 1 // m.Tunnel.Dscp
240 func (m *IpipAddTunnel) Marshal(b []byte) ([]byte, error) {
242 b = make([]byte, m.Size())
244 buf := codec.NewBuffer(b)
245 buf.EncodeUint32(m.Tunnel.Instance)
246 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
247 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
248 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
249 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
250 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
251 buf.EncodeUint32(m.Tunnel.TableID)
252 buf.EncodeUint8(uint8(m.Tunnel.Flags))
253 buf.EncodeUint8(uint8(m.Tunnel.Mode))
254 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
255 return buf.Bytes(), nil
257 func (m *IpipAddTunnel) Unmarshal(b []byte) error {
258 buf := codec.NewBuffer(b)
259 m.Tunnel.Instance = buf.DecodeUint32()
260 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
261 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
262 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
263 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
264 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
265 m.Tunnel.TableID = buf.DecodeUint32()
266 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
267 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
268 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
272 // IpipAddTunnelReply defines message 'ipip_add_tunnel_reply'.
273 type IpipAddTunnelReply struct {
274 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
275 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
278 func (m *IpipAddTunnelReply) Reset() { *m = IpipAddTunnelReply{} }
279 func (*IpipAddTunnelReply) GetMessageName() string { return "ipip_add_tunnel_reply" }
280 func (*IpipAddTunnelReply) GetCrcString() string { return "5383d31f" }
281 func (*IpipAddTunnelReply) GetMessageType() api.MessageType {
282 return api.ReplyMessage
285 func (m *IpipAddTunnelReply) Size() (size int) {
289 size += 4 // m.Retval
290 size += 4 // m.SwIfIndex
293 func (m *IpipAddTunnelReply) Marshal(b []byte) ([]byte, error) {
295 b = make([]byte, m.Size())
297 buf := codec.NewBuffer(b)
298 buf.EncodeInt32(m.Retval)
299 buf.EncodeUint32(uint32(m.SwIfIndex))
300 return buf.Bytes(), nil
302 func (m *IpipAddTunnelReply) Unmarshal(b []byte) error {
303 buf := codec.NewBuffer(b)
304 m.Retval = buf.DecodeInt32()
305 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
309 // IpipDelTunnel defines message 'ipip_del_tunnel'.
310 type IpipDelTunnel struct {
311 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
314 func (m *IpipDelTunnel) Reset() { *m = IpipDelTunnel{} }
315 func (*IpipDelTunnel) GetMessageName() string { return "ipip_del_tunnel" }
316 func (*IpipDelTunnel) GetCrcString() string { return "f9e6675e" }
317 func (*IpipDelTunnel) GetMessageType() api.MessageType {
318 return api.RequestMessage
321 func (m *IpipDelTunnel) Size() (size int) {
325 size += 4 // m.SwIfIndex
328 func (m *IpipDelTunnel) Marshal(b []byte) ([]byte, error) {
330 b = make([]byte, m.Size())
332 buf := codec.NewBuffer(b)
333 buf.EncodeUint32(uint32(m.SwIfIndex))
334 return buf.Bytes(), nil
336 func (m *IpipDelTunnel) Unmarshal(b []byte) error {
337 buf := codec.NewBuffer(b)
338 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
342 // IpipDelTunnelReply defines message 'ipip_del_tunnel_reply'.
343 type IpipDelTunnelReply struct {
344 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
347 func (m *IpipDelTunnelReply) Reset() { *m = IpipDelTunnelReply{} }
348 func (*IpipDelTunnelReply) GetMessageName() string { return "ipip_del_tunnel_reply" }
349 func (*IpipDelTunnelReply) GetCrcString() string { return "e8d4e804" }
350 func (*IpipDelTunnelReply) GetMessageType() api.MessageType {
351 return api.ReplyMessage
354 func (m *IpipDelTunnelReply) Size() (size int) {
358 size += 4 // m.Retval
361 func (m *IpipDelTunnelReply) Marshal(b []byte) ([]byte, error) {
363 b = make([]byte, m.Size())
365 buf := codec.NewBuffer(b)
366 buf.EncodeInt32(m.Retval)
367 return buf.Bytes(), nil
369 func (m *IpipDelTunnelReply) Unmarshal(b []byte) error {
370 buf := codec.NewBuffer(b)
371 m.Retval = buf.DecodeInt32()
375 // IpipTunnelDetails defines message 'ipip_tunnel_details'.
376 type IpipTunnelDetails struct {
377 Tunnel IpipTunnel `binapi:"ipip_tunnel,name=tunnel" json:"tunnel,omitempty"`
380 func (m *IpipTunnelDetails) Reset() { *m = IpipTunnelDetails{} }
381 func (*IpipTunnelDetails) GetMessageName() string { return "ipip_tunnel_details" }
382 func (*IpipTunnelDetails) GetCrcString() string { return "53236d75" }
383 func (*IpipTunnelDetails) GetMessageType() api.MessageType {
384 return api.ReplyMessage
387 func (m *IpipTunnelDetails) Size() (size int) {
391 size += 4 // m.Tunnel.Instance
392 size += 1 // m.Tunnel.Src.Af
393 size += 1 * 16 // m.Tunnel.Src.Un
394 size += 1 // m.Tunnel.Dst.Af
395 size += 1 * 16 // m.Tunnel.Dst.Un
396 size += 4 // m.Tunnel.SwIfIndex
397 size += 4 // m.Tunnel.TableID
398 size += 1 // m.Tunnel.Flags
399 size += 1 // m.Tunnel.Mode
400 size += 1 // m.Tunnel.Dscp
403 func (m *IpipTunnelDetails) Marshal(b []byte) ([]byte, error) {
405 b = make([]byte, m.Size())
407 buf := codec.NewBuffer(b)
408 buf.EncodeUint32(m.Tunnel.Instance)
409 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
410 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 16)
411 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
412 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 16)
413 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
414 buf.EncodeUint32(m.Tunnel.TableID)
415 buf.EncodeUint8(uint8(m.Tunnel.Flags))
416 buf.EncodeUint8(uint8(m.Tunnel.Mode))
417 buf.EncodeUint8(uint8(m.Tunnel.Dscp))
418 return buf.Bytes(), nil
420 func (m *IpipTunnelDetails) Unmarshal(b []byte) error {
421 buf := codec.NewBuffer(b)
422 m.Tunnel.Instance = buf.DecodeUint32()
423 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
424 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
425 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
426 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
427 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
428 m.Tunnel.TableID = buf.DecodeUint32()
429 m.Tunnel.Flags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
430 m.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
431 m.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
435 // IpipTunnelDump defines message 'ipip_tunnel_dump'.
436 type IpipTunnelDump struct {
437 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
440 func (m *IpipTunnelDump) Reset() { *m = IpipTunnelDump{} }
441 func (*IpipTunnelDump) GetMessageName() string { return "ipip_tunnel_dump" }
442 func (*IpipTunnelDump) GetCrcString() string { return "f9e6675e" }
443 func (*IpipTunnelDump) GetMessageType() api.MessageType {
444 return api.RequestMessage
447 func (m *IpipTunnelDump) Size() (size int) {
451 size += 4 // m.SwIfIndex
454 func (m *IpipTunnelDump) Marshal(b []byte) ([]byte, error) {
456 b = make([]byte, m.Size())
458 buf := codec.NewBuffer(b)
459 buf.EncodeUint32(uint32(m.SwIfIndex))
460 return buf.Bytes(), nil
462 func (m *IpipTunnelDump) Unmarshal(b []byte) error {
463 buf := codec.NewBuffer(b)
464 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
468 func init() { file_ipip_binapi_init() }
469 func file_ipip_binapi_init() {
470 api.RegisterMessage((*Ipip6rdAddTunnel)(nil), "ipip_6rd_add_tunnel_56e93cc0")
471 api.RegisterMessage((*Ipip6rdAddTunnelReply)(nil), "ipip_6rd_add_tunnel_reply_5383d31f")
472 api.RegisterMessage((*Ipip6rdDelTunnel)(nil), "ipip_6rd_del_tunnel_f9e6675e")
473 api.RegisterMessage((*Ipip6rdDelTunnelReply)(nil), "ipip_6rd_del_tunnel_reply_e8d4e804")
474 api.RegisterMessage((*IpipAddTunnel)(nil), "ipip_add_tunnel_a9decfcd")
475 api.RegisterMessage((*IpipAddTunnelReply)(nil), "ipip_add_tunnel_reply_5383d31f")
476 api.RegisterMessage((*IpipDelTunnel)(nil), "ipip_del_tunnel_f9e6675e")
477 api.RegisterMessage((*IpipDelTunnelReply)(nil), "ipip_del_tunnel_reply_e8d4e804")
478 api.RegisterMessage((*IpipTunnelDetails)(nil), "ipip_tunnel_details_53236d75")
479 api.RegisterMessage((*IpipTunnelDump)(nil), "ipip_tunnel_dump_f9e6675e")
482 // Messages returns list of all messages in this module.
483 func AllMessages() []api.Message {
484 return []api.Message{
485 (*Ipip6rdAddTunnel)(nil),
486 (*Ipip6rdAddTunnelReply)(nil),
487 (*Ipip6rdDelTunnel)(nil),
488 (*Ipip6rdDelTunnelReply)(nil),
489 (*IpipAddTunnel)(nil),
490 (*IpipAddTunnelReply)(nil),
491 (*IpipDelTunnel)(nil),
492 (*IpipDelTunnelReply)(nil),
493 (*IpipTunnelDetails)(nil),
494 (*IpipTunnelDump)(nil),