1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/ipsec.api.json
7 // Package ipsec contains generated bindings for API file ipsec.api.
20 api "git.fd.io/govpp.git/api"
21 codec "git.fd.io/govpp.git/codec"
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
36 VersionCrc = 0x5a59fef9
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
43 ADDRESS_IP4 AddressFamily = 0
44 ADDRESS_IP6 AddressFamily = 1
48 AddressFamily_name = map[uint32]string{
52 AddressFamily_value = map[string]uint32{
58 func (x AddressFamily) String() string {
59 s, ok := AddressFamily_name[uint32(x)]
63 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
66 // IfStatusFlags defines enum 'if_status_flags'.
67 type IfStatusFlags uint32
70 IF_STATUS_API_FLAG_ADMIN_UP IfStatusFlags = 1
71 IF_STATUS_API_FLAG_LINK_UP IfStatusFlags = 2
75 IfStatusFlags_name = map[uint32]string{
76 1: "IF_STATUS_API_FLAG_ADMIN_UP",
77 2: "IF_STATUS_API_FLAG_LINK_UP",
79 IfStatusFlags_value = map[string]uint32{
80 "IF_STATUS_API_FLAG_ADMIN_UP": 1,
81 "IF_STATUS_API_FLAG_LINK_UP": 2,
85 func (x IfStatusFlags) String() string {
86 s, ok := IfStatusFlags_name[uint32(x)]
90 str := func(n uint32) string {
91 s, ok := IfStatusFlags_name[uint32(n)]
95 return "IfStatusFlags(" + strconv.Itoa(int(n)) + ")"
97 for i := uint32(0); i <= 32; i++ {
107 return str(uint32(x))
112 // IfType defines enum 'if_type'.
116 IF_API_TYPE_HARDWARE IfType = 1
117 IF_API_TYPE_SUB IfType = 2
118 IF_API_TYPE_P2P IfType = 3
119 IF_API_TYPE_PIPE IfType = 4
123 IfType_name = map[uint32]string{
124 1: "IF_API_TYPE_HARDWARE",
125 2: "IF_API_TYPE_SUB",
126 3: "IF_API_TYPE_P2P",
127 4: "IF_API_TYPE_PIPE",
129 IfType_value = map[string]uint32{
130 "IF_API_TYPE_HARDWARE": 1,
131 "IF_API_TYPE_SUB": 2,
132 "IF_API_TYPE_P2P": 3,
133 "IF_API_TYPE_PIPE": 4,
137 func (x IfType) String() string {
138 s, ok := IfType_name[uint32(x)]
142 return "IfType(" + strconv.Itoa(int(x)) + ")"
145 // IPDscp defines enum 'ip_dscp'.
149 IP_API_DSCP_CS0 IPDscp = 0
150 IP_API_DSCP_CS1 IPDscp = 8
151 IP_API_DSCP_AF11 IPDscp = 10
152 IP_API_DSCP_AF12 IPDscp = 12
153 IP_API_DSCP_AF13 IPDscp = 14
154 IP_API_DSCP_CS2 IPDscp = 16
155 IP_API_DSCP_AF21 IPDscp = 18
156 IP_API_DSCP_AF22 IPDscp = 20
157 IP_API_DSCP_AF23 IPDscp = 22
158 IP_API_DSCP_CS3 IPDscp = 24
159 IP_API_DSCP_AF31 IPDscp = 26
160 IP_API_DSCP_AF32 IPDscp = 28
161 IP_API_DSCP_AF33 IPDscp = 30
162 IP_API_DSCP_CS4 IPDscp = 32
163 IP_API_DSCP_AF41 IPDscp = 34
164 IP_API_DSCP_AF42 IPDscp = 36
165 IP_API_DSCP_AF43 IPDscp = 38
166 IP_API_DSCP_CS5 IPDscp = 40
167 IP_API_DSCP_EF IPDscp = 46
168 IP_API_DSCP_CS6 IPDscp = 48
169 IP_API_DSCP_CS7 IPDscp = 50
173 IPDscp_name = map[uint8]string{
174 0: "IP_API_DSCP_CS0",
175 8: "IP_API_DSCP_CS1",
176 10: "IP_API_DSCP_AF11",
177 12: "IP_API_DSCP_AF12",
178 14: "IP_API_DSCP_AF13",
179 16: "IP_API_DSCP_CS2",
180 18: "IP_API_DSCP_AF21",
181 20: "IP_API_DSCP_AF22",
182 22: "IP_API_DSCP_AF23",
183 24: "IP_API_DSCP_CS3",
184 26: "IP_API_DSCP_AF31",
185 28: "IP_API_DSCP_AF32",
186 30: "IP_API_DSCP_AF33",
187 32: "IP_API_DSCP_CS4",
188 34: "IP_API_DSCP_AF41",
189 36: "IP_API_DSCP_AF42",
190 38: "IP_API_DSCP_AF43",
191 40: "IP_API_DSCP_CS5",
192 46: "IP_API_DSCP_EF",
193 48: "IP_API_DSCP_CS6",
194 50: "IP_API_DSCP_CS7",
196 IPDscp_value = map[string]uint8{
197 "IP_API_DSCP_CS0": 0,
198 "IP_API_DSCP_CS1": 8,
199 "IP_API_DSCP_AF11": 10,
200 "IP_API_DSCP_AF12": 12,
201 "IP_API_DSCP_AF13": 14,
202 "IP_API_DSCP_CS2": 16,
203 "IP_API_DSCP_AF21": 18,
204 "IP_API_DSCP_AF22": 20,
205 "IP_API_DSCP_AF23": 22,
206 "IP_API_DSCP_CS3": 24,
207 "IP_API_DSCP_AF31": 26,
208 "IP_API_DSCP_AF32": 28,
209 "IP_API_DSCP_AF33": 30,
210 "IP_API_DSCP_CS4": 32,
211 "IP_API_DSCP_AF41": 34,
212 "IP_API_DSCP_AF42": 36,
213 "IP_API_DSCP_AF43": 38,
214 "IP_API_DSCP_CS5": 40,
215 "IP_API_DSCP_EF": 46,
216 "IP_API_DSCP_CS6": 48,
217 "IP_API_DSCP_CS7": 50,
221 func (x IPDscp) String() string {
222 s, ok := IPDscp_name[uint8(x)]
226 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
229 // IPEcn defines enum 'ip_ecn'.
233 IP_API_ECN_NONE IPEcn = 0
234 IP_API_ECN_ECT0 IPEcn = 1
235 IP_API_ECN_ECT1 IPEcn = 2
236 IP_API_ECN_CE IPEcn = 3
240 IPEcn_name = map[uint8]string{
241 0: "IP_API_ECN_NONE",
242 1: "IP_API_ECN_ECT0",
243 2: "IP_API_ECN_ECT1",
246 IPEcn_value = map[string]uint8{
247 "IP_API_ECN_NONE": 0,
248 "IP_API_ECN_ECT0": 1,
249 "IP_API_ECN_ECT1": 2,
254 func (x IPEcn) String() string {
255 s, ok := IPEcn_name[uint8(x)]
259 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
262 // IPProto defines enum 'ip_proto'.
266 IP_API_PROTO_HOPOPT IPProto = 0
267 IP_API_PROTO_ICMP IPProto = 1
268 IP_API_PROTO_IGMP IPProto = 2
269 IP_API_PROTO_TCP IPProto = 6
270 IP_API_PROTO_UDP IPProto = 17
271 IP_API_PROTO_GRE IPProto = 47
272 IP_API_PROTO_AH IPProto = 50
273 IP_API_PROTO_ESP IPProto = 51
274 IP_API_PROTO_EIGRP IPProto = 88
275 IP_API_PROTO_OSPF IPProto = 89
276 IP_API_PROTO_SCTP IPProto = 132
277 IP_API_PROTO_RESERVED IPProto = 255
281 IPProto_name = map[uint32]string{
282 0: "IP_API_PROTO_HOPOPT",
283 1: "IP_API_PROTO_ICMP",
284 2: "IP_API_PROTO_IGMP",
285 6: "IP_API_PROTO_TCP",
286 17: "IP_API_PROTO_UDP",
287 47: "IP_API_PROTO_GRE",
288 50: "IP_API_PROTO_AH",
289 51: "IP_API_PROTO_ESP",
290 88: "IP_API_PROTO_EIGRP",
291 89: "IP_API_PROTO_OSPF",
292 132: "IP_API_PROTO_SCTP",
293 255: "IP_API_PROTO_RESERVED",
295 IPProto_value = map[string]uint32{
296 "IP_API_PROTO_HOPOPT": 0,
297 "IP_API_PROTO_ICMP": 1,
298 "IP_API_PROTO_IGMP": 2,
299 "IP_API_PROTO_TCP": 6,
300 "IP_API_PROTO_UDP": 17,
301 "IP_API_PROTO_GRE": 47,
302 "IP_API_PROTO_AH": 50,
303 "IP_API_PROTO_ESP": 51,
304 "IP_API_PROTO_EIGRP": 88,
305 "IP_API_PROTO_OSPF": 89,
306 "IP_API_PROTO_SCTP": 132,
307 "IP_API_PROTO_RESERVED": 255,
311 func (x IPProto) String() string {
312 s, ok := IPProto_name[uint32(x)]
316 return "IPProto(" + strconv.Itoa(int(x)) + ")"
319 // IpsecCryptoAlg defines enum 'ipsec_crypto_alg'.
320 type IpsecCryptoAlg uint32
323 IPSEC_API_CRYPTO_ALG_NONE IpsecCryptoAlg = 0
324 IPSEC_API_CRYPTO_ALG_AES_CBC_128 IpsecCryptoAlg = 1
325 IPSEC_API_CRYPTO_ALG_AES_CBC_192 IpsecCryptoAlg = 2
326 IPSEC_API_CRYPTO_ALG_AES_CBC_256 IpsecCryptoAlg = 3
327 IPSEC_API_CRYPTO_ALG_AES_CTR_128 IpsecCryptoAlg = 4
328 IPSEC_API_CRYPTO_ALG_AES_CTR_192 IpsecCryptoAlg = 5
329 IPSEC_API_CRYPTO_ALG_AES_CTR_256 IpsecCryptoAlg = 6
330 IPSEC_API_CRYPTO_ALG_AES_GCM_128 IpsecCryptoAlg = 7
331 IPSEC_API_CRYPTO_ALG_AES_GCM_192 IpsecCryptoAlg = 8
332 IPSEC_API_CRYPTO_ALG_AES_GCM_256 IpsecCryptoAlg = 9
333 IPSEC_API_CRYPTO_ALG_DES_CBC IpsecCryptoAlg = 10
334 IPSEC_API_CRYPTO_ALG_3DES_CBC IpsecCryptoAlg = 11
338 IpsecCryptoAlg_name = map[uint32]string{
339 0: "IPSEC_API_CRYPTO_ALG_NONE",
340 1: "IPSEC_API_CRYPTO_ALG_AES_CBC_128",
341 2: "IPSEC_API_CRYPTO_ALG_AES_CBC_192",
342 3: "IPSEC_API_CRYPTO_ALG_AES_CBC_256",
343 4: "IPSEC_API_CRYPTO_ALG_AES_CTR_128",
344 5: "IPSEC_API_CRYPTO_ALG_AES_CTR_192",
345 6: "IPSEC_API_CRYPTO_ALG_AES_CTR_256",
346 7: "IPSEC_API_CRYPTO_ALG_AES_GCM_128",
347 8: "IPSEC_API_CRYPTO_ALG_AES_GCM_192",
348 9: "IPSEC_API_CRYPTO_ALG_AES_GCM_256",
349 10: "IPSEC_API_CRYPTO_ALG_DES_CBC",
350 11: "IPSEC_API_CRYPTO_ALG_3DES_CBC",
352 IpsecCryptoAlg_value = map[string]uint32{
353 "IPSEC_API_CRYPTO_ALG_NONE": 0,
354 "IPSEC_API_CRYPTO_ALG_AES_CBC_128": 1,
355 "IPSEC_API_CRYPTO_ALG_AES_CBC_192": 2,
356 "IPSEC_API_CRYPTO_ALG_AES_CBC_256": 3,
357 "IPSEC_API_CRYPTO_ALG_AES_CTR_128": 4,
358 "IPSEC_API_CRYPTO_ALG_AES_CTR_192": 5,
359 "IPSEC_API_CRYPTO_ALG_AES_CTR_256": 6,
360 "IPSEC_API_CRYPTO_ALG_AES_GCM_128": 7,
361 "IPSEC_API_CRYPTO_ALG_AES_GCM_192": 8,
362 "IPSEC_API_CRYPTO_ALG_AES_GCM_256": 9,
363 "IPSEC_API_CRYPTO_ALG_DES_CBC": 10,
364 "IPSEC_API_CRYPTO_ALG_3DES_CBC": 11,
368 func (x IpsecCryptoAlg) String() string {
369 s, ok := IpsecCryptoAlg_name[uint32(x)]
373 return "IpsecCryptoAlg(" + strconv.Itoa(int(x)) + ")"
376 // IpsecIntegAlg defines enum 'ipsec_integ_alg'.
377 type IpsecIntegAlg uint32
380 IPSEC_API_INTEG_ALG_NONE IpsecIntegAlg = 0
381 IPSEC_API_INTEG_ALG_MD5_96 IpsecIntegAlg = 1
382 IPSEC_API_INTEG_ALG_SHA1_96 IpsecIntegAlg = 2
383 IPSEC_API_INTEG_ALG_SHA_256_96 IpsecIntegAlg = 3
384 IPSEC_API_INTEG_ALG_SHA_256_128 IpsecIntegAlg = 4
385 IPSEC_API_INTEG_ALG_SHA_384_192 IpsecIntegAlg = 5
386 IPSEC_API_INTEG_ALG_SHA_512_256 IpsecIntegAlg = 6
390 IpsecIntegAlg_name = map[uint32]string{
391 0: "IPSEC_API_INTEG_ALG_NONE",
392 1: "IPSEC_API_INTEG_ALG_MD5_96",
393 2: "IPSEC_API_INTEG_ALG_SHA1_96",
394 3: "IPSEC_API_INTEG_ALG_SHA_256_96",
395 4: "IPSEC_API_INTEG_ALG_SHA_256_128",
396 5: "IPSEC_API_INTEG_ALG_SHA_384_192",
397 6: "IPSEC_API_INTEG_ALG_SHA_512_256",
399 IpsecIntegAlg_value = map[string]uint32{
400 "IPSEC_API_INTEG_ALG_NONE": 0,
401 "IPSEC_API_INTEG_ALG_MD5_96": 1,
402 "IPSEC_API_INTEG_ALG_SHA1_96": 2,
403 "IPSEC_API_INTEG_ALG_SHA_256_96": 3,
404 "IPSEC_API_INTEG_ALG_SHA_256_128": 4,
405 "IPSEC_API_INTEG_ALG_SHA_384_192": 5,
406 "IPSEC_API_INTEG_ALG_SHA_512_256": 6,
410 func (x IpsecIntegAlg) String() string {
411 s, ok := IpsecIntegAlg_name[uint32(x)]
415 return "IpsecIntegAlg(" + strconv.Itoa(int(x)) + ")"
418 // IpsecProto defines enum 'ipsec_proto'.
419 type IpsecProto uint32
422 IPSEC_API_PROTO_ESP IpsecProto = 1
423 IPSEC_API_PROTO_AH IpsecProto = 2
427 IpsecProto_name = map[uint32]string{
428 1: "IPSEC_API_PROTO_ESP",
429 2: "IPSEC_API_PROTO_AH",
431 IpsecProto_value = map[string]uint32{
432 "IPSEC_API_PROTO_ESP": 1,
433 "IPSEC_API_PROTO_AH": 2,
437 func (x IpsecProto) String() string {
438 s, ok := IpsecProto_name[uint32(x)]
442 return "IpsecProto(" + strconv.Itoa(int(x)) + ")"
445 // IpsecSadFlags defines enum 'ipsec_sad_flags'.
446 type IpsecSadFlags uint32
449 IPSEC_API_SAD_FLAG_NONE IpsecSadFlags = 0
450 IPSEC_API_SAD_FLAG_USE_ESN IpsecSadFlags = 1
451 IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY IpsecSadFlags = 2
452 IPSEC_API_SAD_FLAG_IS_TUNNEL IpsecSadFlags = 4
453 IPSEC_API_SAD_FLAG_IS_TUNNEL_V6 IpsecSadFlags = 8
454 IPSEC_API_SAD_FLAG_UDP_ENCAP IpsecSadFlags = 16
458 IpsecSadFlags_name = map[uint32]string{
459 0: "IPSEC_API_SAD_FLAG_NONE",
460 1: "IPSEC_API_SAD_FLAG_USE_ESN",
461 2: "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY",
462 4: "IPSEC_API_SAD_FLAG_IS_TUNNEL",
463 8: "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6",
464 16: "IPSEC_API_SAD_FLAG_UDP_ENCAP",
466 IpsecSadFlags_value = map[string]uint32{
467 "IPSEC_API_SAD_FLAG_NONE": 0,
468 "IPSEC_API_SAD_FLAG_USE_ESN": 1,
469 "IPSEC_API_SAD_FLAG_USE_ANTI_REPLAY": 2,
470 "IPSEC_API_SAD_FLAG_IS_TUNNEL": 4,
471 "IPSEC_API_SAD_FLAG_IS_TUNNEL_V6": 8,
472 "IPSEC_API_SAD_FLAG_UDP_ENCAP": 16,
476 func (x IpsecSadFlags) String() string {
477 s, ok := IpsecSadFlags_name[uint32(x)]
481 str := func(n uint32) string {
482 s, ok := IpsecSadFlags_name[uint32(n)]
486 return "IpsecSadFlags(" + strconv.Itoa(int(n)) + ")"
488 for i := uint32(0); i <= 32; i++ {
498 return str(uint32(x))
503 // IpsecSpdAction defines enum 'ipsec_spd_action'.
504 type IpsecSpdAction uint32
507 IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0
508 IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1
509 IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2
510 IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3
514 IpsecSpdAction_name = map[uint32]string{
515 0: "IPSEC_API_SPD_ACTION_BYPASS",
516 1: "IPSEC_API_SPD_ACTION_DISCARD",
517 2: "IPSEC_API_SPD_ACTION_RESOLVE",
518 3: "IPSEC_API_SPD_ACTION_PROTECT",
520 IpsecSpdAction_value = map[string]uint32{
521 "IPSEC_API_SPD_ACTION_BYPASS": 0,
522 "IPSEC_API_SPD_ACTION_DISCARD": 1,
523 "IPSEC_API_SPD_ACTION_RESOLVE": 2,
524 "IPSEC_API_SPD_ACTION_PROTECT": 3,
528 func (x IpsecSpdAction) String() string {
529 s, ok := IpsecSpdAction_name[uint32(x)]
533 return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")"
536 // LinkDuplex defines enum 'link_duplex'.
537 type LinkDuplex uint32
540 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
541 LINK_DUPLEX_API_HALF LinkDuplex = 1
542 LINK_DUPLEX_API_FULL LinkDuplex = 2
546 LinkDuplex_name = map[uint32]string{
547 0: "LINK_DUPLEX_API_UNKNOWN",
548 1: "LINK_DUPLEX_API_HALF",
549 2: "LINK_DUPLEX_API_FULL",
551 LinkDuplex_value = map[string]uint32{
552 "LINK_DUPLEX_API_UNKNOWN": 0,
553 "LINK_DUPLEX_API_HALF": 1,
554 "LINK_DUPLEX_API_FULL": 2,
558 func (x LinkDuplex) String() string {
559 s, ok := LinkDuplex_name[uint32(x)]
563 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
566 // MtuProto defines enum 'mtu_proto'.
570 MTU_PROTO_API_L3 MtuProto = 1
571 MTU_PROTO_API_IP4 MtuProto = 2
572 MTU_PROTO_API_IP6 MtuProto = 3
573 MTU_PROTO_API_MPLS MtuProto = 4
574 MTU_PROTO_API_N MtuProto = 5
578 MtuProto_name = map[uint32]string{
579 1: "MTU_PROTO_API_L3",
580 2: "MTU_PROTO_API_IP4",
581 3: "MTU_PROTO_API_IP6",
582 4: "MTU_PROTO_API_MPLS",
583 5: "MTU_PROTO_API_N",
585 MtuProto_value = map[string]uint32{
586 "MTU_PROTO_API_L3": 1,
587 "MTU_PROTO_API_IP4": 2,
588 "MTU_PROTO_API_IP6": 3,
589 "MTU_PROTO_API_MPLS": 4,
590 "MTU_PROTO_API_N": 5,
594 func (x MtuProto) String() string {
595 s, ok := MtuProto_name[uint32(x)]
599 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
602 // RxMode defines enum 'rx_mode'.
606 RX_MODE_API_UNKNOWN RxMode = 0
607 RX_MODE_API_POLLING RxMode = 1
608 RX_MODE_API_INTERRUPT RxMode = 2
609 RX_MODE_API_ADAPTIVE RxMode = 3
610 RX_MODE_API_DEFAULT RxMode = 4
614 RxMode_name = map[uint32]string{
615 0: "RX_MODE_API_UNKNOWN",
616 1: "RX_MODE_API_POLLING",
617 2: "RX_MODE_API_INTERRUPT",
618 3: "RX_MODE_API_ADAPTIVE",
619 4: "RX_MODE_API_DEFAULT",
621 RxMode_value = map[string]uint32{
622 "RX_MODE_API_UNKNOWN": 0,
623 "RX_MODE_API_POLLING": 1,
624 "RX_MODE_API_INTERRUPT": 2,
625 "RX_MODE_API_ADAPTIVE": 3,
626 "RX_MODE_API_DEFAULT": 4,
630 func (x RxMode) String() string {
631 s, ok := RxMode_name[uint32(x)]
635 return "RxMode(" + strconv.Itoa(int(x)) + ")"
638 // SubIfFlags defines enum 'sub_if_flags'.
639 type SubIfFlags uint32
642 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
643 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
644 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
645 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
646 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
647 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
648 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
649 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
650 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
651 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
655 SubIfFlags_name = map[uint32]string{
656 1: "SUB_IF_API_FLAG_NO_TAGS",
657 2: "SUB_IF_API_FLAG_ONE_TAG",
658 4: "SUB_IF_API_FLAG_TWO_TAGS",
659 8: "SUB_IF_API_FLAG_DOT1AD",
660 16: "SUB_IF_API_FLAG_EXACT_MATCH",
661 32: "SUB_IF_API_FLAG_DEFAULT",
662 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
663 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
664 254: "SUB_IF_API_FLAG_MASK_VNET",
665 256: "SUB_IF_API_FLAG_DOT1AH",
667 SubIfFlags_value = map[string]uint32{
668 "SUB_IF_API_FLAG_NO_TAGS": 1,
669 "SUB_IF_API_FLAG_ONE_TAG": 2,
670 "SUB_IF_API_FLAG_TWO_TAGS": 4,
671 "SUB_IF_API_FLAG_DOT1AD": 8,
672 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
673 "SUB_IF_API_FLAG_DEFAULT": 32,
674 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
675 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
676 "SUB_IF_API_FLAG_MASK_VNET": 254,
677 "SUB_IF_API_FLAG_DOT1AH": 256,
681 func (x SubIfFlags) String() string {
682 s, ok := SubIfFlags_name[uint32(x)]
686 str := func(n uint32) string {
687 s, ok := SubIfFlags_name[uint32(n)]
691 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
693 for i := uint32(0); i <= 32; i++ {
703 return str(uint32(x))
708 // AddressWithPrefix defines alias 'address_with_prefix'.
709 type AddressWithPrefix Prefix
711 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
712 prefix, err := ParsePrefix(s)
714 return AddressWithPrefix{}, err
716 return AddressWithPrefix(prefix), nil
718 func (x AddressWithPrefix) String() string {
719 return Prefix(x).String()
721 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
722 return []byte(x.String()), nil
724 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
725 prefix, err := ParseAddressWithPrefix(string(text))
733 // InterfaceIndex defines alias 'interface_index'.
734 type InterfaceIndex uint32
736 // IP4Address defines alias 'ip4_address'.
737 type IP4Address [4]uint8
739 func ParseIP4Address(s string) (IP4Address, error) {
740 ip := net.ParseIP(s).To4()
742 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
744 var ipaddr IP4Address
745 copy(ipaddr[:], ip.To4())
749 func (x IP4Address) ToIP() net.IP {
750 return net.IP(x[:]).To4()
752 func (x IP4Address) String() string {
753 return x.ToIP().String()
755 func (x *IP4Address) MarshalText() ([]byte, error) {
756 return []byte(x.String()), nil
758 func (x *IP4Address) UnmarshalText(text []byte) error {
759 ipaddr, err := ParseIP4Address(string(text))
767 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
768 type IP4AddressWithPrefix IP4Prefix
770 // IP6Address defines alias 'ip6_address'.
771 type IP6Address [16]uint8
773 func ParseIP6Address(s string) (IP6Address, error) {
774 ip := net.ParseIP(s).To16()
776 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
778 var ipaddr IP6Address
779 copy(ipaddr[:], ip.To16())
783 func (x IP6Address) ToIP() net.IP {
784 return net.IP(x[:]).To16()
786 func (x IP6Address) String() string {
787 return x.ToIP().String()
789 func (x *IP6Address) MarshalText() ([]byte, error) {
790 return []byte(x.String()), nil
792 func (x *IP6Address) UnmarshalText(text []byte) error {
793 ipaddr, err := ParseIP6Address(string(text))
801 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
802 type IP6AddressWithPrefix IP6Prefix
804 // Address defines type 'address'.
805 type Address struct {
806 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
807 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
810 func ParseAddress(s string) (Address, error) {
813 return Address{}, fmt.Errorf("invalid address: %s", s)
817 addr.Af = ADDRESS_IP6
819 copy(ip6[:], ip.To16())
822 addr.Af = ADDRESS_IP4
824 copy(ip4[:], ip.To4())
829 func (x Address) ToIP() net.IP {
830 if x.Af == ADDRESS_IP6 {
832 return net.IP(ip6[:]).To16()
835 return net.IP(ip4[:]).To4()
838 func (x Address) String() string {
839 return x.ToIP().String()
841 func (x *Address) MarshalText() ([]byte, error) {
842 return []byte(x.String()), nil
844 func (x *Address) UnmarshalText(text []byte) error {
845 addr, err := ParseAddress(string(text))
853 // IP4Prefix defines type 'ip4_prefix'.
854 type IP4Prefix struct {
855 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
856 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
859 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
860 hasPrefix := strings.Contains(s, "/")
862 ip, network, err := net.ParseCIDR(s)
864 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
866 maskSize, _ := network.Mask.Size()
867 prefix.Len = byte(maskSize)
868 prefix.Address, err = ParseIP4Address(ip.String())
870 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
874 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
876 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
878 prefix.Len = byte(defaultMaskSize)
879 prefix.Address, err = ParseIP4Address(ip.String())
881 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
886 func (x IP4Prefix) ToIPNet() *net.IPNet {
887 mask := net.CIDRMask(int(x.Len), 32)
888 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
891 func (x IP4Prefix) String() string {
892 ip := x.Address.String()
893 return ip + "/" + strconv.Itoa(int(x.Len))
895 func (x *IP4Prefix) MarshalText() ([]byte, error) {
896 return []byte(x.String()), nil
898 func (x *IP4Prefix) UnmarshalText(text []byte) error {
899 prefix, err := ParseIP4Prefix(string(text))
907 // IP6Prefix defines type 'ip6_prefix'.
908 type IP6Prefix struct {
909 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
910 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
913 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
914 hasPrefix := strings.Contains(s, "/")
916 ip, network, err := net.ParseCIDR(s)
918 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
920 maskSize, _ := network.Mask.Size()
921 prefix.Len = byte(maskSize)
922 prefix.Address, err = ParseIP6Address(ip.String())
924 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
928 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
930 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
932 prefix.Len = byte(defaultMaskSize)
933 prefix.Address, err = ParseIP6Address(ip.String())
935 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
940 func (x IP6Prefix) ToIPNet() *net.IPNet {
941 mask := net.CIDRMask(int(x.Len), 128)
942 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
945 func (x IP6Prefix) String() string {
946 ip := x.Address.String()
947 return ip + "/" + strconv.Itoa(int(x.Len))
949 func (x *IP6Prefix) MarshalText() ([]byte, error) {
950 return []byte(x.String()), nil
952 func (x *IP6Prefix) UnmarshalText(text []byte) error {
953 prefix, err := ParseIP6Prefix(string(text))
961 // IpsecSadEntry defines type 'ipsec_sad_entry'.
962 type IpsecSadEntry struct {
963 SadID uint32 `binapi:"u32,name=sad_id" json:"sad_id,omitempty"`
964 Spi uint32 `binapi:"u32,name=spi" json:"spi,omitempty"`
965 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
966 CryptoAlgorithm IpsecCryptoAlg `binapi:"ipsec_crypto_alg,name=crypto_algorithm" json:"crypto_algorithm,omitempty"`
967 CryptoKey Key `binapi:"key,name=crypto_key" json:"crypto_key,omitempty"`
968 IntegrityAlgorithm IpsecIntegAlg `binapi:"ipsec_integ_alg,name=integrity_algorithm" json:"integrity_algorithm,omitempty"`
969 IntegrityKey Key `binapi:"key,name=integrity_key" json:"integrity_key,omitempty"`
970 Flags IpsecSadFlags `binapi:"ipsec_sad_flags,name=flags" json:"flags,omitempty"`
971 TunnelSrc Address `binapi:"address,name=tunnel_src" json:"tunnel_src,omitempty"`
972 TunnelDst Address `binapi:"address,name=tunnel_dst" json:"tunnel_dst,omitempty"`
973 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
974 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
977 // IpsecSpdEntry defines type 'ipsec_spd_entry'.
978 type IpsecSpdEntry struct {
979 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
980 Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"`
981 IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
982 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
983 Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"`
984 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
985 RemoteAddressStart Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"`
986 RemoteAddressStop Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"`
987 LocalAddressStart Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"`
988 LocalAddressStop Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"`
989 RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"`
990 RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"`
991 LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"`
992 LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"`
995 // IpsecTunnelProtect defines type 'ipsec_tunnel_protect'.
996 type IpsecTunnelProtect struct {
997 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
998 SaOut uint32 `binapi:"u32,name=sa_out" json:"sa_out,omitempty"`
999 NSaIn uint8 `binapi:"u8,name=n_sa_in" json:"-"`
1000 SaIn []uint32 `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"`
1003 // Key defines type 'key'.
1005 Length uint8 `binapi:"u8,name=length" json:"length,omitempty"`
1006 Data []byte `binapi:"u8[128],name=data" json:"data,omitempty"`
1009 // Mprefix defines type 'mprefix'.
1010 type Mprefix struct {
1011 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
1012 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
1013 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
1014 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
1017 // Prefix defines type 'prefix'.
1018 type Prefix struct {
1019 Address Address `binapi:"address,name=address" json:"address,omitempty"`
1020 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
1023 func ParsePrefix(ip string) (prefix Prefix, err error) {
1024 hasPrefix := strings.Contains(ip, "/")
1026 netIP, network, err := net.ParseCIDR(ip)
1028 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1030 maskSize, _ := network.Mask.Size()
1031 prefix.Len = byte(maskSize)
1032 prefix.Address, err = ParseAddress(netIP.String())
1034 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1037 netIP := net.ParseIP(ip)
1038 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
1039 if netIP.To4() == nil {
1040 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
1042 prefix.Len = byte(defaultMaskSize)
1043 prefix.Address, err = ParseAddress(netIP.String())
1045 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
1050 func (x Prefix) ToIPNet() *net.IPNet {
1052 if x.Address.Af == ADDRESS_IP4 {
1053 mask = net.CIDRMask(int(x.Len), 32)
1055 mask = net.CIDRMask(int(x.Len), 128)
1057 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
1060 func (x Prefix) String() string {
1061 ip := x.Address.String()
1062 return ip + "/" + strconv.Itoa(int(x.Len))
1064 func (x *Prefix) MarshalText() ([]byte, error) {
1065 return []byte(x.String()), nil
1067 func (x *Prefix) UnmarshalText(text []byte) error {
1068 prefix, err := ParsePrefix(string(text))
1076 // PrefixMatcher defines type 'prefix_matcher'.
1077 type PrefixMatcher struct {
1078 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
1079 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
1082 // AddressUnion defines union 'address_union'.
1083 type AddressUnion struct {
1086 XXX_UnionData [16]byte
1089 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
1093 func (u *AddressUnion) SetIP4(a IP4Address) {
1094 buf := codec.NewBuffer(u.XXX_UnionData[:])
1095 buf.EncodeBytes(a[:], 4)
1097 func (u *AddressUnion) GetIP4() (a IP4Address) {
1098 buf := codec.NewBuffer(u.XXX_UnionData[:])
1099 copy(a[:], buf.DecodeBytes(4))
1103 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
1107 func (u *AddressUnion) SetIP6(a IP6Address) {
1108 buf := codec.NewBuffer(u.XXX_UnionData[:])
1109 buf.EncodeBytes(a[:], 16)
1111 func (u *AddressUnion) GetIP6() (a IP6Address) {
1112 buf := codec.NewBuffer(u.XXX_UnionData[:])
1113 copy(a[:], buf.DecodeBytes(16))
1117 // IpsecBackendDetails defines message 'ipsec_backend_details'.
1118 type IpsecBackendDetails struct {
1119 Name []byte `binapi:"u8[128],name=name" json:"name,omitempty"`
1120 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
1121 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
1122 Active uint8 `binapi:"u8,name=active" json:"active,omitempty"`
1125 func (m *IpsecBackendDetails) Reset() { *m = IpsecBackendDetails{} }
1126 func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" }
1127 func (*IpsecBackendDetails) GetCrcString() string { return "7700751c" }
1128 func (*IpsecBackendDetails) GetMessageType() api.MessageType {
1129 return api.ReplyMessage
1132 func (m *IpsecBackendDetails) Size() (size int) {
1136 size += 1 * 128 // m.Name
1137 size += 4 // m.Protocol
1138 size += 1 // m.Index
1139 size += 1 // m.Active
1142 func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) {
1144 b = make([]byte, m.Size())
1146 buf := codec.NewBuffer(b)
1147 buf.EncodeBytes(m.Name, 128)
1148 buf.EncodeUint32(uint32(m.Protocol))
1149 buf.EncodeUint8(m.Index)
1150 buf.EncodeUint8(m.Active)
1151 return buf.Bytes(), nil
1153 func (m *IpsecBackendDetails) Unmarshal(b []byte) error {
1154 buf := codec.NewBuffer(b)
1155 m.Name = make([]byte, 128)
1156 copy(m.Name, buf.DecodeBytes(len(m.Name)))
1157 m.Protocol = IpsecProto(buf.DecodeUint32())
1158 m.Index = buf.DecodeUint8()
1159 m.Active = buf.DecodeUint8()
1163 // IpsecBackendDump defines message 'ipsec_backend_dump'.
1164 type IpsecBackendDump struct{}
1166 func (m *IpsecBackendDump) Reset() { *m = IpsecBackendDump{} }
1167 func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" }
1168 func (*IpsecBackendDump) GetCrcString() string { return "51077d14" }
1169 func (*IpsecBackendDump) GetMessageType() api.MessageType {
1170 return api.RequestMessage
1173 func (m *IpsecBackendDump) Size() (size int) {
1179 func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) {
1181 b = make([]byte, m.Size())
1183 buf := codec.NewBuffer(b)
1184 return buf.Bytes(), nil
1186 func (m *IpsecBackendDump) Unmarshal(b []byte) error {
1190 // IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'.
1191 type IpsecInterfaceAddDelSpd struct {
1192 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1193 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1194 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1197 func (m *IpsecInterfaceAddDelSpd) Reset() { *m = IpsecInterfaceAddDelSpd{} }
1198 func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" }
1199 func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "1e3b8286" }
1200 func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType {
1201 return api.RequestMessage
1204 func (m *IpsecInterfaceAddDelSpd) Size() (size int) {
1208 size += 1 // m.IsAdd
1209 size += 4 // m.SwIfIndex
1210 size += 4 // m.SpdID
1213 func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) {
1215 b = make([]byte, m.Size())
1217 buf := codec.NewBuffer(b)
1218 buf.EncodeUint8(m.IsAdd)
1219 buf.EncodeUint32(m.SwIfIndex)
1220 buf.EncodeUint32(m.SpdID)
1221 return buf.Bytes(), nil
1223 func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error {
1224 buf := codec.NewBuffer(b)
1225 m.IsAdd = buf.DecodeUint8()
1226 m.SwIfIndex = buf.DecodeUint32()
1227 m.SpdID = buf.DecodeUint32()
1231 // IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'.
1232 type IpsecInterfaceAddDelSpdReply struct {
1233 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1236 func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} }
1237 func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string {
1238 return "ipsec_interface_add_del_spd_reply"
1240 func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" }
1241 func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType {
1242 return api.ReplyMessage
1245 func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) {
1249 size += 4 // m.Retval
1252 func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) {
1254 b = make([]byte, m.Size())
1256 buf := codec.NewBuffer(b)
1257 buf.EncodeInt32(m.Retval)
1258 return buf.Bytes(), nil
1260 func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error {
1261 buf := codec.NewBuffer(b)
1262 m.Retval = buf.DecodeInt32()
1266 // IpsecSaDetails defines message 'ipsec_sa_details'.
1267 type IpsecSaDetails struct {
1268 Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
1269 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1270 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
1271 SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
1272 LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
1273 ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
1274 TotalDataSize uint64 `binapi:"u64,name=total_data_size" json:"total_data_size,omitempty"`
1277 func (m *IpsecSaDetails) Reset() { *m = IpsecSaDetails{} }
1278 func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" }
1279 func (*IpsecSaDetails) GetCrcString() string { return "9c8d829a" }
1280 func (*IpsecSaDetails) GetMessageType() api.MessageType {
1281 return api.ReplyMessage
1284 func (m *IpsecSaDetails) Size() (size int) {
1288 size += 4 // m.Entry.SadID
1289 size += 4 // m.Entry.Spi
1290 size += 4 // m.Entry.Protocol
1291 size += 4 // m.Entry.CryptoAlgorithm
1292 size += 1 // m.Entry.CryptoKey.Length
1293 size += 1 * 128 // m.Entry.CryptoKey.Data
1294 size += 4 // m.Entry.IntegrityAlgorithm
1295 size += 1 // m.Entry.IntegrityKey.Length
1296 size += 1 * 128 // m.Entry.IntegrityKey.Data
1297 size += 4 // m.Entry.Flags
1298 size += 4 // m.Entry.TunnelSrc.Af
1299 size += 1 * 16 // m.Entry.TunnelSrc.Un
1300 size += 4 // m.Entry.TunnelDst.Af
1301 size += 1 * 16 // m.Entry.TunnelDst.Un
1302 size += 4 // m.Entry.TxTableID
1303 size += 4 // m.Entry.Salt
1304 size += 4 // m.SwIfIndex
1306 size += 8 // m.SeqOutbound
1307 size += 8 // m.LastSeqInbound
1308 size += 8 // m.ReplayWindow
1309 size += 8 // m.TotalDataSize
1312 func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) {
1314 b = make([]byte, m.Size())
1316 buf := codec.NewBuffer(b)
1317 buf.EncodeUint32(m.Entry.SadID)
1318 buf.EncodeUint32(m.Entry.Spi)
1319 buf.EncodeUint32(uint32(m.Entry.Protocol))
1320 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1321 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1322 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1323 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1324 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1325 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1326 buf.EncodeUint32(uint32(m.Entry.Flags))
1327 buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
1328 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
1329 buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
1330 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
1331 buf.EncodeUint32(m.Entry.TxTableID)
1332 buf.EncodeUint32(m.Entry.Salt)
1333 buf.EncodeUint32(m.SwIfIndex)
1334 buf.EncodeUint32(m.Salt)
1335 buf.EncodeUint64(m.SeqOutbound)
1336 buf.EncodeUint64(m.LastSeqInbound)
1337 buf.EncodeUint64(m.ReplayWindow)
1338 buf.EncodeUint64(m.TotalDataSize)
1339 return buf.Bytes(), nil
1341 func (m *IpsecSaDetails) Unmarshal(b []byte) error {
1342 buf := codec.NewBuffer(b)
1343 m.Entry.SadID = buf.DecodeUint32()
1344 m.Entry.Spi = buf.DecodeUint32()
1345 m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
1346 m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
1347 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1348 m.Entry.CryptoKey.Data = make([]byte, 128)
1349 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1350 m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
1351 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1352 m.Entry.IntegrityKey.Data = make([]byte, 128)
1353 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1354 m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
1355 m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
1356 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1357 m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
1358 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1359 m.Entry.TxTableID = buf.DecodeUint32()
1360 m.Entry.Salt = buf.DecodeUint32()
1361 m.SwIfIndex = buf.DecodeUint32()
1362 m.Salt = buf.DecodeUint32()
1363 m.SeqOutbound = buf.DecodeUint64()
1364 m.LastSeqInbound = buf.DecodeUint64()
1365 m.ReplayWindow = buf.DecodeUint64()
1366 m.TotalDataSize = buf.DecodeUint64()
1370 // IpsecSaDump defines message 'ipsec_sa_dump'.
1371 type IpsecSaDump struct {
1372 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1375 func (m *IpsecSaDump) Reset() { *m = IpsecSaDump{} }
1376 func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" }
1377 func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" }
1378 func (*IpsecSaDump) GetMessageType() api.MessageType {
1379 return api.RequestMessage
1382 func (m *IpsecSaDump) Size() (size int) {
1389 func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) {
1391 b = make([]byte, m.Size())
1393 buf := codec.NewBuffer(b)
1394 buf.EncodeUint32(m.SaID)
1395 return buf.Bytes(), nil
1397 func (m *IpsecSaDump) Unmarshal(b []byte) error {
1398 buf := codec.NewBuffer(b)
1399 m.SaID = buf.DecodeUint32()
1403 // IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'.
1404 type IpsecSadEntryAddDel struct {
1405 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1406 Entry IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
1409 func (m *IpsecSadEntryAddDel) Reset() { *m = IpsecSadEntryAddDel{} }
1410 func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" }
1411 func (*IpsecSadEntryAddDel) GetCrcString() string { return "a25ab61e" }
1412 func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType {
1413 return api.RequestMessage
1416 func (m *IpsecSadEntryAddDel) Size() (size int) {
1420 size += 1 // m.IsAdd
1421 size += 4 // m.Entry.SadID
1422 size += 4 // m.Entry.Spi
1423 size += 4 // m.Entry.Protocol
1424 size += 4 // m.Entry.CryptoAlgorithm
1425 size += 1 // m.Entry.CryptoKey.Length
1426 size += 1 * 128 // m.Entry.CryptoKey.Data
1427 size += 4 // m.Entry.IntegrityAlgorithm
1428 size += 1 // m.Entry.IntegrityKey.Length
1429 size += 1 * 128 // m.Entry.IntegrityKey.Data
1430 size += 4 // m.Entry.Flags
1431 size += 4 // m.Entry.TunnelSrc.Af
1432 size += 1 * 16 // m.Entry.TunnelSrc.Un
1433 size += 4 // m.Entry.TunnelDst.Af
1434 size += 1 * 16 // m.Entry.TunnelDst.Un
1435 size += 4 // m.Entry.TxTableID
1436 size += 4 // m.Entry.Salt
1439 func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) {
1441 b = make([]byte, m.Size())
1443 buf := codec.NewBuffer(b)
1444 buf.EncodeUint8(m.IsAdd)
1445 buf.EncodeUint32(m.Entry.SadID)
1446 buf.EncodeUint32(m.Entry.Spi)
1447 buf.EncodeUint32(uint32(m.Entry.Protocol))
1448 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1449 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1450 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1451 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1452 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1453 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1454 buf.EncodeUint32(uint32(m.Entry.Flags))
1455 buf.EncodeUint32(uint32(m.Entry.TunnelSrc.Af))
1456 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
1457 buf.EncodeUint32(uint32(m.Entry.TunnelDst.Af))
1458 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
1459 buf.EncodeUint32(m.Entry.TxTableID)
1460 buf.EncodeUint32(m.Entry.Salt)
1461 return buf.Bytes(), nil
1463 func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error {
1464 buf := codec.NewBuffer(b)
1465 m.IsAdd = buf.DecodeUint8()
1466 m.Entry.SadID = buf.DecodeUint32()
1467 m.Entry.Spi = buf.DecodeUint32()
1468 m.Entry.Protocol = IpsecProto(buf.DecodeUint32())
1469 m.Entry.CryptoAlgorithm = IpsecCryptoAlg(buf.DecodeUint32())
1470 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1471 m.Entry.CryptoKey.Data = make([]byte, 128)
1472 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1473 m.Entry.IntegrityAlgorithm = IpsecIntegAlg(buf.DecodeUint32())
1474 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1475 m.Entry.IntegrityKey.Data = make([]byte, 128)
1476 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1477 m.Entry.Flags = IpsecSadFlags(buf.DecodeUint32())
1478 m.Entry.TunnelSrc.Af = AddressFamily(buf.DecodeUint32())
1479 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1480 m.Entry.TunnelDst.Af = AddressFamily(buf.DecodeUint32())
1481 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1482 m.Entry.TxTableID = buf.DecodeUint32()
1483 m.Entry.Salt = buf.DecodeUint32()
1487 // IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'.
1488 type IpsecSadEntryAddDelReply struct {
1489 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1490 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1493 func (m *IpsecSadEntryAddDelReply) Reset() { *m = IpsecSadEntryAddDelReply{} }
1494 func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" }
1495 func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1496 func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType {
1497 return api.ReplyMessage
1500 func (m *IpsecSadEntryAddDelReply) Size() (size int) {
1504 size += 4 // m.Retval
1505 size += 4 // m.StatIndex
1508 func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1510 b = make([]byte, m.Size())
1512 buf := codec.NewBuffer(b)
1513 buf.EncodeInt32(m.Retval)
1514 buf.EncodeUint32(m.StatIndex)
1515 return buf.Bytes(), nil
1517 func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error {
1518 buf := codec.NewBuffer(b)
1519 m.Retval = buf.DecodeInt32()
1520 m.StatIndex = buf.DecodeUint32()
1524 // IpsecSelectBackend defines message 'ipsec_select_backend'.
1525 type IpsecSelectBackend struct {
1526 Protocol IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
1527 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
1530 func (m *IpsecSelectBackend) Reset() { *m = IpsecSelectBackend{} }
1531 func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" }
1532 func (*IpsecSelectBackend) GetCrcString() string { return "4fd24836" }
1533 func (*IpsecSelectBackend) GetMessageType() api.MessageType {
1534 return api.RequestMessage
1537 func (m *IpsecSelectBackend) Size() (size int) {
1541 size += 4 // m.Protocol
1542 size += 1 // m.Index
1545 func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) {
1547 b = make([]byte, m.Size())
1549 buf := codec.NewBuffer(b)
1550 buf.EncodeUint32(uint32(m.Protocol))
1551 buf.EncodeUint8(m.Index)
1552 return buf.Bytes(), nil
1554 func (m *IpsecSelectBackend) Unmarshal(b []byte) error {
1555 buf := codec.NewBuffer(b)
1556 m.Protocol = IpsecProto(buf.DecodeUint32())
1557 m.Index = buf.DecodeUint8()
1561 // IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'.
1562 type IpsecSelectBackendReply struct {
1563 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1566 func (m *IpsecSelectBackendReply) Reset() { *m = IpsecSelectBackendReply{} }
1567 func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" }
1568 func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" }
1569 func (*IpsecSelectBackendReply) GetMessageType() api.MessageType {
1570 return api.ReplyMessage
1573 func (m *IpsecSelectBackendReply) Size() (size int) {
1577 size += 4 // m.Retval
1580 func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) {
1582 b = make([]byte, m.Size())
1584 buf := codec.NewBuffer(b)
1585 buf.EncodeInt32(m.Retval)
1586 return buf.Bytes(), nil
1588 func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error {
1589 buf := codec.NewBuffer(b)
1590 m.Retval = buf.DecodeInt32()
1594 // IpsecSpdAddDel defines message 'ipsec_spd_add_del'.
1595 type IpsecSpdAddDel struct {
1596 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1597 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1600 func (m *IpsecSpdAddDel) Reset() { *m = IpsecSpdAddDel{} }
1601 func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" }
1602 func (*IpsecSpdAddDel) GetCrcString() string { return "9ffdf5da" }
1603 func (*IpsecSpdAddDel) GetMessageType() api.MessageType {
1604 return api.RequestMessage
1607 func (m *IpsecSpdAddDel) Size() (size int) {
1611 size += 1 // m.IsAdd
1612 size += 4 // m.SpdID
1615 func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) {
1617 b = make([]byte, m.Size())
1619 buf := codec.NewBuffer(b)
1620 buf.EncodeUint8(m.IsAdd)
1621 buf.EncodeUint32(m.SpdID)
1622 return buf.Bytes(), nil
1624 func (m *IpsecSpdAddDel) Unmarshal(b []byte) error {
1625 buf := codec.NewBuffer(b)
1626 m.IsAdd = buf.DecodeUint8()
1627 m.SpdID = buf.DecodeUint32()
1631 // IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'.
1632 type IpsecSpdAddDelReply struct {
1633 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1636 func (m *IpsecSpdAddDelReply) Reset() { *m = IpsecSpdAddDelReply{} }
1637 func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" }
1638 func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" }
1639 func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType {
1640 return api.ReplyMessage
1643 func (m *IpsecSpdAddDelReply) Size() (size int) {
1647 size += 4 // m.Retval
1650 func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) {
1652 b = make([]byte, m.Size())
1654 buf := codec.NewBuffer(b)
1655 buf.EncodeInt32(m.Retval)
1656 return buf.Bytes(), nil
1658 func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error {
1659 buf := codec.NewBuffer(b)
1660 m.Retval = buf.DecodeInt32()
1664 // IpsecSpdDetails defines message 'ipsec_spd_details'.
1665 type IpsecSpdDetails struct {
1666 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1669 func (m *IpsecSpdDetails) Reset() { *m = IpsecSpdDetails{} }
1670 func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" }
1671 func (*IpsecSpdDetails) GetCrcString() string { return "021e2c20" }
1672 func (*IpsecSpdDetails) GetMessageType() api.MessageType {
1673 return api.ReplyMessage
1676 func (m *IpsecSpdDetails) Size() (size int) {
1680 size += 4 // m.Entry.SpdID
1681 size += 4 // m.Entry.Priority
1682 size += 1 // m.Entry.IsOutbound
1683 size += 4 // m.Entry.SaID
1684 size += 4 // m.Entry.Policy
1685 size += 1 // m.Entry.Protocol
1686 size += 4 // m.Entry.RemoteAddressStart.Af
1687 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1688 size += 4 // m.Entry.RemoteAddressStop.Af
1689 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1690 size += 4 // m.Entry.LocalAddressStart.Af
1691 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1692 size += 4 // m.Entry.LocalAddressStop.Af
1693 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1694 size += 2 // m.Entry.RemotePortStart
1695 size += 2 // m.Entry.RemotePortStop
1696 size += 2 // m.Entry.LocalPortStart
1697 size += 2 // m.Entry.LocalPortStop
1700 func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) {
1702 b = make([]byte, m.Size())
1704 buf := codec.NewBuffer(b)
1705 buf.EncodeUint32(m.Entry.SpdID)
1706 buf.EncodeInt32(m.Entry.Priority)
1707 buf.EncodeUint8(m.Entry.IsOutbound)
1708 buf.EncodeUint32(m.Entry.SaID)
1709 buf.EncodeUint32(uint32(m.Entry.Policy))
1710 buf.EncodeUint8(m.Entry.Protocol)
1711 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
1712 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1713 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
1714 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1715 buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
1716 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1717 buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
1718 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1719 buf.EncodeUint16(m.Entry.RemotePortStart)
1720 buf.EncodeUint16(m.Entry.RemotePortStop)
1721 buf.EncodeUint16(m.Entry.LocalPortStart)
1722 buf.EncodeUint16(m.Entry.LocalPortStop)
1723 return buf.Bytes(), nil
1725 func (m *IpsecSpdDetails) Unmarshal(b []byte) error {
1726 buf := codec.NewBuffer(b)
1727 m.Entry.SpdID = buf.DecodeUint32()
1728 m.Entry.Priority = buf.DecodeInt32()
1729 m.Entry.IsOutbound = buf.DecodeUint8()
1730 m.Entry.SaID = buf.DecodeUint32()
1731 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1732 m.Entry.Protocol = buf.DecodeUint8()
1733 m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
1734 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1735 m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
1736 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1737 m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
1738 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1739 m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
1740 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1741 m.Entry.RemotePortStart = buf.DecodeUint16()
1742 m.Entry.RemotePortStop = buf.DecodeUint16()
1743 m.Entry.LocalPortStart = buf.DecodeUint16()
1744 m.Entry.LocalPortStop = buf.DecodeUint16()
1748 // IpsecSpdDump defines message 'ipsec_spd_dump'.
1749 type IpsecSpdDump struct {
1750 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1751 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1754 func (m *IpsecSpdDump) Reset() { *m = IpsecSpdDump{} }
1755 func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" }
1756 func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" }
1757 func (*IpsecSpdDump) GetMessageType() api.MessageType {
1758 return api.RequestMessage
1761 func (m *IpsecSpdDump) Size() (size int) {
1765 size += 4 // m.SpdID
1769 func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) {
1771 b = make([]byte, m.Size())
1773 buf := codec.NewBuffer(b)
1774 buf.EncodeUint32(m.SpdID)
1775 buf.EncodeUint32(m.SaID)
1776 return buf.Bytes(), nil
1778 func (m *IpsecSpdDump) Unmarshal(b []byte) error {
1779 buf := codec.NewBuffer(b)
1780 m.SpdID = buf.DecodeUint32()
1781 m.SaID = buf.DecodeUint32()
1785 // IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'.
1786 type IpsecSpdEntryAddDel struct {
1787 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
1788 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1791 func (m *IpsecSpdEntryAddDel) Reset() { *m = IpsecSpdEntryAddDel{} }
1792 func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" }
1793 func (*IpsecSpdEntryAddDel) GetCrcString() string { return "db217840" }
1794 func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType {
1795 return api.RequestMessage
1798 func (m *IpsecSpdEntryAddDel) Size() (size int) {
1802 size += 1 // m.IsAdd
1803 size += 4 // m.Entry.SpdID
1804 size += 4 // m.Entry.Priority
1805 size += 1 // m.Entry.IsOutbound
1806 size += 4 // m.Entry.SaID
1807 size += 4 // m.Entry.Policy
1808 size += 1 // m.Entry.Protocol
1809 size += 4 // m.Entry.RemoteAddressStart.Af
1810 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1811 size += 4 // m.Entry.RemoteAddressStop.Af
1812 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1813 size += 4 // m.Entry.LocalAddressStart.Af
1814 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1815 size += 4 // m.Entry.LocalAddressStop.Af
1816 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1817 size += 2 // m.Entry.RemotePortStart
1818 size += 2 // m.Entry.RemotePortStop
1819 size += 2 // m.Entry.LocalPortStart
1820 size += 2 // m.Entry.LocalPortStop
1823 func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) {
1825 b = make([]byte, m.Size())
1827 buf := codec.NewBuffer(b)
1828 buf.EncodeUint8(m.IsAdd)
1829 buf.EncodeUint32(m.Entry.SpdID)
1830 buf.EncodeInt32(m.Entry.Priority)
1831 buf.EncodeUint8(m.Entry.IsOutbound)
1832 buf.EncodeUint32(m.Entry.SaID)
1833 buf.EncodeUint32(uint32(m.Entry.Policy))
1834 buf.EncodeUint8(m.Entry.Protocol)
1835 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStart.Af))
1836 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1837 buf.EncodeUint32(uint32(m.Entry.RemoteAddressStop.Af))
1838 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1839 buf.EncodeUint32(uint32(m.Entry.LocalAddressStart.Af))
1840 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1841 buf.EncodeUint32(uint32(m.Entry.LocalAddressStop.Af))
1842 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1843 buf.EncodeUint16(m.Entry.RemotePortStart)
1844 buf.EncodeUint16(m.Entry.RemotePortStop)
1845 buf.EncodeUint16(m.Entry.LocalPortStart)
1846 buf.EncodeUint16(m.Entry.LocalPortStop)
1847 return buf.Bytes(), nil
1849 func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error {
1850 buf := codec.NewBuffer(b)
1851 m.IsAdd = buf.DecodeUint8()
1852 m.Entry.SpdID = buf.DecodeUint32()
1853 m.Entry.Priority = buf.DecodeInt32()
1854 m.Entry.IsOutbound = buf.DecodeUint8()
1855 m.Entry.SaID = buf.DecodeUint32()
1856 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1857 m.Entry.Protocol = buf.DecodeUint8()
1858 m.Entry.RemoteAddressStart.Af = AddressFamily(buf.DecodeUint32())
1859 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1860 m.Entry.RemoteAddressStop.Af = AddressFamily(buf.DecodeUint32())
1861 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1862 m.Entry.LocalAddressStart.Af = AddressFamily(buf.DecodeUint32())
1863 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1864 m.Entry.LocalAddressStop.Af = AddressFamily(buf.DecodeUint32())
1865 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1866 m.Entry.RemotePortStart = buf.DecodeUint16()
1867 m.Entry.RemotePortStop = buf.DecodeUint16()
1868 m.Entry.LocalPortStart = buf.DecodeUint16()
1869 m.Entry.LocalPortStop = buf.DecodeUint16()
1873 // IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'.
1874 type IpsecSpdEntryAddDelReply struct {
1875 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1876 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1879 func (m *IpsecSpdEntryAddDelReply) Reset() { *m = IpsecSpdEntryAddDelReply{} }
1880 func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" }
1881 func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1882 func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType {
1883 return api.ReplyMessage
1886 func (m *IpsecSpdEntryAddDelReply) Size() (size int) {
1890 size += 4 // m.Retval
1891 size += 4 // m.StatIndex
1894 func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1896 b = make([]byte, m.Size())
1898 buf := codec.NewBuffer(b)
1899 buf.EncodeInt32(m.Retval)
1900 buf.EncodeUint32(m.StatIndex)
1901 return buf.Bytes(), nil
1903 func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error {
1904 buf := codec.NewBuffer(b)
1905 m.Retval = buf.DecodeInt32()
1906 m.StatIndex = buf.DecodeUint32()
1910 // IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'.
1911 type IpsecSpdInterfaceDetails struct {
1912 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1913 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
1916 func (m *IpsecSpdInterfaceDetails) Reset() { *m = IpsecSpdInterfaceDetails{} }
1917 func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" }
1918 func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "2c54296d" }
1919 func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType {
1920 return api.ReplyMessage
1923 func (m *IpsecSpdInterfaceDetails) Size() (size int) {
1927 size += 4 // m.SpdIndex
1928 size += 4 // m.SwIfIndex
1931 func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) {
1933 b = make([]byte, m.Size())
1935 buf := codec.NewBuffer(b)
1936 buf.EncodeUint32(m.SpdIndex)
1937 buf.EncodeUint32(m.SwIfIndex)
1938 return buf.Bytes(), nil
1940 func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error {
1941 buf := codec.NewBuffer(b)
1942 m.SpdIndex = buf.DecodeUint32()
1943 m.SwIfIndex = buf.DecodeUint32()
1947 // IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'.
1948 type IpsecSpdInterfaceDump struct {
1949 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1950 SpdIndexValid uint8 `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"`
1953 func (m *IpsecSpdInterfaceDump) Reset() { *m = IpsecSpdInterfaceDump{} }
1954 func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" }
1955 func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" }
1956 func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType {
1957 return api.RequestMessage
1960 func (m *IpsecSpdInterfaceDump) Size() (size int) {
1964 size += 4 // m.SpdIndex
1965 size += 1 // m.SpdIndexValid
1968 func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) {
1970 b = make([]byte, m.Size())
1972 buf := codec.NewBuffer(b)
1973 buf.EncodeUint32(m.SpdIndex)
1974 buf.EncodeUint8(m.SpdIndexValid)
1975 return buf.Bytes(), nil
1977 func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error {
1978 buf := codec.NewBuffer(b)
1979 m.SpdIndex = buf.DecodeUint32()
1980 m.SpdIndexValid = buf.DecodeUint8()
1984 // IpsecSpdsDetails defines message 'ipsec_spds_details'.
1985 type IpsecSpdsDetails struct {
1986 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1987 Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"`
1990 func (m *IpsecSpdsDetails) Reset() { *m = IpsecSpdsDetails{} }
1991 func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" }
1992 func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" }
1993 func (*IpsecSpdsDetails) GetMessageType() api.MessageType {
1994 return api.ReplyMessage
1997 func (m *IpsecSpdsDetails) Size() (size int) {
2001 size += 4 // m.SpdID
2002 size += 4 // m.Npolicies
2005 func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) {
2007 b = make([]byte, m.Size())
2009 buf := codec.NewBuffer(b)
2010 buf.EncodeUint32(m.SpdID)
2011 buf.EncodeUint32(m.Npolicies)
2012 return buf.Bytes(), nil
2014 func (m *IpsecSpdsDetails) Unmarshal(b []byte) error {
2015 buf := codec.NewBuffer(b)
2016 m.SpdID = buf.DecodeUint32()
2017 m.Npolicies = buf.DecodeUint32()
2021 // IpsecSpdsDump defines message 'ipsec_spds_dump'.
2022 type IpsecSpdsDump struct{}
2024 func (m *IpsecSpdsDump) Reset() { *m = IpsecSpdsDump{} }
2025 func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" }
2026 func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" }
2027 func (*IpsecSpdsDump) GetMessageType() api.MessageType {
2028 return api.RequestMessage
2031 func (m *IpsecSpdsDump) Size() (size int) {
2037 func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) {
2039 b = make([]byte, m.Size())
2041 buf := codec.NewBuffer(b)
2042 return buf.Bytes(), nil
2044 func (m *IpsecSpdsDump) Unmarshal(b []byte) error {
2048 // IpsecTunnelIfAddDel defines message 'ipsec_tunnel_if_add_del'.
2049 type IpsecTunnelIfAddDel struct {
2050 IsAdd uint8 `binapi:"u8,name=is_add" json:"is_add,omitempty"`
2051 Esn uint8 `binapi:"u8,name=esn" json:"esn,omitempty"`
2052 AntiReplay uint8 `binapi:"u8,name=anti_replay" json:"anti_replay,omitempty"`
2053 LocalIP Address `binapi:"address,name=local_ip" json:"local_ip,omitempty"`
2054 RemoteIP Address `binapi:"address,name=remote_ip" json:"remote_ip,omitempty"`
2055 LocalSpi uint32 `binapi:"u32,name=local_spi" json:"local_spi,omitempty"`
2056 RemoteSpi uint32 `binapi:"u32,name=remote_spi" json:"remote_spi,omitempty"`
2057 CryptoAlg uint8 `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"`
2058 LocalCryptoKeyLen uint8 `binapi:"u8,name=local_crypto_key_len" json:"local_crypto_key_len,omitempty"`
2059 LocalCryptoKey []byte `binapi:"u8[128],name=local_crypto_key" json:"local_crypto_key,omitempty"`
2060 RemoteCryptoKeyLen uint8 `binapi:"u8,name=remote_crypto_key_len" json:"remote_crypto_key_len,omitempty"`
2061 RemoteCryptoKey []byte `binapi:"u8[128],name=remote_crypto_key" json:"remote_crypto_key,omitempty"`
2062 IntegAlg uint8 `binapi:"u8,name=integ_alg" json:"integ_alg,omitempty"`
2063 LocalIntegKeyLen uint8 `binapi:"u8,name=local_integ_key_len" json:"local_integ_key_len,omitempty"`
2064 LocalIntegKey []byte `binapi:"u8[128],name=local_integ_key" json:"local_integ_key,omitempty"`
2065 RemoteIntegKeyLen uint8 `binapi:"u8,name=remote_integ_key_len" json:"remote_integ_key_len,omitempty"`
2066 RemoteIntegKey []byte `binapi:"u8[128],name=remote_integ_key" json:"remote_integ_key,omitempty"`
2067 Renumber uint8 `binapi:"u8,name=renumber" json:"renumber,omitempty"`
2068 ShowInstance uint32 `binapi:"u32,name=show_instance" json:"show_instance,omitempty"`
2069 UDPEncap uint8 `binapi:"u8,name=udp_encap" json:"udp_encap,omitempty"`
2070 TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
2071 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
2074 func (m *IpsecTunnelIfAddDel) Reset() { *m = IpsecTunnelIfAddDel{} }
2075 func (*IpsecTunnelIfAddDel) GetMessageName() string { return "ipsec_tunnel_if_add_del" }
2076 func (*IpsecTunnelIfAddDel) GetCrcString() string { return "d5a98274" }
2077 func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType {
2078 return api.RequestMessage
2081 func (m *IpsecTunnelIfAddDel) Size() (size int) {
2085 size += 1 // m.IsAdd
2087 size += 1 // m.AntiReplay
2088 size += 4 // m.LocalIP.Af
2089 size += 1 * 16 // m.LocalIP.Un
2090 size += 4 // m.RemoteIP.Af
2091 size += 1 * 16 // m.RemoteIP.Un
2092 size += 4 // m.LocalSpi
2093 size += 4 // m.RemoteSpi
2094 size += 1 // m.CryptoAlg
2095 size += 1 // m.LocalCryptoKeyLen
2096 size += 1 * 128 // m.LocalCryptoKey
2097 size += 1 // m.RemoteCryptoKeyLen
2098 size += 1 * 128 // m.RemoteCryptoKey
2099 size += 1 // m.IntegAlg
2100 size += 1 // m.LocalIntegKeyLen
2101 size += 1 * 128 // m.LocalIntegKey
2102 size += 1 // m.RemoteIntegKeyLen
2103 size += 1 * 128 // m.RemoteIntegKey
2104 size += 1 // m.Renumber
2105 size += 4 // m.ShowInstance
2106 size += 1 // m.UDPEncap
2107 size += 4 // m.TxTableID
2111 func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) {
2113 b = make([]byte, m.Size())
2115 buf := codec.NewBuffer(b)
2116 buf.EncodeUint8(m.IsAdd)
2117 buf.EncodeUint8(m.Esn)
2118 buf.EncodeUint8(m.AntiReplay)
2119 buf.EncodeUint32(uint32(m.LocalIP.Af))
2120 buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16)
2121 buf.EncodeUint32(uint32(m.RemoteIP.Af))
2122 buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 16)
2123 buf.EncodeUint32(m.LocalSpi)
2124 buf.EncodeUint32(m.RemoteSpi)
2125 buf.EncodeUint8(m.CryptoAlg)
2126 buf.EncodeUint8(m.LocalCryptoKeyLen)
2127 buf.EncodeBytes(m.LocalCryptoKey, 128)
2128 buf.EncodeUint8(m.RemoteCryptoKeyLen)
2129 buf.EncodeBytes(m.RemoteCryptoKey, 128)
2130 buf.EncodeUint8(m.IntegAlg)
2131 buf.EncodeUint8(m.LocalIntegKeyLen)
2132 buf.EncodeBytes(m.LocalIntegKey, 128)
2133 buf.EncodeUint8(m.RemoteIntegKeyLen)
2134 buf.EncodeBytes(m.RemoteIntegKey, 128)
2135 buf.EncodeUint8(m.Renumber)
2136 buf.EncodeUint32(m.ShowInstance)
2137 buf.EncodeUint8(m.UDPEncap)
2138 buf.EncodeUint32(m.TxTableID)
2139 buf.EncodeUint32(m.Salt)
2140 return buf.Bytes(), nil
2142 func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error {
2143 buf := codec.NewBuffer(b)
2144 m.IsAdd = buf.DecodeUint8()
2145 m.Esn = buf.DecodeUint8()
2146 m.AntiReplay = buf.DecodeUint8()
2147 m.LocalIP.Af = AddressFamily(buf.DecodeUint32())
2148 copy(m.LocalIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2149 m.RemoteIP.Af = AddressFamily(buf.DecodeUint32())
2150 copy(m.RemoteIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2151 m.LocalSpi = buf.DecodeUint32()
2152 m.RemoteSpi = buf.DecodeUint32()
2153 m.CryptoAlg = buf.DecodeUint8()
2154 m.LocalCryptoKeyLen = buf.DecodeUint8()
2155 m.LocalCryptoKey = make([]byte, 128)
2156 copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey)))
2157 m.RemoteCryptoKeyLen = buf.DecodeUint8()
2158 m.RemoteCryptoKey = make([]byte, 128)
2159 copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey)))
2160 m.IntegAlg = buf.DecodeUint8()
2161 m.LocalIntegKeyLen = buf.DecodeUint8()
2162 m.LocalIntegKey = make([]byte, 128)
2163 copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey)))
2164 m.RemoteIntegKeyLen = buf.DecodeUint8()
2165 m.RemoteIntegKey = make([]byte, 128)
2166 copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey)))
2167 m.Renumber = buf.DecodeUint8()
2168 m.ShowInstance = buf.DecodeUint32()
2169 m.UDPEncap = buf.DecodeUint8()
2170 m.TxTableID = buf.DecodeUint32()
2171 m.Salt = buf.DecodeUint32()
2175 // IpsecTunnelIfAddDelReply defines message 'ipsec_tunnel_if_add_del_reply'.
2176 type IpsecTunnelIfAddDelReply struct {
2177 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2178 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
2181 func (m *IpsecTunnelIfAddDelReply) Reset() { *m = IpsecTunnelIfAddDelReply{} }
2182 func (*IpsecTunnelIfAddDelReply) GetMessageName() string { return "ipsec_tunnel_if_add_del_reply" }
2183 func (*IpsecTunnelIfAddDelReply) GetCrcString() string { return "fda5941f" }
2184 func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType {
2185 return api.ReplyMessage
2188 func (m *IpsecTunnelIfAddDelReply) Size() (size int) {
2192 size += 4 // m.Retval
2193 size += 4 // m.SwIfIndex
2196 func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) {
2198 b = make([]byte, m.Size())
2200 buf := codec.NewBuffer(b)
2201 buf.EncodeInt32(m.Retval)
2202 buf.EncodeUint32(m.SwIfIndex)
2203 return buf.Bytes(), nil
2205 func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error {
2206 buf := codec.NewBuffer(b)
2207 m.Retval = buf.DecodeInt32()
2208 m.SwIfIndex = buf.DecodeUint32()
2212 // IpsecTunnelIfSetSa defines message 'ipsec_tunnel_if_set_sa'.
2213 type IpsecTunnelIfSetSa struct {
2214 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
2215 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
2216 IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
2219 func (m *IpsecTunnelIfSetSa) Reset() { *m = IpsecTunnelIfSetSa{} }
2220 func (*IpsecTunnelIfSetSa) GetMessageName() string { return "ipsec_tunnel_if_set_sa" }
2221 func (*IpsecTunnelIfSetSa) GetCrcString() string { return "6ab567f2" }
2222 func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType {
2223 return api.RequestMessage
2226 func (m *IpsecTunnelIfSetSa) Size() (size int) {
2230 size += 4 // m.SwIfIndex
2232 size += 1 // m.IsOutbound
2235 func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) {
2237 b = make([]byte, m.Size())
2239 buf := codec.NewBuffer(b)
2240 buf.EncodeUint32(m.SwIfIndex)
2241 buf.EncodeUint32(m.SaID)
2242 buf.EncodeUint8(m.IsOutbound)
2243 return buf.Bytes(), nil
2245 func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error {
2246 buf := codec.NewBuffer(b)
2247 m.SwIfIndex = buf.DecodeUint32()
2248 m.SaID = buf.DecodeUint32()
2249 m.IsOutbound = buf.DecodeUint8()
2253 // IpsecTunnelIfSetSaReply defines message 'ipsec_tunnel_if_set_sa_reply'.
2254 type IpsecTunnelIfSetSaReply struct {
2255 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2258 func (m *IpsecTunnelIfSetSaReply) Reset() { *m = IpsecTunnelIfSetSaReply{} }
2259 func (*IpsecTunnelIfSetSaReply) GetMessageName() string { return "ipsec_tunnel_if_set_sa_reply" }
2260 func (*IpsecTunnelIfSetSaReply) GetCrcString() string { return "e8d4e804" }
2261 func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType {
2262 return api.ReplyMessage
2265 func (m *IpsecTunnelIfSetSaReply) Size() (size int) {
2269 size += 4 // m.Retval
2272 func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) {
2274 b = make([]byte, m.Size())
2276 buf := codec.NewBuffer(b)
2277 buf.EncodeInt32(m.Retval)
2278 return buf.Bytes(), nil
2280 func (m *IpsecTunnelIfSetSaReply) Unmarshal(b []byte) error {
2281 buf := codec.NewBuffer(b)
2282 m.Retval = buf.DecodeInt32()
2286 // IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'.
2287 type IpsecTunnelProtectDel struct {
2288 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2291 func (m *IpsecTunnelProtectDel) Reset() { *m = IpsecTunnelProtectDel{} }
2292 func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" }
2293 func (*IpsecTunnelProtectDel) GetCrcString() string { return "f9e6675e" }
2294 func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType {
2295 return api.RequestMessage
2298 func (m *IpsecTunnelProtectDel) Size() (size int) {
2302 size += 4 // m.SwIfIndex
2305 func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) {
2307 b = make([]byte, m.Size())
2309 buf := codec.NewBuffer(b)
2310 buf.EncodeUint32(uint32(m.SwIfIndex))
2311 return buf.Bytes(), nil
2313 func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error {
2314 buf := codec.NewBuffer(b)
2315 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2319 // IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'.
2320 type IpsecTunnelProtectDelReply struct {
2321 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2324 func (m *IpsecTunnelProtectDelReply) Reset() { *m = IpsecTunnelProtectDelReply{} }
2325 func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" }
2326 func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" }
2327 func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType {
2328 return api.ReplyMessage
2331 func (m *IpsecTunnelProtectDelReply) Size() (size int) {
2335 size += 4 // m.Retval
2338 func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) {
2340 b = make([]byte, m.Size())
2342 buf := codec.NewBuffer(b)
2343 buf.EncodeInt32(m.Retval)
2344 return buf.Bytes(), nil
2346 func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error {
2347 buf := codec.NewBuffer(b)
2348 m.Retval = buf.DecodeInt32()
2352 // IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'.
2353 type IpsecTunnelProtectDetails struct {
2354 Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"`
2357 func (m *IpsecTunnelProtectDetails) Reset() { *m = IpsecTunnelProtectDetails{} }
2358 func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" }
2359 func (*IpsecTunnelProtectDetails) GetCrcString() string { return "7520eefe" }
2360 func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType {
2361 return api.ReplyMessage
2364 func (m *IpsecTunnelProtectDetails) Size() (size int) {
2368 size += 4 // m.Tun.SwIfIndex
2369 size += 4 // m.Tun.SaOut
2370 size += 1 // m.Tun.NSaIn
2371 size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn
2374 func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) {
2376 b = make([]byte, m.Size())
2378 buf := codec.NewBuffer(b)
2379 buf.EncodeUint32(uint32(m.Tun.SwIfIndex))
2380 buf.EncodeUint32(m.Tun.SaOut)
2381 buf.EncodeUint8(uint8(len(m.Tun.SaIn)))
2382 for i := 0; i < len(m.Tun.SaIn); i++ {
2384 if i < len(m.Tun.SaIn) {
2385 x = uint32(m.Tun.SaIn[i])
2389 return buf.Bytes(), nil
2391 func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error {
2392 buf := codec.NewBuffer(b)
2393 m.Tun.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2394 m.Tun.SaOut = buf.DecodeUint32()
2395 m.Tun.NSaIn = buf.DecodeUint8()
2396 m.Tun.SaIn = make([]uint32, m.Tun.NSaIn)
2397 for i := 0; i < len(m.Tun.SaIn); i++ {
2398 m.Tun.SaIn[i] = buf.DecodeUint32()
2403 // IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'.
2404 type IpsecTunnelProtectDump struct {
2405 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2408 func (m *IpsecTunnelProtectDump) Reset() { *m = IpsecTunnelProtectDump{} }
2409 func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" }
2410 func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" }
2411 func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType {
2412 return api.RequestMessage
2415 func (m *IpsecTunnelProtectDump) Size() (size int) {
2419 size += 4 // m.SwIfIndex
2422 func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) {
2424 b = make([]byte, m.Size())
2426 buf := codec.NewBuffer(b)
2427 buf.EncodeUint32(uint32(m.SwIfIndex))
2428 return buf.Bytes(), nil
2430 func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error {
2431 buf := codec.NewBuffer(b)
2432 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2436 // IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'.
2437 type IpsecTunnelProtectUpdate struct {
2438 Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"`
2441 func (m *IpsecTunnelProtectUpdate) Reset() { *m = IpsecTunnelProtectUpdate{} }
2442 func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" }
2443 func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "eccbc177" }
2444 func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType {
2445 return api.RequestMessage
2448 func (m *IpsecTunnelProtectUpdate) Size() (size int) {
2452 size += 4 // m.Tunnel.SwIfIndex
2453 size += 4 // m.Tunnel.SaOut
2454 size += 1 // m.Tunnel.NSaIn
2455 size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn
2458 func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) {
2460 b = make([]byte, m.Size())
2462 buf := codec.NewBuffer(b)
2463 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
2464 buf.EncodeUint32(m.Tunnel.SaOut)
2465 buf.EncodeUint8(uint8(len(m.Tunnel.SaIn)))
2466 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2468 if i < len(m.Tunnel.SaIn) {
2469 x = uint32(m.Tunnel.SaIn[i])
2473 return buf.Bytes(), nil
2475 func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error {
2476 buf := codec.NewBuffer(b)
2477 m.Tunnel.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
2478 m.Tunnel.SaOut = buf.DecodeUint32()
2479 m.Tunnel.NSaIn = buf.DecodeUint8()
2480 m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn)
2481 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2482 m.Tunnel.SaIn[i] = buf.DecodeUint32()
2487 // IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'.
2488 type IpsecTunnelProtectUpdateReply struct {
2489 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2492 func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} }
2493 func (*IpsecTunnelProtectUpdateReply) GetMessageName() string {
2494 return "ipsec_tunnel_protect_update_reply"
2496 func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" }
2497 func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType {
2498 return api.ReplyMessage
2501 func (m *IpsecTunnelProtectUpdateReply) Size() (size int) {
2505 size += 4 // m.Retval
2508 func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) {
2510 b = make([]byte, m.Size())
2512 buf := codec.NewBuffer(b)
2513 buf.EncodeInt32(m.Retval)
2514 return buf.Bytes(), nil
2516 func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error {
2517 buf := codec.NewBuffer(b)
2518 m.Retval = buf.DecodeInt32()
2522 func init() { file_ipsec_binapi_init() }
2523 func file_ipsec_binapi_init() {
2524 api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_7700751c")
2525 api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14")
2526 api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_1e3b8286")
2527 api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804")
2528 api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_9c8d829a")
2529 api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4")
2530 api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_a25ab61e")
2531 api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b")
2532 api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_4fd24836")
2533 api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804")
2534 api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_9ffdf5da")
2535 api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804")
2536 api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_021e2c20")
2537 api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d")
2538 api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_db217840")
2539 api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b")
2540 api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_2c54296d")
2541 api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19")
2542 api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254")
2543 api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14")
2544 api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec_tunnel_if_add_del_d5a98274")
2545 api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec_tunnel_if_add_del_reply_fda5941f")
2546 api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec_tunnel_if_set_sa_6ab567f2")
2547 api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec_tunnel_if_set_sa_reply_e8d4e804")
2548 api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_f9e6675e")
2549 api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804")
2550 api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_7520eefe")
2551 api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e")
2552 api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_eccbc177")
2553 api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804")
2556 // Messages returns list of all messages in this module.
2557 func AllMessages() []api.Message {
2558 return []api.Message{
2559 (*IpsecBackendDetails)(nil),
2560 (*IpsecBackendDump)(nil),
2561 (*IpsecInterfaceAddDelSpd)(nil),
2562 (*IpsecInterfaceAddDelSpdReply)(nil),
2563 (*IpsecSaDetails)(nil),
2564 (*IpsecSaDump)(nil),
2565 (*IpsecSadEntryAddDel)(nil),
2566 (*IpsecSadEntryAddDelReply)(nil),
2567 (*IpsecSelectBackend)(nil),
2568 (*IpsecSelectBackendReply)(nil),
2569 (*IpsecSpdAddDel)(nil),
2570 (*IpsecSpdAddDelReply)(nil),
2571 (*IpsecSpdDetails)(nil),
2572 (*IpsecSpdDump)(nil),
2573 (*IpsecSpdEntryAddDel)(nil),
2574 (*IpsecSpdEntryAddDelReply)(nil),
2575 (*IpsecSpdInterfaceDetails)(nil),
2576 (*IpsecSpdInterfaceDump)(nil),
2577 (*IpsecSpdsDetails)(nil),
2578 (*IpsecSpdsDump)(nil),
2579 (*IpsecTunnelIfAddDel)(nil),
2580 (*IpsecTunnelIfAddDelReply)(nil),
2581 (*IpsecTunnelIfSetSa)(nil),
2582 (*IpsecTunnelIfSetSaReply)(nil),
2583 (*IpsecTunnelProtectDel)(nil),
2584 (*IpsecTunnelProtectDelReply)(nil),
2585 (*IpsecTunnelProtectDetails)(nil),
2586 (*IpsecTunnelProtectDump)(nil),
2587 (*IpsecTunnelProtectUpdate)(nil),
2588 (*IpsecTunnelProtectUpdateReply)(nil),