diff options
Diffstat (limited to 'internal/testbinapi/binapi2001/gbp/gbp.ba.go')
-rw-r--r-- | internal/testbinapi/binapi2001/gbp/gbp.ba.go | 3363 |
1 files changed, 0 insertions, 3363 deletions
diff --git a/internal/testbinapi/binapi2001/gbp/gbp.ba.go b/internal/testbinapi/binapi2001/gbp/gbp.ba.go deleted file mode 100644 index 1f00396..0000000 --- a/internal/testbinapi/binapi2001/gbp/gbp.ba.go +++ /dev/null @@ -1,3363 +0,0 @@ -// Code generated by GoVPP's binapi-generator. DO NOT EDIT. -// versions: -// binapi-generator: v0.4.0-dev -// VPP: 20.01 -// source: .vppapi/plugins/gbp.api.json - -// Package gbp contains generated bindings for API file gbp.api. -// -// Contents: -// 8 aliases -// 17 enums -// 20 structs -// 1 union -// 48 messages -// -package gbp - -import ( - "fmt" - api "git.fd.io/govpp.git/api" - codec "git.fd.io/govpp.git/codec" - "net" - "strconv" - "strings" -) - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the GoVPP api package it is being compiled against. -// A compilation error at this line likely means your copy of the -// GoVPP api package needs to be updated. -const _ = api.GoVppAPIPackageIsVersion2 - -const ( - APIFile = "gbp" - APIVersion = "2.0.0" - VersionCrc = 0xa891d6ff -) - -// AddressFamily defines enum 'address_family'. -type AddressFamily uint32 - -const ( - ADDRESS_IP4 AddressFamily = 0 - ADDRESS_IP6 AddressFamily = 1 -) - -var ( - AddressFamily_name = map[uint32]string{ - 0: "ADDRESS_IP4", - 1: "ADDRESS_IP6", - } - AddressFamily_value = map[string]uint32{ - "ADDRESS_IP4": 0, - "ADDRESS_IP6": 1, - } -) - -func (x AddressFamily) String() string { - s, ok := AddressFamily_name[uint32(x)] - if ok { - return s - } - return "AddressFamily(" + strconv.Itoa(int(x)) + ")" -} - -// GbpBridgeDomainFlags defines enum 'gbp_bridge_domain_flags'. -type GbpBridgeDomainFlags uint32 - -const ( - GBP_BD_API_FLAG_NONE GbpBridgeDomainFlags = 0 - GBP_BD_API_FLAG_DO_NOT_LEARN GbpBridgeDomainFlags = 1 - GBP_BD_API_FLAG_UU_FWD_DROP GbpBridgeDomainFlags = 2 - GBP_BD_API_FLAG_MCAST_DROP GbpBridgeDomainFlags = 4 - GBP_BD_API_FLAG_UCAST_ARP GbpBridgeDomainFlags = 8 -) - -var ( - GbpBridgeDomainFlags_name = map[uint32]string{ - 0: "GBP_BD_API_FLAG_NONE", - 1: "GBP_BD_API_FLAG_DO_NOT_LEARN", - 2: "GBP_BD_API_FLAG_UU_FWD_DROP", - 4: "GBP_BD_API_FLAG_MCAST_DROP", - 8: "GBP_BD_API_FLAG_UCAST_ARP", - } - GbpBridgeDomainFlags_value = map[string]uint32{ - "GBP_BD_API_FLAG_NONE": 0, - "GBP_BD_API_FLAG_DO_NOT_LEARN": 1, - "GBP_BD_API_FLAG_UU_FWD_DROP": 2, - "GBP_BD_API_FLAG_MCAST_DROP": 4, - "GBP_BD_API_FLAG_UCAST_ARP": 8, - } -) - -func (x GbpBridgeDomainFlags) String() string { - s, ok := GbpBridgeDomainFlags_name[uint32(x)] - if ok { - return s - } - str := func(n uint32) string { - s, ok := GbpBridgeDomainFlags_name[uint32(n)] - if ok { - return s - } - return "GbpBridgeDomainFlags(" + strconv.Itoa(int(n)) + ")" - } - for i := uint32(0); i <= 32; i++ { - val := uint32(x) - if val&(1<<i) != 0 { - if s != "" { - s += "|" - } - s += str(1 << i) - } - } - if s == "" { - return str(uint32(x)) - } - return s -} - -// GbpEndpointFlags defines enum 'gbp_endpoint_flags'. -type GbpEndpointFlags uint32 - -const ( - GBP_API_ENDPOINT_FLAG_NONE GbpEndpointFlags = 0 - GBP_API_ENDPOINT_FLAG_BOUNCE GbpEndpointFlags = 1 - GBP_API_ENDPOINT_FLAG_REMOTE GbpEndpointFlags = 2 - GBP_API_ENDPOINT_FLAG_LEARNT GbpEndpointFlags = 4 - GBP_API_ENDPOINT_FLAG_EXTERNAL GbpEndpointFlags = 8 -) - -var ( - GbpEndpointFlags_name = map[uint32]string{ - 0: "GBP_API_ENDPOINT_FLAG_NONE", - 1: "GBP_API_ENDPOINT_FLAG_BOUNCE", - 2: "GBP_API_ENDPOINT_FLAG_REMOTE", - 4: "GBP_API_ENDPOINT_FLAG_LEARNT", - 8: "GBP_API_ENDPOINT_FLAG_EXTERNAL", - } - GbpEndpointFlags_value = map[string]uint32{ - "GBP_API_ENDPOINT_FLAG_NONE": 0, - "GBP_API_ENDPOINT_FLAG_BOUNCE": 1, - "GBP_API_ENDPOINT_FLAG_REMOTE": 2, - "GBP_API_ENDPOINT_FLAG_LEARNT": 4, - "GBP_API_ENDPOINT_FLAG_EXTERNAL": 8, - } -) - -func (x GbpEndpointFlags) String() string { - s, ok := GbpEndpointFlags_name[uint32(x)] - if ok { - return s - } - str := func(n uint32) string { - s, ok := GbpEndpointFlags_name[uint32(n)] - if ok { - return s - } - return "GbpEndpointFlags(" + strconv.Itoa(int(n)) + ")" - } - for i := uint32(0); i <= 32; i++ { - val := uint32(x) - if val&(1<<i) != 0 { - if s != "" { - s += "|" - } - s += str(1 << i) - } - } - if s == "" { - return str(uint32(x)) - } - return s -} - -// GbpExtItfFlags defines enum 'gbp_ext_itf_flags'. -type GbpExtItfFlags uint32 - -const ( - GBP_API_EXT_ITF_F_NONE GbpExtItfFlags = 0 - GBP_API_EXT_ITF_F_ANON GbpExtItfFlags = 1 -) - -var ( - GbpExtItfFlags_name = map[uint32]string{ - 0: "GBP_API_EXT_ITF_F_NONE", - 1: "GBP_API_EXT_ITF_F_ANON", - } - GbpExtItfFlags_value = map[string]uint32{ - "GBP_API_EXT_ITF_F_NONE": 0, - "GBP_API_EXT_ITF_F_ANON": 1, - } -) - -func (x GbpExtItfFlags) String() string { - s, ok := GbpExtItfFlags_name[uint32(x)] - if ok { - return s - } - str := func(n uint32) string { - s, ok := GbpExtItfFlags_name[uint32(n)] - if ok { - return s - } - return "GbpExtItfFlags(" + strconv.Itoa(int(n)) + ")" - } - for i := uint32(0); i <= 32; i++ { - val := uint32(x) - if val&(1<<i) != 0 { - if s != "" { - s += "|" - } - s += str(1 << i) - } - } - if s == "" { - return str(uint32(x)) - } - return s -} - -// GbpHashMode defines enum 'gbp_hash_mode'. -type GbpHashMode uint32 - -const ( - GBP_API_HASH_MODE_SRC_IP GbpHashMode = 1 - GBP_API_HASH_MODE_DST_IP GbpHashMode = 2 - GBP_API_HASH_MODE_SYMMETRIC GbpHashMode = 3 -) - -var ( - GbpHashMode_name = map[uint32]string{ - 1: "GBP_API_HASH_MODE_SRC_IP", - 2: "GBP_API_HASH_MODE_DST_IP", - 3: "GBP_API_HASH_MODE_SYMMETRIC", - } - GbpHashMode_value = map[string]uint32{ - "GBP_API_HASH_MODE_SRC_IP": 1, - "GBP_API_HASH_MODE_DST_IP": 2, - "GBP_API_HASH_MODE_SYMMETRIC": 3, - } -) - -func (x GbpHashMode) String() string { - s, ok := GbpHashMode_name[uint32(x)] - if ok { - return s - } - return "GbpHashMode(" + strconv.Itoa(int(x)) + ")" -} - -// GbpRuleAction defines enum 'gbp_rule_action'. -type GbpRuleAction uint32 - -const ( - GBP_API_RULE_PERMIT GbpRuleAction = 1 - GBP_API_RULE_DENY GbpRuleAction = 2 - GBP_API_RULE_REDIRECT GbpRuleAction = 3 -) - -var ( - GbpRuleAction_name = map[uint32]string{ - 1: "GBP_API_RULE_PERMIT", - 2: "GBP_API_RULE_DENY", - 3: "GBP_API_RULE_REDIRECT", - } - GbpRuleAction_value = map[string]uint32{ - "GBP_API_RULE_PERMIT": 1, - "GBP_API_RULE_DENY": 2, - "GBP_API_RULE_REDIRECT": 3, - } -) - -func (x GbpRuleAction) String() string { - s, ok := GbpRuleAction_name[uint32(x)] - if ok { - return s - } - return "GbpRuleAction(" + strconv.Itoa(int(x)) + ")" -} - -// GbpSubnetType defines enum 'gbp_subnet_type'. -type GbpSubnetType uint32 - -const ( - GBP_API_SUBNET_TRANSPORT GbpSubnetType = 1 - GBP_API_SUBNET_STITCHED_INTERNAL GbpSubnetType = 2 - GBP_API_SUBNET_STITCHED_EXTERNAL GbpSubnetType = 3 - GBP_API_SUBNET_L3_OUT GbpSubnetType = 4 - GBP_API_SUBNET_ANON_L3_OUT GbpSubnetType = 5 -) - -var ( - GbpSubnetType_name = map[uint32]string{ - 1: "GBP_API_SUBNET_TRANSPORT", - 2: "GBP_API_SUBNET_STITCHED_INTERNAL", - 3: "GBP_API_SUBNET_STITCHED_EXTERNAL", - 4: "GBP_API_SUBNET_L3_OUT", - 5: "GBP_API_SUBNET_ANON_L3_OUT", - } - GbpSubnetType_value = map[string]uint32{ - "GBP_API_SUBNET_TRANSPORT": 1, - "GBP_API_SUBNET_STITCHED_INTERNAL": 2, - "GBP_API_SUBNET_STITCHED_EXTERNAL": 3, - "GBP_API_SUBNET_L3_OUT": 4, - "GBP_API_SUBNET_ANON_L3_OUT": 5, - } -) - -func (x GbpSubnetType) String() string { - s, ok := GbpSubnetType_name[uint32(x)] - if ok { - return s - } - return "GbpSubnetType(" + strconv.Itoa(int(x)) + ")" -} - -// GbpVxlanTunnelMode defines enum 'gbp_vxlan_tunnel_mode'. -type GbpVxlanTunnelMode uint32 - -const ( - GBP_VXLAN_TUNNEL_MODE_L2 GbpVxlanTunnelMode = 1 - GBP_VXLAN_TUNNEL_MODE_L3 GbpVxlanTunnelMode = 2 -) - -var ( - GbpVxlanTunnelMode_name = map[uint32]string{ - 1: "GBP_VXLAN_TUNNEL_MODE_L2", - 2: "GBP_VXLAN_TUNNEL_MODE_L3", - } - GbpVxlanTunnelMode_value = map[string]uint32{ - "GBP_VXLAN_TUNNEL_MODE_L2": 1, - "GBP_VXLAN_TUNNEL_MODE_L3": 2, - } -) - -func (x GbpVxlanTunnelMode) String() string { - s, ok := GbpVxlanTunnelMode_name[uint32(x)] - if ok { - return s - } - return "GbpVxlanTunnelMode(" + strconv.Itoa(int(x)) + ")" -} - -// IfStatusFlags defines enum 'if_status_flags'. -type IfStatusFlags uint32 - -const ( - IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1 - IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2 -) - -var ( - IfStatusFlags_name = map[uint32]string{ - 1: "IF_STATUS_API_FLAG_ADMIN_UP", - 2: "IF_STATUS_API_FLAG_LINK_UP", - } - IfStatusFlags_value = map[string]uint32{ - "IF_STATUS_API_FLAG_ADMIN_UP": 1, - "IF_STATUS_API_FLAG_LINK_UP": 2, - } -) - -func (x IfStatusFlags) String() string { - s, ok := IfStatusFlags_name[uint32(x)] - if ok { - return s - } - str := func(n uint32) string { - s, ok := IfStatusFlags_name[uint32(n)] - if ok { - return s - } - return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")" - } - for i := uint32(0); i <= 32; i++ { - val := uint32(x) - if val&(1<<i) != 0 { - if s != "" { - s += "|" - } - s += str(1 << i) - } - } - if s == "" { - return str(uint32(x)) - } - return s -} - -// IfType defines enum 'if_type'. -type IfType uint32 - -const ( - IF_API_TYPE_HARDWARE IfType = 1 - IF_API_TYPE_SUB IfType = 2 - IF_API_TYPE_P2P IfType = 3 - IF_API_TYPE_PIPE IfType = 4 -) - -var ( - IfType_name = map[uint32]string{ - 1: "IF_API_TYPE_HARDWARE", - 2: "IF_API_TYPE_SUB", - 3: "IF_API_TYPE_P2P", - 4: "IF_API_TYPE_PIPE", - } - IfType_value = map[string]uint32{ - "IF_API_TYPE_HARDWARE": 1, - "IF_API_TYPE_SUB": 2, - "IF_API_TYPE_P2P": 3, - "IF_API_TYPE_PIPE": 4, - } -) - -func (x IfType) String() string { - s, ok := IfType_name[uint32(x)] - if ok { - return s - } - return "IfType(" + strconv.Itoa(int(x)) + ")" -} - -// IPDscp defines enum 'ip_dscp'. -type IPDscp uint8 - -const ( - IP_API_DSCP_CS0 IPDscp = 0 - IP_API_DSCP_CS1 IPDscp = 8 - IP_API_DSCP_AF11 IPDscp = 10 - IP_API_DSCP_AF12 IPDscp = 12 - IP_API_DSCP_AF13 IPDscp = 14 - IP_API_DSCP_CS2 IPDscp = 16 - IP_API_DSCP_AF21 IPDscp = 18 - IP_API_DSCP_AF22 IPDscp = 20 - IP_API_DSCP_AF23 IPDscp = 22 - IP_API_DSCP_CS3 IPDscp = 24 - IP_API_DSCP_AF31 IPDscp = 26 - IP_API_DSCP_AF32 IPDscp = 28 - IP_API_DSCP_AF33 IPDscp = 30 - IP_API_DSCP_CS4 IPDscp = 32 - IP_API_DSCP_AF41 IPDscp = 34 - IP_API_DSCP_AF42 IPDscp = 36 - IP_API_DSCP_AF43 IPDscp = 38 - IP_API_DSCP_CS5 IPDscp = 40 - IP_API_DSCP_EF IPDscp = 46 - IP_API_DSCP_CS6 IPDscp = 48 - IP_API_DSCP_CS7 IPDscp = 50 -) - -var ( - IPDscp_name = map[uint8]string{ - 0: "IP_API_DSCP_CS0", - 8: "IP_API_DSCP_CS1", - 10: "IP_API_DSCP_AF11", - 12: "IP_API_DSCP_AF12", - 14: "IP_API_DSCP_AF13", - 16: "IP_API_DSCP_CS2", - 18: "IP_API_DSCP_AF21", - 20: "IP_API_DSCP_AF22", - 22: "IP_API_DSCP_AF23", - 24: "IP_API_DSCP_CS3", - 26: "IP_API_DSCP_AF31", - 28: "IP_API_DSCP_AF32", - 30: "IP_API_DSCP_AF33", - 32: "IP_API_DSCP_CS4", - 34: "IP_API_DSCP_AF41", - 36: "IP_API_DSCP_AF42", - 38: "IP_API_DSCP_AF43", - 40: "IP_API_DSCP_CS5", - 46: "IP_API_DSCP_EF", - 48: "IP_API_DSCP_CS6", - 50: "IP_API_DSCP_CS7", - } - IPDscp_value = map[string]uint8{ - "IP_API_DSCP_CS0": 0, - "IP_API_DSCP_CS1": 8, - "IP_API_DSCP_AF11": 10, - "IP_API_DSCP_AF12": 12, - "IP_API_DSCP_AF13": 14, - "IP_API_DSCP_CS2": 16, - "IP_API_DSCP_AF21": 18, - "IP_API_DSCP_AF22": 20, - "IP_API_DSCP_AF23": 22, - "IP_API_DSCP_CS3": 24, - "IP_API_DSCP_AF31": 26, - "IP_API_DSCP_AF32": 28, - "IP_API_DSCP_AF33": 30, - "IP_API_DSCP_CS4": 32, - "IP_API_DSCP_AF41": 34, - "IP_API_DSCP_AF42": 36, - "IP_API_DSCP_AF43": 38, - "IP_API_DSCP_CS5": 40, - "IP_API_DSCP_EF": 46, - "IP_API_DSCP_CS6": 48, - "IP_API_DSCP_CS7": 50, - } -) - -func (x IPDscp) String() string { - s, ok := IPDscp_name[uint8(x)] - if ok { - return s - } - return "IPDscp(" + strconv.Itoa(int(x)) + ")" -} - -// IPEcn defines enum 'ip_ecn'. -type IPEcn uint8 - -const ( - IP_API_ECN_NONE IPEcn = 0 - IP_API_ECN_ECT0 IPEcn = 1 - IP_API_ECN_ECT1 IPEcn = 2 - IP_API_ECN_CE IPEcn = 3 -) - -var ( - IPEcn_name = map[uint8]string{ - 0: "IP_API_ECN_NONE", - 1: "IP_API_ECN_ECT0", - 2: "IP_API_ECN_ECT1", - 3: "IP_API_ECN_CE", - } - IPEcn_value = map[string]uint8{ - "IP_API_ECN_NONE": 0, - "IP_API_ECN_ECT0": 1, - "IP_API_ECN_ECT1": 2, - "IP_API_ECN_CE": 3, - } -) - -func (x IPEcn) String() string { - s, ok := IPEcn_name[uint8(x)] - if ok { - return s - } - return "IPEcn(" + strconv.Itoa(int(x)) + ")" -} - -// IPProto defines enum 'ip_proto'. -type IPProto uint32 - -const ( - IP_API_PROTO_HOPOPT IPProto = 0 - IP_API_PROTO_ICMP IPProto = 1 - IP_API_PROTO_IGMP IPProto = 2 - IP_API_PROTO_TCP IPProto = 6 - IP_API_PROTO_UDP IPProto = 17 - IP_API_PROTO_GRE IPProto = 47 - IP_API_PROTO_AH IPProto = 50 - IP_API_PROTO_ESP IPProto = 51 - IP_API_PROTO_EIGRP IPProto = 88 - IP_API_PROTO_OSPF IPProto = 89 - IP_API_PROTO_SCTP IPProto = 132 - IP_API_PROTO_RESERVED IPProto = 255 -) - -var ( - IPProto_name = map[uint32]string{ - 0: "IP_API_PROTO_HOPOPT", - 1: "IP_API_PROTO_ICMP", - 2: "IP_API_PROTO_IGMP", - 6: "IP_API_PROTO_TCP", - 17: "IP_API_PROTO_UDP", - 47: "IP_API_PROTO_GRE", - 50: "IP_API_PROTO_AH", - 51: "IP_API_PROTO_ESP", - 88: "IP_API_PROTO_EIGRP", - 89: "IP_API_PROTO_OSPF", - 132: "IP_API_PROTO_SCTP", - 255: "IP_API_PROTO_RESERVED", - } - IPProto_value = map[string]uint32{ - "IP_API_PROTO_HOPOPT": 0, - "IP_API_PROTO_ICMP": 1, - "IP_API_PROTO_IGMP": 2, - "IP_API_PROTO_TCP": 6, - "IP_API_PROTO_UDP": 17, - "IP_API_PROTO_GRE": 47, - "IP_API_PROTO_AH": 50, - "IP_API_PROTO_ESP": 51, - "IP_API_PROTO_EIGRP": 88, - "IP_API_PROTO_OSPF": 89, - "IP_API_PROTO_SCTP": 132, - "IP_API_PROTO_RESERVED": 255, - } -) - -func (x IPProto) String() string { - s, ok := IPProto_name[uint32(x)] - if ok { - return s - } - return "IPProto(" + strconv.Itoa(int(x)) + ")" -} - -// LinkDuplex defines enum 'link_duplex'. -type LinkDuplex uint32 - -const ( - LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0 - LINK_DUPLEX_API_HALF LinkDuplex = 1 - LINK_DUPLEX_API_FULL LinkDuplex = 2 -) - -var ( - LinkDuplex_name = map[uint32]string{ - 0: "LINK_DUPLEX_API_UNKNOWN", - 1: "LINK_DUPLEX_API_HALF", - 2: "LINK_DUPLEX_API_FULL", - } - LinkDuplex_value = map[string]uint32{ - "LINK_DUPLEX_API_UNKNOWN": 0, - "LINK_DUPLEX_API_HALF": 1, - "LINK_DUPLEX_API_FULL": 2, - } -) - -func (x LinkDuplex) String() string { - s, ok := LinkDuplex_name[uint32(x)] - if ok { - return s - } - return "LinkDuplex(" + strconv.Itoa(int(x)) + ")" -} - -// MtuProto defines enum 'mtu_proto'. -type MtuProto uint32 - -const ( - MTU_PROTO_API_L3 MtuProto = 1 - MTU_PROTO_API_IP4 MtuProto = 2 - MTU_PROTO_API_IP6 MtuProto = 3 - MTU_PROTO_API_MPLS MtuProto = 4 - MTU_PROTO_API_N MtuProto = 5 -) - -var ( - MtuProto_name = map[uint32]string{ - 1: "MTU_PROTO_API_L3", - 2: "MTU_PROTO_API_IP4", - 3: "MTU_PROTO_API_IP6", - 4: "MTU_PROTO_API_MPLS", - 5: "MTU_PROTO_API_N", - } - MtuProto_value = map[string]uint32{ - "MTU_PROTO_API_L3": 1, - "MTU_PROTO_API_IP4": 2, - "MTU_PROTO_API_IP6": 3, - "MTU_PROTO_API_MPLS": 4, - "MTU_PROTO_API_N": 5, - } -) - -func (x MtuProto) String() string { - s, ok := MtuProto_name[uint32(x)] - if ok { - return s - } - return "MtuProto(" + strconv.Itoa(int(x)) + ")" -} - -// RxMode defines enum 'rx_mode'. -type RxMode uint32 - -const ( - RX_MODE_API_UNKNOWN RxMode = 0 - RX_MODE_API_POLLING RxMode = 1 - RX_MODE_API_INTERRUPT RxMode = 2 - RX_MODE_API_ADAPTIVE RxMode = 3 - RX_MODE_API_DEFAULT RxMode = 4 -) - -var ( - RxMode_name = map[uint32]string{ - 0: "RX_MODE_API_UNKNOWN", - 1: "RX_MODE_API_POLLING", - 2: "RX_MODE_API_INTERRUPT", - 3: "RX_MODE_API_ADAPTIVE", - 4: "RX_MODE_API_DEFAULT", - } - RxMode_value = map[string]uint32{ - "RX_MODE_API_UNKNOWN": 0, - "RX_MODE_API_POLLING": 1, - "RX_MODE_API_INTERRUPT": 2, - "RX_MODE_API_ADAPTIVE": 3, - "RX_MODE_API_DEFAULT": 4, - } -) - -func (x RxMode) String() string { - s, ok := RxMode_name[uint32(x)] - if ok { - return s - } - return "RxMode(" + strconv.Itoa(int(x)) + ")" -} - -// SubIfFlags defines enum 'sub_if_flags'. -type SubIfFlags uint32 - -const ( - SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1 - SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2 - SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4 - SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8 - SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16 - SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32 - SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64 - SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128 - SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254 - SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256 -) - -var ( - SubIfFlags_name = map[uint32]string{ - 1: "SUB_IF_API_FLAG_NO_TAGS", - 2: "SUB_IF_API_FLAG_ONE_TAG", - 4: "SUB_IF_API_FLAG_TWO_TAGS", - 8: "SUB_IF_API_FLAG_DOT1AD", - 16: "SUB_IF_API_FLAG_EXACT_MATCH", - 32: "SUB_IF_API_FLAG_DEFAULT", - 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY", - 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY", - 254: "SUB_IF_API_FLAG_MASK_VNET", - 256: "SUB_IF_API_FLAG_DOT1AH", - } - SubIfFlags_value = map[string]uint32{ - "SUB_IF_API_FLAG_NO_TAGS": 1, - "SUB_IF_API_FLAG_ONE_TAG": 2, - "SUB_IF_API_FLAG_TWO_TAGS": 4, - "SUB_IF_API_FLAG_DOT1AD": 8, - "SUB_IF_API_FLAG_EXACT_MATCH": 16, - "SUB_IF_API_FLAG_DEFAULT": 32, - "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64, - "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128, - "SUB_IF_API_FLAG_MASK_VNET": 254, - "SUB_IF_API_FLAG_DOT1AH": 256, - } -) - -func (x SubIfFlags) String() string { - s, ok := SubIfFlags_name[uint32(x)] - if ok { - return s - } - str := func(n uint32) string { - s, ok := SubIfFlags_name[uint32(n)] - if ok { - return s - } - return "SubIfFlags(" + strconv.Itoa(int(n)) + ")" - } - for i := uint32(0); i <= 32; i++ { - val := uint32(x) - if val&(1<<i) != 0 { - if s != "" { - s += "|" - } - s += str(1 << i) - } - } - if s == "" { - return str(uint32(x)) - } - return s -} - -// AddressWithPrefix defines alias 'address_with_prefix'. -type AddressWithPrefix Prefix - -func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) { - prefix, err := ParsePrefix(s) - if err != nil { - return AddressWithPrefix{}, err - } - return AddressWithPrefix(prefix), nil -} -func (x AddressWithPrefix) String() string { - return Prefix(x).String() -} -func (x *AddressWithPrefix) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *AddressWithPrefix) UnmarshalText(text []byte) error { - prefix, err := ParseAddressWithPrefix(string(text)) - if err != nil { - return err - } - *x = prefix - return nil -} - -// GbpScope defines alias 'gbp_scope'. -type GbpScope uint16 - -// InterfaceIndex defines alias 'interface_index'. -type InterfaceIndex uint32 - -// IP4Address defines alias 'ip4_address'. -type IP4Address [4]uint8 - -func ParseIP4Address(s string) (IP4Address, error) { - ip := net.ParseIP(s).To4() - if ip == nil { - return IP4Address{}, fmt.Errorf("invalid IP address: %s", s) - } - var ipaddr IP4Address - copy(ipaddr[:], ip.To4()) - return ipaddr, nil -} - -func (x IP4Address) ToIP() net.IP { - return net.IP(x[:]).To4() -} -func (x IP4Address) String() string { - return x.ToIP().String() -} -func (x *IP4Address) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *IP4Address) UnmarshalText(text []byte) error { - ipaddr, err := ParseIP4Address(string(text)) - if err != nil { - return err - } - *x = ipaddr - return nil -} - -// IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'. -type IP4AddressWithPrefix IP4Prefix - -// IP6Address defines alias 'ip6_address'. -type IP6Address [16]uint8 - -func ParseIP6Address(s string) (IP6Address, error) { - ip := net.ParseIP(s).To16() - if ip == nil { - return IP6Address{}, fmt.Errorf("invalid IP address: %s", s) - } - var ipaddr IP6Address - copy(ipaddr[:], ip.To16()) - return ipaddr, nil -} - -func (x IP6Address) ToIP() net.IP { - return net.IP(x[:]).To16() -} -func (x IP6Address) String() string { - return x.ToIP().String() -} -func (x *IP6Address) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *IP6Address) UnmarshalText(text []byte) error { - ipaddr, err := ParseIP6Address(string(text)) - if err != nil { - return err - } - *x = ipaddr - return nil -} - -// IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'. -type IP6AddressWithPrefix IP6Prefix - -// MacAddress defines alias 'mac_address'. -type MacAddress [6]uint8 - -func ParseMacAddress(s string) (MacAddress, error) { - var macaddr MacAddress - mac, err := net.ParseMAC(s) - if err != nil { - return macaddr, err - } - copy(macaddr[:], mac[:]) - return macaddr, nil -} -func (x MacAddress) ToMAC() net.HardwareAddr { - return net.HardwareAddr(x[:]) -} -func (x MacAddress) String() string { - return x.ToMAC().String() -} -func (x *MacAddress) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *MacAddress) UnmarshalText(text []byte) error { - mac, err := ParseMacAddress(string(text)) - if err != nil { - return err - } - *x = mac - return nil -} - -// Address defines type 'address'. -type Address struct { - Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` - Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"` -} - -func ParseAddress(s string) (Address, error) { - ip := net.ParseIP(s) - if ip == nil { - return Address{}, fmt.Errorf("invalid address: %s", s) - } - var addr Address - if ip.To4() == nil { - addr.Af = ADDRESS_IP6 - var ip6 IP6Address - copy(ip6[:], ip.To16()) - addr.Un.SetIP6(ip6) - } else { - addr.Af = ADDRESS_IP4 - var ip4 IP4Address - copy(ip4[:], ip.To4()) - addr.Un.SetIP4(ip4) - } - return addr, nil -} -func (x Address) ToIP() net.IP { - if x.Af == ADDRESS_IP6 { - ip6 := x.Un.GetIP6() - return net.IP(ip6[:]).To16() - } else { - ip4 := x.Un.GetIP4() - return net.IP(ip4[:]).To4() - } -} -func (x Address) String() string { - return x.ToIP().String() -} -func (x *Address) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *Address) UnmarshalText(text []byte) error { - addr, err := ParseAddress(string(text)) - if err != nil { - return err - } - *x = addr - return nil -} - -// GbpBridgeDomain defines type 'gbp_bridge_domain'. -type GbpBridgeDomain struct { - BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` - Flags GbpBridgeDomainFlags `binapi:"gbp_bridge_domain_flags,name=flags" json:"flags,omitempty"` - BviSwIfIndex InterfaceIndex `binapi:"interface_index,name=bvi_sw_if_index" json:"bvi_sw_if_index,omitempty"` - UuFwdSwIfIndex InterfaceIndex `binapi:"interface_index,name=uu_fwd_sw_if_index" json:"uu_fwd_sw_if_index,omitempty"` - BmFloodSwIfIndex InterfaceIndex `binapi:"interface_index,name=bm_flood_sw_if_index" json:"bm_flood_sw_if_index,omitempty"` -} - -// GbpContract defines type 'gbp_contract'. -type GbpContract struct { - Scope GbpScope `binapi:"gbp_scope,name=scope" json:"scope,omitempty"` - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` - Dclass uint16 `binapi:"u16,name=dclass" json:"dclass,omitempty"` - ACLIndex uint32 `binapi:"u32,name=acl_index" json:"acl_index,omitempty"` - NEtherTypes uint8 `binapi:"u8,name=n_ether_types" json:"n_ether_types,omitempty"` - AllowedEthertypes []uint16 `binapi:"u16[16],name=allowed_ethertypes" json:"allowed_ethertypes,omitempty"` - NRules uint8 `binapi:"u8,name=n_rules" json:"-"` - Rules []GbpRule `binapi:"gbp_rule[n_rules],name=rules" json:"rules,omitempty"` -} - -// GbpEndpoint defines type 'gbp_endpoint'. -type GbpEndpoint struct { - SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` - Flags GbpEndpointFlags `binapi:"gbp_endpoint_flags,name=flags" json:"flags,omitempty"` - Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` - Tun GbpEndpointTun `binapi:"gbp_endpoint_tun,name=tun" json:"tun,omitempty"` - NIps uint8 `binapi:"u8,name=n_ips" json:"-"` - Ips []Address `binapi:"address[n_ips],name=ips" json:"ips,omitempty"` -} - -// GbpEndpointGroup defines type 'gbp_endpoint_group'. -type GbpEndpointGroup struct { - Vnid uint32 `binapi:"u32,name=vnid" json:"vnid,omitempty"` - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` - BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` - UplinkSwIfIndex InterfaceIndex `binapi:"interface_index,name=uplink_sw_if_index" json:"uplink_sw_if_index,omitempty"` - Retention GbpEndpointRetention `binapi:"gbp_endpoint_retention,name=retention" json:"retention,omitempty"` -} - -// GbpEndpointRetention defines type 'gbp_endpoint_retention'. -type GbpEndpointRetention struct { - RemoteEpTimeout uint32 `binapi:"u32,name=remote_ep_timeout" json:"remote_ep_timeout,omitempty"` -} - -// GbpEndpointTun defines type 'gbp_endpoint_tun'. -type GbpEndpointTun struct { - Src Address `binapi:"address,name=src" json:"src,omitempty"` - Dst Address `binapi:"address,name=dst" json:"dst,omitempty"` -} - -// GbpExtItf defines type 'gbp_ext_itf'. -type GbpExtItf struct { - SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` - BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` - Flags GbpExtItfFlags `binapi:"gbp_ext_itf_flags,name=flags" json:"flags,omitempty"` -} - -// GbpNextHop defines type 'gbp_next_hop'. -type GbpNextHop struct { - IP Address `binapi:"address,name=ip" json:"ip,omitempty"` - Mac MacAddress `binapi:"mac_address,name=mac" json:"mac,omitempty"` - BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` -} - -// GbpNextHopSet defines type 'gbp_next_hop_set'. -type GbpNextHopSet struct { - HashMode GbpHashMode `binapi:"gbp_hash_mode,name=hash_mode" json:"hash_mode,omitempty"` - NNhs uint8 `binapi:"u8,name=n_nhs" json:"n_nhs,omitempty"` - Nhs [8]GbpNextHop `binapi:"gbp_next_hop[8],name=nhs" json:"nhs,omitempty"` -} - -// GbpRecirc defines type 'gbp_recirc'. -type GbpRecirc struct { - SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` - IsExt bool `binapi:"bool,name=is_ext" json:"is_ext,omitempty"` -} - -// GbpRouteDomain defines type 'gbp_route_domain'. -type GbpRouteDomain struct { - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` - IP4TableID uint32 `binapi:"u32,name=ip4_table_id" json:"ip4_table_id,omitempty"` - IP6TableID uint32 `binapi:"u32,name=ip6_table_id" json:"ip6_table_id,omitempty"` - IP4UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip4_uu_sw_if_index" json:"ip4_uu_sw_if_index,omitempty"` - IP6UuSwIfIndex InterfaceIndex `binapi:"interface_index,name=ip6_uu_sw_if_index" json:"ip6_uu_sw_if_index,omitempty"` - Scope GbpScope `binapi:"gbp_scope,name=scope" json:"scope,omitempty"` -} - -// GbpRule defines type 'gbp_rule'. -type GbpRule struct { - Action GbpRuleAction `binapi:"gbp_rule_action,name=action" json:"action,omitempty"` - NhSet GbpNextHopSet `binapi:"gbp_next_hop_set,name=nh_set" json:"nh_set,omitempty"` -} - -// GbpSubnet defines type 'gbp_subnet'. -type GbpSubnet struct { - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` - SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` - Type GbpSubnetType `binapi:"gbp_subnet_type,name=type" json:"type,omitempty"` - Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"` -} - -// GbpVxlanTunnel defines type 'gbp_vxlan_tunnel'. -type GbpVxlanTunnel struct { - Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` - Mode GbpVxlanTunnelMode `binapi:"gbp_vxlan_tunnel_mode,name=mode" json:"mode,omitempty"` - BdRdID uint32 `binapi:"u32,name=bd_rd_id" json:"bd_rd_id,omitempty"` - Src IP4Address `binapi:"ip4_address,name=src" json:"src,omitempty"` -} - -// IP4Prefix defines type 'ip4_prefix'. -type IP4Prefix struct { - Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"` - Len uint8 `binapi:"u8,name=len" json:"len,omitempty"` -} - -func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) { - hasPrefix := strings.Contains(s, "/") - if hasPrefix { - ip, network, err := net.ParseCIDR(s) - if err != nil { - return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - maskSize, _ := network.Mask.Size() - prefix.Len = byte(maskSize) - prefix.Address, err = ParseIP4Address(ip.String()) - if err != nil { - return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - } else { - ip := net.ParseIP(s) - defaultMaskSize, _ := net.CIDRMask(32, 32).Size() - if ip.To4() == nil { - defaultMaskSize, _ = net.CIDRMask(128, 128).Size() - } - prefix.Len = byte(defaultMaskSize) - prefix.Address, err = ParseIP4Address(ip.String()) - if err != nil { - return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - } - return prefix, nil -} -func (x IP4Prefix) ToIPNet() *net.IPNet { - mask := net.CIDRMask(int(x.Len), 32) - ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} - return ipnet -} -func (x IP4Prefix) String() string { - ip := x.Address.String() - return ip + "/" + strconv.Itoa(int(x.Len)) -} -func (x *IP4Prefix) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *IP4Prefix) UnmarshalText(text []byte) error { - prefix, err := ParseIP4Prefix(string(text)) - if err != nil { - return err - } - *x = prefix - return nil -} - -// IP6Prefix defines type 'ip6_prefix'. -type IP6Prefix struct { - Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"` - Len uint8 `binapi:"u8,name=len" json:"len,omitempty"` -} - -func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) { - hasPrefix := strings.Contains(s, "/") - if hasPrefix { - ip, network, err := net.ParseCIDR(s) - if err != nil { - return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - maskSize, _ := network.Mask.Size() - prefix.Len = byte(maskSize) - prefix.Address, err = ParseIP6Address(ip.String()) - if err != nil { - return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - } else { - ip := net.ParseIP(s) - defaultMaskSize, _ := net.CIDRMask(32, 32).Size() - if ip.To4() == nil { - defaultMaskSize, _ = net.CIDRMask(128, 128).Size() - } - prefix.Len = byte(defaultMaskSize) - prefix.Address, err = ParseIP6Address(ip.String()) - if err != nil { - return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err) - } - } - return prefix, nil -} -func (x IP6Prefix) ToIPNet() *net.IPNet { - mask := net.CIDRMask(int(x.Len), 128) - ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} - return ipnet -} -func (x IP6Prefix) String() string { - ip := x.Address.String() - return ip + "/" + strconv.Itoa(int(x.Len)) -} -func (x *IP6Prefix) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *IP6Prefix) UnmarshalText(text []byte) error { - prefix, err := ParseIP6Prefix(string(text)) - if err != nil { - return err - } - *x = prefix - return nil -} - -// Mprefix defines type 'mprefix'. -type Mprefix struct { - Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"` - GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"` - GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"` - SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"` -} - -// Prefix defines type 'prefix'. -type Prefix struct { - Address Address `binapi:"address,name=address" json:"address,omitempty"` - Len uint8 `binapi:"u8,name=len" json:"len,omitempty"` -} - -func ParsePrefix(ip string) (prefix Prefix, err error) { - hasPrefix := strings.Contains(ip, "/") - if hasPrefix { - netIP, network, err := net.ParseCIDR(ip) - if err != nil { - return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err) - } - maskSize, _ := network.Mask.Size() - prefix.Len = byte(maskSize) - prefix.Address, err = ParseAddress(netIP.String()) - if err != nil { - return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err) - } - } else { - netIP := net.ParseIP(ip) - defaultMaskSize, _ := net.CIDRMask(32, 32).Size() - if netIP.To4() == nil { - defaultMaskSize, _ = net.CIDRMask(128, 128).Size() - } - prefix.Len = byte(defaultMaskSize) - prefix.Address, err = ParseAddress(netIP.String()) - if err != nil { - return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err) - } - } - return prefix, nil -} -func (x Prefix) ToIPNet() *net.IPNet { - var mask net.IPMask - if x.Address.Af == ADDRESS_IP4 { - mask = net.CIDRMask(int(x.Len), 32) - } else { - mask = net.CIDRMask(int(x.Len), 128) - } - ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask} - return ipnet -} -func (x Prefix) String() string { - ip := x.Address.String() - return ip + "/" + strconv.Itoa(int(x.Len)) -} -func (x *Prefix) MarshalText() ([]byte, error) { - return []byte(x.String()), nil -} -func (x *Prefix) UnmarshalText(text []byte) error { - prefix, err := ParsePrefix(string(text)) - if err != nil { - return err - } - *x = prefix - return nil -} - -// PrefixMatcher defines type 'prefix_matcher'. -type PrefixMatcher struct { - Le uint8 `binapi:"u8,name=le" json:"le,omitempty"` - Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"` -} - -// AddressUnion defines union 'address_union'. -type AddressUnion struct { - // IP4 *IP4Address - // IP6 *IP6Address - XXX_UnionData [16]byte -} - -func AddressUnionIP4(a IP4Address) (u AddressUnion) { - u.SetIP4(a) - return -} -func (u *AddressUnion) SetIP4(a IP4Address) { - buf := codec.NewBuffer(u.XXX_UnionData[:]) - buf.EncodeBytes(a[:], 4) -} -func (u *AddressUnion) GetIP4() (a IP4Address) { - buf := codec.NewBuffer(u.XXX_UnionData[:]) - copy(a[:], buf.DecodeBytes(4)) - return -} - -func AddressUnionIP6(a IP6Address) (u AddressUnion) { - u.SetIP6(a) - return -} -func (u *AddressUnion) SetIP6(a IP6Address) { - buf := codec.NewBuffer(u.XXX_UnionData[:]) - buf.EncodeBytes(a[:], 16) -} -func (u *AddressUnion) GetIP6() (a IP6Address) { - buf := codec.NewBuffer(u.XXX_UnionData[:]) - copy(a[:], buf.DecodeBytes(16)) - return -} - -// GbpBridgeDomainAdd defines message 'gbp_bridge_domain_add'. -type GbpBridgeDomainAdd struct { - Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"` -} - -func (m *GbpBridgeDomainAdd) Reset() { *m = GbpBridgeDomainAdd{} } -func (*GbpBridgeDomainAdd) GetMessageName() string { return "gbp_bridge_domain_add" } -func (*GbpBridgeDomainAdd) GetCrcString() string { return "8454bfdf" } -func (*GbpBridgeDomainAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpBridgeDomainAdd) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Bd.BdID - size += 4 // m.Bd.RdID - size += 4 // m.Bd.Flags - size += 4 // m.Bd.BviSwIfIndex - size += 4 // m.Bd.UuFwdSwIfIndex - size += 4 // m.Bd.BmFloodSwIfIndex - return size -} -func (m *GbpBridgeDomainAdd) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Bd.BdID) - buf.EncodeUint32(m.Bd.RdID) - buf.EncodeUint32(uint32(m.Bd.Flags)) - buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex)) - buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex)) - buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex)) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainAdd) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Bd.BdID = buf.DecodeUint32() - m.Bd.RdID = buf.DecodeUint32() - m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32()) - m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - return nil -} - -// GbpBridgeDomainAddReply defines message 'gbp_bridge_domain_add_reply'. -type GbpBridgeDomainAddReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpBridgeDomainAddReply) Reset() { *m = GbpBridgeDomainAddReply{} } -func (*GbpBridgeDomainAddReply) GetMessageName() string { return "gbp_bridge_domain_add_reply" } -func (*GbpBridgeDomainAddReply) GetCrcString() string { return "e8d4e804" } -func (*GbpBridgeDomainAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpBridgeDomainAddReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpBridgeDomainAddReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainAddReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpBridgeDomainDel defines message 'gbp_bridge_domain_del'. -type GbpBridgeDomainDel struct { - BdID uint32 `binapi:"u32,name=bd_id" json:"bd_id,omitempty"` -} - -func (m *GbpBridgeDomainDel) Reset() { *m = GbpBridgeDomainDel{} } -func (*GbpBridgeDomainDel) GetMessageName() string { return "gbp_bridge_domain_del" } -func (*GbpBridgeDomainDel) GetCrcString() string { return "c25fdce6" } -func (*GbpBridgeDomainDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpBridgeDomainDel) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.BdID - return size -} -func (m *GbpBridgeDomainDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.BdID) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.BdID = buf.DecodeUint32() - return nil -} - -// GbpBridgeDomainDelReply defines message 'gbp_bridge_domain_del_reply'. -type GbpBridgeDomainDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpBridgeDomainDelReply) Reset() { *m = GbpBridgeDomainDelReply{} } -func (*GbpBridgeDomainDelReply) GetMessageName() string { return "gbp_bridge_domain_del_reply" } -func (*GbpBridgeDomainDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpBridgeDomainDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpBridgeDomainDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpBridgeDomainDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpBridgeDomainDetails defines message 'gbp_bridge_domain_details'. -type GbpBridgeDomainDetails struct { - Bd GbpBridgeDomain `binapi:"gbp_bridge_domain,name=bd" json:"bd,omitempty"` -} - -func (m *GbpBridgeDomainDetails) Reset() { *m = GbpBridgeDomainDetails{} } -func (*GbpBridgeDomainDetails) GetMessageName() string { return "gbp_bridge_domain_details" } -func (*GbpBridgeDomainDetails) GetCrcString() string { return "2acd15f9" } -func (*GbpBridgeDomainDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpBridgeDomainDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Bd.BdID - size += 4 // m.Bd.RdID - size += 4 // m.Bd.Flags - size += 4 // m.Bd.BviSwIfIndex - size += 4 // m.Bd.UuFwdSwIfIndex - size += 4 // m.Bd.BmFloodSwIfIndex - return size -} -func (m *GbpBridgeDomainDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Bd.BdID) - buf.EncodeUint32(m.Bd.RdID) - buf.EncodeUint32(uint32(m.Bd.Flags)) - buf.EncodeUint32(uint32(m.Bd.BviSwIfIndex)) - buf.EncodeUint32(uint32(m.Bd.UuFwdSwIfIndex)) - buf.EncodeUint32(uint32(m.Bd.BmFloodSwIfIndex)) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Bd.BdID = buf.DecodeUint32() - m.Bd.RdID = buf.DecodeUint32() - m.Bd.Flags = GbpBridgeDomainFlags(buf.DecodeUint32()) - m.Bd.BviSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Bd.UuFwdSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Bd.BmFloodSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - return nil -} - -// GbpBridgeDomainDump defines message 'gbp_bridge_domain_dump'. -type GbpBridgeDomainDump struct{} - -func (m *GbpBridgeDomainDump) Reset() { *m = GbpBridgeDomainDump{} } -func (*GbpBridgeDomainDump) GetMessageName() string { return "gbp_bridge_domain_dump" } -func (*GbpBridgeDomainDump) GetCrcString() string { return "51077d14" } -func (*GbpBridgeDomainDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpBridgeDomainDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpBridgeDomainDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainDump) Unmarshal(b []byte) error { - return nil -} - -// GbpBridgeDomainDumpReply defines message 'gbp_bridge_domain_dump_reply'. -type GbpBridgeDomainDumpReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpBridgeDomainDumpReply) Reset() { *m = GbpBridgeDomainDumpReply{} } -func (*GbpBridgeDomainDumpReply) GetMessageName() string { return "gbp_bridge_domain_dump_reply" } -func (*GbpBridgeDomainDumpReply) GetCrcString() string { return "e8d4e804" } -func (*GbpBridgeDomainDumpReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpBridgeDomainDumpReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpBridgeDomainDumpReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpBridgeDomainDumpReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpContractAddDel defines message 'gbp_contract_add_del'. -type GbpContractAddDel struct { - IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` - Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"` -} - -func (m *GbpContractAddDel) Reset() { *m = GbpContractAddDel{} } -func (*GbpContractAddDel) GetMessageName() string { return "gbp_contract_add_del" } -func (*GbpContractAddDel) GetCrcString() string { return "553e275b" } -func (*GbpContractAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpContractAddDel) Size() (size int) { - if m == nil { - return 0 - } - size += 1 // m.IsAdd - size += 2 // m.Contract.Scope - size += 2 // m.Contract.Sclass - size += 2 // m.Contract.Dclass - size += 4 // m.Contract.ACLIndex - size += 1 // m.Contract.NEtherTypes - size += 2 * 16 // m.Contract.AllowedEthertypes - size += 1 // m.Contract.NRules - for j2 := 0; j2 < len(m.Contract.Rules); j2++ { - var s2 GbpRule - _ = s2 - if j2 < len(m.Contract.Rules) { - s2 = m.Contract.Rules[j2] - } - size += 4 // s2.Action - size += 4 // s2.NhSet.HashMode - size += 1 // s2.NhSet.NNhs - for j4 := 0; j4 < 8; j4++ { - size += 4 // s2.NhSet.Nhs[j4].IP.Af - size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un - size += 1 * 6 // s2.NhSet.Nhs[j4].Mac - size += 4 // s2.NhSet.Nhs[j4].BdID - size += 4 // s2.NhSet.Nhs[j4].RdID - } - } - return size -} -func (m *GbpContractAddDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeBool(m.IsAdd) - buf.EncodeUint16(uint16(m.Contract.Scope)) - buf.EncodeUint16(m.Contract.Sclass) - buf.EncodeUint16(m.Contract.Dclass) - buf.EncodeUint32(m.Contract.ACLIndex) - buf.EncodeUint8(m.Contract.NEtherTypes) - for i := 0; i < 16; i++ { - var x uint16 - if i < len(m.Contract.AllowedEthertypes) { - x = uint16(m.Contract.AllowedEthertypes[i]) - } - buf.EncodeUint16(x) - } - buf.EncodeUint8(uint8(len(m.Contract.Rules))) - for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - var v1 GbpRule // Rules - if j1 < len(m.Contract.Rules) { - v1 = m.Contract.Rules[j1] - } - buf.EncodeUint32(uint32(v1.Action)) - buf.EncodeUint32(uint32(v1.NhSet.HashMode)) - buf.EncodeUint8(v1.NhSet.NNhs) - for j3 := 0; j3 < 8; j3++ { - buf.EncodeUint32(uint32(v1.NhSet.Nhs[j3].IP.Af)) - buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16) - buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6) - buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID) - buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID) - } - } - return buf.Bytes(), nil -} -func (m *GbpContractAddDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.IsAdd = buf.DecodeBool() - m.Contract.Scope = GbpScope(buf.DecodeUint16()) - m.Contract.Sclass = buf.DecodeUint16() - m.Contract.Dclass = buf.DecodeUint16() - m.Contract.ACLIndex = buf.DecodeUint32() - m.Contract.NEtherTypes = buf.DecodeUint8() - m.Contract.AllowedEthertypes = make([]uint16, 16) - for i := 0; i < len(m.Contract.AllowedEthertypes); i++ { - m.Contract.AllowedEthertypes[i] = buf.DecodeUint16() - } - m.Contract.NRules = buf.DecodeUint8() - m.Contract.Rules = make([]GbpRule, m.Contract.NRules) - for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32()) - m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32()) - m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8() - for j3 := 0; j3 < 8; j3++ { - m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6)) - m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32() - m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32() - } - } - return nil -} - -// GbpContractAddDelReply defines message 'gbp_contract_add_del_reply'. -type GbpContractAddDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` - StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"` -} - -func (m *GbpContractAddDelReply) Reset() { *m = GbpContractAddDelReply{} } -func (*GbpContractAddDelReply) GetMessageName() string { return "gbp_contract_add_del_reply" } -func (*GbpContractAddDelReply) GetCrcString() string { return "1992deab" } -func (*GbpContractAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpContractAddDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - size += 4 // m.StatsIndex - return size -} -func (m *GbpContractAddDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - buf.EncodeUint32(m.StatsIndex) - return buf.Bytes(), nil -} -func (m *GbpContractAddDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - m.StatsIndex = buf.DecodeUint32() - return nil -} - -// GbpContractDetails defines message 'gbp_contract_details'. -type GbpContractDetails struct { - Contract GbpContract `binapi:"gbp_contract,name=contract" json:"contract,omitempty"` -} - -func (m *GbpContractDetails) Reset() { *m = GbpContractDetails{} } -func (*GbpContractDetails) GetMessageName() string { return "gbp_contract_details" } -func (*GbpContractDetails) GetCrcString() string { return "2a18db6e" } -func (*GbpContractDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpContractDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 2 // m.Contract.Scope - size += 2 // m.Contract.Sclass - size += 2 // m.Contract.Dclass - size += 4 // m.Contract.ACLIndex - size += 1 // m.Contract.NEtherTypes - size += 2 * 16 // m.Contract.AllowedEthertypes - size += 1 // m.Contract.NRules - for j2 := 0; j2 < len(m.Contract.Rules); j2++ { - var s2 GbpRule - _ = s2 - if j2 < len(m.Contract.Rules) { - s2 = m.Contract.Rules[j2] - } - size += 4 // s2.Action - size += 4 // s2.NhSet.HashMode - size += 1 // s2.NhSet.NNhs - for j4 := 0; j4 < 8; j4++ { - size += 4 // s2.NhSet.Nhs[j4].IP.Af - size += 1 * 16 // s2.NhSet.Nhs[j4].IP.Un - size += 1 * 6 // s2.NhSet.Nhs[j4].Mac - size += 4 // s2.NhSet.Nhs[j4].BdID - size += 4 // s2.NhSet.Nhs[j4].RdID - } - } - return size -} -func (m *GbpContractDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint16(uint16(m.Contract.Scope)) - buf.EncodeUint16(m.Contract.Sclass) - buf.EncodeUint16(m.Contract.Dclass) - buf.EncodeUint32(m.Contract.ACLIndex) - buf.EncodeUint8(m.Contract.NEtherTypes) - for i := 0; i < 16; i++ { - var x uint16 - if i < len(m.Contract.AllowedEthertypes) { - x = uint16(m.Contract.AllowedEthertypes[i]) - } - buf.EncodeUint16(x) - } - buf.EncodeUint8(uint8(len(m.Contract.Rules))) - for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - var v1 GbpRule // Rules - if j1 < len(m.Contract.Rules) { - v1 = m.Contract.Rules[j1] - } - buf.EncodeUint32(uint32(v1.Action)) - buf.EncodeUint32(uint32(v1.NhSet.HashMode)) - buf.EncodeUint8(v1.NhSet.NNhs) - for j3 := 0; j3 < 8; j3++ { - buf.EncodeUint32(uint32(v1.NhSet.Nhs[j3].IP.Af)) - buf.EncodeBytes(v1.NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], 16) - buf.EncodeBytes(v1.NhSet.Nhs[j3].Mac[:], 6) - buf.EncodeUint32(v1.NhSet.Nhs[j3].BdID) - buf.EncodeUint32(v1.NhSet.Nhs[j3].RdID) - } - } - return buf.Bytes(), nil -} -func (m *GbpContractDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Contract.Scope = GbpScope(buf.DecodeUint16()) - m.Contract.Sclass = buf.DecodeUint16() - m.Contract.Dclass = buf.DecodeUint16() - m.Contract.ACLIndex = buf.DecodeUint32() - m.Contract.NEtherTypes = buf.DecodeUint8() - m.Contract.AllowedEthertypes = make([]uint16, 16) - for i := 0; i < len(m.Contract.AllowedEthertypes); i++ { - m.Contract.AllowedEthertypes[i] = buf.DecodeUint16() - } - m.Contract.NRules = buf.DecodeUint8() - m.Contract.Rules = make([]GbpRule, m.Contract.NRules) - for j1 := 0; j1 < len(m.Contract.Rules); j1++ { - m.Contract.Rules[j1].Action = GbpRuleAction(buf.DecodeUint32()) - m.Contract.Rules[j1].NhSet.HashMode = GbpHashMode(buf.DecodeUint32()) - m.Contract.Rules[j1].NhSet.NNhs = buf.DecodeUint8() - for j3 := 0; j3 < 8; j3++ { - m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Contract.Rules[j1].NhSet.Nhs[j3].IP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - copy(m.Contract.Rules[j1].NhSet.Nhs[j3].Mac[:], buf.DecodeBytes(6)) - m.Contract.Rules[j1].NhSet.Nhs[j3].BdID = buf.DecodeUint32() - m.Contract.Rules[j1].NhSet.Nhs[j3].RdID = buf.DecodeUint32() - } - } - return nil -} - -// GbpContractDump defines message 'gbp_contract_dump'. -type GbpContractDump struct{} - -func (m *GbpContractDump) Reset() { *m = GbpContractDump{} } -func (*GbpContractDump) GetMessageName() string { return "gbp_contract_dump" } -func (*GbpContractDump) GetCrcString() string { return "51077d14" } -func (*GbpContractDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpContractDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpContractDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpContractDump) Unmarshal(b []byte) error { - return nil -} - -// GbpEndpointAdd defines message 'gbp_endpoint_add'. -type GbpEndpointAdd struct { - Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"` -} - -func (m *GbpEndpointAdd) Reset() { *m = GbpEndpointAdd{} } -func (*GbpEndpointAdd) GetMessageName() string { return "gbp_endpoint_add" } -func (*GbpEndpointAdd) GetCrcString() string { return "9ce16d5a" } -func (*GbpEndpointAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointAdd) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Endpoint.SwIfIndex - size += 2 // m.Endpoint.Sclass - size += 4 // m.Endpoint.Flags - size += 1 * 6 // m.Endpoint.Mac - size += 4 // m.Endpoint.Tun.Src.Af - size += 1 * 16 // m.Endpoint.Tun.Src.Un - size += 4 // m.Endpoint.Tun.Dst.Af - size += 1 * 16 // m.Endpoint.Tun.Dst.Un - size += 1 // m.Endpoint.NIps - for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ { - var s2 Address - _ = s2 - if j2 < len(m.Endpoint.Ips) { - s2 = m.Endpoint.Ips[j2] - } - size += 4 // s2.Af - size += 1 * 16 // s2.Un - } - return size -} -func (m *GbpEndpointAdd) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex)) - buf.EncodeUint16(m.Endpoint.Sclass) - buf.EncodeUint32(uint32(m.Endpoint.Flags)) - buf.EncodeBytes(m.Endpoint.Mac[:], 6) - buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16) - buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16) - buf.EncodeUint8(uint8(len(m.Endpoint.Ips))) - for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - var v1 Address // Ips - if j1 < len(m.Endpoint.Ips) { - v1 = m.Endpoint.Ips[j1] - } - buf.EncodeUint32(uint32(v1.Af)) - buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16) - } - return buf.Bytes(), nil -} -func (m *GbpEndpointAdd) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Endpoint.Sclass = buf.DecodeUint16() - m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32()) - copy(m.Endpoint.Mac[:], buf.DecodeBytes(6)) - m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Endpoint.NIps = buf.DecodeUint8() - m.Endpoint.Ips = make([]Address, m.Endpoint.NIps) - for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16)) - } - return nil -} - -// GbpEndpointAddReply defines message 'gbp_endpoint_add_reply'. -type GbpEndpointAddReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` - Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"` -} - -func (m *GbpEndpointAddReply) Reset() { *m = GbpEndpointAddReply{} } -func (*GbpEndpointAddReply) GetMessageName() string { return "gbp_endpoint_add_reply" } -func (*GbpEndpointAddReply) GetCrcString() string { return "1dd3ff3e" } -func (*GbpEndpointAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointAddReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - size += 4 // m.Handle - return size -} -func (m *GbpEndpointAddReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - buf.EncodeUint32(m.Handle) - return buf.Bytes(), nil -} -func (m *GbpEndpointAddReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - m.Handle = buf.DecodeUint32() - return nil -} - -// GbpEndpointDel defines message 'gbp_endpoint_del'. -type GbpEndpointDel struct { - Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"` -} - -func (m *GbpEndpointDel) Reset() { *m = GbpEndpointDel{} } -func (*GbpEndpointDel) GetMessageName() string { return "gbp_endpoint_del" } -func (*GbpEndpointDel) GetCrcString() string { return "b93cd566" } -func (*GbpEndpointDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointDel) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Handle - return size -} -func (m *GbpEndpointDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Handle) - return buf.Bytes(), nil -} -func (m *GbpEndpointDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Handle = buf.DecodeUint32() - return nil -} - -// GbpEndpointDelReply defines message 'gbp_endpoint_del_reply'. -type GbpEndpointDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpEndpointDelReply) Reset() { *m = GbpEndpointDelReply{} } -func (*GbpEndpointDelReply) GetMessageName() string { return "gbp_endpoint_del_reply" } -func (*GbpEndpointDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpEndpointDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpEndpointDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpEndpointDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpEndpointDetails defines message 'gbp_endpoint_details'. -type GbpEndpointDetails struct { - Age float64 `binapi:"f64,name=age" json:"age,omitempty"` - Handle uint32 `binapi:"u32,name=handle" json:"handle,omitempty"` - Endpoint GbpEndpoint `binapi:"gbp_endpoint,name=endpoint" json:"endpoint,omitempty"` -} - -func (m *GbpEndpointDetails) Reset() { *m = GbpEndpointDetails{} } -func (*GbpEndpointDetails) GetMessageName() string { return "gbp_endpoint_details" } -func (*GbpEndpointDetails) GetCrcString() string { return "08aecb60" } -func (*GbpEndpointDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 8 // m.Age - size += 4 // m.Handle - size += 4 // m.Endpoint.SwIfIndex - size += 2 // m.Endpoint.Sclass - size += 4 // m.Endpoint.Flags - size += 1 * 6 // m.Endpoint.Mac - size += 4 // m.Endpoint.Tun.Src.Af - size += 1 * 16 // m.Endpoint.Tun.Src.Un - size += 4 // m.Endpoint.Tun.Dst.Af - size += 1 * 16 // m.Endpoint.Tun.Dst.Un - size += 1 // m.Endpoint.NIps - for j2 := 0; j2 < len(m.Endpoint.Ips); j2++ { - var s2 Address - _ = s2 - if j2 < len(m.Endpoint.Ips) { - s2 = m.Endpoint.Ips[j2] - } - size += 4 // s2.Af - size += 1 * 16 // s2.Un - } - return size -} -func (m *GbpEndpointDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeFloat64(m.Age) - buf.EncodeUint32(m.Handle) - buf.EncodeUint32(uint32(m.Endpoint.SwIfIndex)) - buf.EncodeUint16(m.Endpoint.Sclass) - buf.EncodeUint32(uint32(m.Endpoint.Flags)) - buf.EncodeBytes(m.Endpoint.Mac[:], 6) - buf.EncodeUint32(uint32(m.Endpoint.Tun.Src.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], 16) - buf.EncodeUint32(uint32(m.Endpoint.Tun.Dst.Af)) - buf.EncodeBytes(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], 16) - buf.EncodeUint8(uint8(len(m.Endpoint.Ips))) - for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - var v1 Address // Ips - if j1 < len(m.Endpoint.Ips) { - v1 = m.Endpoint.Ips[j1] - } - buf.EncodeUint32(uint32(v1.Af)) - buf.EncodeBytes(v1.Un.XXX_UnionData[:], 16) - } - return buf.Bytes(), nil -} -func (m *GbpEndpointDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Age = buf.DecodeFloat64() - m.Handle = buf.DecodeUint32() - m.Endpoint.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Endpoint.Sclass = buf.DecodeUint16() - m.Endpoint.Flags = GbpEndpointFlags(buf.DecodeUint32()) - copy(m.Endpoint.Mac[:], buf.DecodeBytes(6)) - m.Endpoint.Tun.Src.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Tun.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Endpoint.Tun.Dst.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Tun.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Endpoint.NIps = buf.DecodeUint8() - m.Endpoint.Ips = make([]Address, m.Endpoint.NIps) - for j1 := 0; j1 < len(m.Endpoint.Ips); j1++ { - m.Endpoint.Ips[j1].Af = AddressFamily(buf.DecodeUint32()) - copy(m.Endpoint.Ips[j1].Un.XXX_UnionData[:], buf.DecodeBytes(16)) - } - return nil -} - -// GbpEndpointDump defines message 'gbp_endpoint_dump'. -type GbpEndpointDump struct{} - -func (m *GbpEndpointDump) Reset() { *m = GbpEndpointDump{} } -func (*GbpEndpointDump) GetMessageName() string { return "gbp_endpoint_dump" } -func (*GbpEndpointDump) GetCrcString() string { return "51077d14" } -func (*GbpEndpointDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpEndpointDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpEndpointDump) Unmarshal(b []byte) error { - return nil -} - -// GbpEndpointGroupAdd defines message 'gbp_endpoint_group_add'. -type GbpEndpointGroupAdd struct { - Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"` -} - -func (m *GbpEndpointGroupAdd) Reset() { *m = GbpEndpointGroupAdd{} } -func (*GbpEndpointGroupAdd) GetMessageName() string { return "gbp_endpoint_group_add" } -func (*GbpEndpointGroupAdd) GetCrcString() string { return "8e0f4054" } -func (*GbpEndpointGroupAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointGroupAdd) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Epg.Vnid - size += 2 // m.Epg.Sclass - size += 4 // m.Epg.BdID - size += 4 // m.Epg.RdID - size += 4 // m.Epg.UplinkSwIfIndex - size += 4 // m.Epg.Retention.RemoteEpTimeout - return size -} -func (m *GbpEndpointGroupAdd) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Epg.Vnid) - buf.EncodeUint16(m.Epg.Sclass) - buf.EncodeUint32(m.Epg.BdID) - buf.EncodeUint32(m.Epg.RdID) - buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex)) - buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupAdd) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Epg.Vnid = buf.DecodeUint32() - m.Epg.Sclass = buf.DecodeUint16() - m.Epg.BdID = buf.DecodeUint32() - m.Epg.RdID = buf.DecodeUint32() - m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32() - return nil -} - -// GbpEndpointGroupAddReply defines message 'gbp_endpoint_group_add_reply'. -type GbpEndpointGroupAddReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpEndpointGroupAddReply) Reset() { *m = GbpEndpointGroupAddReply{} } -func (*GbpEndpointGroupAddReply) GetMessageName() string { return "gbp_endpoint_group_add_reply" } -func (*GbpEndpointGroupAddReply) GetCrcString() string { return "e8d4e804" } -func (*GbpEndpointGroupAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointGroupAddReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpEndpointGroupAddReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupAddReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpEndpointGroupDel defines message 'gbp_endpoint_group_del'. -type GbpEndpointGroupDel struct { - Sclass uint16 `binapi:"u16,name=sclass" json:"sclass,omitempty"` -} - -func (m *GbpEndpointGroupDel) Reset() { *m = GbpEndpointGroupDel{} } -func (*GbpEndpointGroupDel) GetMessageName() string { return "gbp_endpoint_group_del" } -func (*GbpEndpointGroupDel) GetCrcString() string { return "3436b8b7" } -func (*GbpEndpointGroupDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointGroupDel) Size() (size int) { - if m == nil { - return 0 - } - size += 2 // m.Sclass - return size -} -func (m *GbpEndpointGroupDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint16(m.Sclass) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Sclass = buf.DecodeUint16() - return nil -} - -// GbpEndpointGroupDelReply defines message 'gbp_endpoint_group_del_reply'. -type GbpEndpointGroupDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpEndpointGroupDelReply) Reset() { *m = GbpEndpointGroupDelReply{} } -func (*GbpEndpointGroupDelReply) GetMessageName() string { return "gbp_endpoint_group_del_reply" } -func (*GbpEndpointGroupDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpEndpointGroupDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointGroupDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpEndpointGroupDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpEndpointGroupDetails defines message 'gbp_endpoint_group_details'. -type GbpEndpointGroupDetails struct { - Epg GbpEndpointGroup `binapi:"gbp_endpoint_group,name=epg" json:"epg,omitempty"` -} - -func (m *GbpEndpointGroupDetails) Reset() { *m = GbpEndpointGroupDetails{} } -func (*GbpEndpointGroupDetails) GetMessageName() string { return "gbp_endpoint_group_details" } -func (*GbpEndpointGroupDetails) GetCrcString() string { return "8f38292c" } -func (*GbpEndpointGroupDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpEndpointGroupDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Epg.Vnid - size += 2 // m.Epg.Sclass - size += 4 // m.Epg.BdID - size += 4 // m.Epg.RdID - size += 4 // m.Epg.UplinkSwIfIndex - size += 4 // m.Epg.Retention.RemoteEpTimeout - return size -} -func (m *GbpEndpointGroupDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Epg.Vnid) - buf.EncodeUint16(m.Epg.Sclass) - buf.EncodeUint32(m.Epg.BdID) - buf.EncodeUint32(m.Epg.RdID) - buf.EncodeUint32(uint32(m.Epg.UplinkSwIfIndex)) - buf.EncodeUint32(m.Epg.Retention.RemoteEpTimeout) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Epg.Vnid = buf.DecodeUint32() - m.Epg.Sclass = buf.DecodeUint16() - m.Epg.BdID = buf.DecodeUint32() - m.Epg.RdID = buf.DecodeUint32() - m.Epg.UplinkSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Epg.Retention.RemoteEpTimeout = buf.DecodeUint32() - return nil -} - -// GbpEndpointGroupDump defines message 'gbp_endpoint_group_dump'. -type GbpEndpointGroupDump struct{} - -func (m *GbpEndpointGroupDump) Reset() { *m = GbpEndpointGroupDump{} } -func (*GbpEndpointGroupDump) GetMessageName() string { return "gbp_endpoint_group_dump" } -func (*GbpEndpointGroupDump) GetCrcString() string { return "51077d14" } -func (*GbpEndpointGroupDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpEndpointGroupDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpEndpointGroupDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpEndpointGroupDump) Unmarshal(b []byte) error { - return nil -} - -// GbpExtItfAddDel defines message 'gbp_ext_itf_add_del'. -type GbpExtItfAddDel struct { - IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` - ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"` -} - -func (m *GbpExtItfAddDel) Reset() { *m = GbpExtItfAddDel{} } -func (*GbpExtItfAddDel) GetMessageName() string { return "gbp_ext_itf_add_del" } -func (*GbpExtItfAddDel) GetCrcString() string { return "12ed5700" } -func (*GbpExtItfAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpExtItfAddDel) Size() (size int) { - if m == nil { - return 0 - } - size += 1 // m.IsAdd - size += 4 // m.ExtItf.SwIfIndex - size += 4 // m.ExtItf.BdID - size += 4 // m.ExtItf.RdID - size += 4 // m.ExtItf.Flags - return size -} -func (m *GbpExtItfAddDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex)) - buf.EncodeUint32(m.ExtItf.BdID) - buf.EncodeUint32(m.ExtItf.RdID) - buf.EncodeUint32(uint32(m.ExtItf.Flags)) - return buf.Bytes(), nil -} -func (m *GbpExtItfAddDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.IsAdd = buf.DecodeBool() - m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.ExtItf.BdID = buf.DecodeUint32() - m.ExtItf.RdID = buf.DecodeUint32() - m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32()) - return nil -} - -// GbpExtItfAddDelReply defines message 'gbp_ext_itf_add_del_reply'. -type GbpExtItfAddDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpExtItfAddDelReply) Reset() { *m = GbpExtItfAddDelReply{} } -func (*GbpExtItfAddDelReply) GetMessageName() string { return "gbp_ext_itf_add_del_reply" } -func (*GbpExtItfAddDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpExtItfAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpExtItfAddDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpExtItfAddDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpExtItfAddDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpExtItfDetails defines message 'gbp_ext_itf_details'. -type GbpExtItfDetails struct { - ExtItf GbpExtItf `binapi:"gbp_ext_itf,name=ext_itf" json:"ext_itf,omitempty"` -} - -func (m *GbpExtItfDetails) Reset() { *m = GbpExtItfDetails{} } -func (*GbpExtItfDetails) GetMessageName() string { return "gbp_ext_itf_details" } -func (*GbpExtItfDetails) GetCrcString() string { return "408a45c0" } -func (*GbpExtItfDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpExtItfDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.ExtItf.SwIfIndex - size += 4 // m.ExtItf.BdID - size += 4 // m.ExtItf.RdID - size += 4 // m.ExtItf.Flags - return size -} -func (m *GbpExtItfDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(uint32(m.ExtItf.SwIfIndex)) - buf.EncodeUint32(m.ExtItf.BdID) - buf.EncodeUint32(m.ExtItf.RdID) - buf.EncodeUint32(uint32(m.ExtItf.Flags)) - return buf.Bytes(), nil -} -func (m *GbpExtItfDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.ExtItf.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.ExtItf.BdID = buf.DecodeUint32() - m.ExtItf.RdID = buf.DecodeUint32() - m.ExtItf.Flags = GbpExtItfFlags(buf.DecodeUint32()) - return nil -} - -// GbpExtItfDump defines message 'gbp_ext_itf_dump'. -type GbpExtItfDump struct{} - -func (m *GbpExtItfDump) Reset() { *m = GbpExtItfDump{} } -func (*GbpExtItfDump) GetMessageName() string { return "gbp_ext_itf_dump" } -func (*GbpExtItfDump) GetCrcString() string { return "51077d14" } -func (*GbpExtItfDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpExtItfDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpExtItfDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpExtItfDump) Unmarshal(b []byte) error { - return nil -} - -// GbpRecircAddDel defines message 'gbp_recirc_add_del'. -type GbpRecircAddDel struct { - IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` - Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"` -} - -func (m *GbpRecircAddDel) Reset() { *m = GbpRecircAddDel{} } -func (*GbpRecircAddDel) GetMessageName() string { return "gbp_recirc_add_del" } -func (*GbpRecircAddDel) GetCrcString() string { return "718c69c3" } -func (*GbpRecircAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpRecircAddDel) Size() (size int) { - if m == nil { - return 0 - } - size += 1 // m.IsAdd - size += 4 // m.Recirc.SwIfIndex - size += 2 // m.Recirc.Sclass - size += 1 // m.Recirc.IsExt - return size -} -func (m *GbpRecircAddDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(uint32(m.Recirc.SwIfIndex)) - buf.EncodeUint16(m.Recirc.Sclass) - buf.EncodeBool(m.Recirc.IsExt) - return buf.Bytes(), nil -} -func (m *GbpRecircAddDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.IsAdd = buf.DecodeBool() - m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Recirc.Sclass = buf.DecodeUint16() - m.Recirc.IsExt = buf.DecodeBool() - return nil -} - -// GbpRecircAddDelReply defines message 'gbp_recirc_add_del_reply'. -type GbpRecircAddDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpRecircAddDelReply) Reset() { *m = GbpRecircAddDelReply{} } -func (*GbpRecircAddDelReply) GetMessageName() string { return "gbp_recirc_add_del_reply" } -func (*GbpRecircAddDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpRecircAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRecircAddDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpRecircAddDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpRecircAddDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpRecircDetails defines message 'gbp_recirc_details'. -type GbpRecircDetails struct { - Recirc GbpRecirc `binapi:"gbp_recirc,name=recirc" json:"recirc,omitempty"` -} - -func (m *GbpRecircDetails) Reset() { *m = GbpRecircDetails{} } -func (*GbpRecircDetails) GetMessageName() string { return "gbp_recirc_details" } -func (*GbpRecircDetails) GetCrcString() string { return "66ecc42e" } -func (*GbpRecircDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRecircDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Recirc.SwIfIndex - size += 2 // m.Recirc.Sclass - size += 1 // m.Recirc.IsExt - return size -} -func (m *GbpRecircDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(uint32(m.Recirc.SwIfIndex)) - buf.EncodeUint16(m.Recirc.Sclass) - buf.EncodeBool(m.Recirc.IsExt) - return buf.Bytes(), nil -} -func (m *GbpRecircDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Recirc.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Recirc.Sclass = buf.DecodeUint16() - m.Recirc.IsExt = buf.DecodeBool() - return nil -} - -// GbpRecircDump defines message 'gbp_recirc_dump'. -type GbpRecircDump struct{} - -func (m *GbpRecircDump) Reset() { *m = GbpRecircDump{} } -func (*GbpRecircDump) GetMessageName() string { return "gbp_recirc_dump" } -func (*GbpRecircDump) GetCrcString() string { return "51077d14" } -func (*GbpRecircDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpRecircDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpRecircDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpRecircDump) Unmarshal(b []byte) error { - return nil -} - -// GbpRouteDomainAdd defines message 'gbp_route_domain_add'. -type GbpRouteDomainAdd struct { - Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"` -} - -func (m *GbpRouteDomainAdd) Reset() { *m = GbpRouteDomainAdd{} } -func (*GbpRouteDomainAdd) GetMessageName() string { return "gbp_route_domain_add" } -func (*GbpRouteDomainAdd) GetCrcString() string { return "2d0afe38" } -func (*GbpRouteDomainAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpRouteDomainAdd) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Rd.RdID - size += 4 // m.Rd.IP4TableID - size += 4 // m.Rd.IP6TableID - size += 4 // m.Rd.IP4UuSwIfIndex - size += 4 // m.Rd.IP6UuSwIfIndex - size += 2 // m.Rd.Scope - return size -} -func (m *GbpRouteDomainAdd) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Rd.RdID) - buf.EncodeUint32(m.Rd.IP4TableID) - buf.EncodeUint32(m.Rd.IP6TableID) - buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex)) - buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex)) - buf.EncodeUint16(uint16(m.Rd.Scope)) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainAdd) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Rd.RdID = buf.DecodeUint32() - m.Rd.IP4TableID = buf.DecodeUint32() - m.Rd.IP6TableID = buf.DecodeUint32() - m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Rd.Scope = GbpScope(buf.DecodeUint16()) - return nil -} - -// GbpRouteDomainAddReply defines message 'gbp_route_domain_add_reply'. -type GbpRouteDomainAddReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpRouteDomainAddReply) Reset() { *m = GbpRouteDomainAddReply{} } -func (*GbpRouteDomainAddReply) GetMessageName() string { return "gbp_route_domain_add_reply" } -func (*GbpRouteDomainAddReply) GetCrcString() string { return "e8d4e804" } -func (*GbpRouteDomainAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRouteDomainAddReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpRouteDomainAddReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainAddReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpRouteDomainDel defines message 'gbp_route_domain_del'. -type GbpRouteDomainDel struct { - RdID uint32 `binapi:"u32,name=rd_id" json:"rd_id,omitempty"` -} - -func (m *GbpRouteDomainDel) Reset() { *m = GbpRouteDomainDel{} } -func (*GbpRouteDomainDel) GetMessageName() string { return "gbp_route_domain_del" } -func (*GbpRouteDomainDel) GetCrcString() string { return "bee4edcd" } -func (*GbpRouteDomainDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpRouteDomainDel) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.RdID - return size -} -func (m *GbpRouteDomainDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.RdID) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.RdID = buf.DecodeUint32() - return nil -} - -// GbpRouteDomainDelReply defines message 'gbp_route_domain_del_reply'. -type GbpRouteDomainDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpRouteDomainDelReply) Reset() { *m = GbpRouteDomainDelReply{} } -func (*GbpRouteDomainDelReply) GetMessageName() string { return "gbp_route_domain_del_reply" } -func (*GbpRouteDomainDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpRouteDomainDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRouteDomainDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpRouteDomainDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpRouteDomainDetails defines message 'gbp_route_domain_details'. -type GbpRouteDomainDetails struct { - Rd GbpRouteDomain `binapi:"gbp_route_domain,name=rd" json:"rd,omitempty"` -} - -func (m *GbpRouteDomainDetails) Reset() { *m = GbpRouteDomainDetails{} } -func (*GbpRouteDomainDetails) GetMessageName() string { return "gbp_route_domain_details" } -func (*GbpRouteDomainDetails) GetCrcString() string { return "8ab11375" } -func (*GbpRouteDomainDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRouteDomainDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Rd.RdID - size += 4 // m.Rd.IP4TableID - size += 4 // m.Rd.IP6TableID - size += 4 // m.Rd.IP4UuSwIfIndex - size += 4 // m.Rd.IP6UuSwIfIndex - size += 2 // m.Rd.Scope - return size -} -func (m *GbpRouteDomainDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Rd.RdID) - buf.EncodeUint32(m.Rd.IP4TableID) - buf.EncodeUint32(m.Rd.IP6TableID) - buf.EncodeUint32(uint32(m.Rd.IP4UuSwIfIndex)) - buf.EncodeUint32(uint32(m.Rd.IP6UuSwIfIndex)) - buf.EncodeUint16(uint16(m.Rd.Scope)) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Rd.RdID = buf.DecodeUint32() - m.Rd.IP4TableID = buf.DecodeUint32() - m.Rd.IP6TableID = buf.DecodeUint32() - m.Rd.IP4UuSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Rd.IP6UuSwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Rd.Scope = GbpScope(buf.DecodeUint16()) - return nil -} - -// GbpRouteDomainDump defines message 'gbp_route_domain_dump'. -type GbpRouteDomainDump struct{} - -func (m *GbpRouteDomainDump) Reset() { *m = GbpRouteDomainDump{} } -func (*GbpRouteDomainDump) GetMessageName() string { return "gbp_route_domain_dump" } -func (*GbpRouteDomainDump) GetCrcString() string { return "51077d14" } -func (*GbpRouteDomainDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpRouteDomainDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpRouteDomainDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainDump) Unmarshal(b []byte) error { - return nil -} - -// GbpRouteDomainDumpReply defines message 'gbp_route_domain_dump_reply'. -type GbpRouteDomainDumpReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpRouteDomainDumpReply) Reset() { *m = GbpRouteDomainDumpReply{} } -func (*GbpRouteDomainDumpReply) GetMessageName() string { return "gbp_route_domain_dump_reply" } -func (*GbpRouteDomainDumpReply) GetCrcString() string { return "e8d4e804" } -func (*GbpRouteDomainDumpReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpRouteDomainDumpReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpRouteDomainDumpReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpRouteDomainDumpReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpSubnetAddDel defines message 'gbp_subnet_add_del'. -type GbpSubnetAddDel struct { - IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` - Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"` -} - -func (m *GbpSubnetAddDel) Reset() { *m = GbpSubnetAddDel{} } -func (*GbpSubnetAddDel) GetMessageName() string { return "gbp_subnet_add_del" } -func (*GbpSubnetAddDel) GetCrcString() string { return "888aca35" } -func (*GbpSubnetAddDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpSubnetAddDel) Size() (size int) { - if m == nil { - return 0 - } - size += 1 // m.IsAdd - size += 4 // m.Subnet.RdID - size += 4 // m.Subnet.SwIfIndex - size += 2 // m.Subnet.Sclass - size += 4 // m.Subnet.Type - size += 4 // m.Subnet.Prefix.Address.Af - size += 1 * 16 // m.Subnet.Prefix.Address.Un - size += 1 // m.Subnet.Prefix.Len - return size -} -func (m *GbpSubnetAddDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeBool(m.IsAdd) - buf.EncodeUint32(m.Subnet.RdID) - buf.EncodeUint32(uint32(m.Subnet.SwIfIndex)) - buf.EncodeUint16(m.Subnet.Sclass) - buf.EncodeUint32(uint32(m.Subnet.Type)) - buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af)) - buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16) - buf.EncodeUint8(m.Subnet.Prefix.Len) - return buf.Bytes(), nil -} -func (m *GbpSubnetAddDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.IsAdd = buf.DecodeBool() - m.Subnet.RdID = buf.DecodeUint32() - m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Subnet.Sclass = buf.DecodeUint16() - m.Subnet.Type = GbpSubnetType(buf.DecodeUint32()) - m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Subnet.Prefix.Len = buf.DecodeUint8() - return nil -} - -// GbpSubnetAddDelReply defines message 'gbp_subnet_add_del_reply'. -type GbpSubnetAddDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpSubnetAddDelReply) Reset() { *m = GbpSubnetAddDelReply{} } -func (*GbpSubnetAddDelReply) GetMessageName() string { return "gbp_subnet_add_del_reply" } -func (*GbpSubnetAddDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpSubnetAddDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpSubnetAddDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpSubnetAddDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpSubnetAddDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpSubnetDetails defines message 'gbp_subnet_details'. -type GbpSubnetDetails struct { - Subnet GbpSubnet `binapi:"gbp_subnet,name=subnet" json:"subnet,omitempty"` -} - -func (m *GbpSubnetDetails) Reset() { *m = GbpSubnetDetails{} } -func (*GbpSubnetDetails) GetMessageName() string { return "gbp_subnet_details" } -func (*GbpSubnetDetails) GetCrcString() string { return "4ed84156" } -func (*GbpSubnetDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpSubnetDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Subnet.RdID - size += 4 // m.Subnet.SwIfIndex - size += 2 // m.Subnet.Sclass - size += 4 // m.Subnet.Type - size += 4 // m.Subnet.Prefix.Address.Af - size += 1 * 16 // m.Subnet.Prefix.Address.Un - size += 1 // m.Subnet.Prefix.Len - return size -} -func (m *GbpSubnetDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Subnet.RdID) - buf.EncodeUint32(uint32(m.Subnet.SwIfIndex)) - buf.EncodeUint16(m.Subnet.Sclass) - buf.EncodeUint32(uint32(m.Subnet.Type)) - buf.EncodeUint32(uint32(m.Subnet.Prefix.Address.Af)) - buf.EncodeBytes(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], 16) - buf.EncodeUint8(m.Subnet.Prefix.Len) - return buf.Bytes(), nil -} -func (m *GbpSubnetDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Subnet.RdID = buf.DecodeUint32() - m.Subnet.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - m.Subnet.Sclass = buf.DecodeUint16() - m.Subnet.Type = GbpSubnetType(buf.DecodeUint32()) - m.Subnet.Prefix.Address.Af = AddressFamily(buf.DecodeUint32()) - copy(m.Subnet.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16)) - m.Subnet.Prefix.Len = buf.DecodeUint8() - return nil -} - -// GbpSubnetDump defines message 'gbp_subnet_dump'. -type GbpSubnetDump struct{} - -func (m *GbpSubnetDump) Reset() { *m = GbpSubnetDump{} } -func (*GbpSubnetDump) GetMessageName() string { return "gbp_subnet_dump" } -func (*GbpSubnetDump) GetCrcString() string { return "51077d14" } -func (*GbpSubnetDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpSubnetDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpSubnetDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpSubnetDump) Unmarshal(b []byte) error { - return nil -} - -// GbpVxlanTunnelAdd defines message 'gbp_vxlan_tunnel_add'. -type GbpVxlanTunnelAdd struct { - Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"` -} - -func (m *GbpVxlanTunnelAdd) Reset() { *m = GbpVxlanTunnelAdd{} } -func (*GbpVxlanTunnelAdd) GetMessageName() string { return "gbp_vxlan_tunnel_add" } -func (*GbpVxlanTunnelAdd) GetCrcString() string { return "3e070b35" } -func (*GbpVxlanTunnelAdd) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpVxlanTunnelAdd) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Tunnel.Vni - size += 4 // m.Tunnel.Mode - size += 4 // m.Tunnel.BdRdID - size += 1 * 4 // m.Tunnel.Src - return size -} -func (m *GbpVxlanTunnelAdd) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Tunnel.Vni) - buf.EncodeUint32(uint32(m.Tunnel.Mode)) - buf.EncodeUint32(m.Tunnel.BdRdID) - buf.EncodeBytes(m.Tunnel.Src[:], 4) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelAdd) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Tunnel.Vni = buf.DecodeUint32() - m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32()) - m.Tunnel.BdRdID = buf.DecodeUint32() - copy(m.Tunnel.Src[:], buf.DecodeBytes(4)) - return nil -} - -// GbpVxlanTunnelAddReply defines message 'gbp_vxlan_tunnel_add_reply'. -type GbpVxlanTunnelAddReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` - SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` -} - -func (m *GbpVxlanTunnelAddReply) Reset() { *m = GbpVxlanTunnelAddReply{} } -func (*GbpVxlanTunnelAddReply) GetMessageName() string { return "gbp_vxlan_tunnel_add_reply" } -func (*GbpVxlanTunnelAddReply) GetCrcString() string { return "5383d31f" } -func (*GbpVxlanTunnelAddReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpVxlanTunnelAddReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - size += 4 // m.SwIfIndex - return size -} -func (m *GbpVxlanTunnelAddReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - buf.EncodeUint32(uint32(m.SwIfIndex)) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelAddReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - m.SwIfIndex = InterfaceIndex(buf.DecodeUint32()) - return nil -} - -// GbpVxlanTunnelDel defines message 'gbp_vxlan_tunnel_del'. -type GbpVxlanTunnelDel struct { - Vni uint32 `binapi:"u32,name=vni" json:"vni,omitempty"` -} - -func (m *GbpVxlanTunnelDel) Reset() { *m = GbpVxlanTunnelDel{} } -func (*GbpVxlanTunnelDel) GetMessageName() string { return "gbp_vxlan_tunnel_del" } -func (*GbpVxlanTunnelDel) GetCrcString() string { return "8d1f2fe9" } -func (*GbpVxlanTunnelDel) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpVxlanTunnelDel) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Vni - return size -} -func (m *GbpVxlanTunnelDel) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Vni) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelDel) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Vni = buf.DecodeUint32() - return nil -} - -// GbpVxlanTunnelDelReply defines message 'gbp_vxlan_tunnel_del_reply'. -type GbpVxlanTunnelDelReply struct { - Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` -} - -func (m *GbpVxlanTunnelDelReply) Reset() { *m = GbpVxlanTunnelDelReply{} } -func (*GbpVxlanTunnelDelReply) GetMessageName() string { return "gbp_vxlan_tunnel_del_reply" } -func (*GbpVxlanTunnelDelReply) GetCrcString() string { return "e8d4e804" } -func (*GbpVxlanTunnelDelReply) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpVxlanTunnelDelReply) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Retval - return size -} -func (m *GbpVxlanTunnelDelReply) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeInt32(m.Retval) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelDelReply) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Retval = buf.DecodeInt32() - return nil -} - -// GbpVxlanTunnelDetails defines message 'gbp_vxlan_tunnel_details'. -type GbpVxlanTunnelDetails struct { - Tunnel GbpVxlanTunnel `binapi:"gbp_vxlan_tunnel,name=tunnel" json:"tunnel,omitempty"` -} - -func (m *GbpVxlanTunnelDetails) Reset() { *m = GbpVxlanTunnelDetails{} } -func (*GbpVxlanTunnelDetails) GetMessageName() string { return "gbp_vxlan_tunnel_details" } -func (*GbpVxlanTunnelDetails) GetCrcString() string { return "65c6c818" } -func (*GbpVxlanTunnelDetails) GetMessageType() api.MessageType { - return api.ReplyMessage -} - -func (m *GbpVxlanTunnelDetails) Size() (size int) { - if m == nil { - return 0 - } - size += 4 // m.Tunnel.Vni - size += 4 // m.Tunnel.Mode - size += 4 // m.Tunnel.BdRdID - size += 1 * 4 // m.Tunnel.Src - return size -} -func (m *GbpVxlanTunnelDetails) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - buf.EncodeUint32(m.Tunnel.Vni) - buf.EncodeUint32(uint32(m.Tunnel.Mode)) - buf.EncodeUint32(m.Tunnel.BdRdID) - buf.EncodeBytes(m.Tunnel.Src[:], 4) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelDetails) Unmarshal(b []byte) error { - buf := codec.NewBuffer(b) - m.Tunnel.Vni = buf.DecodeUint32() - m.Tunnel.Mode = GbpVxlanTunnelMode(buf.DecodeUint32()) - m.Tunnel.BdRdID = buf.DecodeUint32() - copy(m.Tunnel.Src[:], buf.DecodeBytes(4)) - return nil -} - -// GbpVxlanTunnelDump defines message 'gbp_vxlan_tunnel_dump'. -type GbpVxlanTunnelDump struct{} - -func (m *GbpVxlanTunnelDump) Reset() { *m = GbpVxlanTunnelDump{} } -func (*GbpVxlanTunnelDump) GetMessageName() string { return "gbp_vxlan_tunnel_dump" } -func (*GbpVxlanTunnelDump) GetCrcString() string { return "51077d14" } -func (*GbpVxlanTunnelDump) GetMessageType() api.MessageType { - return api.RequestMessage -} - -func (m *GbpVxlanTunnelDump) Size() (size int) { - if m == nil { - return 0 - } - return size -} -func (m *GbpVxlanTunnelDump) Marshal(b []byte) ([]byte, error) { - if b == nil { - b = make([]byte, m.Size()) - } - buf := codec.NewBuffer(b) - return buf.Bytes(), nil -} -func (m *GbpVxlanTunnelDump) Unmarshal(b []byte) error { - return nil -} - -func init() { file_gbp_binapi_init() } -func file_gbp_binapi_init() { - api.RegisterMessage((*GbpBridgeDomainAdd)(nil), "gbp_bridge_domain_add_8454bfdf") - api.RegisterMessage((*GbpBridgeDomainAddReply)(nil), "gbp_bridge_domain_add_reply_e8d4e804") - api.RegisterMessage((*GbpBridgeDomainDel)(nil), "gbp_bridge_domain_del_c25fdce6") - api.RegisterMessage((*GbpBridgeDomainDelReply)(nil), "gbp_bridge_domain_del_reply_e8d4e804") - api.RegisterMessage((*GbpBridgeDomainDetails)(nil), "gbp_bridge_domain_details_2acd15f9") - api.RegisterMessage((*GbpBridgeDomainDump)(nil), "gbp_bridge_domain_dump_51077d14") - api.RegisterMessage((*GbpBridgeDomainDumpReply)(nil), "gbp_bridge_domain_dump_reply_e8d4e804") - api.RegisterMessage((*GbpContractAddDel)(nil), "gbp_contract_add_del_553e275b") - api.RegisterMessage((*GbpContractAddDelReply)(nil), "gbp_contract_add_del_reply_1992deab") - api.RegisterMessage((*GbpContractDetails)(nil), "gbp_contract_details_2a18db6e") - api.RegisterMessage((*GbpContractDump)(nil), "gbp_contract_dump_51077d14") - api.RegisterMessage((*GbpEndpointAdd)(nil), "gbp_endpoint_add_9ce16d5a") - api.RegisterMessage((*GbpEndpointAddReply)(nil), "gbp_endpoint_add_reply_1dd3ff3e") - api.RegisterMessage((*GbpEndpointDel)(nil), "gbp_endpoint_del_b93cd566") - api.RegisterMessage((*GbpEndpointDelReply)(nil), "gbp_endpoint_del_reply_e8d4e804") - api.RegisterMessage((*GbpEndpointDetails)(nil), "gbp_endpoint_details_08aecb60") - api.RegisterMessage((*GbpEndpointDump)(nil), "gbp_endpoint_dump_51077d14") - api.RegisterMessage((*GbpEndpointGroupAdd)(nil), "gbp_endpoint_group_add_8e0f4054") - api.RegisterMessage((*GbpEndpointGroupAddReply)(nil), "gbp_endpoint_group_add_reply_e8d4e804") - api.RegisterMessage((*GbpEndpointGroupDel)(nil), "gbp_endpoint_group_del_3436b8b7") - api.RegisterMessage((*GbpEndpointGroupDelReply)(nil), "gbp_endpoint_group_del_reply_e8d4e804") - api.RegisterMessage((*GbpEndpointGroupDetails)(nil), "gbp_endpoint_group_details_8f38292c") - api.RegisterMessage((*GbpEndpointGroupDump)(nil), "gbp_endpoint_group_dump_51077d14") - api.RegisterMessage((*GbpExtItfAddDel)(nil), "gbp_ext_itf_add_del_12ed5700") - api.RegisterMessage((*GbpExtItfAddDelReply)(nil), "gbp_ext_itf_add_del_reply_e8d4e804") - api.RegisterMessage((*GbpExtItfDetails)(nil), "gbp_ext_itf_details_408a45c0") - api.RegisterMessage((*GbpExtItfDump)(nil), "gbp_ext_itf_dump_51077d14") - api.RegisterMessage((*GbpRecircAddDel)(nil), "gbp_recirc_add_del_718c69c3") - api.RegisterMessage((*GbpRecircAddDelReply)(nil), "gbp_recirc_add_del_reply_e8d4e804") - api.RegisterMessage((*GbpRecircDetails)(nil), "gbp_recirc_details_66ecc42e") - api.RegisterMessage((*GbpRecircDump)(nil), "gbp_recirc_dump_51077d14") - api.RegisterMessage((*GbpRouteDomainAdd)(nil), "gbp_route_domain_add_2d0afe38") - api.RegisterMessage((*GbpRouteDomainAddReply)(nil), "gbp_route_domain_add_reply_e8d4e804") - api.RegisterMessage((*GbpRouteDomainDel)(nil), "gbp_route_domain_del_bee4edcd") - api.RegisterMessage((*GbpRouteDomainDelReply)(nil), "gbp_route_domain_del_reply_e8d4e804") - api.RegisterMessage((*GbpRouteDomainDetails)(nil), "gbp_route_domain_details_8ab11375") - api.RegisterMessage((*GbpRouteDomainDump)(nil), "gbp_route_domain_dump_51077d14") - api.RegisterMessage((*GbpRouteDomainDumpReply)(nil), "gbp_route_domain_dump_reply_e8d4e804") - api.RegisterMessage((*GbpSubnetAddDel)(nil), "gbp_subnet_add_del_888aca35") - api.RegisterMessage((*GbpSubnetAddDelReply)(nil), "gbp_subnet_add_del_reply_e8d4e804") - api.RegisterMessage((*GbpSubnetDetails)(nil), "gbp_subnet_details_4ed84156") - api.RegisterMessage((*GbpSubnetDump)(nil), "gbp_subnet_dump_51077d14") - api.RegisterMessage((*GbpVxlanTunnelAdd)(nil), "gbp_vxlan_tunnel_add_3e070b35") - api.RegisterMessage((*GbpVxlanTunnelAddReply)(nil), "gbp_vxlan_tunnel_add_reply_5383d31f") - api.RegisterMessage((*GbpVxlanTunnelDel)(nil), "gbp_vxlan_tunnel_del_8d1f2fe9") - api.RegisterMessage((*GbpVxlanTunnelDelReply)(nil), "gbp_vxlan_tunnel_del_reply_e8d4e804") - api.RegisterMessage((*GbpVxlanTunnelDetails)(nil), "gbp_vxlan_tunnel_details_65c6c818") - api.RegisterMessage((*GbpVxlanTunnelDump)(nil), "gbp_vxlan_tunnel_dump_51077d14") -} - -// Messages returns list of all messages in this module. -func AllMessages() []api.Message { - return []api.Message{ - (*GbpBridgeDomainAdd)(nil), - (*GbpBridgeDomainAddReply)(nil), - (*GbpBridgeDomainDel)(nil), - (*GbpBridgeDomainDelReply)(nil), - (*GbpBridgeDomainDetails)(nil), - (*GbpBridgeDomainDump)(nil), - (*GbpBridgeDomainDumpReply)(nil), - (*GbpContractAddDel)(nil), - (*GbpContractAddDelReply)(nil), - (*GbpContractDetails)(nil), - (*GbpContractDump)(nil), - (*GbpEndpointAdd)(nil), - (*GbpEndpointAddReply)(nil), - (*GbpEndpointDel)(nil), - (*GbpEndpointDelReply)(nil), - (*GbpEndpointDetails)(nil), - (*GbpEndpointDump)(nil), - (*GbpEndpointGroupAdd)(nil), - (*GbpEndpointGroupAddReply)(nil), - (*GbpEndpointGroupDel)(nil), - (*GbpEndpointGroupDelReply)(nil), - (*GbpEndpointGroupDetails)(nil), - (*GbpEndpointGroupDump)(nil), - (*GbpExtItfAddDel)(nil), - (*GbpExtItfAddDelReply)(nil), - (*GbpExtItfDetails)(nil), - (*GbpExtItfDump)(nil), - (*GbpRecircAddDel)(nil), - (*GbpRecircAddDelReply)(nil), - (*GbpRecircDetails)(nil), - (*GbpRecircDump)(nil), - (*GbpRouteDomainAdd)(nil), - (*GbpRouteDomainAddReply)(nil), - (*GbpRouteDomainDel)(nil), - (*GbpRouteDomainDelReply)(nil), - (*GbpRouteDomainDetails)(nil), - (*GbpRouteDomainDump)(nil), - (*GbpRouteDomainDumpReply)(nil), - (*GbpSubnetAddDel)(nil), - (*GbpSubnetAddDelReply)(nil), - (*GbpSubnetDetails)(nil), - (*GbpSubnetDump)(nil), - (*GbpVxlanTunnelAdd)(nil), - (*GbpVxlanTunnelAddReply)(nil), - (*GbpVxlanTunnelDel)(nil), - (*GbpVxlanTunnelDelReply)(nil), - (*GbpVxlanTunnelDetails)(nil), - (*GbpVxlanTunnelDump)(nil), - } -} |