github.com/edwarnicke/govpp@v0.0.0-20230130211138-14ef5d20b1d0/binapi/ipsec_types/ipsec_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/core/ipsec_types.api.json 6 7 // Package ipsec_types contains generated bindings for API file ipsec_types.api. 8 // 9 // Contents: 10 // 5 enums 11 // 6 structs 12 // 13 package ipsec_types 14 15 import ( 16 "strconv" 17 18 api "git.fd.io/govpp.git/api" 19 _ "github.com/edwarnicke/govpp/binapi/interface_types" 20 ip_types "github.com/edwarnicke/govpp/binapi/ip_types" 21 tunnel_types "github.com/edwarnicke/govpp/binapi/tunnel_types" 22 ) 23 24 // This is a compile-time assertion to ensure that this generated file 25 // is compatible with the GoVPP api package it is being compiled against. 26 // A compilation error at this line likely means your copy of the 27 // GoVPP api package needs to be updated. 28 const _ = api.GoVppAPIPackageIsVersion2 29 30 // IpsecCryptoAlg defines enum 'ipsec_crypto_alg'. 31 type IpsecCryptoAlg uint32 32 33 const ( 34 IPSEC_API_CRYPTO_ALG_NONE IpsecCryptoAlg = 0 35 IPSEC_API_CRYPTO_ALG_AES_CBC_128 IpsecCryptoAlg = 1 36 IPSEC_API_CRYPTO_ALG_AES_CBC_192 IpsecCryptoAlg = 2 37 IPSEC_API_CRYPTO_ALG_AES_CBC_256 IpsecCryptoAlg = 3 38 IPSEC_API_CRYPTO_ALG_AES_CTR_128 IpsecCryptoAlg = 4 39 IPSEC_API_CRYPTO_ALG_AES_CTR_192 IpsecCryptoAlg = 5 40 IPSEC_API_CRYPTO_ALG_AES_CTR_256 IpsecCryptoAlg = 6 41 IPSEC_API_CRYPTO_ALG_AES_GCM_128 IpsecCryptoAlg = 7 42 IPSEC_API_CRYPTO_ALG_AES_GCM_192 IpsecCryptoAlg = 8 43 IPSEC_API_CRYPTO_ALG_AES_GCM_256 IpsecCryptoAlg = 9 44 IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10 45 IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11 46 IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305 IpsecCryptoAlg = 12 47 ) 48 49 var ( 50 IpsecCryptoAlg_name = map[uint32]string{ 51 0: "IPSEC_API_CRYPTO_ALG_NONE", 52 1: "IPSEC_API_CRYPTO_ALG_AES_CBC_128", 53 2: "IPSEC_API_CRYPTO_ALG_AES_CBC_192", 54 3: "IPSEC_API_CRYPTO_ALG_AES_CBC_256", 55 4: "IPSEC_API_CRYPTO_ALG_AES_CTR_128", 56 5: "IPSEC_API_CRYPTO_ALG_AES_CTR_192", 57 6: "IPSEC_API_CRYPTO_ALG_AES_CTR_256", 58 7: "IPSEC_API_CRYPTO_ALG_AES_GCM_128", 59 8: "IPSEC_API_CRYPTO_ALG_AES_GCM_192", 60 9: "IPSEC_API_CRYPTO_ALG_AES_GCM_256", 61 10: "IPSEC_API_CRYPTO_ALG_DES_CBC", 62 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC", 63 12: "IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305", 64 } 65 IpsecCryptoAlg_value = map[string]uint32{ 66 "IPSEC_API_CRYPTO_ALG_NONE": 0, 67 "IPSEC_API_CRYPTO_ALG_AES_CBC_128": 1, 68 "IPSEC_API_CRYPTO_ALG_AES_CBC_192": 2, 69 "IPSEC_API_CRYPTO_ALG_AES_CBC_256": 3, 70 "IPSEC_API_CRYPTO_ALG_AES_CTR_128": 4, 71 "IPSEC_API_CRYPTO_ALG_AES_CTR_192": 5, 72 "IPSEC_API_CRYPTO_ALG_AES_CTR_256": 6, 73 "IPSEC_API_CRYPTO_ALG_AES_GCM_128": 7, 74 "IPSEC_API_CRYPTO_ALG_AES_GCM_192": 8, 75 "IPSEC_API_CRYPTO_ALG_AES_GCM_256": 9, 76 "IPSEC_API_CRYPTO_ALG_DES_CBC": 10, 77 "IPSEC_API_CRYPTO_ALG_3DES_CBC": 11, 78 "IPSEC_API_CRYPTO_ALG_CHACHA20_POLY1305": 12, 79 } 80 ) 81 82 func (x IpsecCryptoAlg) String() string { 83 s, ok := IpsecCryptoAlg_name[uint32(x)] 84 if ok { 85 return s 86 } 87 return "IpsecCryptoAlg(" + strconv.Itoa(int(x)) + ")" 88 } 89 90 // IpsecIntegAlg defines enum 'ipsec_integ_alg'. 91 type IpsecIntegAlg uint32 92 93 const ( 94 IPSEC_API_INTEG_ALG_NONE IpsecIntegAlg = 0 95 IPSEC_API_INTEG_ALG_MD5_96 IpsecIntegAlg = 1 96 IPSEC_API_INTEG_ALG_SHA1_96 IpsecIntegAlg = 2 97 IPSEC_API_INTEG_ALG_SHA_256_96 IpsecIntegAlg = 3 98 IPSEC_API_INTEG_ALG_SHA_256_128 IpsecIntegAlg = 4 99 IPSEC_API_INTEG_ALG_SHA_384_192 IpsecIntegAlg = 5 100 IPSEC_API_INTEG_ALG_SHA_512_256 IpsecIntegAlg = 6 101 ) 102 103 var ( 104 IpsecIntegAlg_name = map[uint32]string{ 105 0: "IPSEC_API_INTEG_ALG_NONE", 106 1: "IPSEC_API_INTEG_ALG_MD5_96", 107 2: "IPSEC_API_INTEG_ALG_SHA1_96", 108 3: "IPSEC_API_INTEG_ALG_SHA_256_96", 109 4: "IPSEC_API_INTEG_ALG_SHA_256_128", 110 5: "IPSEC_API_INTEG_ALG_SHA_384_192", 111 6: "IPSEC_API_INTEG_ALG_SHA_512_256", 112 } 113 IpsecIntegAlg_value = map[string]uint32{ 114 "IPSEC_API_INTEG_ALG_NONE": 0, 115 "IPSEC_API_INTEG_ALG_MD5_96": 1, 116 "IPSEC_API_INTEG_ALG_SHA1_96": 2, 117 "IPSEC_API_INTEG_ALG_SHA_256_96": 3, 118 "IPSEC_API_INTEG_ALG_SHA_256_128": 4, 119 "IPSEC_API_INTEG_ALG_SHA_384_192": 5, 120 "IPSEC_API_INTEG_ALG_SHA_512_256": 6, 121 } 122 ) 123 124 func (x IpsecIntegAlg) String() string { 125 s, ok := IpsecIntegAlg_name[uint32(x)] 126 if ok { 127 return s 128 } 129 return "IpsecIntegAlg(" + strconv.Itoa(int(x)) + ")" 130 } 131 132 // IpsecProto defines enum 'ipsec_proto'. 133 type IpsecProto uint32 134 135 const ( 136 IPSEC_API_PROTO_ESP IpsecProto = 50 137 IPSEC_API_PROTO_AH IpsecProto = 51 138 ) 139 140 var ( 141 IpsecProto_name = map[uint32]string{ 142 50: "IPSEC_API_PROTO_ESP", 143 51: "IPSEC_API_PROTO_AH", 144 } 145 IpsecProto_value = map[string]uint32{ 146 "IPSEC_API_PROTO_ESP": 50, 147 "IPSEC_API_PROTO_AH": 51, 148 } 149 ) 150 151 func (x IpsecProto) String() string { 152 s, ok := IpsecProto_name[uint32(x)] 153 if ok { 154 return s 155 } 156 return "IpsecProto(" + strconv.Itoa(int(x)) + ")" 157 } 158 159 // IpsecSadFlags defines enum 'ipsec_sad_flags'. 160 type IpsecSadFlags uint32 161 162 const ( 163 IPSEC_API_SAD_FLAG_NONE IpsecSadFlags = 0 164 IPSEC_API_SAD_FLAG_USE_ESN IpsecSadFlags = 1 165 IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY IpsecSadFlags = 2 166 IPSEC_API_SAD_FLAG_IS_TUNNEL IpsecSadFlags = 4 167 IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 IpsecSadFlags = 8 168 IPSEC_API_SAD_FLAG_UDP_ENCAP IpsecSadFlags = 16 169 IPSEC_API_SAD_FLAG_IS_INBOUND IpsecSadFlags = 64 170 IPSEC_API_SAD_FLAG_ASYNC IpsecSadFlags = 128 171 ) 172 173 var ( 174 IpsecSadFlags_name = map[uint32]string{ 175 0: "IPSEC_API_SAD_FLAG_NONE", 176 1: "IPSEC_API_SAD_FLAG_USE_ESN", 177 2: "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY", 178 4: "IPSEC_API_SAD_FLAG_IS_TUNNEL", 179 8: "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6", 180 16: "IPSEC_API_SAD_FLAG_UDP_ENCAP", 181 64: "IPSEC_API_SAD_FLAG_IS_INBOUND", 182 128: "IPSEC_API_SAD_FLAG_ASYNC", 183 } 184 IpsecSadFlags_value = map[string]uint32{ 185 "IPSEC_API_SAD_FLAG_NONE": 0, 186 "IPSEC_API_SAD_FLAG_USE_ESN": 1, 187 "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY": 2, 188 "IPSEC_API_SAD_FLAG_IS_TUNNEL": 4, 189 "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6": 8, 190 "IPSEC_API_SAD_FLAG_UDP_ENCAP": 16, 191 "IPSEC_API_SAD_FLAG_IS_INBOUND": 64, 192 "IPSEC_API_SAD_FLAG_ASYNC": 128, 193 } 194 ) 195 196 func (x IpsecSadFlags) String() string { 197 s, ok := IpsecSadFlags_name[uint32(x)] 198 if ok { 199 return s 200 } 201 str := func(n uint32) string { 202 s, ok := IpsecSadFlags_name[uint32(n)] 203 if ok { 204 return s 205 } 206 return "IpsecSadFlags(" + strconv.Itoa(int(n)) + ")" 207 } 208 for i := uint32(0); i <= 32; i++ { 209 val := uint32(x) 210 if val&(1<<i) != 0 { 211 if s != "" { 212 s += "|" 213 } 214 s += str(1 << i) 215 } 216 } 217 if s == "" { 218 return str(uint32(x)) 219 } 220 return s 221 } 222 223 // IpsecSpdAction defines enum 'ipsec_spd_action'. 224 type IpsecSpdAction uint32 225 226 const ( 227 IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0 228 IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1 229 IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2 230 IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3 231 ) 232 233 var ( 234 IpsecSpdAction_name = map[uint32]string{ 235 0: "IPSEC_API_SPD_ACTION_BYPASS", 236 1: "IPSEC_API_SPD_ACTION_DISCARD", 237 2: "IPSEC_API_SPD_ACTION_RESOLVE", 238 3: "IPSEC_API_SPD_ACTION_PROTECT", 239 } 240 IpsecSpdAction_value = map[string]uint32{ 241 "IPSEC_API_SPD_ACTION_BYPASS": 0, 242 "IPSEC_API_SPD_ACTION_DISCARD": 1, 243 "IPSEC_API_SPD_ACTION_RESOLVE": 2, 244 "IPSEC_API_SPD_ACTION_PROTECT": 3, 245 } 246 ) 247 248 func (x IpsecSpdAction) String() string { 249 s, ok := IpsecSpdAction_name[uint32(x)] 250 if ok { 251 return s 252 } 253 return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")" 254 } 255 256 // IpsecSadEntry defines type 'ipsec_sad_entry'. 257 type IpsecSadEntry struct { 258 SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"` 259 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"` 260 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` 261 CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"` 262 CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"` 263 IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"` 264 IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"` 265 Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"` 266 TunnelSrc ip_types.Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"` 267 TunnelDst ip_types.Address `binapi:"address,name=tunnel_dst" json:"tunnel_dst,omitempty"` 268 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"` 269 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` 270 UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=4500" json:"udp_src_port,omitempty"` 271 UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` 272 } 273 274 // IpsecSadEntryV2 defines type 'ipsec_sad_entry_v2'. 275 type IpsecSadEntryV2 struct { 276 SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"` 277 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"` 278 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` 279 CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"` 280 CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"` 281 IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"` 282 IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"` 283 Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"` 284 TunnelSrc ip_types.Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"` 285 TunnelDst ip_types.Address `binapi:"address,name=tunnel_dst" json:"tunnel_dst,omitempty"` 286 TunnelFlags tunnel_types.TunnelEncapDecapFlags `binapi:"tunnel_encap_decap_flags,name=tunnel_flags" json:"tunnel_flags,omitempty"` 287 Dscp ip_types.IPDscp `binapi:"ip_dscp,name=dscp" json:"dscp,omitempty"` 288 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"` 289 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` 290 UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=4500" json:"udp_src_port,omitempty"` 291 UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` 292 } 293 294 // IpsecSadEntryV3 defines type 'ipsec_sad_entry_v3'. 295 type IpsecSadEntryV3 struct { 296 SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"` 297 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"` 298 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` 299 CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"` 300 CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"` 301 IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"` 302 IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"` 303 Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"` 304 Tunnel tunnel_types.Tunnel `binapi:"tunnel,name=tunnel" json:"tunnel,omitempty"` 305 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` 306 UDPSrcPort uint16 `binapi:"u16,name=udp_src_port,default=4500" json:"udp_src_port,omitempty"` 307 UDPDstPort uint16 `binapi:"u16,name=udp_dst_port,default=4500" json:"udp_dst_port,omitempty"` 308 } 309 310 // IpsecSpdEntry defines type 'ipsec_spd_entry'. 311 type IpsecSpdEntry struct { 312 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` 313 Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"` 314 IsOutbound bool `binapi:"bool,name=is_outbound" json:"is_outbound,omitempty"` 315 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` 316 Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"` 317 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"` 318 RemoteAddressStart ip_types.Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"` 319 RemoteAddressStop ip_types.Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"` 320 LocalAddressStart ip_types.Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"` 321 LocalAddressStop ip_types.Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"` 322 RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"` 323 RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"` 324 LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"` 325 LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"` 326 } 327 328 // IpsecSpdEntryV2 defines type 'ipsec_spd_entry_v2'. 329 type IpsecSpdEntryV2 struct { 330 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` 331 Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"` 332 IsOutbound bool `binapi:"bool,name=is_outbound" json:"is_outbound,omitempty"` 333 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` 334 Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"` 335 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"` 336 RemoteAddressStart ip_types.Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"` 337 RemoteAddressStop ip_types.Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"` 338 LocalAddressStart ip_types.Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"` 339 LocalAddressStop ip_types.Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"` 340 RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"` 341 RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"` 342 LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"` 343 LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"` 344 } 345 346 // Key defines type 'key'. 347 type Key struct { 348 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"` 349 Data []byte `binapi:"u8[128],name=data" json:"data,omitempty"` 350 }