1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/ip6_nd.api.json
7 // Package ip6_nd contains generated bindings for API file ip6_nd.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 = 0xbb8ff0e9
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 // LinkDuplex defines enum 'link_duplex'.
321 type LinkDuplex uint32
324 LINK_DUPLEX_API_UNKNOWN LinkDuplex = 0
325 LINK_DUPLEX_API_HALF LinkDuplex = 1
326 LINK_DUPLEX_API_FULL LinkDuplex = 2
330 LinkDuplex_name = map[uint32]string{
331 0: "LINK_DUPLEX_API_UNKNOWN",
332 1: "LINK_DUPLEX_API_HALF",
333 2: "LINK_DUPLEX_API_FULL",
335 LinkDuplex_value = map[string]uint32{
336 "LINK_DUPLEX_API_UNKNOWN": 0,
337 "LINK_DUPLEX_API_HALF": 1,
338 "LINK_DUPLEX_API_FULL": 2,
342 func (x LinkDuplex) String() string {
343 s, ok := LinkDuplex_name[uint32(x)]
347 return "LinkDuplex(" + strconv.Itoa(int(x)) + ")"
350 // MtuProto defines enum 'mtu_proto'.
354 MTU_PROTO_API_L3 MtuProto = 1
355 MTU_PROTO_API_IP4 MtuProto = 2
356 MTU_PROTO_API_IP6 MtuProto = 3
357 MTU_PROTO_API_MPLS MtuProto = 4
358 MTU_PROTO_API_N MtuProto = 5
362 MtuProto_name = map[uint32]string{
363 1: "MTU_PROTO_API_L3",
364 2: "MTU_PROTO_API_IP4",
365 3: "MTU_PROTO_API_IP6",
366 4: "MTU_PROTO_API_MPLS",
367 5: "MTU_PROTO_API_N",
369 MtuProto_value = map[string]uint32{
370 "MTU_PROTO_API_L3": 1,
371 "MTU_PROTO_API_IP4": 2,
372 "MTU_PROTO_API_IP6": 3,
373 "MTU_PROTO_API_MPLS": 4,
374 "MTU_PROTO_API_N": 5,
378 func (x MtuProto) String() string {
379 s, ok := MtuProto_name[uint32(x)]
383 return "MtuProto(" + strconv.Itoa(int(x)) + ")"
386 // RxMode defines enum 'rx_mode'.
390 RX_MODE_API_UNKNOWN RxMode = 0
391 RX_MODE_API_POLLING RxMode = 1
392 RX_MODE_API_INTERRUPT RxMode = 2
393 RX_MODE_API_ADAPTIVE RxMode = 3
394 RX_MODE_API_DEFAULT RxMode = 4
398 RxMode_name = map[uint32]string{
399 0: "RX_MODE_API_UNKNOWN",
400 1: "RX_MODE_API_POLLING",
401 2: "RX_MODE_API_INTERRUPT",
402 3: "RX_MODE_API_ADAPTIVE",
403 4: "RX_MODE_API_DEFAULT",
405 RxMode_value = map[string]uint32{
406 "RX_MODE_API_UNKNOWN": 0,
407 "RX_MODE_API_POLLING": 1,
408 "RX_MODE_API_INTERRUPT": 2,
409 "RX_MODE_API_ADAPTIVE": 3,
410 "RX_MODE_API_DEFAULT": 4,
414 func (x RxMode) String() string {
415 s, ok := RxMode_name[uint32(x)]
419 return "RxMode(" + strconv.Itoa(int(x)) + ")"
422 // SubIfFlags defines enum 'sub_if_flags'.
423 type SubIfFlags uint32
426 SUB_IF_API_FLAG_NO_TAGS SubIfFlags = 1
427 SUB_IF_API_FLAG_ONE_TAG SubIfFlags = 2
428 SUB_IF_API_FLAG_TWO_TAGS SubIfFlags = 4
429 SUB_IF_API_FLAG_DOT1AD SubIfFlags = 8
430 SUB_IF_API_FLAG_EXACT_MATCH SubIfFlags = 16
431 SUB_IF_API_FLAG_DEFAULT SubIfFlags = 32
432 SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY SubIfFlags = 64
433 SUB_IF_API_FLAG_INNER_VLAN_ID_ANY SubIfFlags = 128
434 SUB_IF_API_FLAG_MASK_VNET SubIfFlags = 254
435 SUB_IF_API_FLAG_DOT1AH SubIfFlags = 256
439 SubIfFlags_name = map[uint32]string{
440 1: "SUB_IF_API_FLAG_NO_TAGS",
441 2: "SUB_IF_API_FLAG_ONE_TAG",
442 4: "SUB_IF_API_FLAG_TWO_TAGS",
443 8: "SUB_IF_API_FLAG_DOT1AD",
444 16: "SUB_IF_API_FLAG_EXACT_MATCH",
445 32: "SUB_IF_API_FLAG_DEFAULT",
446 64: "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY",
447 128: "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY",
448 254: "SUB_IF_API_FLAG_MASK_VNET",
449 256: "SUB_IF_API_FLAG_DOT1AH",
451 SubIfFlags_value = map[string]uint32{
452 "SUB_IF_API_FLAG_NO_TAGS": 1,
453 "SUB_IF_API_FLAG_ONE_TAG": 2,
454 "SUB_IF_API_FLAG_TWO_TAGS": 4,
455 "SUB_IF_API_FLAG_DOT1AD": 8,
456 "SUB_IF_API_FLAG_EXACT_MATCH": 16,
457 "SUB_IF_API_FLAG_DEFAULT": 32,
458 "SUB_IF_API_FLAG_OUTER_VLAN_ID_ANY": 64,
459 "SUB_IF_API_FLAG_INNER_VLAN_ID_ANY": 128,
460 "SUB_IF_API_FLAG_MASK_VNET": 254,
461 "SUB_IF_API_FLAG_DOT1AH": 256,
465 func (x SubIfFlags) String() string {
466 s, ok := SubIfFlags_name[uint32(x)]
470 str := func(n uint32) string {
471 s, ok := SubIfFlags_name[uint32(n)]
475 return "SubIfFlags(" + strconv.Itoa(int(n)) + ")"
477 for i := uint32(0); i <= 32; i++ {
487 return str(uint32(x))
492 // AddressWithPrefix defines alias 'address_with_prefix'.
493 type AddressWithPrefix Prefix
495 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
496 prefix, err := ParsePrefix(s)
498 return AddressWithPrefix{}, err
500 return AddressWithPrefix(prefix), nil
503 func (x AddressWithPrefix) String() string {
504 return Prefix(x).String()
507 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
508 return []byte(x.String()), nil
511 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
512 prefix, err := ParseAddressWithPrefix(string(text))
520 // InterfaceIndex defines alias 'interface_index'.
521 type InterfaceIndex uint32
523 // IP4Address defines alias 'ip4_address'.
524 type IP4Address [4]uint8
526 func ParseIP4Address(s string) (IP4Address, error) {
527 ip := net.ParseIP(s).To4()
529 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
531 var ipaddr IP4Address
532 copy(ipaddr[:], ip.To4())
536 func (x IP4Address) ToIP() net.IP {
537 return net.IP(x[:]).To4()
540 func (x IP4Address) String() string {
541 return x.ToIP().String()
544 func (x *IP4Address) MarshalText() ([]byte, error) {
545 return []byte(x.String()), nil
548 func (x *IP4Address) UnmarshalText(text []byte) error {
549 ipaddr, err := ParseIP4Address(string(text))
557 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
558 type IP4AddressWithPrefix IP4Prefix
560 // IP6Address defines alias 'ip6_address'.
561 type IP6Address [16]uint8
563 func ParseIP6Address(s string) (IP6Address, error) {
564 ip := net.ParseIP(s).To16()
566 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
568 var ipaddr IP6Address
569 copy(ipaddr[:], ip.To16())
573 func (x IP6Address) ToIP() net.IP {
574 return net.IP(x[:]).To16()
577 func (x IP6Address) String() string {
578 return x.ToIP().String()
581 func (x *IP6Address) MarshalText() ([]byte, error) {
582 return []byte(x.String()), nil
585 func (x *IP6Address) UnmarshalText(text []byte) error {
586 ipaddr, err := ParseIP6Address(string(text))
594 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
595 type IP6AddressWithPrefix IP6Prefix
597 // Address defines type 'address'.
598 type Address struct {
599 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
600 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
603 func ParseAddress(s string) (Address, error) {
606 return Address{}, fmt.Errorf("invalid address: %s", s)
608 return AddressFromIP(ip), nil
611 func AddressFromIP(ip net.IP) Address {
614 addr.Af = ADDRESS_IP6
616 copy(ip6[:], ip.To16())
619 addr.Af = ADDRESS_IP4
621 copy(ip4[:], ip.To4())
627 func (x Address) ToIP() net.IP {
628 if x.Af == ADDRESS_IP6 {
630 return net.IP(ip6[:]).To16()
633 return net.IP(ip4[:]).To4()
637 func (x Address) String() string {
638 return x.ToIP().String()
641 func (x *Address) MarshalText() ([]byte, error) {
642 return []byte(x.String()), nil
645 func (x *Address) UnmarshalText(text []byte) error {
646 addr, err := ParseAddress(string(text))
654 // IP4Prefix defines type 'ip4_prefix'.
655 type IP4Prefix struct {
656 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
657 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
660 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
661 hasPrefix := strings.Contains(s, "/")
663 ip, network, err := net.ParseCIDR(s)
665 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
667 maskSize, _ := network.Mask.Size()
668 prefix.Len = byte(maskSize)
669 prefix.Address, err = ParseIP4Address(ip.String())
671 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
675 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
677 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
679 prefix.Len = byte(defaultMaskSize)
680 prefix.Address, err = ParseIP4Address(ip.String())
682 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
688 func (x IP4Prefix) ToIPNet() *net.IPNet {
689 mask := net.CIDRMask(int(x.Len), 32)
690 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
694 func (x IP4Prefix) String() string {
695 ip := x.Address.String()
696 return ip + "/" + strconv.Itoa(int(x.Len))
699 func (x *IP4Prefix) MarshalText() ([]byte, error) {
700 return []byte(x.String()), nil
703 func (x *IP4Prefix) UnmarshalText(text []byte) error {
704 prefix, err := ParseIP4Prefix(string(text))
712 // IP6Prefix defines type 'ip6_prefix'.
713 type IP6Prefix struct {
714 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
715 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
718 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
719 hasPrefix := strings.Contains(s, "/")
721 ip, network, err := net.ParseCIDR(s)
723 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
725 maskSize, _ := network.Mask.Size()
726 prefix.Len = byte(maskSize)
727 prefix.Address, err = ParseIP6Address(ip.String())
729 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
733 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
735 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
737 prefix.Len = byte(defaultMaskSize)
738 prefix.Address, err = ParseIP6Address(ip.String())
740 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
746 func (x IP6Prefix) ToIPNet() *net.IPNet {
747 mask := net.CIDRMask(int(x.Len), 128)
748 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
752 func (x IP6Prefix) String() string {
753 ip := x.Address.String()
754 return ip + "/" + strconv.Itoa(int(x.Len))
757 func (x *IP6Prefix) MarshalText() ([]byte, error) {
758 return []byte(x.String()), nil
761 func (x *IP6Prefix) UnmarshalText(text []byte) error {
762 prefix, err := ParseIP6Prefix(string(text))
770 // IP6RaPrefixInfo defines type 'ip6_ra_prefix_info'.
771 type IP6RaPrefixInfo struct {
772 Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
773 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
774 ValidTime uint32 `binapi:"u32,name=valid_time" json:"valid_time,omitempty"`
775 PreferredTime uint32 `binapi:"u32,name=preferred_time" json:"preferred_time,omitempty"`
778 // Mprefix defines type 'mprefix'.
779 type Mprefix struct {
780 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
781 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
782 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
783 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
786 // Prefix defines type 'prefix'.
788 Address Address `binapi:"address,name=address" json:"address,omitempty"`
789 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
792 func ParsePrefix(ip string) (prefix Prefix, err error) {
793 hasPrefix := strings.Contains(ip, "/")
795 netIP, network, err := net.ParseCIDR(ip)
797 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
799 maskSize, _ := network.Mask.Size()
800 prefix.Len = byte(maskSize)
801 prefix.Address, err = ParseAddress(netIP.String())
803 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
806 netIP := net.ParseIP(ip)
807 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
808 if netIP.To4() == nil {
809 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
811 prefix.Len = byte(defaultMaskSize)
812 prefix.Address, err = ParseAddress(netIP.String())
814 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
820 func (x Prefix) ToIPNet() *net.IPNet {
822 if x.Address.Af == ADDRESS_IP4 {
823 mask = net.CIDRMask(int(x.Len), 32)
825 mask = net.CIDRMask(int(x.Len), 128)
827 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
831 func (x Prefix) String() string {
832 ip := x.Address.String()
833 return ip + "/" + strconv.Itoa(int(x.Len))
836 func (x *Prefix) MarshalText() ([]byte, error) {
837 return []byte(x.String()), nil
840 func (x *Prefix) UnmarshalText(text []byte) error {
841 prefix, err := ParsePrefix(string(text))
849 // PrefixMatcher defines type 'prefix_matcher'.
850 type PrefixMatcher struct {
851 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
852 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
855 // AddressUnion defines union 'address_union'.
856 type AddressUnion struct {
857 // AddressUnion can be one of:
860 XXX_UnionData [16]byte
863 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
867 func (u *AddressUnion) SetIP4(a IP4Address) {
868 buf := codec.NewBuffer(u.XXX_UnionData[:])
869 buf.EncodeBytes(a[:], 4)
871 func (u *AddressUnion) GetIP4() (a IP4Address) {
872 buf := codec.NewBuffer(u.XXX_UnionData[:])
873 copy(a[:], buf.DecodeBytes(4))
877 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
881 func (u *AddressUnion) SetIP6(a IP6Address) {
882 buf := codec.NewBuffer(u.XXX_UnionData[:])
883 buf.EncodeBytes(a[:], 16)
885 func (u *AddressUnion) GetIP6() (a IP6Address) {
886 buf := codec.NewBuffer(u.XXX_UnionData[:])
887 copy(a[:], buf.DecodeBytes(16))
891 // IP6RaEvent defines message 'ip6_ra_event'.
892 type IP6RaEvent struct {
893 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
894 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
895 RouterAddr IP6Address `binapi:"ip6_address,name=router_addr" json:"router_addr,omitempty"`
896 CurrentHopLimit uint8 `binapi:"u8,name=current_hop_limit" json:"current_hop_limit,omitempty"`
897 Flags uint8 `binapi:"u8,name=flags" json:"flags,omitempty"`
898 RouterLifetimeInSec uint16 `binapi:"u16,name=router_lifetime_in_sec" json:"router_lifetime_in_sec,omitempty"`
899 NeighborReachableTimeInMsec uint32 `binapi:"u32,name=neighbor_reachable_time_in_msec" json:"neighbor_reachable_time_in_msec,omitempty"`
900 TimeInMsecBetweenRetransmittedNeighborSolicitations uint32 `binapi:"u32,name=time_in_msec_between_retransmitted_neighbor_solicitations" json:"time_in_msec_between_retransmitted_neighbor_solicitations,omitempty"`
901 NPrefixes uint32 `binapi:"u32,name=n_prefixes" json:"-"`
902 Prefixes []IP6RaPrefixInfo `binapi:"ip6_ra_prefix_info[n_prefixes],name=prefixes" json:"prefixes,omitempty"`
905 func (m *IP6RaEvent) Reset() { *m = IP6RaEvent{} }
906 func (*IP6RaEvent) GetMessageName() string { return "ip6_ra_event" }
907 func (*IP6RaEvent) GetCrcString() string { return "47e8cfbe" }
908 func (*IP6RaEvent) GetMessageType() api.MessageType {
909 return api.EventMessage
912 func (m *IP6RaEvent) Size() (size int) {
917 size += 4 // m.SwIfIndex
918 size += 1 * 16 // m.RouterAddr
919 size += 1 // m.CurrentHopLimit
921 size += 2 // m.RouterLifetimeInSec
922 size += 4 // m.NeighborReachableTimeInMsec
923 size += 4 // m.TimeInMsecBetweenRetransmittedNeighborSolicitations
924 size += 4 // m.NPrefixes
925 for j1 := 0; j1 < len(m.Prefixes); j1++ {
926 var s1 IP6RaPrefixInfo
928 if j1 < len(m.Prefixes) {
931 size += 4 // s1.Prefix.Address.Af
932 size += 1 * 16 // s1.Prefix.Address.Un
933 size += 1 // s1.Prefix.Len
934 size += 1 // s1.Flags
935 size += 4 // s1.ValidTime
936 size += 4 // s1.PreferredTime
940 func (m *IP6RaEvent) Marshal(b []byte) ([]byte, error) {
942 b = make([]byte, m.Size())
944 buf := codec.NewBuffer(b)
945 buf.EncodeUint32(m.PID)
946 buf.EncodeUint32(uint32(m.SwIfIndex))
947 buf.EncodeBytes(m.RouterAddr[:], 16)
948 buf.EncodeUint8(m.CurrentHopLimit)
949 buf.EncodeUint8(m.Flags)
950 buf.EncodeUint16(m.RouterLifetimeInSec)
951 buf.EncodeUint32(m.NeighborReachableTimeInMsec)
952 buf.EncodeUint32(m.TimeInMsecBetweenRetransmittedNeighborSolicitations)
953 buf.EncodeUint32(uint32(len(m.Prefixes)))
954 for j0 := 0; j0 < len(m.Prefixes); j0++ {
955 var v0 IP6RaPrefixInfo // Prefixes
956 if j0 < len(m.Prefixes) {
959 buf.EncodeUint32(uint32(v0.Prefix.Address.Af))
960 buf.EncodeBytes(v0.Prefix.Address.Un.XXX_UnionData[:], 16)
961 buf.EncodeUint8(v0.Prefix.Len)
962 buf.EncodeUint8(v0.Flags)
963 buf.EncodeUint32(v0.ValidTime)
964 buf.EncodeUint32(v0.PreferredTime)
966 return buf.Bytes(), nil
968 func (m *IP6RaEvent) Unmarshal(b []byte) error {
969 buf := codec.NewBuffer(b)
970 m.PID = buf.DecodeUint32()
971 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
972 copy(m.RouterAddr[:], buf.DecodeBytes(16))
973 m.CurrentHopLimit = buf.DecodeUint8()
974 m.Flags = buf.DecodeUint8()
975 m.RouterLifetimeInSec = buf.DecodeUint16()
976 m.NeighborReachableTimeInMsec = buf.DecodeUint32()
977 m.TimeInMsecBetweenRetransmittedNeighborSolicitations = buf.DecodeUint32()
978 m.NPrefixes = buf.DecodeUint32()
979 m.Prefixes = make([]IP6RaPrefixInfo, m.NPrefixes)
980 for j0 := 0; j0 < len(m.Prefixes); j0++ {
981 m.Prefixes[j0].Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
982 copy(m.Prefixes[j0].Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
983 m.Prefixes[j0].Prefix.Len = buf.DecodeUint8()
984 m.Prefixes[j0].Flags = buf.DecodeUint8()
985 m.Prefixes[j0].ValidTime = buf.DecodeUint32()
986 m.Prefixes[j0].PreferredTime = buf.DecodeUint32()
991 // IP6ndProxyAddDel defines message 'ip6nd_proxy_add_del'.
992 type IP6ndProxyAddDel struct {
993 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
994 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
995 IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
998 func (m *IP6ndProxyAddDel) Reset() { *m = IP6ndProxyAddDel{} }
999 func (*IP6ndProxyAddDel) GetMessageName() string { return "ip6nd_proxy_add_del" }
1000 func (*IP6ndProxyAddDel) GetCrcString() string { return "3fdf6659" }
1001 func (*IP6ndProxyAddDel) GetMessageType() api.MessageType {
1002 return api.RequestMessage
1005 func (m *IP6ndProxyAddDel) Size() (size int) {
1009 size += 4 // m.SwIfIndex
1010 size += 1 // m.IsAdd
1011 size += 1 * 16 // m.IP
1014 func (m *IP6ndProxyAddDel) Marshal(b []byte) ([]byte, error) {
1016 b = make([]byte, m.Size())
1018 buf := codec.NewBuffer(b)
1019 buf.EncodeUint32(uint32(m.SwIfIndex))
1020 buf.EncodeBool(m.IsAdd)
1021 buf.EncodeBytes(m.IP[:], 16)
1022 return buf.Bytes(), nil
1024 func (m *IP6ndProxyAddDel) Unmarshal(b []byte) error {
1025 buf := codec.NewBuffer(b)
1026 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1027 m.IsAdd = buf.DecodeBool()
1028 copy(m.IP[:], buf.DecodeBytes(16))
1032 // IP6ndProxyAddDelReply defines message 'ip6nd_proxy_add_del_reply'.
1033 type IP6ndProxyAddDelReply struct {
1034 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1037 func (m *IP6ndProxyAddDelReply) Reset() { *m = IP6ndProxyAddDelReply{} }
1038 func (*IP6ndProxyAddDelReply) GetMessageName() string { return "ip6nd_proxy_add_del_reply" }
1039 func (*IP6ndProxyAddDelReply) GetCrcString() string { return "e8d4e804" }
1040 func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType {
1041 return api.ReplyMessage
1044 func (m *IP6ndProxyAddDelReply) Size() (size int) {
1048 size += 4 // m.Retval
1051 func (m *IP6ndProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
1053 b = make([]byte, m.Size())
1055 buf := codec.NewBuffer(b)
1056 buf.EncodeInt32(m.Retval)
1057 return buf.Bytes(), nil
1059 func (m *IP6ndProxyAddDelReply) Unmarshal(b []byte) error {
1060 buf := codec.NewBuffer(b)
1061 m.Retval = buf.DecodeInt32()
1065 // IP6ndProxyDetails defines message 'ip6nd_proxy_details'.
1066 type IP6ndProxyDetails struct {
1067 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1068 IP IP6Address `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
1071 func (m *IP6ndProxyDetails) Reset() { *m = IP6ndProxyDetails{} }
1072 func (*IP6ndProxyDetails) GetMessageName() string { return "ip6nd_proxy_details" }
1073 func (*IP6ndProxyDetails) GetCrcString() string { return "d35be8ff" }
1074 func (*IP6ndProxyDetails) GetMessageType() api.MessageType {
1075 return api.ReplyMessage
1078 func (m *IP6ndProxyDetails) Size() (size int) {
1082 size += 4 // m.SwIfIndex
1083 size += 1 * 16 // m.IP
1086 func (m *IP6ndProxyDetails) Marshal(b []byte) ([]byte, error) {
1088 b = make([]byte, m.Size())
1090 buf := codec.NewBuffer(b)
1091 buf.EncodeUint32(uint32(m.SwIfIndex))
1092 buf.EncodeBytes(m.IP[:], 16)
1093 return buf.Bytes(), nil
1095 func (m *IP6ndProxyDetails) Unmarshal(b []byte) error {
1096 buf := codec.NewBuffer(b)
1097 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1098 copy(m.IP[:], buf.DecodeBytes(16))
1102 // IP6ndProxyDump defines message 'ip6nd_proxy_dump'.
1103 type IP6ndProxyDump struct{}
1105 func (m *IP6ndProxyDump) Reset() { *m = IP6ndProxyDump{} }
1106 func (*IP6ndProxyDump) GetMessageName() string { return "ip6nd_proxy_dump" }
1107 func (*IP6ndProxyDump) GetCrcString() string { return "51077d14" }
1108 func (*IP6ndProxyDump) GetMessageType() api.MessageType {
1109 return api.RequestMessage
1112 func (m *IP6ndProxyDump) Size() (size int) {
1118 func (m *IP6ndProxyDump) Marshal(b []byte) ([]byte, error) {
1120 b = make([]byte, m.Size())
1122 buf := codec.NewBuffer(b)
1123 return buf.Bytes(), nil
1125 func (m *IP6ndProxyDump) Unmarshal(b []byte) error {
1129 // IP6ndSendRouterSolicitation defines message 'ip6nd_send_router_solicitation'.
1130 type IP6ndSendRouterSolicitation struct {
1131 Irt uint32 `binapi:"u32,name=irt" json:"irt,omitempty"`
1132 Mrt uint32 `binapi:"u32,name=mrt" json:"mrt,omitempty"`
1133 Mrc uint32 `binapi:"u32,name=mrc" json:"mrc,omitempty"`
1134 Mrd uint32 `binapi:"u32,name=mrd" json:"mrd,omitempty"`
1135 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1136 Stop bool `binapi:"bool,name=stop" json:"stop,omitempty"`
1139 func (m *IP6ndSendRouterSolicitation) Reset() { *m = IP6ndSendRouterSolicitation{} }
1140 func (*IP6ndSendRouterSolicitation) GetMessageName() string { return "ip6nd_send_router_solicitation" }
1141 func (*IP6ndSendRouterSolicitation) GetCrcString() string { return "e5de609c" }
1142 func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType {
1143 return api.RequestMessage
1146 func (m *IP6ndSendRouterSolicitation) Size() (size int) {
1154 size += 4 // m.SwIfIndex
1158 func (m *IP6ndSendRouterSolicitation) Marshal(b []byte) ([]byte, error) {
1160 b = make([]byte, m.Size())
1162 buf := codec.NewBuffer(b)
1163 buf.EncodeUint32(m.Irt)
1164 buf.EncodeUint32(m.Mrt)
1165 buf.EncodeUint32(m.Mrc)
1166 buf.EncodeUint32(m.Mrd)
1167 buf.EncodeUint32(uint32(m.SwIfIndex))
1168 buf.EncodeBool(m.Stop)
1169 return buf.Bytes(), nil
1171 func (m *IP6ndSendRouterSolicitation) Unmarshal(b []byte) error {
1172 buf := codec.NewBuffer(b)
1173 m.Irt = buf.DecodeUint32()
1174 m.Mrt = buf.DecodeUint32()
1175 m.Mrc = buf.DecodeUint32()
1176 m.Mrd = buf.DecodeUint32()
1177 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1178 m.Stop = buf.DecodeBool()
1182 // IP6ndSendRouterSolicitationReply defines message 'ip6nd_send_router_solicitation_reply'.
1183 type IP6ndSendRouterSolicitationReply struct {
1184 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1187 func (m *IP6ndSendRouterSolicitationReply) Reset() { *m = IP6ndSendRouterSolicitationReply{} }
1188 func (*IP6ndSendRouterSolicitationReply) GetMessageName() string {
1189 return "ip6nd_send_router_solicitation_reply"
1191 func (*IP6ndSendRouterSolicitationReply) GetCrcString() string { return "e8d4e804" }
1192 func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType {
1193 return api.ReplyMessage
1196 func (m *IP6ndSendRouterSolicitationReply) Size() (size int) {
1200 size += 4 // m.Retval
1203 func (m *IP6ndSendRouterSolicitationReply) Marshal(b []byte) ([]byte, error) {
1205 b = make([]byte, m.Size())
1207 buf := codec.NewBuffer(b)
1208 buf.EncodeInt32(m.Retval)
1209 return buf.Bytes(), nil
1211 func (m *IP6ndSendRouterSolicitationReply) Unmarshal(b []byte) error {
1212 buf := codec.NewBuffer(b)
1213 m.Retval = buf.DecodeInt32()
1217 // SwInterfaceIP6ndRaConfig defines message 'sw_interface_ip6nd_ra_config'.
1218 type SwInterfaceIP6ndRaConfig struct {
1219 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1220 Suppress uint8 `binapi:"u8,name=suppress" json:"suppress,omitempty"`
1221 Managed uint8 `binapi:"u8,name=managed" json:"managed,omitempty"`
1222 Other uint8 `binapi:"u8,name=other" json:"other,omitempty"`
1223 LlOption uint8 `binapi:"u8,name=ll_option" json:"ll_option,omitempty"`
1224 SendUnicast uint8 `binapi:"u8,name=send_unicast" json:"send_unicast,omitempty"`
1225 Cease uint8 `binapi:"u8,name=cease" json:"cease,omitempty"`
1226 IsNo bool `binapi:"bool,name=is_no" json:"is_no,omitempty"`
1227 DefaultRouter uint8 `binapi:"u8,name=default_router" json:"default_router,omitempty"`
1228 MaxInterval uint32 `binapi:"u32,name=max_interval" json:"max_interval,omitempty"`
1229 MinInterval uint32 `binapi:"u32,name=min_interval" json:"min_interval,omitempty"`
1230 Lifetime uint32 `binapi:"u32,name=lifetime" json:"lifetime,omitempty"`
1231 InitialCount uint32 `binapi:"u32,name=initial_count" json:"initial_count,omitempty"`
1232 InitialInterval uint32 `binapi:"u32,name=initial_interval" json:"initial_interval,omitempty"`
1235 func (m *SwInterfaceIP6ndRaConfig) Reset() { *m = SwInterfaceIP6ndRaConfig{} }
1236 func (*SwInterfaceIP6ndRaConfig) GetMessageName() string { return "sw_interface_ip6nd_ra_config" }
1237 func (*SwInterfaceIP6ndRaConfig) GetCrcString() string { return "3eb00b1c" }
1238 func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType {
1239 return api.RequestMessage
1242 func (m *SwInterfaceIP6ndRaConfig) Size() (size int) {
1246 size += 4 // m.SwIfIndex
1247 size += 1 // m.Suppress
1248 size += 1 // m.Managed
1249 size += 1 // m.Other
1250 size += 1 // m.LlOption
1251 size += 1 // m.SendUnicast
1252 size += 1 // m.Cease
1254 size += 1 // m.DefaultRouter
1255 size += 4 // m.MaxInterval
1256 size += 4 // m.MinInterval
1257 size += 4 // m.Lifetime
1258 size += 4 // m.InitialCount
1259 size += 4 // m.InitialInterval
1262 func (m *SwInterfaceIP6ndRaConfig) Marshal(b []byte) ([]byte, error) {
1264 b = make([]byte, m.Size())
1266 buf := codec.NewBuffer(b)
1267 buf.EncodeUint32(uint32(m.SwIfIndex))
1268 buf.EncodeUint8(m.Suppress)
1269 buf.EncodeUint8(m.Managed)
1270 buf.EncodeUint8(m.Other)
1271 buf.EncodeUint8(m.LlOption)
1272 buf.EncodeUint8(m.SendUnicast)
1273 buf.EncodeUint8(m.Cease)
1274 buf.EncodeBool(m.IsNo)
1275 buf.EncodeUint8(m.DefaultRouter)
1276 buf.EncodeUint32(m.MaxInterval)
1277 buf.EncodeUint32(m.MinInterval)
1278 buf.EncodeUint32(m.Lifetime)
1279 buf.EncodeUint32(m.InitialCount)
1280 buf.EncodeUint32(m.InitialInterval)
1281 return buf.Bytes(), nil
1283 func (m *SwInterfaceIP6ndRaConfig) Unmarshal(b []byte) error {
1284 buf := codec.NewBuffer(b)
1285 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1286 m.Suppress = buf.DecodeUint8()
1287 m.Managed = buf.DecodeUint8()
1288 m.Other = buf.DecodeUint8()
1289 m.LlOption = buf.DecodeUint8()
1290 m.SendUnicast = buf.DecodeUint8()
1291 m.Cease = buf.DecodeUint8()
1292 m.IsNo = buf.DecodeBool()
1293 m.DefaultRouter = buf.DecodeUint8()
1294 m.MaxInterval = buf.DecodeUint32()
1295 m.MinInterval = buf.DecodeUint32()
1296 m.Lifetime = buf.DecodeUint32()
1297 m.InitialCount = buf.DecodeUint32()
1298 m.InitialInterval = buf.DecodeUint32()
1302 // SwInterfaceIP6ndRaConfigReply defines message 'sw_interface_ip6nd_ra_config_reply'.
1303 type SwInterfaceIP6ndRaConfigReply struct {
1304 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1307 func (m *SwInterfaceIP6ndRaConfigReply) Reset() { *m = SwInterfaceIP6ndRaConfigReply{} }
1308 func (*SwInterfaceIP6ndRaConfigReply) GetMessageName() string {
1309 return "sw_interface_ip6nd_ra_config_reply"
1311 func (*SwInterfaceIP6ndRaConfigReply) GetCrcString() string { return "e8d4e804" }
1312 func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType {
1313 return api.ReplyMessage
1316 func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) {
1320 size += 4 // m.Retval
1323 func (m *SwInterfaceIP6ndRaConfigReply) Marshal(b []byte) ([]byte, error) {
1325 b = make([]byte, m.Size())
1327 buf := codec.NewBuffer(b)
1328 buf.EncodeInt32(m.Retval)
1329 return buf.Bytes(), nil
1331 func (m *SwInterfaceIP6ndRaConfigReply) Unmarshal(b []byte) error {
1332 buf := codec.NewBuffer(b)
1333 m.Retval = buf.DecodeInt32()
1337 // SwInterfaceIP6ndRaPrefix defines message 'sw_interface_ip6nd_ra_prefix'.
1338 type SwInterfaceIP6ndRaPrefix struct {
1339 SwIfIndex InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1340 Prefix Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
1341 UseDefault bool `binapi:"bool,name=use_default" json:"use_default,omitempty"`
1342 NoAdvertise bool `binapi:"bool,name=no_advertise" json:"no_advertise,omitempty"`
1343 OffLink bool `binapi:"bool,name=off_link" json:"off_link,omitempty"`
1344 NoAutoconfig bool `binapi:"bool,name=no_autoconfig" json:"no_autoconfig,omitempty"`
1345 NoOnlink bool `binapi:"bool,name=no_onlink" json:"no_onlink,omitempty"`
1346 IsNo bool `binapi:"bool,name=is_no" json:"is_no,omitempty"`
1347 ValLifetime uint32 `binapi:"u32,name=val_lifetime" json:"val_lifetime,omitempty"`
1348 PrefLifetime uint32 `binapi:"u32,name=pref_lifetime" json:"pref_lifetime,omitempty"`
1351 func (m *SwInterfaceIP6ndRaPrefix) Reset() { *m = SwInterfaceIP6ndRaPrefix{} }
1352 func (*SwInterfaceIP6ndRaPrefix) GetMessageName() string { return "sw_interface_ip6nd_ra_prefix" }
1353 func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string { return "e098785f" }
1354 func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType {
1355 return api.RequestMessage
1358 func (m *SwInterfaceIP6ndRaPrefix) Size() (size int) {
1362 size += 4 // m.SwIfIndex
1363 size += 4 // m.Prefix.Address.Af
1364 size += 1 * 16 // m.Prefix.Address.Un
1365 size += 1 // m.Prefix.Len
1366 size += 1 // m.UseDefault
1367 size += 1 // m.NoAdvertise
1368 size += 1 // m.OffLink
1369 size += 1 // m.NoAutoconfig
1370 size += 1 // m.NoOnlink
1372 size += 4 // m.ValLifetime
1373 size += 4 // m.PrefLifetime
1376 func (m *SwInterfaceIP6ndRaPrefix) Marshal(b []byte) ([]byte, error) {
1378 b = make([]byte, m.Size())
1380 buf := codec.NewBuffer(b)
1381 buf.EncodeUint32(uint32(m.SwIfIndex))
1382 buf.EncodeUint32(uint32(m.Prefix.Address.Af))
1383 buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
1384 buf.EncodeUint8(m.Prefix.Len)
1385 buf.EncodeBool(m.UseDefault)
1386 buf.EncodeBool(m.NoAdvertise)
1387 buf.EncodeBool(m.OffLink)
1388 buf.EncodeBool(m.NoAutoconfig)
1389 buf.EncodeBool(m.NoOnlink)
1390 buf.EncodeBool(m.IsNo)
1391 buf.EncodeUint32(m.ValLifetime)
1392 buf.EncodeUint32(m.PrefLifetime)
1393 return buf.Bytes(), nil
1395 func (m *SwInterfaceIP6ndRaPrefix) Unmarshal(b []byte) error {
1396 buf := codec.NewBuffer(b)
1397 m.SwIfIndex = InterfaceIndex(buf.DecodeUint32())
1398 m.Prefix.Address.Af = AddressFamily(buf.DecodeUint32())
1399 copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1400 m.Prefix.Len = buf.DecodeUint8()
1401 m.UseDefault = buf.DecodeBool()
1402 m.NoAdvertise = buf.DecodeBool()
1403 m.OffLink = buf.DecodeBool()
1404 m.NoAutoconfig = buf.DecodeBool()
1405 m.NoOnlink = buf.DecodeBool()
1406 m.IsNo = buf.DecodeBool()
1407 m.ValLifetime = buf.DecodeUint32()
1408 m.PrefLifetime = buf.DecodeUint32()
1412 // SwInterfaceIP6ndRaPrefixReply defines message 'sw_interface_ip6nd_ra_prefix_reply'.
1413 type SwInterfaceIP6ndRaPrefixReply struct {
1414 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1417 func (m *SwInterfaceIP6ndRaPrefixReply) Reset() { *m = SwInterfaceIP6ndRaPrefixReply{} }
1418 func (*SwInterfaceIP6ndRaPrefixReply) GetMessageName() string {
1419 return "sw_interface_ip6nd_ra_prefix_reply"
1421 func (*SwInterfaceIP6ndRaPrefixReply) GetCrcString() string { return "e8d4e804" }
1422 func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType {
1423 return api.ReplyMessage
1426 func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) {
1430 size += 4 // m.Retval
1433 func (m *SwInterfaceIP6ndRaPrefixReply) Marshal(b []byte) ([]byte, error) {
1435 b = make([]byte, m.Size())
1437 buf := codec.NewBuffer(b)
1438 buf.EncodeInt32(m.Retval)
1439 return buf.Bytes(), nil
1441 func (m *SwInterfaceIP6ndRaPrefixReply) Unmarshal(b []byte) error {
1442 buf := codec.NewBuffer(b)
1443 m.Retval = buf.DecodeInt32()
1447 // WantIP6RaEvents defines message 'want_ip6_ra_events'.
1448 type WantIP6RaEvents struct {
1449 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
1450 PID uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
1453 func (m *WantIP6RaEvents) Reset() { *m = WantIP6RaEvents{} }
1454 func (*WantIP6RaEvents) GetMessageName() string { return "want_ip6_ra_events" }
1455 func (*WantIP6RaEvents) GetCrcString() string { return "3ec6d6c2" }
1456 func (*WantIP6RaEvents) GetMessageType() api.MessageType {
1457 return api.RequestMessage
1460 func (m *WantIP6RaEvents) Size() (size int) {
1464 size += 1 // m.Enable
1468 func (m *WantIP6RaEvents) Marshal(b []byte) ([]byte, error) {
1470 b = make([]byte, m.Size())
1472 buf := codec.NewBuffer(b)
1473 buf.EncodeBool(m.Enable)
1474 buf.EncodeUint32(m.PID)
1475 return buf.Bytes(), nil
1477 func (m *WantIP6RaEvents) Unmarshal(b []byte) error {
1478 buf := codec.NewBuffer(b)
1479 m.Enable = buf.DecodeBool()
1480 m.PID = buf.DecodeUint32()
1484 // WantIP6RaEventsReply defines message 'want_ip6_ra_events_reply'.
1485 type WantIP6RaEventsReply struct {
1486 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1489 func (m *WantIP6RaEventsReply) Reset() { *m = WantIP6RaEventsReply{} }
1490 func (*WantIP6RaEventsReply) GetMessageName() string { return "want_ip6_ra_events_reply" }
1491 func (*WantIP6RaEventsReply) GetCrcString() string { return "e8d4e804" }
1492 func (*WantIP6RaEventsReply) GetMessageType() api.MessageType {
1493 return api.ReplyMessage
1496 func (m *WantIP6RaEventsReply) Size() (size int) {
1500 size += 4 // m.Retval
1503 func (m *WantIP6RaEventsReply) Marshal(b []byte) ([]byte, error) {
1505 b = make([]byte, m.Size())
1507 buf := codec.NewBuffer(b)
1508 buf.EncodeInt32(m.Retval)
1509 return buf.Bytes(), nil
1511 func (m *WantIP6RaEventsReply) Unmarshal(b []byte) error {
1512 buf := codec.NewBuffer(b)
1513 m.Retval = buf.DecodeInt32()
1517 func init() { file_ip6_nd_binapi_init() }
1518 func file_ip6_nd_binapi_init() {
1519 api.RegisterMessage((*IP6RaEvent)(nil), "ip6_ra_event_47e8cfbe")
1520 api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip6nd_proxy_add_del_3fdf6659")
1521 api.RegisterMessage((*IP6ndProxyAddDelReply)(nil), "ip6nd_proxy_add_del_reply_e8d4e804")
1522 api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip6nd_proxy_details_d35be8ff")
1523 api.RegisterMessage((*IP6ndProxyDump)(nil), "ip6nd_proxy_dump_51077d14")
1524 api.RegisterMessage((*IP6ndSendRouterSolicitation)(nil), "ip6nd_send_router_solicitation_e5de609c")
1525 api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip6nd_send_router_solicitation_reply_e8d4e804")
1526 api.RegisterMessage((*SwInterfaceIP6ndRaConfig)(nil), "sw_interface_ip6nd_ra_config_3eb00b1c")
1527 api.RegisterMessage((*SwInterfaceIP6ndRaConfigReply)(nil), "sw_interface_ip6nd_ra_config_reply_e8d4e804")
1528 api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "sw_interface_ip6nd_ra_prefix_e098785f")
1529 api.RegisterMessage((*SwInterfaceIP6ndRaPrefixReply)(nil), "sw_interface_ip6nd_ra_prefix_reply_e8d4e804")
1530 api.RegisterMessage((*WantIP6RaEvents)(nil), "want_ip6_ra_events_3ec6d6c2")
1531 api.RegisterMessage((*WantIP6RaEventsReply)(nil), "want_ip6_ra_events_reply_e8d4e804")
1534 // Messages returns list of all messages in this module.
1535 func AllMessages() []api.Message {
1536 return []api.Message{
1538 (*IP6ndProxyAddDel)(nil),
1539 (*IP6ndProxyAddDelReply)(nil),
1540 (*IP6ndProxyDetails)(nil),
1541 (*IP6ndProxyDump)(nil),
1542 (*IP6ndSendRouterSolicitation)(nil),
1543 (*IP6ndSendRouterSolicitationReply)(nil),
1544 (*SwInterfaceIP6ndRaConfig)(nil),
1545 (*SwInterfaceIP6ndRaConfigReply)(nil),
1546 (*SwInterfaceIP6ndRaPrefix)(nil),
1547 (*SwInterfaceIP6ndRaPrefixReply)(nil),
1548 (*WantIP6RaEvents)(nil),
1549 (*WantIP6RaEventsReply)(nil),