github.com/networkservicemesh/govpp@v0.0.0-20240328101142-8a444680fbba/binapi/vxlan/vxlan.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.10.0-dev 4 // VPP: 23.10-rc0~170-g6f1548434 5 // source: plugins/vxlan.api.json 6 7 // Package vxlan contains generated bindings for API file vxlan.api. 8 // 9 // Contents: 10 // - 14 messages 11 package vxlan 12 13 import ( 14 interface_types "github.com/networkservicemesh/govpp/binapi/interface_types" 15 ip_types "github.com/networkservicemesh/govpp/binapi/ip_types" 16 api "go.fd.io/govpp/api" 17 codec "go.fd.io/govpp/codec" 18 ) 19 20 // This is a compile-time assertion to ensure that this generated file 21 // is compatible with the GoVPP api package it is being compiled against. 22 // A compilation error at this line likely means your copy of the 23 // GoVPP api package needs to be updated. 24 const _ = api.GoVppAPIPackageIsVersion2 25 26 const ( 27 APIFile = "vxlan" 28 APIVersion = "2.1.0" 29 VersionCrc = 0x95381587 30 ) 31 32 // Interface set vxlan-bypass request 33 // - sw_if_index - interface used to reach neighbor 34 // - is_ipv6 - if non-zero, enable ipv6-vxlan-bypass, else ipv4-vxlan-bypass 35 // - enable - if non-zero enable, else disable 36 // 37 // SwInterfaceSetVxlanBypass defines message 'sw_interface_set_vxlan_bypass'. 38 type SwInterfaceSetVxlanBypass struct { 39 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 40 IsIPv6 bool `binapi:"bool,name=is_ipv6" json:"is_ipv6,omitempty"` 41 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 42 } 43 44 func (m *SwInterfaceSetVxlanBypass) Reset() { *m = SwInterfaceSetVxlanBypass{} } 45 func (*SwInterfaceSetVxlanBypass) GetMessageName() string { return "sw_interface_set_vxlan_bypass" } 46 func (*SwInterfaceSetVxlanBypass) GetCrcString() string { return "65247409" } 47 func (*SwInterfaceSetVxlanBypass) GetMessageType() api.MessageType { 48 return api.RequestMessage 49 } 50 51 func (m *SwInterfaceSetVxlanBypass) Size() (size int) { 52 if m == nil { 53 return 0 54 } 55 size += 4 // m.SwIfIndex 56 size += 1 // m.IsIPv6 57 size += 1 // m.Enable 58 return size 59 } 60 func (m *SwInterfaceSetVxlanBypass) Marshal(b []byte) ([]byte, error) { 61 if b == nil { 62 b = make([]byte, m.Size()) 63 } 64 buf := codec.NewBuffer(b) 65 buf.EncodeUint32(uint32(m.SwIfIndex)) 66 buf.EncodeBool(m.IsIPv6) 67 buf.EncodeBool(m.Enable) 68 return buf.Bytes(), nil 69 } 70 func (m *SwInterfaceSetVxlanBypass) Unmarshal(b []byte) error { 71 buf := codec.NewBuffer(b) 72 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 73 m.IsIPv6 = buf.DecodeBool() 74 m.Enable = buf.DecodeBool() 75 return nil 76 } 77 78 // SwInterfaceSetVxlanBypassReply defines message 'sw_interface_set_vxlan_bypass_reply'. 79 type SwInterfaceSetVxlanBypassReply struct { 80 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 81 } 82 83 func (m *SwInterfaceSetVxlanBypassReply) Reset() { *m = SwInterfaceSetVxlanBypassReply{} } 84 func (*SwInterfaceSetVxlanBypassReply) GetMessageName() string { 85 return "sw_interface_set_vxlan_bypass_reply" 86 } 87 func (*SwInterfaceSetVxlanBypassReply) GetCrcString() string { return "e8d4e804" } 88 func (*SwInterfaceSetVxlanBypassReply) GetMessageType() api.MessageType { 89 return api.ReplyMessage 90 } 91 92 func (m *SwInterfaceSetVxlanBypassReply) Size() (size int) { 93 if m == nil { 94 return 0 95 } 96 size += 4 // m.Retval 97 return size 98 } 99 func (m *SwInterfaceSetVxlanBypassReply) Marshal(b []byte) ([]byte, error) { 100 if b == nil { 101 b = make([]byte, m.Size()) 102 } 103 buf := codec.NewBuffer(b) 104 buf.EncodeInt32(m.Retval) 105 return buf.Bytes(), nil 106 } 107 func (m *SwInterfaceSetVxlanBypassReply) Unmarshal(b []byte) error { 108 buf := codec.NewBuffer(b) 109 m.Retval = buf.DecodeInt32() 110 return nil 111 } 112 113 // Create or delete a VXLAN tunnel 114 // - is_add - Use 1 to create the tunnel, 0 to remove it 115 // - instance - optional unique custom device instance, else ~0. 116 // - src_address - Source IP address 117 // - dst_address - Destination IP address, can be multicast 118 // - mcast_sw_if_index - Interface for multicast destination 119 // - encap_vrf_id - Encap route table FIB index 120 // - decap_next_index - index of decap next graph node 121 // - vni - The VXLAN Network Identifier, uint24 122 // 123 // VxlanAddDelTunnel defines message 'vxlan_add_del_tunnel'. 124 // Deprecated: the message will be removed in the future versions 125 type VxlanAddDelTunnel struct { 126 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 127 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"` 128 SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` 129 DstAddress ip_types.Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"` 130 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` 131 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` 132 DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"` 133 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 134 } 135 136 func (m *VxlanAddDelTunnel) Reset() { *m = VxlanAddDelTunnel{} } 137 func (*VxlanAddDelTunnel) GetMessageName() string { return "vxlan_add_del_tunnel" } 138 func (*VxlanAddDelTunnel) GetCrcString() string { return "0c09dc80" } 139 func (*VxlanAddDelTunnel) GetMessageType() api.MessageType { 140 return api.RequestMessage 141 } 142 143 func (m *VxlanAddDelTunnel) Size() (size int) { 144 if m == nil { 145 return 0 146 } 147 size += 1 // m.IsAdd 148 size += 4 // m.Instance 149 size += 1 // m.SrcAddress.Af 150 size += 1 * 16 // m.SrcAddress.Un 151 size += 1 // m.DstAddress.Af 152 size += 1 * 16 // m.DstAddress.Un 153 size += 4 // m.McastSwIfIndex 154 size += 4 // m.EncapVrfID 155 size += 4 // m.DecapNextIndex 156 size += 4 // m.Vni 157 return size 158 } 159 func (m *VxlanAddDelTunnel) Marshal(b []byte) ([]byte, error) { 160 if b == nil { 161 b = make([]byte, m.Size()) 162 } 163 buf := codec.NewBuffer(b) 164 buf.EncodeBool(m.IsAdd) 165 buf.EncodeUint32(m.Instance) 166 buf.EncodeUint8(uint8(m.SrcAddress.Af)) 167 buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) 168 buf.EncodeUint8(uint8(m.DstAddress.Af)) 169 buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) 170 buf.EncodeUint32(uint32(m.McastSwIfIndex)) 171 buf.EncodeUint32(m.EncapVrfID) 172 buf.EncodeUint32(m.DecapNextIndex) 173 buf.EncodeUint32(m.Vni) 174 return buf.Bytes(), nil 175 } 176 func (m *VxlanAddDelTunnel) Unmarshal(b []byte) error { 177 buf := codec.NewBuffer(b) 178 m.IsAdd = buf.DecodeBool() 179 m.Instance = buf.DecodeUint32() 180 m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 181 copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 182 m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 183 copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 184 m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 185 m.EncapVrfID = buf.DecodeUint32() 186 m.DecapNextIndex = buf.DecodeUint32() 187 m.Vni = buf.DecodeUint32() 188 return nil 189 } 190 191 // VxlanAddDelTunnelReply defines message 'vxlan_add_del_tunnel_reply'. 192 // Deprecated: the message will be removed in the future versions 193 type VxlanAddDelTunnelReply struct { 194 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 195 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 196 } 197 198 func (m *VxlanAddDelTunnelReply) Reset() { *m = VxlanAddDelTunnelReply{} } 199 func (*VxlanAddDelTunnelReply) GetMessageName() string { return "vxlan_add_del_tunnel_reply" } 200 func (*VxlanAddDelTunnelReply) GetCrcString() string { return "5383d31f" } 201 func (*VxlanAddDelTunnelReply) GetMessageType() api.MessageType { 202 return api.ReplyMessage 203 } 204 205 func (m *VxlanAddDelTunnelReply) Size() (size int) { 206 if m == nil { 207 return 0 208 } 209 size += 4 // m.Retval 210 size += 4 // m.SwIfIndex 211 return size 212 } 213 func (m *VxlanAddDelTunnelReply) Marshal(b []byte) ([]byte, error) { 214 if b == nil { 215 b = make([]byte, m.Size()) 216 } 217 buf := codec.NewBuffer(b) 218 buf.EncodeInt32(m.Retval) 219 buf.EncodeUint32(uint32(m.SwIfIndex)) 220 return buf.Bytes(), nil 221 } 222 func (m *VxlanAddDelTunnelReply) Unmarshal(b []byte) error { 223 buf := codec.NewBuffer(b) 224 m.Retval = buf.DecodeInt32() 225 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 226 return nil 227 } 228 229 // Create or delete a VXLAN tunnel 230 // - is_add - Use 1 to create the tunnel, 0 to remove it 231 // - instance - optional unique custom device instance, else ~0. 232 // - src_address - Source IP address 233 // - dst_address - Destination IP address, can be multicast 234 // - src_port - Source UDP port. It is not included in sent packets. Used only for port registration 235 // - dst_port - Destination UDP port 236 // - mcast_sw_if_index - Interface for multicast destination 237 // - encap_vrf_id - Encap route table FIB index 238 // - decap_next_index - index of decap next graph node 239 // - vni - The VXLAN Network Identifier, uint24 240 // 241 // VxlanAddDelTunnelV2 defines message 'vxlan_add_del_tunnel_v2'. 242 // Deprecated: the message will be removed in the future versions 243 type VxlanAddDelTunnelV2 struct { 244 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 245 Instance uint32 `binapi:"u32,name=instance,default=4294967295" json:"instance,omitempty"` 246 SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` 247 DstAddress ip_types.Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"` 248 SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"` 249 DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"` 250 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` 251 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` 252 DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"` 253 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 254 } 255 256 func (m *VxlanAddDelTunnelV2) Reset() { *m = VxlanAddDelTunnelV2{} } 257 func (*VxlanAddDelTunnelV2) GetMessageName() string { return "vxlan_add_del_tunnel_v2" } 258 func (*VxlanAddDelTunnelV2) GetCrcString() string { return "4f223f40" } 259 func (*VxlanAddDelTunnelV2) GetMessageType() api.MessageType { 260 return api.RequestMessage 261 } 262 263 func (m *VxlanAddDelTunnelV2) Size() (size int) { 264 if m == nil { 265 return 0 266 } 267 size += 1 // m.IsAdd 268 size += 4 // m.Instance 269 size += 1 // m.SrcAddress.Af 270 size += 1 * 16 // m.SrcAddress.Un 271 size += 1 // m.DstAddress.Af 272 size += 1 * 16 // m.DstAddress.Un 273 size += 2 // m.SrcPort 274 size += 2 // m.DstPort 275 size += 4 // m.McastSwIfIndex 276 size += 4 // m.EncapVrfID 277 size += 4 // m.DecapNextIndex 278 size += 4 // m.Vni 279 return size 280 } 281 func (m *VxlanAddDelTunnelV2) Marshal(b []byte) ([]byte, error) { 282 if b == nil { 283 b = make([]byte, m.Size()) 284 } 285 buf := codec.NewBuffer(b) 286 buf.EncodeBool(m.IsAdd) 287 buf.EncodeUint32(m.Instance) 288 buf.EncodeUint8(uint8(m.SrcAddress.Af)) 289 buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) 290 buf.EncodeUint8(uint8(m.DstAddress.Af)) 291 buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) 292 buf.EncodeUint16(m.SrcPort) 293 buf.EncodeUint16(m.DstPort) 294 buf.EncodeUint32(uint32(m.McastSwIfIndex)) 295 buf.EncodeUint32(m.EncapVrfID) 296 buf.EncodeUint32(m.DecapNextIndex) 297 buf.EncodeUint32(m.Vni) 298 return buf.Bytes(), nil 299 } 300 func (m *VxlanAddDelTunnelV2) Unmarshal(b []byte) error { 301 buf := codec.NewBuffer(b) 302 m.IsAdd = buf.DecodeBool() 303 m.Instance = buf.DecodeUint32() 304 m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 305 copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 306 m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 307 copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 308 m.SrcPort = buf.DecodeUint16() 309 m.DstPort = buf.DecodeUint16() 310 m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 311 m.EncapVrfID = buf.DecodeUint32() 312 m.DecapNextIndex = buf.DecodeUint32() 313 m.Vni = buf.DecodeUint32() 314 return nil 315 } 316 317 // VxlanAddDelTunnelV2Reply defines message 'vxlan_add_del_tunnel_v2_reply'. 318 // Deprecated: the message will be removed in the future versions 319 type VxlanAddDelTunnelV2Reply struct { 320 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 321 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 322 } 323 324 func (m *VxlanAddDelTunnelV2Reply) Reset() { *m = VxlanAddDelTunnelV2Reply{} } 325 func (*VxlanAddDelTunnelV2Reply) GetMessageName() string { return "vxlan_add_del_tunnel_v2_reply" } 326 func (*VxlanAddDelTunnelV2Reply) GetCrcString() string { return "5383d31f" } 327 func (*VxlanAddDelTunnelV2Reply) GetMessageType() api.MessageType { 328 return api.ReplyMessage 329 } 330 331 func (m *VxlanAddDelTunnelV2Reply) Size() (size int) { 332 if m == nil { 333 return 0 334 } 335 size += 4 // m.Retval 336 size += 4 // m.SwIfIndex 337 return size 338 } 339 func (m *VxlanAddDelTunnelV2Reply) Marshal(b []byte) ([]byte, error) { 340 if b == nil { 341 b = make([]byte, m.Size()) 342 } 343 buf := codec.NewBuffer(b) 344 buf.EncodeInt32(m.Retval) 345 buf.EncodeUint32(uint32(m.SwIfIndex)) 346 return buf.Bytes(), nil 347 } 348 func (m *VxlanAddDelTunnelV2Reply) Unmarshal(b []byte) error { 349 buf := codec.NewBuffer(b) 350 m.Retval = buf.DecodeInt32() 351 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 352 return nil 353 } 354 355 // Create or delete a VXLAN tunnel 356 // - is_add - Use 1 to create the tunnel, 0 to remove it 357 // - instance - optional unique custom device instance, else ~0. 358 // - src_address - Source IP address 359 // - dst_address - Destination IP address, can be multicast 360 // - src_port - Source UDP port. It is not included in sent packets. Used only for port registration 361 // - dst_port - Destination UDP port 362 // - mcast_sw_if_index - Interface for multicast destination 363 // - encap_vrf_id - Encap route table FIB index 364 // - decap_next_index - index of decap next graph node 365 // - vni - The VXLAN Network Identifier, uint24 366 // - is_l3 - if true, create the interface in L3 mode, w/o MAC 367 // 368 // VxlanAddDelTunnelV3 defines message 'vxlan_add_del_tunnel_v3'. 369 type VxlanAddDelTunnelV3 struct { 370 IsAdd bool `binapi:"bool,name=is_add,default=true" json:"is_add,omitempty"` 371 Instance uint32 `binapi:"u32,name=instance,default=4294967295" json:"instance,omitempty"` 372 SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` 373 DstAddress ip_types.Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"` 374 SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"` 375 DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"` 376 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` 377 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` 378 DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"` 379 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 380 IsL3 bool `binapi:"bool,name=is_l3,default=false" json:"is_l3,omitempty"` 381 } 382 383 func (m *VxlanAddDelTunnelV3) Reset() { *m = VxlanAddDelTunnelV3{} } 384 func (*VxlanAddDelTunnelV3) GetMessageName() string { return "vxlan_add_del_tunnel_v3" } 385 func (*VxlanAddDelTunnelV3) GetCrcString() string { return "0072b037" } 386 func (*VxlanAddDelTunnelV3) GetMessageType() api.MessageType { 387 return api.RequestMessage 388 } 389 390 func (m *VxlanAddDelTunnelV3) Size() (size int) { 391 if m == nil { 392 return 0 393 } 394 size += 1 // m.IsAdd 395 size += 4 // m.Instance 396 size += 1 // m.SrcAddress.Af 397 size += 1 * 16 // m.SrcAddress.Un 398 size += 1 // m.DstAddress.Af 399 size += 1 * 16 // m.DstAddress.Un 400 size += 2 // m.SrcPort 401 size += 2 // m.DstPort 402 size += 4 // m.McastSwIfIndex 403 size += 4 // m.EncapVrfID 404 size += 4 // m.DecapNextIndex 405 size += 4 // m.Vni 406 size += 1 // m.IsL3 407 return size 408 } 409 func (m *VxlanAddDelTunnelV3) Marshal(b []byte) ([]byte, error) { 410 if b == nil { 411 b = make([]byte, m.Size()) 412 } 413 buf := codec.NewBuffer(b) 414 buf.EncodeBool(m.IsAdd) 415 buf.EncodeUint32(m.Instance) 416 buf.EncodeUint8(uint8(m.SrcAddress.Af)) 417 buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) 418 buf.EncodeUint8(uint8(m.DstAddress.Af)) 419 buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) 420 buf.EncodeUint16(m.SrcPort) 421 buf.EncodeUint16(m.DstPort) 422 buf.EncodeUint32(uint32(m.McastSwIfIndex)) 423 buf.EncodeUint32(m.EncapVrfID) 424 buf.EncodeUint32(m.DecapNextIndex) 425 buf.EncodeUint32(m.Vni) 426 buf.EncodeBool(m.IsL3) 427 return buf.Bytes(), nil 428 } 429 func (m *VxlanAddDelTunnelV3) Unmarshal(b []byte) error { 430 buf := codec.NewBuffer(b) 431 m.IsAdd = buf.DecodeBool() 432 m.Instance = buf.DecodeUint32() 433 m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 434 copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 435 m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 436 copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 437 m.SrcPort = buf.DecodeUint16() 438 m.DstPort = buf.DecodeUint16() 439 m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 440 m.EncapVrfID = buf.DecodeUint32() 441 m.DecapNextIndex = buf.DecodeUint32() 442 m.Vni = buf.DecodeUint32() 443 m.IsL3 = buf.DecodeBool() 444 return nil 445 } 446 447 // VxlanAddDelTunnelV3Reply defines message 'vxlan_add_del_tunnel_v3_reply'. 448 type VxlanAddDelTunnelV3Reply struct { 449 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 450 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 451 } 452 453 func (m *VxlanAddDelTunnelV3Reply) Reset() { *m = VxlanAddDelTunnelV3Reply{} } 454 func (*VxlanAddDelTunnelV3Reply) GetMessageName() string { return "vxlan_add_del_tunnel_v3_reply" } 455 func (*VxlanAddDelTunnelV3Reply) GetCrcString() string { return "5383d31f" } 456 func (*VxlanAddDelTunnelV3Reply) GetMessageType() api.MessageType { 457 return api.ReplyMessage 458 } 459 460 func (m *VxlanAddDelTunnelV3Reply) Size() (size int) { 461 if m == nil { 462 return 0 463 } 464 size += 4 // m.Retval 465 size += 4 // m.SwIfIndex 466 return size 467 } 468 func (m *VxlanAddDelTunnelV3Reply) Marshal(b []byte) ([]byte, error) { 469 if b == nil { 470 b = make([]byte, m.Size()) 471 } 472 buf := codec.NewBuffer(b) 473 buf.EncodeInt32(m.Retval) 474 buf.EncodeUint32(uint32(m.SwIfIndex)) 475 return buf.Bytes(), nil 476 } 477 func (m *VxlanAddDelTunnelV3Reply) Unmarshal(b []byte) error { 478 buf := codec.NewBuffer(b) 479 m.Retval = buf.DecodeInt32() 480 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 481 return nil 482 } 483 484 // Offload vxlan rx request 485 // - hw_if_index - rx hw interface 486 // - sw_if_index - vxlan interface to offload 487 // - enable - if non-zero enable, else disable 488 // 489 // VxlanOffloadRx defines message 'vxlan_offload_rx'. 490 type VxlanOffloadRx struct { 491 HwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=hw_if_index" json:"hw_if_index,omitempty"` 492 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 493 Enable bool `binapi:"bool,name=enable,default=true" json:"enable,omitempty"` 494 } 495 496 func (m *VxlanOffloadRx) Reset() { *m = VxlanOffloadRx{} } 497 func (*VxlanOffloadRx) GetMessageName() string { return "vxlan_offload_rx" } 498 func (*VxlanOffloadRx) GetCrcString() string { return "9cc95087" } 499 func (*VxlanOffloadRx) GetMessageType() api.MessageType { 500 return api.RequestMessage 501 } 502 503 func (m *VxlanOffloadRx) Size() (size int) { 504 if m == nil { 505 return 0 506 } 507 size += 4 // m.HwIfIndex 508 size += 4 // m.SwIfIndex 509 size += 1 // m.Enable 510 return size 511 } 512 func (m *VxlanOffloadRx) Marshal(b []byte) ([]byte, error) { 513 if b == nil { 514 b = make([]byte, m.Size()) 515 } 516 buf := codec.NewBuffer(b) 517 buf.EncodeUint32(uint32(m.HwIfIndex)) 518 buf.EncodeUint32(uint32(m.SwIfIndex)) 519 buf.EncodeBool(m.Enable) 520 return buf.Bytes(), nil 521 } 522 func (m *VxlanOffloadRx) Unmarshal(b []byte) error { 523 buf := codec.NewBuffer(b) 524 m.HwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 525 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 526 m.Enable = buf.DecodeBool() 527 return nil 528 } 529 530 // VxlanOffloadRxReply defines message 'vxlan_offload_rx_reply'. 531 type VxlanOffloadRxReply struct { 532 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` 533 } 534 535 func (m *VxlanOffloadRxReply) Reset() { *m = VxlanOffloadRxReply{} } 536 func (*VxlanOffloadRxReply) GetMessageName() string { return "vxlan_offload_rx_reply" } 537 func (*VxlanOffloadRxReply) GetCrcString() string { return "e8d4e804" } 538 func (*VxlanOffloadRxReply) GetMessageType() api.MessageType { 539 return api.ReplyMessage 540 } 541 542 func (m *VxlanOffloadRxReply) Size() (size int) { 543 if m == nil { 544 return 0 545 } 546 size += 4 // m.Retval 547 return size 548 } 549 func (m *VxlanOffloadRxReply) Marshal(b []byte) ([]byte, error) { 550 if b == nil { 551 b = make([]byte, m.Size()) 552 } 553 buf := codec.NewBuffer(b) 554 buf.EncodeInt32(m.Retval) 555 return buf.Bytes(), nil 556 } 557 func (m *VxlanOffloadRxReply) Unmarshal(b []byte) error { 558 buf := codec.NewBuffer(b) 559 m.Retval = buf.DecodeInt32() 560 return nil 561 } 562 563 // VxlanTunnelDetails defines message 'vxlan_tunnel_details'. 564 // Deprecated: the message will be removed in the future versions 565 type VxlanTunnelDetails struct { 566 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 567 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"` 568 SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` 569 DstAddress ip_types.Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"` 570 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` 571 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` 572 DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"` 573 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 574 } 575 576 func (m *VxlanTunnelDetails) Reset() { *m = VxlanTunnelDetails{} } 577 func (*VxlanTunnelDetails) GetMessageName() string { return "vxlan_tunnel_details" } 578 func (*VxlanTunnelDetails) GetCrcString() string { return "c3916cb1" } 579 func (*VxlanTunnelDetails) GetMessageType() api.MessageType { 580 return api.ReplyMessage 581 } 582 583 func (m *VxlanTunnelDetails) Size() (size int) { 584 if m == nil { 585 return 0 586 } 587 size += 4 // m.SwIfIndex 588 size += 4 // m.Instance 589 size += 1 // m.SrcAddress.Af 590 size += 1 * 16 // m.SrcAddress.Un 591 size += 1 // m.DstAddress.Af 592 size += 1 * 16 // m.DstAddress.Un 593 size += 4 // m.McastSwIfIndex 594 size += 4 // m.EncapVrfID 595 size += 4 // m.DecapNextIndex 596 size += 4 // m.Vni 597 return size 598 } 599 func (m *VxlanTunnelDetails) Marshal(b []byte) ([]byte, error) { 600 if b == nil { 601 b = make([]byte, m.Size()) 602 } 603 buf := codec.NewBuffer(b) 604 buf.EncodeUint32(uint32(m.SwIfIndex)) 605 buf.EncodeUint32(m.Instance) 606 buf.EncodeUint8(uint8(m.SrcAddress.Af)) 607 buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) 608 buf.EncodeUint8(uint8(m.DstAddress.Af)) 609 buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) 610 buf.EncodeUint32(uint32(m.McastSwIfIndex)) 611 buf.EncodeUint32(m.EncapVrfID) 612 buf.EncodeUint32(m.DecapNextIndex) 613 buf.EncodeUint32(m.Vni) 614 return buf.Bytes(), nil 615 } 616 func (m *VxlanTunnelDetails) Unmarshal(b []byte) error { 617 buf := codec.NewBuffer(b) 618 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 619 m.Instance = buf.DecodeUint32() 620 m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 621 copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 622 m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 623 copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 624 m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 625 m.EncapVrfID = buf.DecodeUint32() 626 m.DecapNextIndex = buf.DecodeUint32() 627 m.Vni = buf.DecodeUint32() 628 return nil 629 } 630 631 // VxlanTunnelDump defines message 'vxlan_tunnel_dump'. 632 // Deprecated: the message will be removed in the future versions 633 type VxlanTunnelDump struct { 634 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 635 } 636 637 func (m *VxlanTunnelDump) Reset() { *m = VxlanTunnelDump{} } 638 func (*VxlanTunnelDump) GetMessageName() string { return "vxlan_tunnel_dump" } 639 func (*VxlanTunnelDump) GetCrcString() string { return "f9e6675e" } 640 func (*VxlanTunnelDump) GetMessageType() api.MessageType { 641 return api.RequestMessage 642 } 643 644 func (m *VxlanTunnelDump) Size() (size int) { 645 if m == nil { 646 return 0 647 } 648 size += 4 // m.SwIfIndex 649 return size 650 } 651 func (m *VxlanTunnelDump) Marshal(b []byte) ([]byte, error) { 652 if b == nil { 653 b = make([]byte, m.Size()) 654 } 655 buf := codec.NewBuffer(b) 656 buf.EncodeUint32(uint32(m.SwIfIndex)) 657 return buf.Bytes(), nil 658 } 659 func (m *VxlanTunnelDump) Unmarshal(b []byte) error { 660 buf := codec.NewBuffer(b) 661 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 662 return nil 663 } 664 665 // VxlanTunnelV2Details defines message 'vxlan_tunnel_v2_details'. 666 type VxlanTunnelV2Details struct { 667 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 668 Instance uint32 `binapi:"u32,name=instance" json:"instance,omitempty"` 669 SrcAddress ip_types.Address `binapi:"address,name=src_address" json:"src_address,omitempty"` 670 DstAddress ip_types.Address `binapi:"address,name=dst_address" json:"dst_address,omitempty"` 671 SrcPort uint16 `binapi:"u16,name=src_port" json:"src_port,omitempty"` 672 DstPort uint16 `binapi:"u16,name=dst_port" json:"dst_port,omitempty"` 673 McastSwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=mcast_sw_if_index" json:"mcast_sw_if_index,omitempty"` 674 EncapVrfID uint32 `binapi:"u32,name=encap_vrf_id" json:"encap_vrf_id,omitempty"` 675 DecapNextIndex uint32 `binapi:"u32,name=decap_next_index" json:"decap_next_index,omitempty"` 676 Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` 677 } 678 679 func (m *VxlanTunnelV2Details) Reset() { *m = VxlanTunnelV2Details{} } 680 func (*VxlanTunnelV2Details) GetMessageName() string { return "vxlan_tunnel_v2_details" } 681 func (*VxlanTunnelV2Details) GetCrcString() string { return "d3bdd4d9" } 682 func (*VxlanTunnelV2Details) GetMessageType() api.MessageType { 683 return api.ReplyMessage 684 } 685 686 func (m *VxlanTunnelV2Details) Size() (size int) { 687 if m == nil { 688 return 0 689 } 690 size += 4 // m.SwIfIndex 691 size += 4 // m.Instance 692 size += 1 // m.SrcAddress.Af 693 size += 1 * 16 // m.SrcAddress.Un 694 size += 1 // m.DstAddress.Af 695 size += 1 * 16 // m.DstAddress.Un 696 size += 2 // m.SrcPort 697 size += 2 // m.DstPort 698 size += 4 // m.McastSwIfIndex 699 size += 4 // m.EncapVrfID 700 size += 4 // m.DecapNextIndex 701 size += 4 // m.Vni 702 return size 703 } 704 func (m *VxlanTunnelV2Details) Marshal(b []byte) ([]byte, error) { 705 if b == nil { 706 b = make([]byte, m.Size()) 707 } 708 buf := codec.NewBuffer(b) 709 buf.EncodeUint32(uint32(m.SwIfIndex)) 710 buf.EncodeUint32(m.Instance) 711 buf.EncodeUint8(uint8(m.SrcAddress.Af)) 712 buf.EncodeBytes(m.SrcAddress.Un.XXX_UnionData[:], 16) 713 buf.EncodeUint8(uint8(m.DstAddress.Af)) 714 buf.EncodeBytes(m.DstAddress.Un.XXX_UnionData[:], 16) 715 buf.EncodeUint16(m.SrcPort) 716 buf.EncodeUint16(m.DstPort) 717 buf.EncodeUint32(uint32(m.McastSwIfIndex)) 718 buf.EncodeUint32(m.EncapVrfID) 719 buf.EncodeUint32(m.DecapNextIndex) 720 buf.EncodeUint32(m.Vni) 721 return buf.Bytes(), nil 722 } 723 func (m *VxlanTunnelV2Details) Unmarshal(b []byte) error { 724 buf := codec.NewBuffer(b) 725 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 726 m.Instance = buf.DecodeUint32() 727 m.SrcAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 728 copy(m.SrcAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 729 m.DstAddress.Af = ip_types.AddressFamily(buf.DecodeUint8()) 730 copy(m.DstAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16)) 731 m.SrcPort = buf.DecodeUint16() 732 m.DstPort = buf.DecodeUint16() 733 m.McastSwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 734 m.EncapVrfID = buf.DecodeUint32() 735 m.DecapNextIndex = buf.DecodeUint32() 736 m.Vni = buf.DecodeUint32() 737 return nil 738 } 739 740 // VxlanTunnelV2Dump defines message 'vxlan_tunnel_v2_dump'. 741 type VxlanTunnelV2Dump struct { 742 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` 743 } 744 745 func (m *VxlanTunnelV2Dump) Reset() { *m = VxlanTunnelV2Dump{} } 746 func (*VxlanTunnelV2Dump) GetMessageName() string { return "vxlan_tunnel_v2_dump" } 747 func (*VxlanTunnelV2Dump) GetCrcString() string { return "f9e6675e" } 748 func (*VxlanTunnelV2Dump) GetMessageType() api.MessageType { 749 return api.RequestMessage 750 } 751 752 func (m *VxlanTunnelV2Dump) Size() (size int) { 753 if m == nil { 754 return 0 755 } 756 size += 4 // m.SwIfIndex 757 return size 758 } 759 func (m *VxlanTunnelV2Dump) Marshal(b []byte) ([]byte, error) { 760 if b == nil { 761 b = make([]byte, m.Size()) 762 } 763 buf := codec.NewBuffer(b) 764 buf.EncodeUint32(uint32(m.SwIfIndex)) 765 return buf.Bytes(), nil 766 } 767 func (m *VxlanTunnelV2Dump) Unmarshal(b []byte) error { 768 buf := codec.NewBuffer(b) 769 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) 770 return nil 771 } 772 773 func init() { file_vxlan_binapi_init() } 774 func file_vxlan_binapi_init() { 775 api.RegisterMessage((*SwInterfaceSetVxlanBypass)(nil), "sw_interface_set_vxlan_bypass_65247409") 776 api.RegisterMessage((*SwInterfaceSetVxlanBypassReply)(nil), "sw_interface_set_vxlan_bypass_reply_e8d4e804") 777 api.RegisterMessage((*VxlanAddDelTunnel)(nil), "vxlan_add_del_tunnel_0c09dc80") 778 api.RegisterMessage((*VxlanAddDelTunnelReply)(nil), "vxlan_add_del_tunnel_reply_5383d31f") 779 api.RegisterMessage((*VxlanAddDelTunnelV2)(nil), "vxlan_add_del_tunnel_v2_4f223f40") 780 api.RegisterMessage((*VxlanAddDelTunnelV2Reply)(nil), "vxlan_add_del_tunnel_v2_reply_5383d31f") 781 api.RegisterMessage((*VxlanAddDelTunnelV3)(nil), "vxlan_add_del_tunnel_v3_0072b037") 782 api.RegisterMessage((*VxlanAddDelTunnelV3Reply)(nil), "vxlan_add_del_tunnel_v3_reply_5383d31f") 783 api.RegisterMessage((*VxlanOffloadRx)(nil), "vxlan_offload_rx_9cc95087") 784 api.RegisterMessage((*VxlanOffloadRxReply)(nil), "vxlan_offload_rx_reply_e8d4e804") 785 api.RegisterMessage((*VxlanTunnelDetails)(nil), "vxlan_tunnel_details_c3916cb1") 786 api.RegisterMessage((*VxlanTunnelDump)(nil), "vxlan_tunnel_dump_f9e6675e") 787 api.RegisterMessage((*VxlanTunnelV2Details)(nil), "vxlan_tunnel_v2_details_d3bdd4d9") 788 api.RegisterMessage((*VxlanTunnelV2Dump)(nil), "vxlan_tunnel_v2_dump_f9e6675e") 789 } 790 791 // Messages returns list of all messages in this module. 792 func AllMessages() []api.Message { 793 return []api.Message{ 794 (*SwInterfaceSetVxlanBypass)(nil), 795 (*SwInterfaceSetVxlanBypassReply)(nil), 796 (*VxlanAddDelTunnel)(nil), 797 (*VxlanAddDelTunnelReply)(nil), 798 (*VxlanAddDelTunnelV2)(nil), 799 (*VxlanAddDelTunnelV2Reply)(nil), 800 (*VxlanAddDelTunnelV3)(nil), 801 (*VxlanAddDelTunnelV3Reply)(nil), 802 (*VxlanOffloadRx)(nil), 803 (*VxlanOffloadRxReply)(nil), 804 (*VxlanTunnelDetails)(nil), 805 (*VxlanTunnelDump)(nil), 806 (*VxlanTunnelV2Details)(nil), 807 (*VxlanTunnelV2Dump)(nil), 808 } 809 }