github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/lb_types/lb_types.ba.go (about) 1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT. 2 // versions: 3 // binapi-generator: v0.4.0-dev 4 // VPP: 23.02-rc0~189-g57127b32a 5 // source: /usr/share/vpp/api/plugins/lb_types.api.json 6 7 // Package lb_types contains generated bindings for API file lb_types.api. 8 // 9 // Contents: 10 // 5 enums 11 // 1 struct 12 // 13 package lb_types 14 15 import ( 16 "strconv" 17 18 api "git.fd.io/govpp.git/api" 19 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 20 ) 21 22 // This is a compile-time assertion to ensure that this generated file 23 // is compatible with the GoVPP api package it is being compiled against. 24 // A compilation error at this line likely means your copy of the 25 // GoVPP api package needs to be updated. 26 const _ = api.GoVppAPIPackageIsVersion2 27 28 // LbEncapType defines enum 'lb_encap_type'. 29 type LbEncapType uint32 30 31 const ( 32 LB_API_ENCAP_TYPE_GRE4 LbEncapType = 0 33 LB_API_ENCAP_TYPE_GRE6 LbEncapType = 1 34 LB_API_ENCAP_TYPE_L3DSR LbEncapType = 2 35 LB_API_ENCAP_TYPE_NAT4 LbEncapType = 3 36 LB_API_ENCAP_TYPE_NAT6 LbEncapType = 4 37 LB_API_ENCAP_N_TYPES LbEncapType = 5 38 ) 39 40 var ( 41 LbEncapType_name = map[uint32]string{ 42 0: "LB_API_ENCAP_TYPE_GRE4", 43 1: "LB_API_ENCAP_TYPE_GRE6", 44 2: "LB_API_ENCAP_TYPE_L3DSR", 45 3: "LB_API_ENCAP_TYPE_NAT4", 46 4: "LB_API_ENCAP_TYPE_NAT6", 47 5: "LB_API_ENCAP_N_TYPES", 48 } 49 LbEncapType_value = map[string]uint32{ 50 "LB_API_ENCAP_TYPE_GRE4": 0, 51 "LB_API_ENCAP_TYPE_GRE6": 1, 52 "LB_API_ENCAP_TYPE_L3DSR": 2, 53 "LB_API_ENCAP_TYPE_NAT4": 3, 54 "LB_API_ENCAP_TYPE_NAT6": 4, 55 "LB_API_ENCAP_N_TYPES": 5, 56 } 57 ) 58 59 func (x LbEncapType) String() string { 60 s, ok := LbEncapType_name[uint32(x)] 61 if ok { 62 return s 63 } 64 return "LbEncapType(" + strconv.Itoa(int(x)) + ")" 65 } 66 67 // LbLkpTypeT defines enum 'lb_lkp_type_t'. 68 type LbLkpTypeT uint32 69 70 const ( 71 LB_API_LKP_SAME_IP_PORT LbLkpTypeT = 0 72 LB_API_LKP_DIFF_IP_PORT LbLkpTypeT = 1 73 LB_API_LKP_ALL_PORT_IP LbLkpTypeT = 2 74 LB_API_LKP_N_TYPES LbLkpTypeT = 3 75 ) 76 77 var ( 78 LbLkpTypeT_name = map[uint32]string{ 79 0: "LB_API_LKP_SAME_IP_PORT", 80 1: "LB_API_LKP_DIFF_IP_PORT", 81 2: "LB_API_LKP_ALL_PORT_IP", 82 3: "LB_API_LKP_N_TYPES", 83 } 84 LbLkpTypeT_value = map[string]uint32{ 85 "LB_API_LKP_SAME_IP_PORT": 0, 86 "LB_API_LKP_DIFF_IP_PORT": 1, 87 "LB_API_LKP_ALL_PORT_IP": 2, 88 "LB_API_LKP_N_TYPES": 3, 89 } 90 ) 91 92 func (x LbLkpTypeT) String() string { 93 s, ok := LbLkpTypeT_name[uint32(x)] 94 if ok { 95 return s 96 } 97 return "LbLkpTypeT(" + strconv.Itoa(int(x)) + ")" 98 } 99 100 // LbNatProtocol defines enum 'lb_nat_protocol'. 101 type LbNatProtocol uint32 102 103 const ( 104 LB_API_NAT_PROTOCOL_UDP LbNatProtocol = 6 105 LB_API_NAT_PROTOCOL_TCP LbNatProtocol = 23 106 LB_API_NAT_PROTOCOL_ANY LbNatProtocol = 4294967295 107 ) 108 109 var ( 110 LbNatProtocol_name = map[uint32]string{ 111 6: "LB_API_NAT_PROTOCOL_UDP", 112 23: "LB_API_NAT_PROTOCOL_TCP", 113 4294967295: "LB_API_NAT_PROTOCOL_ANY", 114 } 115 LbNatProtocol_value = map[string]uint32{ 116 "LB_API_NAT_PROTOCOL_UDP": 6, 117 "LB_API_NAT_PROTOCOL_TCP": 23, 118 "LB_API_NAT_PROTOCOL_ANY": 4294967295, 119 } 120 ) 121 122 func (x LbNatProtocol) String() string { 123 s, ok := LbNatProtocol_name[uint32(x)] 124 if ok { 125 return s 126 } 127 return "LbNatProtocol(" + strconv.Itoa(int(x)) + ")" 128 } 129 130 // LbSrvType defines enum 'lb_srv_type'. 131 type LbSrvType uint32 132 133 const ( 134 LB_API_SRV_TYPE_CLUSTERIP LbSrvType = 0 135 LB_API_SRV_TYPE_NODEPORT LbSrvType = 1 136 LB_API_SRV_N_TYPES LbSrvType = 2 137 ) 138 139 var ( 140 LbSrvType_name = map[uint32]string{ 141 0: "LB_API_SRV_TYPE_CLUSTERIP", 142 1: "LB_API_SRV_TYPE_NODEPORT", 143 2: "LB_API_SRV_N_TYPES", 144 } 145 LbSrvType_value = map[string]uint32{ 146 "LB_API_SRV_TYPE_CLUSTERIP": 0, 147 "LB_API_SRV_TYPE_NODEPORT": 1, 148 "LB_API_SRV_N_TYPES": 2, 149 } 150 ) 151 152 func (x LbSrvType) String() string { 153 s, ok := LbSrvType_name[uint32(x)] 154 if ok { 155 return s 156 } 157 return "LbSrvType(" + strconv.Itoa(int(x)) + ")" 158 } 159 160 // LbVipType defines enum 'lb_vip_type'. 161 type LbVipType uint32 162 163 const ( 164 LB_API_VIP_TYPE_IP6_GRE6 LbVipType = 0 165 LB_API_VIP_TYPE_IP6_GRE4 LbVipType = 1 166 LB_API_VIP_TYPE_IP4_GRE6 LbVipType = 2 167 LB_API_VIP_TYPE_IP4_GRE4 LbVipType = 3 168 LB_API_VIP_TYPE_IP4_L3DSR LbVipType = 4 169 LB_API_VIP_TYPE_IP4_NAT4 LbVipType = 5 170 LB_API_VIP_TYPE_IP6_NAT6 LbVipType = 6 171 LB_API_VIP_N_TYPES LbVipType = 7 172 ) 173 174 var ( 175 LbVipType_name = map[uint32]string{ 176 0: "LB_API_VIP_TYPE_IP6_GRE6", 177 1: "LB_API_VIP_TYPE_IP6_GRE4", 178 2: "LB_API_VIP_TYPE_IP4_GRE6", 179 3: "LB_API_VIP_TYPE_IP4_GRE4", 180 4: "LB_API_VIP_TYPE_IP4_L3DSR", 181 5: "LB_API_VIP_TYPE_IP4_NAT4", 182 6: "LB_API_VIP_TYPE_IP6_NAT6", 183 7: "LB_API_VIP_N_TYPES", 184 } 185 LbVipType_value = map[string]uint32{ 186 "LB_API_VIP_TYPE_IP6_GRE6": 0, 187 "LB_API_VIP_TYPE_IP6_GRE4": 1, 188 "LB_API_VIP_TYPE_IP4_GRE6": 2, 189 "LB_API_VIP_TYPE_IP4_GRE4": 3, 190 "LB_API_VIP_TYPE_IP4_L3DSR": 4, 191 "LB_API_VIP_TYPE_IP4_NAT4": 5, 192 "LB_API_VIP_TYPE_IP6_NAT6": 6, 193 "LB_API_VIP_N_TYPES": 7, 194 } 195 ) 196 197 func (x LbVipType) String() string { 198 s, ok := LbVipType_name[uint32(x)] 199 if ok { 200 return s 201 } 202 return "LbVipType(" + strconv.Itoa(int(x)) + ")" 203 } 204 205 // LbVip defines type 'lb_vip'. 206 type LbVip struct { 207 Pfx ip_types.AddressWithPrefix `binapi:"address_with_prefix,name=pfx" json:"pfx,omitempty"` 208 Protocol ip_types.IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"` 209 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"` 210 }