1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/ipsec.api.json
7 // Package ipsec contains generated bindings for API file ipsec.api.
24 api "git.fd.io/govpp.git/api"
25 codec "git.fd.io/govpp.git/codec"
28 // This is a compile-time assertion to ensure that this generated file
29 // is compatible with the GoVPP api package it is being compiled against.
30 // A compilation error at this line likely means your copy of the
31 // GoVPP api package needs to be updated.
32 const _ = api.GoVppAPIPackageIsVersion2
37 VersionCrc = 0x5a59fef9
40 // AddressFamily defines enum 'address_family'.
41 type AddressFamily uint32
44 ADDRESS_IP4 AddressFamily = 0
45 ADDRESS_IP6 AddressFamily = 1
49 AddressFamily_name = map[uint32]string{
53 AddressFamily_value = map[string]uint32{
59 func (x AddressFamily) String() string {
60 s, ok := AddressFamily_name[uint32(x)]
64 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
67 // IfStatusFlags defines enum 'if_status_flags'.
68 type IfStatusFlags uint32
71 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
72 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
76 IfStatusFlags_name = map[uint32]string{
77 1: "IF_STATUS_API_FLAG_ADMIN_UP",
78 2: "IF_STATUS_API_FLAG_LINK_UP",
80 IfStatusFlags_value = map[string]uint32{
81 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
82 "IF_STATUS_API_FLAG_LINK_UP": 2,
86 func (x IfStatusFlags) String() string {
87 s, ok := IfStatusFlags_name[uint32(x)]
91 str := func(n uint32) string {
92 s, ok := IfStatusFlags_name[uint32(n)]
96 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
98 for i := uint32(0); i <= 32; i++ {
108 return str(uint32(x))
113 // IfType defines enum 'if_type'.
117 IF_API_TYPE_HARDWARE IfType = 1
118 IF_API_TYPE_SUB IfType = 2
119 IF_API_TYPE_P2P IfType = 3
120 IF_API_TYPE_PIPE IfType = 4
124 IfType_name = map[uint32]string{
125 1: "IF_API_TYPE_HARDWARE",
126 2: "IF_API_TYPE_SUB",
127 3: "IF_API_TYPE_P2P",
128 4: "IF_API_TYPE_PIPE",
130 IfType_value = map[string]uint32{
131 "IF_API_TYPE_HARDWARE": 1,
132 "IF_API_TYPE_SUB": 2,
133 "IF_API_TYPE_P2P": 3,
134 "IF_API_TYPE_PIPE": 4,
138 func (x IfType) String() string {
139 s, ok := IfType_name[uint32(x)]
143 return "IfType(" + strconv.Itoa(int(x)) + ")"
146 // IPDscp defines enum 'ip_dscp'.
150 IP_API_DSCP_CS0 IPDscp = 0
151 IP_API_DSCP_CS1 IPDscp = 8
152 IP_API_DSCP_AF11 IPDscp = 10
153 IP_API_DSCP_AF12 IPDscp = 12
154 IP_API_DSCP_AF13 IPDscp = 14
155 IP_API_DSCP_CS2 IPDscp = 16
156 IP_API_DSCP_AF21 IPDscp = 18
157 IP_API_DSCP_AF22 IPDscp = 20
158 IP_API_DSCP_AF23 IPDscp = 22
159 IP_API_DSCP_CS3 IPDscp = 24
160 IP_API_DSCP_AF31 IPDscp = 26
161 IP_API_DSCP_AF32 IPDscp = 28
162 IP_API_DSCP_AF33 IPDscp = 30
163 IP_API_DSCP_CS4 IPDscp = 32
164 IP_API_DSCP_AF41 IPDscp = 34
165 IP_API_DSCP_AF42 IPDscp = 36
166 IP_API_DSCP_AF43 IPDscp = 38
167 IP_API_DSCP_CS5 IPDscp = 40
168 IP_API_DSCP_EF IPDscp = 46
169 IP_API_DSCP_CS6 IPDscp = 48
170 IP_API_DSCP_CS7 IPDscp = 50
174 IPDscp_name = map[uint8]string{
175 0: "IP_API_DSCP_CS0",
176 8: "IP_API_DSCP_CS1",
177 10: "IP_API_DSCP_AF11",
178 12: "IP_API_DSCP_AF12",
179 14: "IP_API_DSCP_AF13",
180 16: "IP_API_DSCP_CS2",
181 18: "IP_API_DSCP_AF21",
182 20: "IP_API_DSCP_AF22",
183 22: "IP_API_DSCP_AF23",
184 24: "IP_API_DSCP_CS3",
185 26: "IP_API_DSCP_AF31",
186 28: "IP_API_DSCP_AF32",
187 30: "IP_API_DSCP_AF33",
188 32: "IP_API_DSCP_CS4",
189 34: "IP_API_DSCP_AF41",
190 36: "IP_API_DSCP_AF42",
191 38: "IP_API_DSCP_AF43",
192 40: "IP_API_DSCP_CS5",
193 46: "IP_API_DSCP_EF",
194 48: "IP_API_DSCP_CS6",
195 50: "IP_API_DSCP_CS7",
197 IPDscp_value = map[string]uint8{
198 "IP_API_DSCP_CS0": 0,
199 "IP_API_DSCP_CS1": 8,
200 "IP_API_DSCP_AF11": 10,
201 "IP_API_DSCP_AF12": 12,
202 "IP_API_DSCP_AF13": 14,
203 "IP_API_DSCP_CS2": 16,
204 "IP_API_DSCP_AF21": 18,
205 "IP_API_DSCP_AF22": 20,
206 "IP_API_DSCP_AF23": 22,
207 "IP_API_DSCP_CS3": 24,
208 "IP_API_DSCP_AF31": 26,
209 "IP_API_DSCP_AF32": 28,
210 "IP_API_DSCP_AF33": 30,
211 "IP_API_DSCP_CS4": 32,
212 "IP_API_DSCP_AF41": 34,
213 "IP_API_DSCP_AF42": 36,
214 "IP_API_DSCP_AF43": 38,
215 "IP_API_DSCP_CS5": 40,
216 "IP_API_DSCP_EF": 46,
217 "IP_API_DSCP_CS6": 48,
218 "IP_API_DSCP_CS7": 50,
222 func (x IPDscp) String() string {
223 s, ok := IPDscp_name[uint8(x)]
227 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
230 // IPEcn defines enum 'ip_ecn'.
234 IP_API_ECN_NONE IPEcn = 0
235 IP_API_ECN_ECT0 IPEcn = 1
236 IP_API_ECN_ECT1 IPEcn = 2
237 IP_API_ECN_CE IPEcn = 3
241 IPEcn_name = map[uint8]string{
242 0: "IP_API_ECN_NONE",
243 1: "IP_API_ECN_ECT0",
244 2: "IP_API_ECN_ECT1",
247 IPEcn_value = map[string]uint8{
248 "IP_API_ECN_NONE": 0,
249 "IP_API_ECN_ECT0": 1,
250 "IP_API_ECN_ECT1": 2,
255 func (x IPEcn) String() string {
256 s, ok := IPEcn_name[uint8(x)]
260 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
263 // IPProto defines enum 'ip_proto'.
267 IP_API_PROTO_HOPOPT IPProto = 0
268 IP_API_PROTO_ICMP IPProto = 1
269 IP_API_PROTO_IGMP IPProto = 2
270 IP_API_PROTO_TCP IPProto = 6
271 IP_API_PROTO_UDP IPProto = 17
272 IP_API_PROTO_GRE IPProto = 47
273 IP_API_PROTO_AH IPProto = 50
274 IP_API_PROTO_ESP IPProto = 51
275 IP_API_PROTO_EIGRP IPProto = 88
276 IP_API_PROTO_OSPF IPProto = 89
277 IP_API_PROTO_SCTP IPProto = 132
278 IP_API_PROTO_RESERVED IPProto = 255
282 IPProto_name = map[uint32]string{
283 0: "IP_API_PROTO_HOPOPT",
284 1: "IP_API_PROTO_ICMP",
285 2: "IP_API_PROTO_IGMP",
286 6: "IP_API_PROTO_TCP",
287 17: "IP_API_PROTO_UDP",
288 47: "IP_API_PROTO_GRE",
289 50: "IP_API_PROTO_AH",
290 51: "IP_API_PROTO_ESP",
291 88: "IP_API_PROTO_EIGRP",
292 89: "IP_API_PROTO_OSPF",
293 132: "IP_API_PROTO_SCTP",
294 255: "IP_API_PROTO_RESERVED",
296 IPProto_value = map[string]uint32{
297 "IP_API_PROTO_HOPOPT": 0,
298 "IP_API_PROTO_ICMP": 1,
299 "IP_API_PROTO_IGMP": 2,
300 "IP_API_PROTO_TCP": 6,
301 "IP_API_PROTO_UDP": 17,
302 "IP_API_PROTO_GRE": 47,
303 "IP_API_PROTO_AH": 50,
304 "IP_API_PROTO_ESP": 51,
305 "IP_API_PROTO_EIGRP": 88,
306 "IP_API_PROTO_OSPF": 89,
307 "IP_API_PROTO_SCTP": 132,
308 "IP_API_PROTO_RESERVED": 255,
312 func (x IPProto) String() string {
313 s, ok := IPProto_name[uint32(x)]
317 return "IPProto(" + strconv.Itoa(int(x)) + ")"
320 // IpsecCryptoAlg defines enum 'ipsec_crypto_alg'.
321 type IpsecCryptoAlg uint32
324 IPSEC_API_CRYPTO_ALG_NONE IpsecCryptoAlg = 0
325 IPSEC_API_CRYPTO_ALG_AES_CBC_128 IpsecCryptoAlg = 1
326 IPSEC_API_CRYPTO_ALG_AES_CBC_192 IpsecCryptoAlg = 2
327 IPSEC_API_CRYPTO_ALG_AES_CBC_256 IpsecCryptoAlg = 3
328 IPSEC_API_CRYPTO_ALG_AES_CTR_128 IpsecCryptoAlg = 4
329 IPSEC_API_CRYPTO_ALG_AES_CTR_192 IpsecCryptoAlg = 5
330 IPSEC_API_CRYPTO_ALG_AES_CTR_256 IpsecCryptoAlg = 6
331 IPSEC_API_CRYPTO_ALG_AES_GCM_128 IpsecCryptoAlg = 7
332 IPSEC_API_CRYPTO_ALG_AES_GCM_192 IpsecCryptoAlg = 8
333 IPSEC_API_CRYPTO_ALG_AES_GCM_256 IpsecCryptoAlg = 9
334 IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10
335 IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11
339 IpsecCryptoAlg_name = map[uint32]string{
340 0: "IPSEC_API_CRYPTO_ALG_NONE",
341 1: "IPSEC_API_CRYPTO_ALG_AES_CBC_128",
342 2: "IPSEC_API_CRYPTO_ALG_AES_CBC_192",
343 3: "IPSEC_API_CRYPTO_ALG_AES_CBC_256",
344 4: "IPSEC_API_CRYPTO_ALG_AES_CTR_128",
345 5: "IPSEC_API_CRYPTO_ALG_AES_CTR_192",
346 6: "IPSEC_API_CRYPTO_ALG_AES_CTR_256",
347 7: "IPSEC_API_CRYPTO_ALG_AES_GCM_128",
348 8: "IPSEC_API_CRYPTO_ALG_AES_GCM_192",
349 9: "IPSEC_API_CRYPTO_ALG_AES_GCM_256",
350 10: "IPSEC_API_CRYPTO_ALG_DES_CBC",
351 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC",
353 IpsecCryptoAlg_value = map[string]uint32{
354 "IPSEC_API_CRYPTO_ALG_NONE": 0,
355 "IPSEC_API_CRYPTO_ALG_AES_CBC_128": 1,
356 "IPSEC_API_CRYPTO_ALG_AES_CBC_192": 2,
357 "IPSEC_API_CRYPTO_ALG_AES_CBC_256": 3,
358 "IPSEC_API_CRYPTO_ALG_AES_CTR_128": 4,
359 "IPSEC_API_CRYPTO_ALG_AES_CTR_192": 5,
360 "IPSEC_API_CRYPTO_ALG_AES_CTR_256": 6,
361 "IPSEC_API_CRYPTO_ALG_AES_GCM_128": 7,
362 "IPSEC_API_CRYPTO_ALG_AES_GCM_192": 8,
363 "IPSEC_API_CRYPTO_ALG_AES_GCM_256": 9,
364 "IPSEC_API_CRYPTO_ALG_DES_CBC": 10,
365 "IPSEC_API_CRYPTO_ALG_3DES_CBC": 11,
369 func (x IpsecCryptoAlg) String() string {
370 s, ok := IpsecCryptoAlg_name[uint32(x)]
374 return "IpsecCryptoAlg(" + strconv.Itoa(int(x)) + ")"
377 // IpsecIntegAlg defines enum 'ipsec_integ_alg'.
378 type IpsecIntegAlg uint32
381 IPSEC_API_INTEG_ALG_NONE IpsecIntegAlg = 0
382 IPSEC_API_INTEG_ALG_MD5_96 IpsecIntegAlg = 1
383 IPSEC_API_INTEG_ALG_SHA1_96 IpsecIntegAlg = 2
384 IPSEC_API_INTEG_ALG_SHA_256_96 IpsecIntegAlg = 3
385 IPSEC_API_INTEG_ALG_SHA_256_128 IpsecIntegAlg = 4
386 IPSEC_API_INTEG_ALG_SHA_384_192 IpsecIntegAlg = 5
387 IPSEC_API_INTEG_ALG_SHA_512_256 IpsecIntegAlg = 6
391 IpsecIntegAlg_name = map[uint32]string{
392 0: "IPSEC_API_INTEG_ALG_NONE",
393 1: "IPSEC_API_INTEG_ALG_MD5_96",
394 2: "IPSEC_API_INTEG_ALG_SHA1_96",
395 3: "IPSEC_API_INTEG_ALG_SHA_256_96",
396 4: "IPSEC_API_INTEG_ALG_SHA_256_128",
397 5: "IPSEC_API_INTEG_ALG_SHA_384_192",
398 6: "IPSEC_API_INTEG_ALG_SHA_512_256",
400 IpsecIntegAlg_value = map[string]uint32{
401 "IPSEC_API_INTEG_ALG_NONE": 0,
402 "IPSEC_API_INTEG_ALG_MD5_96": 1,
403 "IPSEC_API_INTEG_ALG_SHA1_96": 2,
404 "IPSEC_API_INTEG_ALG_SHA_256_96": 3,
405 "IPSEC_API_INTEG_ALG_SHA_256_128": 4,
406 "IPSEC_API_INTEG_ALG_SHA_384_192": 5,
407 "IPSEC_API_INTEG_ALG_SHA_512_256": 6,
411 func (x IpsecIntegAlg) String() string {
412 s, ok := IpsecIntegAlg_name[uint32(x)]
416 return "IpsecIntegAlg(" + strconv.Itoa(int(x)) + ")"
419 // IpsecProto defines enum 'ipsec_proto'.
420 type IpsecProto uint32
423 IPSEC_API_PROTO_ESP IpsecProto = 1
424 IPSEC_API_PROTO_AH IpsecProto = 2
428 IpsecProto_name = map[uint32]string{
429 1: "IPSEC_API_PROTO_ESP",
430 2: "IPSEC_API_PROTO_AH",
432 IpsecProto_value = map[string]uint32{
433 "IPSEC_API_PROTO_ESP": 1,
434 "IPSEC_API_PROTO_AH": 2,
438 func (x IpsecProto) String() string {
439 s, ok := IpsecProto_name[uint32(x)]
443 return "IpsecProto(" + strconv.Itoa(int(x)) + ")"
446 // IpsecSadFlags defines enum 'ipsec_sad_flags'.
447 type IpsecSadFlags uint32
450 IPSEC_API_SAD_FLAG_NONE IpsecSadFlags = 0
451 IPSEC_API_SAD_FLAG_USE_ESN IpsecSadFlags = 1
452 IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY IpsecSadFlags = 2
453 IPSEC_API_SAD_FLAG_IS_TUNNEL IpsecSadFlags = 4
454 IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 IpsecSadFlags = 8
455 IPSEC_API_SAD_FLAG_UDP_ENCAP IpsecSadFlags = 16
459 IpsecSadFlags_name = map[uint32]string{
460 0: "IPSEC_API_SAD_FLAG_NONE",
461 1: "IPSEC_API_SAD_FLAG_USE_ESN",
462 2: "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY",
463 4: "IPSEC_API_SAD_FLAG_IS_TUNNEL",
464 8: "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6",
465 16: "IPSEC_API_SAD_FLAG_UDP_ENCAP",
467 IpsecSadFlags_value = map[string]uint32{
468 "IPSEC_API_SAD_FLAG_NONE": 0,
469 "IPSEC_API_SAD_FLAG_USE_ESN": 1,
470 "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY": 2,
471 "IPSEC_API_SAD_FLAG_IS_TUNNEL": 4,
472 "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6": 8,
473 "IPSEC_API_SAD_FLAG_UDP_ENCAP": 16,
477 func (x IpsecSadFlags) String() string {
478 s, ok := IpsecSadFlags_name[uint32(x)]
482 str := func(n uint32) string {
483 s, ok := IpsecSadFlags_name[uint32(n)]
487 return "IpsecSadFlags(" + strconv.Itoa(int(n)) + ")"
489 for i := uint32(0); i <= 32; i++ {
499 return str(uint32(x))
504 // IpsecSpdAction defines enum 'ipsec_spd_action'.
505 type IpsecSpdAction uint32
508 IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0
509 IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1
510 IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2
511 IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3
515 IpsecSpdAction_name = map[uint32]string{
516 0: "IPSEC_API_SPD_ACTION_BYPASS",
517 1: "IPSEC_API_SPD_ACTION_DISCARD",
518 2: "IPSEC_API_SPD_ACTION_RESOLVE",
519 3: "IPSEC_API_SPD_ACTION_PROTECT",
521 IpsecSpdAction_value = map[string]uint32{
522 "IPSEC_API_SPD_ACTION_BYPASS": 0,
523 "IPSEC_API_SPD_ACTION_DISCARD": 1,
524 "IPSEC_API_SPD_ACTION_RESOLVE": 2,
525 "IPSEC_API_SPD_ACTION_PROTECT": 3,
529 func (x IpsecSpdAction) String() string {
530 s, ok := IpsecSpdAction_name[uint32(x)]
534 return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")"
537 // LinkDuplex defines enum 'link_duplex'.
538 type LinkDuplex uint32
541 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
542 LINK_DUPLEX_API_HALF LinkDuplex = 1
543 LINK_DUPLEX_API_FULL LinkDuplex = 2
547 LinkDuplex_name = map[uint32]string{
548 0: "LINK_DUPLEX_API_UNKNOWN",
549 1: "LINK_DUPLEX_API_HALF",
550 2: "LINK_DUPLEX_API_FULL",
552 LinkDuplex_value = map[string]uint32{
553 "LINK_DUPLEX_API_UNKNOWN": 0,
554 "LINK_DUPLEX_API_HALF": 1,
555 "LINK_DUPLEX_API_FULL": 2,
559 func (x LinkDuplex) String() string {
560 s, ok := LinkDuplex_name[uint32(x)]
564 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
567 // MtuProto defines enum 'mtu_proto'.
571 MTU_PROTO_API_L3 MtuProto = 1
572 MTU_PROTO_API_IP4 MtuProto = 2
573 MTU_PROTO_API_IP6 MtuProto = 3
574 MTU_PROTO_API_MPLS MtuProto = 4
575 MTU_PROTO_API_N MtuProto = 5
579 MtuProto_name = map[uint32]string{
580 1: "MTU_PROTO_API_L3",
581 2: "MTU_PROTO_API_IP4",
582 3: "MTU_PROTO_API_IP6",
583 4: "MTU_PROTO_API_MPLS",
584 5: "MTU_PROTO_API_N",
586 MtuProto_value = map[string]uint32{
587 "MTU_PROTO_API_L3": 1,
588 "MTU_PROTO_API_IP4": 2,
589 "MTU_PROTO_API_IP6": 3,
590 "MTU_PROTO_API_MPLS": 4,
591 "MTU_PROTO_API_N": 5,
595 func (x MtuProto) String() string {
596 s, ok := MtuProto_name[uint32(x)]
600 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
603 // RxMode defines enum 'rx_mode'.
607 RX_MODE_API_UNKNOWN RxMode = 0
608 RX_MODE_API_POLLING RxMode = 1
609 RX_MODE_API_INTERRUPT RxMode = 2
610 RX_MODE_API_ADAPTIVE RxMode = 3
611 RX_MODE_API_DEFAULT RxMode = 4
615 RxMode_name = map[uint32]string{
616 0: "RX_MODE_API_UNKNOWN",
617 1: "RX_MODE_API_POLLING",
618 2: "RX_MODE_API_INTERRUPT",
619 3: "RX_MODE_API_ADAPTIVE",
620 4: "RX_MODE_API_DEFAULT",
622 RxMode_value = map[string]uint32{
623 "RX_MODE_API_UNKNOWN": 0,
624 "RX_MODE_API_POLLING": 1,
625 "RX_MODE_API_INTERRUPT": 2,
626 "RX_MODE_API_ADAPTIVE": 3,
627 "RX_MODE_API_DEFAULT": 4,
631 func (x RxMode) String() string {
632 s, ok := RxMode_name[uint32(x)]
636 return "RxMode(" + strconv.Itoa(int(x)) + ")"
639 // SubIfFlags defines enum 'sub_if_flags'.
640 type SubIfFlags uint32
643 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
644 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
645 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
646 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
647 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
648 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
649 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
650 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
651 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
652 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
656 SubIfFlags_name = map[uint32]string{
657 1: "SUB_IF_API_FLAG_NO_TAGS",
658 2: "SUB_IF_API_FLAG_ONE_TAG",
659 4: "SUB_IF_API_FLAG_TWO_TAGS",
660 8: "SUB_IF_API_FLAG_DOT1AD",
661 16: "SUB_IF_API_FLAG_EXACT_MATCH",
662 32: "SUB_IF_API_FLAG_DEFAULT",
663 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
664 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
665 254: "SUB_IF_API_FLAG_MASK_VNET",
666 256: "SUB_IF_API_FLAG_DOT1AH",
668 SubIfFlags_value = map[string]uint32{
669 "SUB_IF_API_FLAG_NO_TAGS": 1,
670 "SUB_IF_API_FLAG_ONE_TAG": 2,
671 "SUB_IF_API_FLAG_TWO_TAGS": 4,
672 "SUB_IF_API_FLAG_DOT1AD": 8,
673 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
674 "SUB_IF_API_FLAG_DEFAULT": 32,
675 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
676 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
677 "SUB_IF_API_FLAG_MASK_VNET": 254,
678 "SUB_IF_API_FLAG_DOT1AH": 256,
682 func (x SubIfFlags) String() string {
683 s, ok := SubIfFlags_name[uint32(x)]
687 str := func(n uint32) string {
688 s, ok := SubIfFlags_name[uint32(n)]
692 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
694 for i := uint32(0); i <= 32; i++ {
704 return str(uint32(x))
709 // AddressWithPrefix defines alias 'address_with_prefix'.
710 type AddressWithPrefix Prefix
712 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
713 prefix, err := ParsePrefix(s)
715 return AddressWithPrefix{}, err
717 return AddressWithPrefix(prefix), nil
720 func (x AddressWithPrefix) String() string {
721 return Prefix(x).String()
724 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
725 return []byte(x.String()), nil
728 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
729 prefix, err := ParseAddressWithPrefix(string(text))
737 // InterfaceIndex defines alias 'interface_index'.
738 type InterfaceIndex uint32
740 // IP4Address defines alias 'ip4_address'.
741 type IP4Address [4]uint8
743 func ParseIP4Address(s string) (IP4Address, error) {
744 ip := net.ParseIP(s).To4()
746 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
748 var ipaddr IP4Address
749 copy(ipaddr[:], ip.To4())
753 func (x IP4Address) ToIP() net.IP {
754 return net.IP(x[:]).To4()
757 func (x IP4Address) String() string {
758 return x.ToIP().String()
761 func (x *IP4Address) MarshalText() ([]byte, error) {
762 return []byte(x.String()), nil
765 func (x *IP4Address) UnmarshalText(text []byte) error {
766 ipaddr, err := ParseIP4Address(string(text))
774 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
775 type IP4AddressWithPrefix IP4Prefix
777 // IP6Address defines alias 'ip6_address'.
778 type IP6Address [16]uint8
780 func ParseIP6Address(s string) (IP6Address, error) {
781 ip := net.ParseIP(s).To16()
783 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
785 var ipaddr IP6Address
786 copy(ipaddr[:], ip.To16())
790 func (x IP6Address) ToIP() net.IP {
791 return net.IP(x[:]).To16()
794 func (x IP6Address) String() string {
795 return x.ToIP().String()
798 func (x *IP6Address) MarshalText() ([]byte, error) {
799 return []byte(x.String()), nil
802 func (x *IP6Address) UnmarshalText(text []byte) error {
803 ipaddr, err := ParseIP6Address(string(text))
811 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
812 type IP6AddressWithPrefix IP6Prefix
814 // Address defines type 'address'.
815 type Address struct {
816 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
817 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
820 func ParseAddress(s string) (Address, error) {
823 return Address{}, fmt.Errorf("invalid address: %s", s)
825 return AddressFromIP(ip), nil
828 func AddressFromIP(ip net.IP) Address {
831 addr.Af = ADDRESS_IP6
833 copy(ip6[:], ip.To16())
836 addr.Af = ADDRESS_IP4
838 copy(ip4[:], ip.To4())
844 func (x Address) ToIP() net.IP {
845 if x.Af == ADDRESS_IP6 {
847 return net.IP(ip6[:]).To16()
850 return net.IP(ip4[:]).To4()
854 func (x Address) String() string {
855 return x.ToIP().String()
858 func (x *Address) MarshalText() ([]byte, error) {
859 return []byte(x.String()), nil
862 func (x *Address) UnmarshalText(text []byte) error {
863 addr, err := ParseAddress(string(text))
871 // IP4Prefix defines type 'ip4_prefix'.
872 type IP4Prefix struct {
873 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
874 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
877 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
878 hasPrefix := strings.Contains(s, "/")
880 ip, network, err := net.ParseCIDR(s)
882 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
884 maskSize, _ := network.Mask.Size()
885 prefix.Len = byte(maskSize)
886 prefix.Address, err = ParseIP4Address(ip.String())
888 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
892 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
894 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
896 prefix.Len = byte(defaultMaskSize)
897 prefix.Address, err = ParseIP4Address(ip.String())
899 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
905 func (x IP4Prefix) ToIPNet() *net.IPNet {
906 mask := net.CIDRMask(int(x.Len), 32)
907 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
911 func (x IP4Prefix) String() string {
912 ip := x.Address.String()
913 return ip + "/" + strconv.Itoa(int(x.Len))
916 func (x *IP4Prefix) MarshalText() ([]byte, error) {
917 return []byte(x.String()), nil
920 func (x *IP4Prefix) UnmarshalText(text []byte) error {
921 prefix, err := ParseIP4Prefix(string(text))
929 // IP6Prefix defines type 'ip6_prefix'.
930 type IP6Prefix struct {
931 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
932 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
935 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
936 hasPrefix := strings.Contains(s, "/")
938 ip, network, err := net.ParseCIDR(s)
940 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
942 maskSize, _ := network.Mask.Size()
943 prefix.Len = byte(maskSize)
944 prefix.Address, err = ParseIP6Address(ip.String())
946 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
950 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
952 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
954 prefix.Len = byte(defaultMaskSize)
955 prefix.Address, err = ParseIP6Address(ip.String())
957 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
963 func (x IP6Prefix) ToIPNet() *net.IPNet {
964 mask := net.CIDRMask(int(x.Len), 128)
965 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
969 func (x IP6Prefix) String() string {
970 ip := x.Address.String()
971 return ip + "/" + strconv.Itoa(int(x.Len))
974 func (x *IP6Prefix) MarshalText() ([]byte, error) {
975 return []byte(x.String()), nil
978 func (x *IP6Prefix) UnmarshalText(text []byte) error {
979 prefix, err := ParseIP6Prefix(string(text))
987 // IpsecSadEntry defines type 'ipsec_sad_entry'.
988 type IpsecSadEntry struct {
989 SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"`
990 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
991 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
992 CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"`
993 CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"`
994 IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"`
995 IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"`
996 Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"`
997 TunnelSrc Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"`
998 TunnelDst Address `binapi:"address,name=tunnel_dst" json:"tunnel_dst,omitempty"`
999 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
1000 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
1003 // IpsecSpdEntry defines type 'ipsec_spd_entry'.
1004 type IpsecSpdEntry struct {
1005 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1006 Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"`
1007 IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
1008 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1009 Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"`
1010 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
1011 RemoteAddressStart Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"`
1012 RemoteAddressStop Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"`
1013 LocalAddressStart Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"`
1014 LocalAddressStop Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"`
1015 RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"`
1016 RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"`
1017 LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"`
1018 LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"`
1021 // IpsecTunnelProtect defines type 'ipsec_tunnel_protect'.
1022 type IpsecTunnelProtect struct {
1023 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1024 SaOut uint32 `binapi:"u32,name=sa_out" json:"sa_out,omitempty"`
1025 NSaIn uint8 `binapi:"u8,name=n_sa_in" json:"-"`
1026 SaIn []uint32 `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"`
1029 // Key defines type 'key'.
1031 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
1032 Data []byte `binapi:"u8[128],name=data" json:"data,omitempty"`
1035 // Mprefix defines type 'mprefix'.
1036 type Mprefix struct {
1037 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
1038 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
1039 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
1040 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
1043 // Prefix defines type 'prefix'.
1044 type Prefix struct {
1045 Address Address `binapi:"address,name=address" json:"address,omitempty"`
1046 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
1049 func ParsePrefix(ip string) (prefix Prefix, err error) {
1050 hasPrefix := strings.Contains(ip, "/")
1052 netIP, network, err := net.ParseCIDR(ip)
1054 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1056 maskSize, _ := network.Mask.Size()
1057 prefix.Len = byte(maskSize)
1058 prefix.Address, err = ParseAddress(netIP.String())
1060 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1063 netIP := net.ParseIP(ip)
1064 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1065 if netIP.To4() == nil {
1066 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1068 prefix.Len = byte(defaultMaskSize)
1069 prefix.Address, err = ParseAddress(netIP.String())
1071 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1077 func (x Prefix) ToIPNet() *net.IPNet {
1079 if x.Address.Af == ADDRESS_IP4 {
1080 mask = net.CIDRMask(int(x.Len), 32)
1082 mask = net.CIDRMask(int(x.Len), 128)
1084 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1088 func (x Prefix) String() string {
1089 ip := x.Address.String()
1090 return ip + "/" + strconv.Itoa(int(x.Len))
1093 func (x *Prefix) MarshalText() ([]byte, error) {
1094 return []byte(x.String()), nil
1097 func (x *Prefix) UnmarshalText(text []byte) error {
1098 prefix, err := ParsePrefix(string(text))
1106 // PrefixMatcher defines type 'prefix_matcher'.
1107 type PrefixMatcher struct {
1108 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
1109 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
1112 // AddressUnion defines union 'address_union'.
1113 type AddressUnion struct {
1114 // AddressUnion can be one of:
1115 // - IP4 *IP4Address
1116 // - IP6 *IP6Address
1117 XXX_UnionData [16]byte
1120 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
1124 func (u *AddressUnion) SetIP4(a IP4Address) {
1125 buf := codec.NewBuffer(u.XXX_UnionData[:])
1126 buf.EncodeBytes(a[:], 4)
1128 func (u *AddressUnion) GetIP4() (a IP4Address) {
1129 buf := codec.NewBuffer(u.XXX_UnionData[:])
1130 copy(a[:], buf.DecodeBytes(4))
1134 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
1138 func (u *AddressUnion) SetIP6(a IP6Address) {
1139 buf := codec.NewBuffer(u.XXX_UnionData[:])
1140 buf.EncodeBytes(a[:], 16)
1142 func (u *AddressUnion) GetIP6() (a IP6Address) {
1143 buf := codec.NewBuffer(u.XXX_UnionData[:])
1144 copy(a[:], buf.DecodeBytes(16))
1148 // IpsecBackendDetails defines message 'ipsec_backend_details'.
1149 type IpsecBackendDetails struct {
1150 Name []byte `binapi:"u8[128],name=name" json:"name,omitempty"`
1151 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
1152 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
1153 Active uint8 `binapi:"u8,name=active" json:"active,omitempty"`
1156 func (m *IpsecBackendDetails) Reset() { *m = IpsecBackendDetails{} }
1157 func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" }
1158 func (*IpsecBackendDetails) GetCrcString() string { return "7700751c" }
1159 func (*IpsecBackendDetails) GetMessageType() api.MessageType {
1160 return api.ReplyMessage
1163 func (m *IpsecBackendDetails) Size() (size int) {
1167 size += 1 * 128 // m.Name
1168 size += 4 // m.Protocol
1169 size += 1 // m.Index
1170 size += 1 // m.Active
1173 func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) {
1175 b = make([]byte, m.Size())
1177 buf := codec.NewBuffer(b)
1178 buf.EncodeBytes(m.Name, 128)
1179 buf.EncodeUint32(uint32(m.Protocol))
1180 buf.EncodeUint8(m.Index)
1181 buf.EncodeUint8(m.Active)
1182 return buf.Bytes(), nil
1184 func (m *IpsecBackendDetails) Unmarshal(b []byte) error {
1185 buf := codec.NewBuffer(b)
1186 m.Name = make([]byte, 128)
1187 copy(m.Name, buf.DecodeBytes(len(m.Name)))
1188 m.Protocol = IpsecProto(buf.DecodeUint32())
1189 m.Index = buf.DecodeUint8()
1190 m.Active = buf.DecodeUint8()
1194 // IpsecBackendDump defines message 'ipsec_backend_dump'.
1195 type IpsecBackendDump struct{}
1197 func (m *IpsecBackendDump) Reset() { *m = IpsecBackendDump{} }
1198 func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" }
1199 func (*IpsecBackendDump) GetCrcString() string { return "51077d14" }
1200 func (*IpsecBackendDump) GetMessageType() api.MessageType {
1201 return api.RequestMessage
1204 func (m *IpsecBackendDump) Size() (size int) {
1210 func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) {
1212 b = make([]byte, m.Size())
1214 buf := codec.NewBuffer(b)
1215 return buf.Bytes(), nil
1217 func (m *IpsecBackendDump) Unmarshal(b []byte) error {
1221 // IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'.
1222 type IpsecInterfaceAddDelSpd struct {
1223 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1224 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1225 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1228 func (m *IpsecInterfaceAddDelSpd) Reset() { *m = IpsecInterfaceAddDelSpd{} }
1229 func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" }
1230 func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "1e3b8286" }
1231 func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType {
1232 return api.RequestMessage
1235 func (m *IpsecInterfaceAddDelSpd) Size() (size int) {
1239 size += 1 // m.IsAdd
1240 size += 4 // m.SwIfIndex
1241 size += 4 // m.SpdID
1244 func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) {
1246 b = make([]byte, m.Size())
1248 buf := codec.NewBuffer(b)
1249 buf.EncodeUint8(m.IsAdd)
1250 buf.EncodeUint32(m.SwIfIndex)
1251 buf.EncodeUint32(m.SpdID)
1252 return buf.Bytes(), nil
1254 func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error {
1255 buf := codec.NewBuffer(b)
1256 m.IsAdd = buf.DecodeUint8()
1257 m.SwIfIndex = buf.DecodeUint32()
1258 m.SpdID = buf.DecodeUint32()
1262 // IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'.
1263 type IpsecInterfaceAddDelSpdReply struct {
1264 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1267 func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} }
1268 func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string {
1269 return "ipsec_interface_add_del_spd_reply"
1271 func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" }
1272 func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType {
1273 return api.ReplyMessage
1276 func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) {
1280 size += 4 // m.Retval
1283 func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) {
1285 b = make([]byte, m.Size())
1287 buf := codec.NewBuffer(b)
1288 buf.EncodeInt32(m.Retval)
1289 return buf.Bytes(), nil
1291 func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error {
1292 buf := codec.NewBuffer(b)
1293 m.Retval = buf.DecodeInt32()
1297 // IpsecSaDetails defines message 'ipsec_sa_details'.
1298 type IpsecSaDetails struct {
1299 Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
1300 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1301 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
1302 SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
1303 LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
1304 ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
1305 TotalDataSize uint64 `binapi:"u64,name=total_data_size" json:"total_data_size,omitempty"`
1308 func (m *IpsecSaDetails) Reset() { *m = IpsecSaDetails{} }
1309 func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" }
1310 func (*IpsecSaDetails) GetCrcString() string { return "9c8d829a" }
1311 func (*IpsecSaDetails) GetMessageType() api.MessageType {
1312 return api.ReplyMessage
1315 func (m *IpsecSaDetails) Size() (size int) {
1319 size += 4 // m.Entry.SadID
1320 size += 4 // m.Entry.Spi
1321 size += 4 // m.Entry.Protocol
1322 size += 4 // m.Entry.CryptoAlgorithm
1323 size += 1 // m.Entry.CryptoKey.Length
1324 size += 1 * 128 // m.Entry.CryptoKey.Data
1325 size += 4 // m.Entry.IntegrityAlgorithm
1326 size += 1 // m.Entry.IntegrityKey.Length
1327 size += 1 * 128 // m.Entry.IntegrityKey.Data
1328 size += 4 // m.Entry.Flags
1329 size += 4 // m.Entry.TunnelSrc.Af
1330 size += 1 * 16 // m.Entry.TunnelSrc.Un
1331 size += 4 // m.Entry.TunnelDst.Af
1332 size += 1 * 16 // m.Entry.TunnelDst.Un
1333 size += 4 // m.Entry.TxTableID
1334 size += 4 // m.Entry.Salt
1335 size += 4 // m.SwIfIndex
1337 size += 8 // m.SeqOutbound
1338 size += 8 // m.LastSeqInbound
1339 size += 8 // m.ReplayWindow
1340 size += 8 // m.TotalDataSize
1343 func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) {
1345 b = make([]byte, m.Size())
1347 buf := codec.NewBuffer(b)
1348 buf.EncodeUint32(m.Entry.SadID)
1349 buf.EncodeUint32(m.Entry.Spi)
1350 buf.EncodeUint32(uint32(m.Entry.Protocol))
1351 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1352 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1353 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1354 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1355 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1356 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1357 buf.EncodeUint32(uint32(m.Entry.Flags))
1358 buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
1359 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
1360 buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
1361 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
1362 buf.EncodeUint32(m.Entry.TxTableID)
1363 buf.EncodeUint32(m.Entry.Salt)
1364 buf.EncodeUint32(m.SwIfIndex)
1365 buf.EncodeUint32(m.Salt)
1366 buf.EncodeUint64(m.SeqOutbound)
1367 buf.EncodeUint64(m.LastSeqInbound)
1368 buf.EncodeUint64(m.ReplayWindow)
1369 buf.EncodeUint64(m.TotalDataSize)
1370 return buf.Bytes(), nil
1372 func (m *IpsecSaDetails) Unmarshal(b []byte) error {
1373 buf := codec.NewBuffer(b)
1374 m.Entry.SadID = buf.DecodeUint32()
1375 m.Entry.Spi = buf.DecodeUint32()
1376 m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
1377 m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
1378 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1379 m.Entry.CryptoKey.Data = make([]byte, 128)
1380 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1381 m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
1382 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1383 m.Entry.IntegrityKey.Data = make([]byte, 128)
1384 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1385 m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
1386 m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
1387 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1388 m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
1389 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1390 m.Entry.TxTableID = buf.DecodeUint32()
1391 m.Entry.Salt = buf.DecodeUint32()
1392 m.SwIfIndex = buf.DecodeUint32()
1393 m.Salt = buf.DecodeUint32()
1394 m.SeqOutbound = buf.DecodeUint64()
1395 m.LastSeqInbound = buf.DecodeUint64()
1396 m.ReplayWindow = buf.DecodeUint64()
1397 m.TotalDataSize = buf.DecodeUint64()
1401 // IpsecSaDump defines message 'ipsec_sa_dump'.
1402 type IpsecSaDump struct {
1403 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1406 func (m *IpsecSaDump) Reset() { *m = IpsecSaDump{} }
1407 func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" }
1408 func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" }
1409 func (*IpsecSaDump) GetMessageType() api.MessageType {
1410 return api.RequestMessage
1413 func (m *IpsecSaDump) Size() (size int) {
1420 func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) {
1422 b = make([]byte, m.Size())
1424 buf := codec.NewBuffer(b)
1425 buf.EncodeUint32(m.SaID)
1426 return buf.Bytes(), nil
1428 func (m *IpsecSaDump) Unmarshal(b []byte) error {
1429 buf := codec.NewBuffer(b)
1430 m.SaID = buf.DecodeUint32()
1434 // IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'.
1435 type IpsecSadEntryAddDel struct {
1436 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1437 Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
1440 func (m *IpsecSadEntryAddDel) Reset() { *m = IpsecSadEntryAddDel{} }
1441 func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" }
1442 func (*IpsecSadEntryAddDel) GetCrcString() string { return "a25ab61e" }
1443 func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType {
1444 return api.RequestMessage
1447 func (m *IpsecSadEntryAddDel) Size() (size int) {
1451 size += 1 // m.IsAdd
1452 size += 4 // m.Entry.SadID
1453 size += 4 // m.Entry.Spi
1454 size += 4 // m.Entry.Protocol
1455 size += 4 // m.Entry.CryptoAlgorithm
1456 size += 1 // m.Entry.CryptoKey.Length
1457 size += 1 * 128 // m.Entry.CryptoKey.Data
1458 size += 4 // m.Entry.IntegrityAlgorithm
1459 size += 1 // m.Entry.IntegrityKey.Length
1460 size += 1 * 128 // m.Entry.IntegrityKey.Data
1461 size += 4 // m.Entry.Flags
1462 size += 4 // m.Entry.TunnelSrc.Af
1463 size += 1 * 16 // m.Entry.TunnelSrc.Un
1464 size += 4 // m.Entry.TunnelDst.Af
1465 size += 1 * 16 // m.Entry.TunnelDst.Un
1466 size += 4 // m.Entry.TxTableID
1467 size += 4 // m.Entry.Salt
1470 func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) {
1472 b = make([]byte, m.Size())
1474 buf := codec.NewBuffer(b)
1475 buf.EncodeUint8(m.IsAdd)
1476 buf.EncodeUint32(m.Entry.SadID)
1477 buf.EncodeUint32(m.Entry.Spi)
1478 buf.EncodeUint32(uint32(m.Entry.Protocol))
1479 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1480 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1481 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1482 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1483 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1484 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1485 buf.EncodeUint32(uint32(m.Entry.Flags))
1486 buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
1487 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
1488 buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
1489 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
1490 buf.EncodeUint32(m.Entry.TxTableID)
1491 buf.EncodeUint32(m.Entry.Salt)
1492 return buf.Bytes(), nil
1494 func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error {
1495 buf := codec.NewBuffer(b)
1496 m.IsAdd = buf.DecodeUint8()
1497 m.Entry.SadID = buf.DecodeUint32()
1498 m.Entry.Spi = buf.DecodeUint32()
1499 m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
1500 m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
1501 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1502 m.Entry.CryptoKey.Data = make([]byte, 128)
1503 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1504 m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
1505 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1506 m.Entry.IntegrityKey.Data = make([]byte, 128)
1507 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1508 m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
1509 m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
1510 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1511 m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
1512 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1513 m.Entry.TxTableID = buf.DecodeUint32()
1514 m.Entry.Salt = buf.DecodeUint32()
1518 // IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'.
1519 type IpsecSadEntryAddDelReply struct {
1520 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1521 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1524 func (m *IpsecSadEntryAddDelReply) Reset() { *m = IpsecSadEntryAddDelReply{} }
1525 func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" }
1526 func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1527 func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType {
1528 return api.ReplyMessage
1531 func (m *IpsecSadEntryAddDelReply) Size() (size int) {
1535 size += 4 // m.Retval
1536 size += 4 // m.StatIndex
1539 func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1541 b = make([]byte, m.Size())
1543 buf := codec.NewBuffer(b)
1544 buf.EncodeInt32(m.Retval)
1545 buf.EncodeUint32(m.StatIndex)
1546 return buf.Bytes(), nil
1548 func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error {
1549 buf := codec.NewBuffer(b)
1550 m.Retval = buf.DecodeInt32()
1551 m.StatIndex = buf.DecodeUint32()
1555 // IpsecSelectBackend defines message 'ipsec_select_backend'.
1556 type IpsecSelectBackend struct {
1557 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
1558 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
1561 func (m *IpsecSelectBackend) Reset() { *m = IpsecSelectBackend{} }
1562 func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" }
1563 func (*IpsecSelectBackend) GetCrcString() string { return "4fd24836" }
1564 func (*IpsecSelectBackend) GetMessageType() api.MessageType {
1565 return api.RequestMessage
1568 func (m *IpsecSelectBackend) Size() (size int) {
1572 size += 4 // m.Protocol
1573 size += 1 // m.Index
1576 func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) {
1578 b = make([]byte, m.Size())
1580 buf := codec.NewBuffer(b)
1581 buf.EncodeUint32(uint32(m.Protocol))
1582 buf.EncodeUint8(m.Index)
1583 return buf.Bytes(), nil
1585 func (m *IpsecSelectBackend) Unmarshal(b []byte) error {
1586 buf := codec.NewBuffer(b)
1587 m.Protocol = IpsecProto(buf.DecodeUint32())
1588 m.Index = buf.DecodeUint8()
1592 // IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'.
1593 type IpsecSelectBackendReply struct {
1594 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1597 func (m *IpsecSelectBackendReply) Reset() { *m = IpsecSelectBackendReply{} }
1598 func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" }
1599 func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" }
1600 func (*IpsecSelectBackendReply) GetMessageType() api.MessageType {
1601 return api.ReplyMessage
1604 func (m *IpsecSelectBackendReply) Size() (size int) {
1608 size += 4 // m.Retval
1611 func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) {
1613 b = make([]byte, m.Size())
1615 buf := codec.NewBuffer(b)
1616 buf.EncodeInt32(m.Retval)
1617 return buf.Bytes(), nil
1619 func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error {
1620 buf := codec.NewBuffer(b)
1621 m.Retval = buf.DecodeInt32()
1625 // IpsecSpdAddDel defines message 'ipsec_spd_add_del'.
1626 type IpsecSpdAddDel struct {
1627 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1628 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1631 func (m *IpsecSpdAddDel) Reset() { *m = IpsecSpdAddDel{} }
1632 func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" }
1633 func (*IpsecSpdAddDel) GetCrcString() string { return "9ffdf5da" }
1634 func (*IpsecSpdAddDel) GetMessageType() api.MessageType {
1635 return api.RequestMessage
1638 func (m *IpsecSpdAddDel) Size() (size int) {
1642 size += 1 // m.IsAdd
1643 size += 4 // m.SpdID
1646 func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) {
1648 b = make([]byte, m.Size())
1650 buf := codec.NewBuffer(b)
1651 buf.EncodeUint8(m.IsAdd)
1652 buf.EncodeUint32(m.SpdID)
1653 return buf.Bytes(), nil
1655 func (m *IpsecSpdAddDel) Unmarshal(b []byte) error {
1656 buf := codec.NewBuffer(b)
1657 m.IsAdd = buf.DecodeUint8()
1658 m.SpdID = buf.DecodeUint32()
1662 // IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'.
1663 type IpsecSpdAddDelReply struct {
1664 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1667 func (m *IpsecSpdAddDelReply) Reset() { *m = IpsecSpdAddDelReply{} }
1668 func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" }
1669 func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" }
1670 func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType {
1671 return api.ReplyMessage
1674 func (m *IpsecSpdAddDelReply) Size() (size int) {
1678 size += 4 // m.Retval
1681 func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) {
1683 b = make([]byte, m.Size())
1685 buf := codec.NewBuffer(b)
1686 buf.EncodeInt32(m.Retval)
1687 return buf.Bytes(), nil
1689 func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error {
1690 buf := codec.NewBuffer(b)
1691 m.Retval = buf.DecodeInt32()
1695 // IpsecSpdDetails defines message 'ipsec_spd_details'.
1696 type IpsecSpdDetails struct {
1697 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1700 func (m *IpsecSpdDetails) Reset() { *m = IpsecSpdDetails{} }
1701 func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" }
1702 func (*IpsecSpdDetails) GetCrcString() string { return "021e2c20" }
1703 func (*IpsecSpdDetails) GetMessageType() api.MessageType {
1704 return api.ReplyMessage
1707 func (m *IpsecSpdDetails) Size() (size int) {
1711 size += 4 // m.Entry.SpdID
1712 size += 4 // m.Entry.Priority
1713 size += 1 // m.Entry.IsOutbound
1714 size += 4 // m.Entry.SaID
1715 size += 4 // m.Entry.Policy
1716 size += 1 // m.Entry.Protocol
1717 size += 4 // m.Entry.RemoteAddressStart.Af
1718 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1719 size += 4 // m.Entry.RemoteAddressStop.Af
1720 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1721 size += 4 // m.Entry.LocalAddressStart.Af
1722 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1723 size += 4 // m.Entry.LocalAddressStop.Af
1724 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1725 size += 2 // m.Entry.RemotePortStart
1726 size += 2 // m.Entry.RemotePortStop
1727 size += 2 // m.Entry.LocalPortStart
1728 size += 2 // m.Entry.LocalPortStop
1731 func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) {
1733 b = make([]byte, m.Size())
1735 buf := codec.NewBuffer(b)
1736 buf.EncodeUint32(m.Entry.SpdID)
1737 buf.EncodeInt32(m.Entry.Priority)
1738 buf.EncodeUint8(m.Entry.IsOutbound)
1739 buf.EncodeUint32(m.Entry.SaID)
1740 buf.EncodeUint32(uint32(m.Entry.Policy))
1741 buf.EncodeUint8(m.Entry.Protocol)
1742 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
1743 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1744 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
1745 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1746 buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
1747 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1748 buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
1749 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1750 buf.EncodeUint16(m.Entry.RemotePortStart)
1751 buf.EncodeUint16(m.Entry.RemotePortStop)
1752 buf.EncodeUint16(m.Entry.LocalPortStart)
1753 buf.EncodeUint16(m.Entry.LocalPortStop)
1754 return buf.Bytes(), nil
1756 func (m *IpsecSpdDetails) Unmarshal(b []byte) error {
1757 buf := codec.NewBuffer(b)
1758 m.Entry.SpdID = buf.DecodeUint32()
1759 m.Entry.Priority = buf.DecodeInt32()
1760 m.Entry.IsOutbound = buf.DecodeUint8()
1761 m.Entry.SaID = buf.DecodeUint32()
1762 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1763 m.Entry.Protocol = buf.DecodeUint8()
1764 m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
1765 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1766 m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
1767 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1768 m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
1769 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1770 m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
1771 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1772 m.Entry.RemotePortStart = buf.DecodeUint16()
1773 m.Entry.RemotePortStop = buf.DecodeUint16()
1774 m.Entry.LocalPortStart = buf.DecodeUint16()
1775 m.Entry.LocalPortStop = buf.DecodeUint16()
1779 // IpsecSpdDump defines message 'ipsec_spd_dump'.
1780 type IpsecSpdDump struct {
1781 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1782 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1785 func (m *IpsecSpdDump) Reset() { *m = IpsecSpdDump{} }
1786 func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" }
1787 func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" }
1788 func (*IpsecSpdDump) GetMessageType() api.MessageType {
1789 return api.RequestMessage
1792 func (m *IpsecSpdDump) Size() (size int) {
1796 size += 4 // m.SpdID
1800 func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) {
1802 b = make([]byte, m.Size())
1804 buf := codec.NewBuffer(b)
1805 buf.EncodeUint32(m.SpdID)
1806 buf.EncodeUint32(m.SaID)
1807 return buf.Bytes(), nil
1809 func (m *IpsecSpdDump) Unmarshal(b []byte) error {
1810 buf := codec.NewBuffer(b)
1811 m.SpdID = buf.DecodeUint32()
1812 m.SaID = buf.DecodeUint32()
1816 // IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'.
1817 type IpsecSpdEntryAddDel struct {
1818 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1819 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1822 func (m *IpsecSpdEntryAddDel) Reset() { *m = IpsecSpdEntryAddDel{} }
1823 func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" }
1824 func (*IpsecSpdEntryAddDel) GetCrcString() string { return "db217840" }
1825 func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType {
1826 return api.RequestMessage
1829 func (m *IpsecSpdEntryAddDel) Size() (size int) {
1833 size += 1 // m.IsAdd
1834 size += 4 // m.Entry.SpdID
1835 size += 4 // m.Entry.Priority
1836 size += 1 // m.Entry.IsOutbound
1837 size += 4 // m.Entry.SaID
1838 size += 4 // m.Entry.Policy
1839 size += 1 // m.Entry.Protocol
1840 size += 4 // m.Entry.RemoteAddressStart.Af
1841 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1842 size += 4 // m.Entry.RemoteAddressStop.Af
1843 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1844 size += 4 // m.Entry.LocalAddressStart.Af
1845 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1846 size += 4 // m.Entry.LocalAddressStop.Af
1847 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1848 size += 2 // m.Entry.RemotePortStart
1849 size += 2 // m.Entry.RemotePortStop
1850 size += 2 // m.Entry.LocalPortStart
1851 size += 2 // m.Entry.LocalPortStop
1854 func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) {
1856 b = make([]byte, m.Size())
1858 buf := codec.NewBuffer(b)
1859 buf.EncodeUint8(m.IsAdd)
1860 buf.EncodeUint32(m.Entry.SpdID)
1861 buf.EncodeInt32(m.Entry.Priority)
1862 buf.EncodeUint8(m.Entry.IsOutbound)
1863 buf.EncodeUint32(m.Entry.SaID)
1864 buf.EncodeUint32(uint32(m.Entry.Policy))
1865 buf.EncodeUint8(m.Entry.Protocol)
1866 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
1867 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1868 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
1869 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1870 buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
1871 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1872 buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
1873 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1874 buf.EncodeUint16(m.Entry.RemotePortStart)
1875 buf.EncodeUint16(m.Entry.RemotePortStop)
1876 buf.EncodeUint16(m.Entry.LocalPortStart)
1877 buf.EncodeUint16(m.Entry.LocalPortStop)
1878 return buf.Bytes(), nil
1880 func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error {
1881 buf := codec.NewBuffer(b)
1882 m.IsAdd = buf.DecodeUint8()
1883 m.Entry.SpdID = buf.DecodeUint32()
1884 m.Entry.Priority = buf.DecodeInt32()
1885 m.Entry.IsOutbound = buf.DecodeUint8()
1886 m.Entry.SaID = buf.DecodeUint32()
1887 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1888 m.Entry.Protocol = buf.DecodeUint8()
1889 m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
1890 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1891 m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
1892 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1893 m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
1894 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1895 m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
1896 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1897 m.Entry.RemotePortStart = buf.DecodeUint16()
1898 m.Entry.RemotePortStop = buf.DecodeUint16()
1899 m.Entry.LocalPortStart = buf.DecodeUint16()
1900 m.Entry.LocalPortStop = buf.DecodeUint16()
1904 // IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'.
1905 type IpsecSpdEntryAddDelReply struct {
1906 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1907 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1910 func (m *IpsecSpdEntryAddDelReply) Reset() { *m = IpsecSpdEntryAddDelReply{} }
1911 func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" }
1912 func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1913 func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType {
1914 return api.ReplyMessage
1917 func (m *IpsecSpdEntryAddDelReply) Size() (size int) {
1921 size += 4 // m.Retval
1922 size += 4 // m.StatIndex
1925 func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1927 b = make([]byte, m.Size())
1929 buf := codec.NewBuffer(b)
1930 buf.EncodeInt32(m.Retval)
1931 buf.EncodeUint32(m.StatIndex)
1932 return buf.Bytes(), nil
1934 func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error {
1935 buf := codec.NewBuffer(b)
1936 m.Retval = buf.DecodeInt32()
1937 m.StatIndex = buf.DecodeUint32()
1941 // IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'.
1942 type IpsecSpdInterfaceDetails struct {
1943 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1944 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1947 func (m *IpsecSpdInterfaceDetails) Reset() { *m = IpsecSpdInterfaceDetails{} }
1948 func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" }
1949 func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "2c54296d" }
1950 func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType {
1951 return api.ReplyMessage
1954 func (m *IpsecSpdInterfaceDetails) Size() (size int) {
1958 size += 4 // m.SpdIndex
1959 size += 4 // m.SwIfIndex
1962 func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) {
1964 b = make([]byte, m.Size())
1966 buf := codec.NewBuffer(b)
1967 buf.EncodeUint32(m.SpdIndex)
1968 buf.EncodeUint32(m.SwIfIndex)
1969 return buf.Bytes(), nil
1971 func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error {
1972 buf := codec.NewBuffer(b)
1973 m.SpdIndex = buf.DecodeUint32()
1974 m.SwIfIndex = buf.DecodeUint32()
1978 // IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'.
1979 type IpsecSpdInterfaceDump struct {
1980 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1981 SpdIndexValid uint8 `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"`
1984 func (m *IpsecSpdInterfaceDump) Reset() { *m = IpsecSpdInterfaceDump{} }
1985 func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" }
1986 func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" }
1987 func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType {
1988 return api.RequestMessage
1991 func (m *IpsecSpdInterfaceDump) Size() (size int) {
1995 size += 4 // m.SpdIndex
1996 size += 1 // m.SpdIndexValid
1999 func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) {
2001 b = make([]byte, m.Size())
2003 buf := codec.NewBuffer(b)
2004 buf.EncodeUint32(m.SpdIndex)
2005 buf.EncodeUint8(m.SpdIndexValid)
2006 return buf.Bytes(), nil
2008 func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error {
2009 buf := codec.NewBuffer(b)
2010 m.SpdIndex = buf.DecodeUint32()
2011 m.SpdIndexValid = buf.DecodeUint8()
2015 // IpsecSpdsDetails defines message 'ipsec_spds_details'.
2016 type IpsecSpdsDetails struct {
2017 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
2018 Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"`
2021 func (m *IpsecSpdsDetails) Reset() { *m = IpsecSpdsDetails{} }
2022 func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" }
2023 func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" }
2024 func (*IpsecSpdsDetails) GetMessageType() api.MessageType {
2025 return api.ReplyMessage
2028 func (m *IpsecSpdsDetails) Size() (size int) {
2032 size += 4 // m.SpdID
2033 size += 4 // m.Npolicies
2036 func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) {
2038 b = make([]byte, m.Size())
2040 buf := codec.NewBuffer(b)
2041 buf.EncodeUint32(m.SpdID)
2042 buf.EncodeUint32(m.Npolicies)
2043 return buf.Bytes(), nil
2045 func (m *IpsecSpdsDetails) Unmarshal(b []byte) error {
2046 buf := codec.NewBuffer(b)
2047 m.SpdID = buf.DecodeUint32()
2048 m.Npolicies = buf.DecodeUint32()
2052 // IpsecSpdsDump defines message 'ipsec_spds_dump'.
2053 type IpsecSpdsDump struct{}
2055 func (m *IpsecSpdsDump) Reset() { *m = IpsecSpdsDump{} }
2056 func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" }
2057 func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" }
2058 func (*IpsecSpdsDump) GetMessageType() api.MessageType {
2059 return api.RequestMessage
2062 func (m *IpsecSpdsDump) Size() (size int) {
2068 func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) {
2070 b = make([]byte, m.Size())
2072 buf := codec.NewBuffer(b)
2073 return buf.Bytes(), nil
2075 func (m *IpsecSpdsDump) Unmarshal(b []byte) error {
2079 // IpsecTunnelIfAddDel defines message 'ipsec_tunnel_if_add_del'.
2080 type IpsecTunnelIfAddDel struct {
2081 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
2082 Esn uint8 `binapi:"u8,name=esn" json:"esn,omitempty"`
2083 AntiReplay uint8 `binapi:"u8,name=anti_replay" json:"anti_replay,omitempty"`
2084 LocalIP Address `binapi:"address,name=local_ip" json:"local_ip,omitempty"`
2085 RemoteIP Address `binapi:"address,name=remote_ip" json:"remote_ip,omitempty"`
2086 LocalSpi uint32 `binapi:"u32,name=local_spi" json:"local_spi,omitempty"`
2087 RemoteSpi uint32 `binapi:"u32,name=remote_spi" json:"remote_spi,omitempty"`
2088 CryptoAlg uint8 `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"`
2089 LocalCryptoKeyLen uint8 `binapi:"u8,name=local_crypto_key_len" json:"local_crypto_key_len,omitempty"`
2090 LocalCryptoKey []byte `binapi:"u8[128],name=local_crypto_key" json:"local_crypto_key,omitempty"`
2091 RemoteCryptoKeyLen uint8 `binapi:"u8,name=remote_crypto_key_len" json:"remote_crypto_key_len,omitempty"`
2092 RemoteCryptoKey []byte `binapi:"u8[128],name=remote_crypto_key" json:"remote_crypto_key,omitempty"`
2093 IntegAlg uint8 `binapi:"u8,name=integ_alg" json:"integ_alg,omitempty"`
2094 LocalIntegKeyLen uint8 `binapi:"u8,name=local_integ_key_len" json:"local_integ_key_len,omitempty"`
2095 LocalIntegKey []byte `binapi:"u8[128],name=local_integ_key" json:"local_integ_key,omitempty"`
2096 RemoteIntegKeyLen uint8 `binapi:"u8,name=remote_integ_key_len" json:"remote_integ_key_len,omitempty"`
2097 RemoteIntegKey []byte `binapi:"u8[128],name=remote_integ_key" json:"remote_integ_key,omitempty"`
2098 Renumber uint8 `binapi:"u8,name=renumber" json:"renumber,omitempty"`
2099 ShowInstance uint32 `binapi:"u32,name=show_instance" json:"show_instance,omitempty"`
2100 UDPEncap uint8 `binapi:"u8,name=udp_encap" json:"udp_encap,omitempty"`
2101 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
2102 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
2105 func (m *IpsecTunnelIfAddDel) Reset() { *m = IpsecTunnelIfAddDel{} }
2106 func (*IpsecTunnelIfAddDel) GetMessageName() string { return "ipsec_tunnel_if_add_del" }
2107 func (*IpsecTunnelIfAddDel) GetCrcString() string { return "d5a98274" }
2108 func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType {
2109 return api.RequestMessage
2112 func (m *IpsecTunnelIfAddDel) Size() (size int) {
2116 size += 1 // m.IsAdd
2118 size += 1 // m.AntiReplay
2119 size += 4 // m.LocalIP.Af
2120 size += 1 * 16 // m.LocalIP.Un
2121 size += 4 // m.RemoteIP.Af
2122 size += 1 * 16 // m.RemoteIP.Un
2123 size += 4 // m.LocalSpi
2124 size += 4 // m.RemoteSpi
2125 size += 1 // m.CryptoAlg
2126 size += 1 // m.LocalCryptoKeyLen
2127 size += 1 * 128 // m.LocalCryptoKey
2128 size += 1 // m.RemoteCryptoKeyLen
2129 size += 1 * 128 // m.RemoteCryptoKey
2130 size += 1 // m.IntegAlg
2131 size += 1 // m.LocalIntegKeyLen
2132 size += 1 * 128 // m.LocalIntegKey
2133 size += 1 // m.RemoteIntegKeyLen
2134 size += 1 * 128 // m.RemoteIntegKey
2135 size += 1 // m.Renumber
2136 size += 4 // m.ShowInstance
2137 size += 1 // m.UDPEncap
2138 size += 4 // m.TxTableID
2142 func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) {
2144 b = make([]byte, m.Size())
2146 buf := codec.NewBuffer(b)
2147 buf.EncodeUint8(m.IsAdd)
2148 buf.EncodeUint8(m.Esn)
2149 buf.EncodeUint8(m.AntiReplay)
2150 buf.EncodeUint32(uint32(m.LocalIP.Af))
2151 buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16)
2152 buf.EncodeUint32(uint32(m.RemoteIP.Af))
2153 buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 16)
2154 buf.EncodeUint32(m.LocalSpi)
2155 buf.EncodeUint32(m.RemoteSpi)
2156 buf.EncodeUint8(m.CryptoAlg)
2157 buf.EncodeUint8(m.LocalCryptoKeyLen)
2158 buf.EncodeBytes(m.LocalCryptoKey, 128)
2159 buf.EncodeUint8(m.RemoteCryptoKeyLen)
2160 buf.EncodeBytes(m.RemoteCryptoKey, 128)
2161 buf.EncodeUint8(m.IntegAlg)
2162 buf.EncodeUint8(m.LocalIntegKeyLen)
2163 buf.EncodeBytes(m.LocalIntegKey, 128)
2164 buf.EncodeUint8(m.RemoteIntegKeyLen)
2165 buf.EncodeBytes(m.RemoteIntegKey, 128)
2166 buf.EncodeUint8(m.Renumber)
2167 buf.EncodeUint32(m.ShowInstance)
2168 buf.EncodeUint8(m.UDPEncap)
2169 buf.EncodeUint32(m.TxTableID)
2170 buf.EncodeUint32(m.Salt)
2171 return buf.Bytes(), nil
2173 func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error {
2174 buf := codec.NewBuffer(b)
2175 m.IsAdd = buf.DecodeUint8()
2176 m.Esn = buf.DecodeUint8()
2177 m.AntiReplay = buf.DecodeUint8()
2178 m.LocalIP.Af = AddressFamily(buf.DecodeUint32())
2179 copy(m.LocalIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2180 m.RemoteIP.Af = AddressFamily(buf.DecodeUint32())
2181 copy(m.RemoteIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2182 m.LocalSpi = buf.DecodeUint32()
2183 m.RemoteSpi = buf.DecodeUint32()
2184 m.CryptoAlg = buf.DecodeUint8()
2185 m.LocalCryptoKeyLen = buf.DecodeUint8()
2186 m.LocalCryptoKey = make([]byte, 128)
2187 copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey)))
2188 m.RemoteCryptoKeyLen = buf.DecodeUint8()
2189 m.RemoteCryptoKey = make([]byte, 128)
2190 copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey)))
2191 m.IntegAlg = buf.DecodeUint8()
2192 m.LocalIntegKeyLen = buf.DecodeUint8()
2193 m.LocalIntegKey = make([]byte, 128)
2194 copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey)))
2195 m.RemoteIntegKeyLen = buf.DecodeUint8()
2196 m.RemoteIntegKey = make([]byte, 128)
2197 copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey)))
2198 m.Renumber = buf.DecodeUint8()
2199 m.ShowInstance = buf.DecodeUint32()
2200 m.UDPEncap = buf.DecodeUint8()
2201 m.TxTableID = buf.DecodeUint32()
2202 m.Salt = buf.DecodeUint32()
2206 // IpsecTunnelIfAddDelReply defines message 'ipsec_tunnel_if_add_del_reply'.
2207 type IpsecTunnelIfAddDelReply struct {
2208 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2209 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
2212 func (m *IpsecTunnelIfAddDelReply) Reset() { *m = IpsecTunnelIfAddDelReply{} }
2213 func (*IpsecTunnelIfAddDelReply) GetMessageName() string { return "ipsec_tunnel_if_add_del_reply" }
2214 func (*IpsecTunnelIfAddDelReply) GetCrcString() string { return "fda5941f" }
2215 func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType {
2216 return api.ReplyMessage
2219 func (m *IpsecTunnelIfAddDelReply) Size() (size int) {
2223 size += 4 // m.Retval
2224 size += 4 // m.SwIfIndex
2227 func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) {
2229 b = make([]byte, m.Size())
2231 buf := codec.NewBuffer(b)
2232 buf.EncodeInt32(m.Retval)
2233 buf.EncodeUint32(m.SwIfIndex)
2234 return buf.Bytes(), nil
2236 func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error {
2237 buf := codec.NewBuffer(b)
2238 m.Retval = buf.DecodeInt32()
2239 m.SwIfIndex = buf.DecodeUint32()
2243 // IpsecTunnelIfSetSa defines message 'ipsec_tunnel_if_set_sa'.
2244 type IpsecTunnelIfSetSa struct {
2245 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
2246 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
2247 IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
2250 func (m *IpsecTunnelIfSetSa) Reset() { *m = IpsecTunnelIfSetSa{} }
2251 func (*IpsecTunnelIfSetSa) GetMessageName() string { return "ipsec_tunnel_if_set_sa" }
2252 func (*IpsecTunnelIfSetSa) GetCrcString() string { return "6ab567f2" }
2253 func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType {
2254 return api.RequestMessage
2257 func (m *IpsecTunnelIfSetSa) Size() (size int) {
2261 size += 4 // m.SwIfIndex
2263 size += 1 // m.IsOutbound
2266 func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) {
2268 b = make([]byte, m.Size())
2270 buf := codec.NewBuffer(b)
2271 buf.EncodeUint32(m.SwIfIndex)
2272 buf.EncodeUint32(m.SaID)
2273 buf.EncodeUint8(m.IsOutbound)
2274 return buf.Bytes(), nil
2276 func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error {
2277 buf := codec.NewBuffer(b)
2278 m.SwIfIndex = buf.DecodeUint32()
2279 m.SaID = buf.DecodeUint32()
2280 m.IsOutbound = buf.DecodeUint8()
2284 // IpsecTunnelIfSetSaReply defines message 'ipsec_tunnel_if_set_sa_reply'.
2285 type IpsecTunnelIfSetSaReply struct {
2286 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2289 func (m *IpsecTunnelIfSetSaReply) Reset() { *m = IpsecTunnelIfSetSaReply{} }
2290 func (*IpsecTunnelIfSetSaReply) GetMessageName() string { return "ipsec_tunnel_if_set_sa_reply" }
2291 func (*IpsecTunnelIfSetSaReply) GetCrcString() string { return "e8d4e804" }
2292 func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType {
2293 return api.ReplyMessage
2296 func (m *IpsecTunnelIfSetSaReply) Size() (size int) {
2300 size += 4 // m.Retval
2303 func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) {
2305 b = make([]byte, m.Size())
2307 buf := codec.NewBuffer(b)
2308 buf.EncodeInt32(m.Retval)
2309 return buf.Bytes(), nil
2311 func (m *IpsecTunnelIfSetSaReply) Unmarshal(b []byte) error {
2312 buf := codec.NewBuffer(b)
2313 m.Retval = buf.DecodeInt32()
2317 // IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'.
2318 type IpsecTunnelProtectDel struct {
2319 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2322 func (m *IpsecTunnelProtectDel) Reset() { *m = IpsecTunnelProtectDel{} }
2323 func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" }
2324 func (*IpsecTunnelProtectDel) GetCrcString() string { return "f9e6675e" }
2325 func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType {
2326 return api.RequestMessage
2329 func (m *IpsecTunnelProtectDel) Size() (size int) {
2333 size += 4 // m.SwIfIndex
2336 func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) {
2338 b = make([]byte, m.Size())
2340 buf := codec.NewBuffer(b)
2341 buf.EncodeUint32(uint32(m.SwIfIndex))
2342 return buf.Bytes(), nil
2344 func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error {
2345 buf := codec.NewBuffer(b)
2346 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2350 // IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'.
2351 type IpsecTunnelProtectDelReply struct {
2352 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2355 func (m *IpsecTunnelProtectDelReply) Reset() { *m = IpsecTunnelProtectDelReply{} }
2356 func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" }
2357 func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" }
2358 func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType {
2359 return api.ReplyMessage
2362 func (m *IpsecTunnelProtectDelReply) Size() (size int) {
2366 size += 4 // m.Retval
2369 func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) {
2371 b = make([]byte, m.Size())
2373 buf := codec.NewBuffer(b)
2374 buf.EncodeInt32(m.Retval)
2375 return buf.Bytes(), nil
2377 func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error {
2378 buf := codec.NewBuffer(b)
2379 m.Retval = buf.DecodeInt32()
2383 // IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'.
2384 type IpsecTunnelProtectDetails struct {
2385 Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"`
2388 func (m *IpsecTunnelProtectDetails) Reset() { *m = IpsecTunnelProtectDetails{} }
2389 func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" }
2390 func (*IpsecTunnelProtectDetails) GetCrcString() string { return "7520eefe" }
2391 func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType {
2392 return api.ReplyMessage
2395 func (m *IpsecTunnelProtectDetails) Size() (size int) {
2399 size += 4 // m.Tun.SwIfIndex
2400 size += 4 // m.Tun.SaOut
2401 size += 1 // m.Tun.NSaIn
2402 size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn
2405 func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) {
2407 b = make([]byte, m.Size())
2409 buf := codec.NewBuffer(b)
2410 buf.EncodeUint32(uint32(m.Tun.SwIfIndex))
2411 buf.EncodeUint32(m.Tun.SaOut)
2412 buf.EncodeUint8(uint8(len(m.Tun.SaIn)))
2413 for i := 0; i < len(m.Tun.SaIn); i++ {
2415 if i < len(m.Tun.SaIn) {
2416 x = uint32(m.Tun.SaIn[i])
2420 return buf.Bytes(), nil
2422 func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error {
2423 buf := codec.NewBuffer(b)
2424 m.Tun.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2425 m.Tun.SaOut = buf.DecodeUint32()
2426 m.Tun.NSaIn = buf.DecodeUint8()
2427 m.Tun.SaIn = make([]uint32, m.Tun.NSaIn)
2428 for i := 0; i < len(m.Tun.SaIn); i++ {
2429 m.Tun.SaIn[i] = buf.DecodeUint32()
2434 // IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'.
2435 type IpsecTunnelProtectDump struct {
2436 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2439 func (m *IpsecTunnelProtectDump) Reset() { *m = IpsecTunnelProtectDump{} }
2440 func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" }
2441 func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" }
2442 func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType {
2443 return api.RequestMessage
2446 func (m *IpsecTunnelProtectDump) Size() (size int) {
2450 size += 4 // m.SwIfIndex
2453 func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) {
2455 b = make([]byte, m.Size())
2457 buf := codec.NewBuffer(b)
2458 buf.EncodeUint32(uint32(m.SwIfIndex))
2459 return buf.Bytes(), nil
2461 func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error {
2462 buf := codec.NewBuffer(b)
2463 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2467 // IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'.
2468 type IpsecTunnelProtectUpdate struct {
2469 Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"`
2472 func (m *IpsecTunnelProtectUpdate) Reset() { *m = IpsecTunnelProtectUpdate{} }
2473 func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" }
2474 func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "eccbc177" }
2475 func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType {
2476 return api.RequestMessage
2479 func (m *IpsecTunnelProtectUpdate) Size() (size int) {
2483 size += 4 // m.Tunnel.SwIfIndex
2484 size += 4 // m.Tunnel.SaOut
2485 size += 1 // m.Tunnel.NSaIn
2486 size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn
2489 func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) {
2491 b = make([]byte, m.Size())
2493 buf := codec.NewBuffer(b)
2494 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
2495 buf.EncodeUint32(m.Tunnel.SaOut)
2496 buf.EncodeUint8(uint8(len(m.Tunnel.SaIn)))
2497 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2499 if i < len(m.Tunnel.SaIn) {
2500 x = uint32(m.Tunnel.SaIn[i])
2504 return buf.Bytes(), nil
2506 func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error {
2507 buf := codec.NewBuffer(b)
2508 m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2509 m.Tunnel.SaOut = buf.DecodeUint32()
2510 m.Tunnel.NSaIn = buf.DecodeUint8()
2511 m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn)
2512 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2513 m.Tunnel.SaIn[i] = buf.DecodeUint32()
2518 // IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'.
2519 type IpsecTunnelProtectUpdateReply struct {
2520 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2523 func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} }
2524 func (*IpsecTunnelProtectUpdateReply) GetMessageName() string {
2525 return "ipsec_tunnel_protect_update_reply"
2527 func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" }
2528 func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType {
2529 return api.ReplyMessage
2532 func (m *IpsecTunnelProtectUpdateReply) Size() (size int) {
2536 size += 4 // m.Retval
2539 func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) {
2541 b = make([]byte, m.Size())
2543 buf := codec.NewBuffer(b)
2544 buf.EncodeInt32(m.Retval)
2545 return buf.Bytes(), nil
2547 func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error {
2548 buf := codec.NewBuffer(b)
2549 m.Retval = buf.DecodeInt32()
2553 func init() { file_ipsec_binapi_init() }
2554 func file_ipsec_binapi_init() {
2555 api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_7700751c")
2556 api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14")
2557 api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_1e3b8286")
2558 api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804")
2559 api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_9c8d829a")
2560 api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4")
2561 api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_a25ab61e")
2562 api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b")
2563 api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_4fd24836")
2564 api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804")
2565 api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_9ffdf5da")
2566 api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804")
2567 api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_021e2c20")
2568 api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d")
2569 api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_db217840")
2570 api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b")
2571 api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_2c54296d")
2572 api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19")
2573 api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254")
2574 api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14")
2575 api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec_tunnel_if_add_del_d5a98274")
2576 api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec_tunnel_if_add_del_reply_fda5941f")
2577 api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec_tunnel_if_set_sa_6ab567f2")
2578 api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec_tunnel_if_set_sa_reply_e8d4e804")
2579 api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_f9e6675e")
2580 api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804")
2581 api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_7520eefe")
2582 api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e")
2583 api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_eccbc177")
2584 api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804")
2587 // Messages returns list of all messages in this module.
2588 func AllMessages() []api.Message {
2589 return []api.Message{
2590 (*IpsecBackendDetails)(nil),
2591 (*IpsecBackendDump)(nil),
2592 (*IpsecInterfaceAddDelSpd)(nil),
2593 (*IpsecInterfaceAddDelSpdReply)(nil),
2594 (*IpsecSaDetails)(nil),
2595 (*IpsecSaDump)(nil),
2596 (*IpsecSadEntryAddDel)(nil),
2597 (*IpsecSadEntryAddDelReply)(nil),
2598 (*IpsecSelectBackend)(nil),
2599 (*IpsecSelectBackendReply)(nil),
2600 (*IpsecSpdAddDel)(nil),
2601 (*IpsecSpdAddDelReply)(nil),
2602 (*IpsecSpdDetails)(nil),
2603 (*IpsecSpdDump)(nil),
2604 (*IpsecSpdEntryAddDel)(nil),
2605 (*IpsecSpdEntryAddDelReply)(nil),
2606 (*IpsecSpdInterfaceDetails)(nil),
2607 (*IpsecSpdInterfaceDump)(nil),
2608 (*IpsecSpdsDetails)(nil),
2609 (*IpsecSpdsDump)(nil),
2610 (*IpsecTunnelIfAddDel)(nil),
2611 (*IpsecTunnelIfAddDelReply)(nil),
2612 (*IpsecTunnelIfSetSa)(nil),
2613 (*IpsecTunnelIfSetSaReply)(nil),
2614 (*IpsecTunnelProtectDel)(nil),
2615 (*IpsecTunnelProtectDelReply)(nil),
2616 (*IpsecTunnelProtectDetails)(nil),
2617 (*IpsecTunnelProtectDump)(nil),
2618 (*IpsecTunnelProtectUpdate)(nil),
2619 (*IpsecTunnelProtectUpdateReply)(nil),