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/vxlan_gbp.api.json
7 // Package vxlan_gbp contains generated bindings for API file vxlan_gbp.api.
17 api "git.fd.io/govpp.git/api"
18 interface_types "git.fd.io/govpp.git/binapi/interface_types"
19 ip_types "git.fd.io/govpp.git/binapi/ip_types"
20 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 = 0xfa8aff54
36 // VxlanGbpAPITunnelMode defines enum 'vxlan_gbp_api_tunnel_mode'.
37 type VxlanGbpAPITunnelMode uint32
40 VXLAN_GBP_API_TUNNEL_MODE_L2 VxlanGbpAPITunnelMode = 1
41 VXLAN_GBP_API_TUNNEL_MODE_L3 VxlanGbpAPITunnelMode = 2
45 VxlanGbpAPITunnelMode_name = map[uint32]string{
46 1: "VXLAN_GBP_API_TUNNEL_MODE_L2",
47 2: "VXLAN_GBP_API_TUNNEL_MODE_L3",
49 VxlanGbpAPITunnelMode_value = map[string]uint32{
50 "VXLAN_GBP_API_TUNNEL_MODE_L2": 1,
51 "VXLAN_GBP_API_TUNNEL_MODE_L3": 2,
55 func (x VxlanGbpAPITunnelMode) String() string {
56 s, ok := VxlanGbpAPITunnelMode_name[uint32(x)]
60 return "VxlanGbpAPITunnelMode(" + strconv.Itoa(int(x)) + ")"
63 // VxlanGbpTunnel defines type 'vxlan_gbp_tunnel'.
64 type VxlanGbpTunnel struct {
65 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"`
66 Src ip_types.Address `binapi:"address,name=src" json:"src,omitempty"`
67 Dst ip_types.Address `binapi:"address,name=dst" json:"dst,omitempty"`
68 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"`
69 EncapTableID uint32 `binapi:"u32,name=encap_table_id" json:"encap_table_id,omitempty"`
70 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"`
71 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
72 Mode VxlanGbpAPITunnelMode `binapi:"vxlan_gbp_api_tunnel_mode,name=mode" json:"mode,omitempty"`
75 // SwInterfaceSetVxlanGbpBypass defines message 'sw_interface_set_vxlan_gbp_bypass'.
76 type SwInterfaceSetVxlanGbpBypass struct {
77 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
78 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"`
79 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"`
82 func (m *SwInterfaceSetVxlanGbpBypass) Reset() { *m = SwInterfaceSetVxlanGbpBypass{} }
83 func (*SwInterfaceSetVxlanGbpBypass) GetMessageName() string {
84 return "sw_interface_set_vxlan_gbp_bypass"
86 func (*SwInterfaceSetVxlanGbpBypass) GetCrcString() string { return "65247409" }
87 func (*SwInterfaceSetVxlanGbpBypass) GetMessageType() api.MessageType {
88 return api.RequestMessage
91 func (m *SwInterfaceSetVxlanGbpBypass) Size() int {
96 size += 4 // m.SwIfIndex
101 func (m *SwInterfaceSetVxlanGbpBypass) Marshal(b []byte) ([]byte, error) {
102 var buf *codec.Buffer
104 buf = codec.NewBuffer(make([]byte, m.Size()))
106 buf = codec.NewBuffer(b)
108 buf.EncodeUint32(uint32(m.SwIfIndex))
109 buf.EncodeBool(m.IsIPv6)
110 buf.EncodeBool(m.Enable)
111 return buf.Bytes(), nil
113 func (m *SwInterfaceSetVxlanGbpBypass) Unmarshal(b []byte) error {
114 buf := codec.NewBuffer(b)
115 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
116 m.IsIPv6 = buf.DecodeBool()
117 m.Enable = buf.DecodeBool()
121 // SwInterfaceSetVxlanGbpBypassReply defines message 'sw_interface_set_vxlan_gbp_bypass_reply'.
122 type SwInterfaceSetVxlanGbpBypassReply struct {
123 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
126 func (m *SwInterfaceSetVxlanGbpBypassReply) Reset() { *m = SwInterfaceSetVxlanGbpBypassReply{} }
127 func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageName() string {
128 return "sw_interface_set_vxlan_gbp_bypass_reply"
130 func (*SwInterfaceSetVxlanGbpBypassReply) GetCrcString() string { return "e8d4e804" }
131 func (*SwInterfaceSetVxlanGbpBypassReply) GetMessageType() api.MessageType {
132 return api.ReplyMessage
135 func (m *SwInterfaceSetVxlanGbpBypassReply) Size() int {
140 size += 4 // m.Retval
143 func (m *SwInterfaceSetVxlanGbpBypassReply) Marshal(b []byte) ([]byte, error) {
144 var buf *codec.Buffer
146 buf = codec.NewBuffer(make([]byte, m.Size()))
148 buf = codec.NewBuffer(b)
150 buf.EncodeUint32(uint32(m.Retval))
151 return buf.Bytes(), nil
153 func (m *SwInterfaceSetVxlanGbpBypassReply) Unmarshal(b []byte) error {
154 buf := codec.NewBuffer(b)
155 m.Retval = int32(buf.DecodeUint32())
159 // VxlanGbpTunnelAddDel defines message 'vxlan_gbp_tunnel_add_del'.
160 type VxlanGbpTunnelAddDel struct {
161 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"`
162 Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
165 func (m *VxlanGbpTunnelAddDel) Reset() { *m = VxlanGbpTunnelAddDel{} }
166 func (*VxlanGbpTunnelAddDel) GetMessageName() string { return "vxlan_gbp_tunnel_add_del" }
167 func (*VxlanGbpTunnelAddDel) GetCrcString() string { return "8c819166" }
168 func (*VxlanGbpTunnelAddDel) GetMessageType() api.MessageType {
169 return api.RequestMessage
172 func (m *VxlanGbpTunnelAddDel) Size() int {
178 size += 4 // m.Tunnel.Instance
179 size += 1 // m.Tunnel.Src.Af
180 size += 1 * 16 // m.Tunnel.Src.Un
181 size += 1 // m.Tunnel.Dst.Af
182 size += 1 * 16 // m.Tunnel.Dst.Un
183 size += 4 // m.Tunnel.McastSwIfIndex
184 size += 4 // m.Tunnel.EncapTableID
185 size += 4 // m.Tunnel.Vni
186 size += 4 // m.Tunnel.SwIfIndex
187 size += 4 // m.Tunnel.Mode
190 func (m *VxlanGbpTunnelAddDel) Marshal(b []byte) ([]byte, error) {
191 var buf *codec.Buffer
193 buf = codec.NewBuffer(make([]byte, m.Size()))
195 buf = codec.NewBuffer(b)
197 buf.EncodeBool(m.IsAdd)
198 buf.EncodeUint32(uint32(m.Tunnel.Instance))
199 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
200 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0)
201 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
202 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0)
203 buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
204 buf.EncodeUint32(uint32(m.Tunnel.EncapTableID))
205 buf.EncodeUint32(uint32(m.Tunnel.Vni))
206 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
207 buf.EncodeUint32(uint32(m.Tunnel.Mode))
208 return buf.Bytes(), nil
210 func (m *VxlanGbpTunnelAddDel) Unmarshal(b []byte) error {
211 buf := codec.NewBuffer(b)
212 m.IsAdd = buf.DecodeBool()
213 m.Tunnel.Instance = buf.DecodeUint32()
214 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
215 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
216 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
217 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
218 m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
219 m.Tunnel.EncapTableID = buf.DecodeUint32()
220 m.Tunnel.Vni = buf.DecodeUint32()
221 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
222 m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
226 // VxlanGbpTunnelAddDelReply defines message 'vxlan_gbp_tunnel_add_del_reply'.
227 type VxlanGbpTunnelAddDelReply struct {
228 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
229 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
232 func (m *VxlanGbpTunnelAddDelReply) Reset() { *m = VxlanGbpTunnelAddDelReply{} }
233 func (*VxlanGbpTunnelAddDelReply) GetMessageName() string { return "vxlan_gbp_tunnel_add_del_reply" }
234 func (*VxlanGbpTunnelAddDelReply) GetCrcString() string { return "5383d31f" }
235 func (*VxlanGbpTunnelAddDelReply) GetMessageType() api.MessageType {
236 return api.ReplyMessage
239 func (m *VxlanGbpTunnelAddDelReply) Size() int {
244 size += 4 // m.Retval
245 size += 4 // m.SwIfIndex
248 func (m *VxlanGbpTunnelAddDelReply) Marshal(b []byte) ([]byte, error) {
249 var buf *codec.Buffer
251 buf = codec.NewBuffer(make([]byte, m.Size()))
253 buf = codec.NewBuffer(b)
255 buf.EncodeUint32(uint32(m.Retval))
256 buf.EncodeUint32(uint32(m.SwIfIndex))
257 return buf.Bytes(), nil
259 func (m *VxlanGbpTunnelAddDelReply) Unmarshal(b []byte) error {
260 buf := codec.NewBuffer(b)
261 m.Retval = int32(buf.DecodeUint32())
262 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
266 // VxlanGbpTunnelDetails defines message 'vxlan_gbp_tunnel_details'.
267 type VxlanGbpTunnelDetails struct {
268 Tunnel VxlanGbpTunnel `binapi:"vxlan_gbp_tunnel,name=tunnel" json:"tunnel,omitempty"`
271 func (m *VxlanGbpTunnelDetails) Reset() { *m = VxlanGbpTunnelDetails{} }
272 func (*VxlanGbpTunnelDetails) GetMessageName() string { return "vxlan_gbp_tunnel_details" }
273 func (*VxlanGbpTunnelDetails) GetCrcString() string { return "1da24016" }
274 func (*VxlanGbpTunnelDetails) GetMessageType() api.MessageType {
275 return api.ReplyMessage
278 func (m *VxlanGbpTunnelDetails) Size() int {
283 size += 4 // m.Tunnel.Instance
284 size += 1 // m.Tunnel.Src.Af
285 size += 1 * 16 // m.Tunnel.Src.Un
286 size += 1 // m.Tunnel.Dst.Af
287 size += 1 * 16 // m.Tunnel.Dst.Un
288 size += 4 // m.Tunnel.McastSwIfIndex
289 size += 4 // m.Tunnel.EncapTableID
290 size += 4 // m.Tunnel.Vni
291 size += 4 // m.Tunnel.SwIfIndex
292 size += 4 // m.Tunnel.Mode
295 func (m *VxlanGbpTunnelDetails) Marshal(b []byte) ([]byte, error) {
296 var buf *codec.Buffer
298 buf = codec.NewBuffer(make([]byte, m.Size()))
300 buf = codec.NewBuffer(b)
302 buf.EncodeUint32(uint32(m.Tunnel.Instance))
303 buf.EncodeUint8(uint8(m.Tunnel.Src.Af))
304 buf.EncodeBytes(m.Tunnel.Src.Un.XXX_UnionData[:], 0)
305 buf.EncodeUint8(uint8(m.Tunnel.Dst.Af))
306 buf.EncodeBytes(m.Tunnel.Dst.Un.XXX_UnionData[:], 0)
307 buf.EncodeUint32(uint32(m.Tunnel.McastSwIfIndex))
308 buf.EncodeUint32(uint32(m.Tunnel.EncapTableID))
309 buf.EncodeUint32(uint32(m.Tunnel.Vni))
310 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
311 buf.EncodeUint32(uint32(m.Tunnel.Mode))
312 return buf.Bytes(), nil
314 func (m *VxlanGbpTunnelDetails) Unmarshal(b []byte) error {
315 buf := codec.NewBuffer(b)
316 m.Tunnel.Instance = buf.DecodeUint32()
317 m.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
318 copy(m.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
319 m.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
320 copy(m.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
321 m.Tunnel.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
322 m.Tunnel.EncapTableID = buf.DecodeUint32()
323 m.Tunnel.Vni = buf.DecodeUint32()
324 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
325 m.Tunnel.Mode = VxlanGbpAPITunnelMode(buf.DecodeUint32())
329 // VxlanGbpTunnelDump defines message 'vxlan_gbp_tunnel_dump'.
330 type VxlanGbpTunnelDump struct {
331 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
334 func (m *VxlanGbpTunnelDump) Reset() { *m = VxlanGbpTunnelDump{} }
335 func (*VxlanGbpTunnelDump) GetMessageName() string { return "vxlan_gbp_tunnel_dump" }
336 func (*VxlanGbpTunnelDump) GetCrcString() string { return "f9e6675e" }
337 func (*VxlanGbpTunnelDump) GetMessageType() api.MessageType {
338 return api.RequestMessage
341 func (m *VxlanGbpTunnelDump) Size() int {
346 size += 4 // m.SwIfIndex
349 func (m *VxlanGbpTunnelDump) Marshal(b []byte) ([]byte, error) {
350 var buf *codec.Buffer
352 buf = codec.NewBuffer(make([]byte, m.Size()))
354 buf = codec.NewBuffer(b)
356 buf.EncodeUint32(uint32(m.SwIfIndex))
357 return buf.Bytes(), nil
359 func (m *VxlanGbpTunnelDump) Unmarshal(b []byte) error {
360 buf := codec.NewBuffer(b)
361 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
365 func init() { file_vxlan_gbp_binapi_init() }
366 func file_vxlan_gbp_binapi_init() {
367 api.RegisterMessage((*SwInterfaceSetVxlanGbpBypass)(nil), "sw_interface_set_vxlan_gbp_bypass_65247409")
368 api.RegisterMessage((*SwInterfaceSetVxlanGbpBypassReply)(nil), "sw_interface_set_vxlan_gbp_bypass_reply_e8d4e804")
369 api.RegisterMessage((*VxlanGbpTunnelAddDel)(nil), "vxlan_gbp_tunnel_add_del_8c819166")
370 api.RegisterMessage((*VxlanGbpTunnelAddDelReply)(nil), "vxlan_gbp_tunnel_add_del_reply_5383d31f")
371 api.RegisterMessage((*VxlanGbpTunnelDetails)(nil), "vxlan_gbp_tunnel_details_1da24016")
372 api.RegisterMessage((*VxlanGbpTunnelDump)(nil), "vxlan_gbp_tunnel_dump_f9e6675e")
375 // Messages returns list of all messages in this module.
376 func AllMessages() []api.Message {
377 return []api.Message{
378 (*SwInterfaceSetVxlanGbpBypass)(nil),
379 (*SwInterfaceSetVxlanGbpBypassReply)(nil),
380 (*VxlanGbpTunnelAddDel)(nil),
381 (*VxlanGbpTunnelAddDelReply)(nil),
382 (*VxlanGbpTunnelDetails)(nil),
383 (*VxlanGbpTunnelDump)(nil),