1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/bier.api.json
7 // Package bier contains generated bindings for API file bier.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 = 0x27c878c4
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 // FibPathFlags defines enum 'fib_path_flags'.
68 type FibPathFlags uint32
71 FIB_API_PATH_FLAG_NONE FibPathFlags = 0
72 FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1
73 FIB_API_PATH_FLAG_RESOLVE_VIA_HOST FibPathFlags = 2
74 FIB_API_PATH_FLAG_POP_PW_CW FibPathFlags = 4
78 FibPathFlags_name = map[uint32]string{
79 0: "FIB_API_PATH_FLAG_NONE",
80 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED",
81 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST",
82 4: "FIB_API_PATH_FLAG_POP_PW_CW",
84 FibPathFlags_value = map[string]uint32{
85 "FIB_API_PATH_FLAG_NONE": 0,
86 "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1,
87 "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST": 2,
88 "FIB_API_PATH_FLAG_POP_PW_CW": 4,
92 func (x FibPathFlags) String() string {
93 s, ok := FibPathFlags_name[uint32(x)]
97 str := func(n uint32) string {
98 s, ok := FibPathFlags_name[uint32(n)]
102 return "FibPathFlags(" + strconv.Itoa(int(n)) + ")"
104 for i := uint32(0); i <= 32; i++ {
114 return str(uint32(x))
119 // FibPathNhProto defines enum 'fib_path_nh_proto'.
120 type FibPathNhProto uint32
123 FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
124 FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
125 FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
126 FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
127 FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
131 FibPathNhProto_name = map[uint32]string{
132 0: "FIB_API_PATH_NH_PROTO_IP4",
133 1: "FIB_API_PATH_NH_PROTO_IP6",
134 2: "FIB_API_PATH_NH_PROTO_MPLS",
135 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
136 4: "FIB_API_PATH_NH_PROTO_BIER",
138 FibPathNhProto_value = map[string]uint32{
139 "FIB_API_PATH_NH_PROTO_IP4": 0,
140 "FIB_API_PATH_NH_PROTO_IP6": 1,
141 "FIB_API_PATH_NH_PROTO_MPLS": 2,
142 "FIB_API_PATH_NH_PROTO_ETHERNET": 3,
143 "FIB_API_PATH_NH_PROTO_BIER": 4,
147 func (x FibPathNhProto) String() string {
148 s, ok := FibPathNhProto_name[uint32(x)]
152 return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
155 // FibPathType defines enum 'fib_path_type'.
156 type FibPathType uint32
159 FIB_API_PATH_TYPE_NORMAL FibPathType = 0
160 FIB_API_PATH_TYPE_LOCAL FibPathType = 1
161 FIB_API_PATH_TYPE_DROP FibPathType = 2
162 FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
163 FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
164 FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
165 FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
166 FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
167 FIB_API_PATH_TYPE_DVR FibPathType = 8
168 FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
169 FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
173 FibPathType_name = map[uint32]string{
174 0: "FIB_API_PATH_TYPE_NORMAL",
175 1: "FIB_API_PATH_TYPE_LOCAL",
176 2: "FIB_API_PATH_TYPE_DROP",
177 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
178 4: "FIB_API_PATH_TYPE_BIER_IMP",
179 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
180 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
181 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
182 8: "FIB_API_PATH_TYPE_DVR",
183 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
184 10: "FIB_API_PATH_TYPE_CLASSIFY",
186 FibPathType_value = map[string]uint32{
187 "FIB_API_PATH_TYPE_NORMAL": 0,
188 "FIB_API_PATH_TYPE_LOCAL": 1,
189 "FIB_API_PATH_TYPE_DROP": 2,
190 "FIB_API_PATH_TYPE_UDP_ENCAP": 3,
191 "FIB_API_PATH_TYPE_BIER_IMP": 4,
192 "FIB_API_PATH_TYPE_ICMP_UNREACH": 5,
193 "FIB_API_PATH_TYPE_ICMP_PROHIBIT": 6,
194 "FIB_API_PATH_TYPE_SOURCE_LOOKUP": 7,
195 "FIB_API_PATH_TYPE_DVR": 8,
196 "FIB_API_PATH_TYPE_INTERFACE_RX": 9,
197 "FIB_API_PATH_TYPE_CLASSIFY": 10,
201 func (x FibPathType) String() string {
202 s, ok := FibPathType_name[uint32(x)]
206 return "FibPathType(" + strconv.Itoa(int(x)) + ")"
209 // IPDscp defines enum 'ip_dscp'.
213 IP_API_DSCP_CS0 IPDscp = 0
214 IP_API_DSCP_CS1 IPDscp = 8
215 IP_API_DSCP_AF11 IPDscp = 10
216 IP_API_DSCP_AF12 IPDscp = 12
217 IP_API_DSCP_AF13 IPDscp = 14
218 IP_API_DSCP_CS2 IPDscp = 16
219 IP_API_DSCP_AF21 IPDscp = 18
220 IP_API_DSCP_AF22 IPDscp = 20
221 IP_API_DSCP_AF23 IPDscp = 22
222 IP_API_DSCP_CS3 IPDscp = 24
223 IP_API_DSCP_AF31 IPDscp = 26
224 IP_API_DSCP_AF32 IPDscp = 28
225 IP_API_DSCP_AF33 IPDscp = 30
226 IP_API_DSCP_CS4 IPDscp = 32
227 IP_API_DSCP_AF41 IPDscp = 34
228 IP_API_DSCP_AF42 IPDscp = 36
229 IP_API_DSCP_AF43 IPDscp = 38
230 IP_API_DSCP_CS5 IPDscp = 40
231 IP_API_DSCP_EF IPDscp = 46
232 IP_API_DSCP_CS6 IPDscp = 48
233 IP_API_DSCP_CS7 IPDscp = 50
237 IPDscp_name = map[uint8]string{
238 0: "IP_API_DSCP_CS0",
239 8: "IP_API_DSCP_CS1",
240 10: "IP_API_DSCP_AF11",
241 12: "IP_API_DSCP_AF12",
242 14: "IP_API_DSCP_AF13",
243 16: "IP_API_DSCP_CS2",
244 18: "IP_API_DSCP_AF21",
245 20: "IP_API_DSCP_AF22",
246 22: "IP_API_DSCP_AF23",
247 24: "IP_API_DSCP_CS3",
248 26: "IP_API_DSCP_AF31",
249 28: "IP_API_DSCP_AF32",
250 30: "IP_API_DSCP_AF33",
251 32: "IP_API_DSCP_CS4",
252 34: "IP_API_DSCP_AF41",
253 36: "IP_API_DSCP_AF42",
254 38: "IP_API_DSCP_AF43",
255 40: "IP_API_DSCP_CS5",
256 46: "IP_API_DSCP_EF",
257 48: "IP_API_DSCP_CS6",
258 50: "IP_API_DSCP_CS7",
260 IPDscp_value = map[string]uint8{
261 "IP_API_DSCP_CS0": 0,
262 "IP_API_DSCP_CS1": 8,
263 "IP_API_DSCP_AF11": 10,
264 "IP_API_DSCP_AF12": 12,
265 "IP_API_DSCP_AF13": 14,
266 "IP_API_DSCP_CS2": 16,
267 "IP_API_DSCP_AF21": 18,
268 "IP_API_DSCP_AF22": 20,
269 "IP_API_DSCP_AF23": 22,
270 "IP_API_DSCP_CS3": 24,
271 "IP_API_DSCP_AF31": 26,
272 "IP_API_DSCP_AF32": 28,
273 "IP_API_DSCP_AF33": 30,
274 "IP_API_DSCP_CS4": 32,
275 "IP_API_DSCP_AF41": 34,
276 "IP_API_DSCP_AF42": 36,
277 "IP_API_DSCP_AF43": 38,
278 "IP_API_DSCP_CS5": 40,
279 "IP_API_DSCP_EF": 46,
280 "IP_API_DSCP_CS6": 48,
281 "IP_API_DSCP_CS7": 50,
285 func (x IPDscp) String() string {
286 s, ok := IPDscp_name[uint8(x)]
290 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
293 // IPEcn defines enum 'ip_ecn'.
297 IP_API_ECN_NONE IPEcn = 0
298 IP_API_ECN_ECT0 IPEcn = 1
299 IP_API_ECN_ECT1 IPEcn = 2
300 IP_API_ECN_CE IPEcn = 3
304 IPEcn_name = map[uint8]string{
305 0: "IP_API_ECN_NONE",
306 1: "IP_API_ECN_ECT0",
307 2: "IP_API_ECN_ECT1",
310 IPEcn_value = map[string]uint8{
311 "IP_API_ECN_NONE": 0,
312 "IP_API_ECN_ECT0": 1,
313 "IP_API_ECN_ECT1": 2,
318 func (x IPEcn) String() string {
319 s, ok := IPEcn_name[uint8(x)]
323 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
326 // IPProto defines enum 'ip_proto'.
330 IP_API_PROTO_HOPOPT IPProto = 0
331 IP_API_PROTO_ICMP IPProto = 1
332 IP_API_PROTO_IGMP IPProto = 2
333 IP_API_PROTO_TCP IPProto = 6
334 IP_API_PROTO_UDP IPProto = 17
335 IP_API_PROTO_GRE IPProto = 47
336 IP_API_PROTO_AH IPProto = 50
337 IP_API_PROTO_ESP IPProto = 51
338 IP_API_PROTO_EIGRP IPProto = 88
339 IP_API_PROTO_OSPF IPProto = 89
340 IP_API_PROTO_SCTP IPProto = 132
341 IP_API_PROTO_RESERVED IPProto = 255
345 IPProto_name = map[uint32]string{
346 0: "IP_API_PROTO_HOPOPT",
347 1: "IP_API_PROTO_ICMP",
348 2: "IP_API_PROTO_IGMP",
349 6: "IP_API_PROTO_TCP",
350 17: "IP_API_PROTO_UDP",
351 47: "IP_API_PROTO_GRE",
352 50: "IP_API_PROTO_AH",
353 51: "IP_API_PROTO_ESP",
354 88: "IP_API_PROTO_EIGRP",
355 89: "IP_API_PROTO_OSPF",
356 132: "IP_API_PROTO_SCTP",
357 255: "IP_API_PROTO_RESERVED",
359 IPProto_value = map[string]uint32{
360 "IP_API_PROTO_HOPOPT": 0,
361 "IP_API_PROTO_ICMP": 1,
362 "IP_API_PROTO_IGMP": 2,
363 "IP_API_PROTO_TCP": 6,
364 "IP_API_PROTO_UDP": 17,
365 "IP_API_PROTO_GRE": 47,
366 "IP_API_PROTO_AH": 50,
367 "IP_API_PROTO_ESP": 51,
368 "IP_API_PROTO_EIGRP": 88,
369 "IP_API_PROTO_OSPF": 89,
370 "IP_API_PROTO_SCTP": 132,
371 "IP_API_PROTO_RESERVED": 255,
375 func (x IPProto) String() string {
376 s, ok := IPProto_name[uint32(x)]
380 return "IPProto(" + strconv.Itoa(int(x)) + ")"
383 // AddressWithPrefix defines alias 'address_with_prefix'.
384 type AddressWithPrefix Prefix
386 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
387 prefix, err := ParsePrefix(s)
389 return AddressWithPrefix{}, err
391 return AddressWithPrefix(prefix), nil
394 func (x AddressWithPrefix) String() string {
395 return Prefix(x).String()
398 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
399 return []byte(x.String()), nil
402 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
403 prefix, err := ParseAddressWithPrefix(string(text))
411 // IP4Address defines alias 'ip4_address'.
412 type IP4Address [4]uint8
414 func ParseIP4Address(s string) (IP4Address, error) {
415 ip := net.ParseIP(s).To4()
417 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
419 var ipaddr IP4Address
420 copy(ipaddr[:], ip.To4())
424 func (x IP4Address) ToIP() net.IP {
425 return net.IP(x[:]).To4()
428 func (x IP4Address) String() string {
429 return x.ToIP().String()
432 func (x *IP4Address) MarshalText() ([]byte, error) {
433 return []byte(x.String()), nil
436 func (x *IP4Address) UnmarshalText(text []byte) error {
437 ipaddr, err := ParseIP4Address(string(text))
445 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
446 type IP4AddressWithPrefix IP4Prefix
448 // IP6Address defines alias 'ip6_address'.
449 type IP6Address [16]uint8
451 func ParseIP6Address(s string) (IP6Address, error) {
452 ip := net.ParseIP(s).To16()
454 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
456 var ipaddr IP6Address
457 copy(ipaddr[:], ip.To16())
461 func (x IP6Address) ToIP() net.IP {
462 return net.IP(x[:]).To16()
465 func (x IP6Address) String() string {
466 return x.ToIP().String()
469 func (x *IP6Address) MarshalText() ([]byte, error) {
470 return []byte(x.String()), nil
473 func (x *IP6Address) UnmarshalText(text []byte) error {
474 ipaddr, err := ParseIP6Address(string(text))
482 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
483 type IP6AddressWithPrefix IP6Prefix
485 // Address defines type 'address'.
486 type Address struct {
487 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
488 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
491 func ParseAddress(s string) (Address, error) {
494 return Address{}, fmt.Errorf("invalid address: %s", s)
496 return AddressFromIP(ip), nil
499 func AddressFromIP(ip net.IP) Address {
502 addr.Af = ADDRESS_IP6
504 copy(ip6[:], ip.To16())
507 addr.Af = ADDRESS_IP4
509 copy(ip4[:], ip.To4())
515 func (x Address) ToIP() net.IP {
516 if x.Af == ADDRESS_IP6 {
518 return net.IP(ip6[:]).To16()
521 return net.IP(ip4[:]).To4()
525 func (x Address) String() string {
526 return x.ToIP().String()
529 func (x *Address) MarshalText() ([]byte, error) {
530 return []byte(x.String()), nil
533 func (x *Address) UnmarshalText(text []byte) error {
534 addr, err := ParseAddress(string(text))
542 // BierRoute defines type 'bier_route'.
543 type BierRoute struct {
544 BrBp uint32 `binapi:"u32,name=br_bp" json:"br_bp,omitempty"`
545 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
546 BrNPaths uint8 `binapi:"u8,name=br_n_paths" json:"-"`
547 BrPaths []FibPath `binapi:"fib_path[br_n_paths],name=br_paths" json:"br_paths,omitempty"`
550 // BierTableID defines type 'bier_table_id'.
551 type BierTableID struct {
552 BtSet uint8 `binapi:"u8,name=bt_set" json:"bt_set,omitempty"`
553 BtSubDomain uint8 `binapi:"u8,name=bt_sub_domain" json:"bt_sub_domain,omitempty"`
554 BtHdrLenID uint8 `binapi:"u8,name=bt_hdr_len_id" json:"bt_hdr_len_id,omitempty"`
557 // FibMplsLabel defines type 'fib_mpls_label'.
558 type FibMplsLabel struct {
559 IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
560 Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
561 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
562 Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
565 // FibPath defines type 'fib_path'.
566 type FibPath struct {
567 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
568 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
569 RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
570 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
571 Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
572 Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
573 Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
574 Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
575 Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
576 NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
577 LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
580 // FibPathNh defines type 'fib_path_nh'.
581 type FibPathNh struct {
582 Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
583 ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
584 ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
585 ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
588 // IP4Prefix defines type 'ip4_prefix'.
589 type IP4Prefix struct {
590 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
591 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
594 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
595 hasPrefix := strings.Contains(s, "/")
597 ip, network, err := net.ParseCIDR(s)
599 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
601 maskSize, _ := network.Mask.Size()
602 prefix.Len = byte(maskSize)
603 prefix.Address, err = ParseIP4Address(ip.String())
605 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
609 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
611 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
613 prefix.Len = byte(defaultMaskSize)
614 prefix.Address, err = ParseIP4Address(ip.String())
616 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
622 func (x IP4Prefix) ToIPNet() *net.IPNet {
623 mask := net.CIDRMask(int(x.Len), 32)
624 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
628 func (x IP4Prefix) String() string {
629 ip := x.Address.String()
630 return ip + "/" + strconv.Itoa(int(x.Len))
633 func (x *IP4Prefix) MarshalText() ([]byte, error) {
634 return []byte(x.String()), nil
637 func (x *IP4Prefix) UnmarshalText(text []byte) error {
638 prefix, err := ParseIP4Prefix(string(text))
646 // IP6Prefix defines type 'ip6_prefix'.
647 type IP6Prefix struct {
648 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
649 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
652 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
653 hasPrefix := strings.Contains(s, "/")
655 ip, network, err := net.ParseCIDR(s)
657 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
659 maskSize, _ := network.Mask.Size()
660 prefix.Len = byte(maskSize)
661 prefix.Address, err = ParseIP6Address(ip.String())
663 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
667 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
669 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
671 prefix.Len = byte(defaultMaskSize)
672 prefix.Address, err = ParseIP6Address(ip.String())
674 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
680 func (x IP6Prefix) ToIPNet() *net.IPNet {
681 mask := net.CIDRMask(int(x.Len), 128)
682 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
686 func (x IP6Prefix) String() string {
687 ip := x.Address.String()
688 return ip + "/" + strconv.Itoa(int(x.Len))
691 func (x *IP6Prefix) MarshalText() ([]byte, error) {
692 return []byte(x.String()), nil
695 func (x *IP6Prefix) UnmarshalText(text []byte) error {
696 prefix, err := ParseIP6Prefix(string(text))
704 // Mprefix defines type 'mprefix'.
705 type Mprefix struct {
706 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
707 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
708 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
709 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
712 // Prefix defines type 'prefix'.
714 Address Address `binapi:"address,name=address" json:"address,omitempty"`
715 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
718 func ParsePrefix(ip string) (prefix Prefix, err error) {
719 hasPrefix := strings.Contains(ip, "/")
721 netIP, network, err := net.ParseCIDR(ip)
723 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
725 maskSize, _ := network.Mask.Size()
726 prefix.Len = byte(maskSize)
727 prefix.Address, err = ParseAddress(netIP.String())
729 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
732 netIP := net.ParseIP(ip)
733 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
734 if netIP.To4() == nil {
735 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
737 prefix.Len = byte(defaultMaskSize)
738 prefix.Address, err = ParseAddress(netIP.String())
740 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
746 func (x Prefix) ToIPNet() *net.IPNet {
748 if x.Address.Af == ADDRESS_IP4 {
749 mask = net.CIDRMask(int(x.Len), 32)
751 mask = net.CIDRMask(int(x.Len), 128)
753 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
757 func (x Prefix) String() string {
758 ip := x.Address.String()
759 return ip + "/" + strconv.Itoa(int(x.Len))
762 func (x *Prefix) MarshalText() ([]byte, error) {
763 return []byte(x.String()), nil
766 func (x *Prefix) UnmarshalText(text []byte) error {
767 prefix, err := ParsePrefix(string(text))
775 // PrefixMatcher defines type 'prefix_matcher'.
776 type PrefixMatcher struct {
777 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
778 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
781 // AddressUnion defines union 'address_union'.
782 type AddressUnion struct {
783 // AddressUnion can be one of:
786 XXX_UnionData [16]byte
789 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
793 func (u *AddressUnion) SetIP4(a IP4Address) {
794 buf := codec.NewBuffer(u.XXX_UnionData[:])
795 buf.EncodeBytes(a[:], 4)
797 func (u *AddressUnion) GetIP4() (a IP4Address) {
798 buf := codec.NewBuffer(u.XXX_UnionData[:])
799 copy(a[:], buf.DecodeBytes(4))
803 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
807 func (u *AddressUnion) SetIP6(a IP6Address) {
808 buf := codec.NewBuffer(u.XXX_UnionData[:])
809 buf.EncodeBytes(a[:], 16)
811 func (u *AddressUnion) GetIP6() (a IP6Address) {
812 buf := codec.NewBuffer(u.XXX_UnionData[:])
813 copy(a[:], buf.DecodeBytes(16))
817 // BierDispEntryAddDel defines message 'bier_disp_entry_add_del'.
818 type BierDispEntryAddDel struct {
819 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
820 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
821 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
822 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
823 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
824 BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
827 func (m *BierDispEntryAddDel) Reset() { *m = BierDispEntryAddDel{} }
828 func (*BierDispEntryAddDel) GetMessageName() string { return "bier_disp_entry_add_del" }
829 func (*BierDispEntryAddDel) GetCrcString() string { return "648323eb" }
830 func (*BierDispEntryAddDel) GetMessageType() api.MessageType {
831 return api.RequestMessage
834 func (m *BierDispEntryAddDel) Size() (size int) {
839 size += 4 // m.BdeTblID
840 size += 1 // m.BdeIsAdd
841 size += 1 // m.BdePayloadProto
842 size += 1 // m.BdeNPaths
843 for j1 := 0; j1 < len(m.BdePaths); j1++ {
846 if j1 < len(m.BdePaths) {
849 size += 4 // s1.SwIfIndex
850 size += 4 // s1.TableID
851 size += 4 // s1.RpfID
852 size += 1 // s1.Weight
853 size += 1 // s1.Preference
855 size += 4 // s1.Flags
856 size += 4 // s1.Proto
857 size += 1 * 16 // s1.Nh.Address
858 size += 4 // s1.Nh.ViaLabel
859 size += 4 // s1.Nh.ObjID
860 size += 4 // s1.Nh.ClassifyTableIndex
861 size += 1 // s1.NLabels
862 for j2 := 0; j2 < 16; j2++ {
863 size += 1 // s1.LabelStack[j2].IsUniform
864 size += 4 // s1.LabelStack[j2].Label
865 size += 1 // s1.LabelStack[j2].TTL
866 size += 1 // s1.LabelStack[j2].Exp
871 func (m *BierDispEntryAddDel) Marshal(b []byte) ([]byte, error) {
873 b = make([]byte, m.Size())
875 buf := codec.NewBuffer(b)
876 buf.EncodeUint16(m.BdeBp)
877 buf.EncodeUint32(m.BdeTblID)
878 buf.EncodeBool(m.BdeIsAdd)
879 buf.EncodeUint8(m.BdePayloadProto)
880 buf.EncodeUint8(uint8(len(m.BdePaths)))
881 for j0 := 0; j0 < len(m.BdePaths); j0++ {
882 var v0 FibPath // BdePaths
883 if j0 < len(m.BdePaths) {
886 buf.EncodeUint32(v0.SwIfIndex)
887 buf.EncodeUint32(v0.TableID)
888 buf.EncodeUint32(v0.RpfID)
889 buf.EncodeUint8(v0.Weight)
890 buf.EncodeUint8(v0.Preference)
891 buf.EncodeUint32(uint32(v0.Type))
892 buf.EncodeUint32(uint32(v0.Flags))
893 buf.EncodeUint32(uint32(v0.Proto))
894 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16)
895 buf.EncodeUint32(v0.Nh.ViaLabel)
896 buf.EncodeUint32(v0.Nh.ObjID)
897 buf.EncodeUint32(v0.Nh.ClassifyTableIndex)
898 buf.EncodeUint8(v0.NLabels)
899 for j1 := 0; j1 < 16; j1++ {
900 buf.EncodeUint8(v0.LabelStack[j1].IsUniform)
901 buf.EncodeUint32(v0.LabelStack[j1].Label)
902 buf.EncodeUint8(v0.LabelStack[j1].TTL)
903 buf.EncodeUint8(v0.LabelStack[j1].Exp)
906 return buf.Bytes(), nil
908 func (m *BierDispEntryAddDel) Unmarshal(b []byte) error {
909 buf := codec.NewBuffer(b)
910 m.BdeBp = buf.DecodeUint16()
911 m.BdeTblID = buf.DecodeUint32()
912 m.BdeIsAdd = buf.DecodeBool()
913 m.BdePayloadProto = buf.DecodeUint8()
914 m.BdeNPaths = buf.DecodeUint8()
915 m.BdePaths = make([]FibPath, m.BdeNPaths)
916 for j0 := 0; j0 < len(m.BdePaths); j0++ {
917 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
918 m.BdePaths[j0].TableID = buf.DecodeUint32()
919 m.BdePaths[j0].RpfID = buf.DecodeUint32()
920 m.BdePaths[j0].Weight = buf.DecodeUint8()
921 m.BdePaths[j0].Preference = buf.DecodeUint8()
922 m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
923 m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
924 m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
925 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
926 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
927 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
928 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
929 m.BdePaths[j0].NLabels = buf.DecodeUint8()
930 for j1 := 0; j1 < 16; j1++ {
931 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
932 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
933 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
934 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
940 // BierDispEntryAddDelReply defines message 'bier_disp_entry_add_del_reply'.
941 type BierDispEntryAddDelReply struct {
942 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
945 func (m *BierDispEntryAddDelReply) Reset() { *m = BierDispEntryAddDelReply{} }
946 func (*BierDispEntryAddDelReply) GetMessageName() string { return "bier_disp_entry_add_del_reply" }
947 func (*BierDispEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
948 func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType {
949 return api.ReplyMessage
952 func (m *BierDispEntryAddDelReply) Size() (size int) {
956 size += 4 // m.Retval
959 func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
961 b = make([]byte, m.Size())
963 buf := codec.NewBuffer(b)
964 buf.EncodeInt32(m.Retval)
965 return buf.Bytes(), nil
967 func (m *BierDispEntryAddDelReply) Unmarshal(b []byte) error {
968 buf := codec.NewBuffer(b)
969 m.Retval = buf.DecodeInt32()
973 // BierDispEntryDetails defines message 'bier_disp_entry_details'.
974 type BierDispEntryDetails struct {
975 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
976 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
977 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
978 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
979 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
980 BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
983 func (m *BierDispEntryDetails) Reset() { *m = BierDispEntryDetails{} }
984 func (*BierDispEntryDetails) GetMessageName() string { return "bier_disp_entry_details" }
985 func (*BierDispEntryDetails) GetCrcString() string { return "e5b039a9" }
986 func (*BierDispEntryDetails) GetMessageType() api.MessageType {
987 return api.ReplyMessage
990 func (m *BierDispEntryDetails) Size() (size int) {
995 size += 4 // m.BdeTblID
996 size += 1 // m.BdeIsAdd
997 size += 1 // m.BdePayloadProto
998 size += 1 // m.BdeNPaths
999 for j1 := 0; j1 < len(m.BdePaths); j1++ {
1002 if j1 < len(m.BdePaths) {
1005 size += 4 // s1.SwIfIndex
1006 size += 4 // s1.TableID
1007 size += 4 // s1.RpfID
1008 size += 1 // s1.Weight
1009 size += 1 // s1.Preference
1010 size += 4 // s1.Type
1011 size += 4 // s1.Flags
1012 size += 4 // s1.Proto
1013 size += 1 * 16 // s1.Nh.Address
1014 size += 4 // s1.Nh.ViaLabel
1015 size += 4 // s1.Nh.ObjID
1016 size += 4 // s1.Nh.ClassifyTableIndex
1017 size += 1 // s1.NLabels
1018 for j2 := 0; j2 < 16; j2++ {
1019 size += 1 // s1.LabelStack[j2].IsUniform
1020 size += 4 // s1.LabelStack[j2].Label
1021 size += 1 // s1.LabelStack[j2].TTL
1022 size += 1 // s1.LabelStack[j2].Exp
1027 func (m *BierDispEntryDetails) Marshal(b []byte) ([]byte, error) {
1029 b = make([]byte, m.Size())
1031 buf := codec.NewBuffer(b)
1032 buf.EncodeUint16(m.BdeBp)
1033 buf.EncodeUint32(m.BdeTblID)
1034 buf.EncodeBool(m.BdeIsAdd)
1035 buf.EncodeUint8(m.BdePayloadProto)
1036 buf.EncodeUint8(uint8(len(m.BdePaths)))
1037 for j0 := 0; j0 < len(m.BdePaths); j0++ {
1038 var v0 FibPath // BdePaths
1039 if j0 < len(m.BdePaths) {
1042 buf.EncodeUint32(v0.SwIfIndex)
1043 buf.EncodeUint32(v0.TableID)
1044 buf.EncodeUint32(v0.RpfID)
1045 buf.EncodeUint8(v0.Weight)
1046 buf.EncodeUint8(v0.Preference)
1047 buf.EncodeUint32(uint32(v0.Type))
1048 buf.EncodeUint32(uint32(v0.Flags))
1049 buf.EncodeUint32(uint32(v0.Proto))
1050 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16)
1051 buf.EncodeUint32(v0.Nh.ViaLabel)
1052 buf.EncodeUint32(v0.Nh.ObjID)
1053 buf.EncodeUint32(v0.Nh.ClassifyTableIndex)
1054 buf.EncodeUint8(v0.NLabels)
1055 for j1 := 0; j1 < 16; j1++ {
1056 buf.EncodeUint8(v0.LabelStack[j1].IsUniform)
1057 buf.EncodeUint32(v0.LabelStack[j1].Label)
1058 buf.EncodeUint8(v0.LabelStack[j1].TTL)
1059 buf.EncodeUint8(v0.LabelStack[j1].Exp)
1062 return buf.Bytes(), nil
1064 func (m *BierDispEntryDetails) Unmarshal(b []byte) error {
1065 buf := codec.NewBuffer(b)
1066 m.BdeBp = buf.DecodeUint16()
1067 m.BdeTblID = buf.DecodeUint32()
1068 m.BdeIsAdd = buf.DecodeBool()
1069 m.BdePayloadProto = buf.DecodeUint8()
1070 m.BdeNPaths = buf.DecodeUint8()
1071 m.BdePaths = make([]FibPath, m.BdeNPaths)
1072 for j0 := 0; j0 < len(m.BdePaths); j0++ {
1073 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
1074 m.BdePaths[j0].TableID = buf.DecodeUint32()
1075 m.BdePaths[j0].RpfID = buf.DecodeUint32()
1076 m.BdePaths[j0].Weight = buf.DecodeUint8()
1077 m.BdePaths[j0].Preference = buf.DecodeUint8()
1078 m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
1079 m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
1080 m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
1081 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1082 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
1083 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
1084 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
1085 m.BdePaths[j0].NLabels = buf.DecodeUint8()
1086 for j1 := 0; j1 < 16; j1++ {
1087 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
1088 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
1089 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
1090 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
1096 // BierDispEntryDump defines message 'bier_disp_entry_dump'.
1097 type BierDispEntryDump struct {
1098 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
1101 func (m *BierDispEntryDump) Reset() { *m = BierDispEntryDump{} }
1102 func (*BierDispEntryDump) GetMessageName() string { return "bier_disp_entry_dump" }
1103 func (*BierDispEntryDump) GetCrcString() string { return "b5fa54ad" }
1104 func (*BierDispEntryDump) GetMessageType() api.MessageType {
1105 return api.RequestMessage
1108 func (m *BierDispEntryDump) Size() (size int) {
1112 size += 4 // m.BdeTblID
1115 func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) {
1117 b = make([]byte, m.Size())
1119 buf := codec.NewBuffer(b)
1120 buf.EncodeUint32(m.BdeTblID)
1121 return buf.Bytes(), nil
1123 func (m *BierDispEntryDump) Unmarshal(b []byte) error {
1124 buf := codec.NewBuffer(b)
1125 m.BdeTblID = buf.DecodeUint32()
1129 // BierDispTableAddDel defines message 'bier_disp_table_add_del'.
1130 type BierDispTableAddDel struct {
1131 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
1132 BdtIsAdd bool `binapi:"bool,name=bdt_is_add" json:"bdt_is_add,omitempty"`
1135 func (m *BierDispTableAddDel) Reset() { *m = BierDispTableAddDel{} }
1136 func (*BierDispTableAddDel) GetMessageName() string { return "bier_disp_table_add_del" }
1137 func (*BierDispTableAddDel) GetCrcString() string { return "889657ac" }
1138 func (*BierDispTableAddDel) GetMessageType() api.MessageType {
1139 return api.RequestMessage
1142 func (m *BierDispTableAddDel) Size() (size int) {
1146 size += 4 // m.BdtTblID
1147 size += 1 // m.BdtIsAdd
1150 func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) {
1152 b = make([]byte, m.Size())
1154 buf := codec.NewBuffer(b)
1155 buf.EncodeUint32(m.BdtTblID)
1156 buf.EncodeBool(m.BdtIsAdd)
1157 return buf.Bytes(), nil
1159 func (m *BierDispTableAddDel) Unmarshal(b []byte) error {
1160 buf := codec.NewBuffer(b)
1161 m.BdtTblID = buf.DecodeUint32()
1162 m.BdtIsAdd = buf.DecodeBool()
1166 // BierDispTableAddDelReply defines message 'bier_disp_table_add_del_reply'.
1167 type BierDispTableAddDelReply struct {
1168 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1171 func (m *BierDispTableAddDelReply) Reset() { *m = BierDispTableAddDelReply{} }
1172 func (*BierDispTableAddDelReply) GetMessageName() string { return "bier_disp_table_add_del_reply" }
1173 func (*BierDispTableAddDelReply) GetCrcString() string { return "e8d4e804" }
1174 func (*BierDispTableAddDelReply) GetMessageType() api.MessageType {
1175 return api.ReplyMessage
1178 func (m *BierDispTableAddDelReply) Size() (size int) {
1182 size += 4 // m.Retval
1185 func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) {
1187 b = make([]byte, m.Size())
1189 buf := codec.NewBuffer(b)
1190 buf.EncodeInt32(m.Retval)
1191 return buf.Bytes(), nil
1193 func (m *BierDispTableAddDelReply) Unmarshal(b []byte) error {
1194 buf := codec.NewBuffer(b)
1195 m.Retval = buf.DecodeInt32()
1199 // BierDispTableDetails defines message 'bier_disp_table_details'.
1200 type BierDispTableDetails struct {
1201 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
1204 func (m *BierDispTableDetails) Reset() { *m = BierDispTableDetails{} }
1205 func (*BierDispTableDetails) GetMessageName() string { return "bier_disp_table_details" }
1206 func (*BierDispTableDetails) GetCrcString() string { return "d27942c0" }
1207 func (*BierDispTableDetails) GetMessageType() api.MessageType {
1208 return api.ReplyMessage
1211 func (m *BierDispTableDetails) Size() (size int) {
1215 size += 4 // m.BdtTblID
1218 func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) {
1220 b = make([]byte, m.Size())
1222 buf := codec.NewBuffer(b)
1223 buf.EncodeUint32(m.BdtTblID)
1224 return buf.Bytes(), nil
1226 func (m *BierDispTableDetails) Unmarshal(b []byte) error {
1227 buf := codec.NewBuffer(b)
1228 m.BdtTblID = buf.DecodeUint32()
1232 // BierDispTableDump defines message 'bier_disp_table_dump'.
1233 type BierDispTableDump struct{}
1235 func (m *BierDispTableDump) Reset() { *m = BierDispTableDump{} }
1236 func (*BierDispTableDump) GetMessageName() string { return "bier_disp_table_dump" }
1237 func (*BierDispTableDump) GetCrcString() string { return "51077d14" }
1238 func (*BierDispTableDump) GetMessageType() api.MessageType {
1239 return api.RequestMessage
1242 func (m *BierDispTableDump) Size() (size int) {
1248 func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) {
1250 b = make([]byte, m.Size())
1252 buf := codec.NewBuffer(b)
1253 return buf.Bytes(), nil
1255 func (m *BierDispTableDump) Unmarshal(b []byte) error {
1259 // BierImpAdd defines message 'bier_imp_add'.
1260 type BierImpAdd struct {
1261 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
1262 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
1263 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
1264 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
1267 func (m *BierImpAdd) Reset() { *m = BierImpAdd{} }
1268 func (*BierImpAdd) GetMessageName() string { return "bier_imp_add" }
1269 func (*BierImpAdd) GetCrcString() string { return "3856dc3d" }
1270 func (*BierImpAdd) GetMessageType() api.MessageType {
1271 return api.RequestMessage
1274 func (m *BierImpAdd) Size() (size int) {
1278 size += 1 // m.BiTblID.BtSet
1279 size += 1 // m.BiTblID.BtSubDomain
1280 size += 1 // m.BiTblID.BtHdrLenID
1281 size += 2 // m.BiSrc
1282 size += 1 // m.BiNBytes
1283 size += 1 * len(m.BiBytes) // m.BiBytes
1286 func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) {
1288 b = make([]byte, m.Size())
1290 buf := codec.NewBuffer(b)
1291 buf.EncodeUint8(m.BiTblID.BtSet)
1292 buf.EncodeUint8(m.BiTblID.BtSubDomain)
1293 buf.EncodeUint8(m.BiTblID.BtHdrLenID)
1294 buf.EncodeUint16(m.BiSrc)
1295 buf.EncodeUint8(uint8(len(m.BiBytes)))
1296 buf.EncodeBytes(m.BiBytes, 0)
1297 return buf.Bytes(), nil
1299 func (m *BierImpAdd) Unmarshal(b []byte) error {
1300 buf := codec.NewBuffer(b)
1301 m.BiTblID.BtSet = buf.DecodeUint8()
1302 m.BiTblID.BtSubDomain = buf.DecodeUint8()
1303 m.BiTblID.BtHdrLenID = buf.DecodeUint8()
1304 m.BiSrc = buf.DecodeUint16()
1305 m.BiNBytes = buf.DecodeUint8()
1306 m.BiBytes = make([]byte, m.BiNBytes)
1307 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
1311 // BierImpAddReply defines message 'bier_imp_add_reply'.
1312 type BierImpAddReply struct {
1313 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1314 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
1317 func (m *BierImpAddReply) Reset() { *m = BierImpAddReply{} }
1318 func (*BierImpAddReply) GetMessageName() string { return "bier_imp_add_reply" }
1319 func (*BierImpAddReply) GetCrcString() string { return "d49c5793" }
1320 func (*BierImpAddReply) GetMessageType() api.MessageType {
1321 return api.ReplyMessage
1324 func (m *BierImpAddReply) Size() (size int) {
1328 size += 4 // m.Retval
1329 size += 4 // m.BiIndex
1332 func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) {
1334 b = make([]byte, m.Size())
1336 buf := codec.NewBuffer(b)
1337 buf.EncodeInt32(m.Retval)
1338 buf.EncodeUint32(m.BiIndex)
1339 return buf.Bytes(), nil
1341 func (m *BierImpAddReply) Unmarshal(b []byte) error {
1342 buf := codec.NewBuffer(b)
1343 m.Retval = buf.DecodeInt32()
1344 m.BiIndex = buf.DecodeUint32()
1348 // BierImpDel defines message 'bier_imp_del'.
1349 type BierImpDel struct {
1350 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
1353 func (m *BierImpDel) Reset() { *m = BierImpDel{} }
1354 func (*BierImpDel) GetMessageName() string { return "bier_imp_del" }
1355 func (*BierImpDel) GetCrcString() string { return "7d45edf6" }
1356 func (*BierImpDel) GetMessageType() api.MessageType {
1357 return api.RequestMessage
1360 func (m *BierImpDel) Size() (size int) {
1364 size += 4 // m.BiIndex
1367 func (m *BierImpDel) Marshal(b []byte) ([]byte, error) {
1369 b = make([]byte, m.Size())
1371 buf := codec.NewBuffer(b)
1372 buf.EncodeUint32(m.BiIndex)
1373 return buf.Bytes(), nil
1375 func (m *BierImpDel) Unmarshal(b []byte) error {
1376 buf := codec.NewBuffer(b)
1377 m.BiIndex = buf.DecodeUint32()
1381 // BierImpDelReply defines message 'bier_imp_del_reply'.
1382 type BierImpDelReply struct {
1383 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1386 func (m *BierImpDelReply) Reset() { *m = BierImpDelReply{} }
1387 func (*BierImpDelReply) GetMessageName() string { return "bier_imp_del_reply" }
1388 func (*BierImpDelReply) GetCrcString() string { return "e8d4e804" }
1389 func (*BierImpDelReply) GetMessageType() api.MessageType {
1390 return api.ReplyMessage
1393 func (m *BierImpDelReply) Size() (size int) {
1397 size += 4 // m.Retval
1400 func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) {
1402 b = make([]byte, m.Size())
1404 buf := codec.NewBuffer(b)
1405 buf.EncodeInt32(m.Retval)
1406 return buf.Bytes(), nil
1408 func (m *BierImpDelReply) Unmarshal(b []byte) error {
1409 buf := codec.NewBuffer(b)
1410 m.Retval = buf.DecodeInt32()
1414 // BierImpDetails defines message 'bier_imp_details'.
1415 type BierImpDetails struct {
1416 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
1417 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
1418 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
1419 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
1422 func (m *BierImpDetails) Reset() { *m = BierImpDetails{} }
1423 func (*BierImpDetails) GetMessageName() string { return "bier_imp_details" }
1424 func (*BierImpDetails) GetCrcString() string { return "b76192df" }
1425 func (*BierImpDetails) GetMessageType() api.MessageType {
1426 return api.ReplyMessage
1429 func (m *BierImpDetails) Size() (size int) {
1433 size += 1 // m.BiTblID.BtSet
1434 size += 1 // m.BiTblID.BtSubDomain
1435 size += 1 // m.BiTblID.BtHdrLenID
1436 size += 2 // m.BiSrc
1437 size += 1 // m.BiNBytes
1438 size += 1 * len(m.BiBytes) // m.BiBytes
1441 func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) {
1443 b = make([]byte, m.Size())
1445 buf := codec.NewBuffer(b)
1446 buf.EncodeUint8(m.BiTblID.BtSet)
1447 buf.EncodeUint8(m.BiTblID.BtSubDomain)
1448 buf.EncodeUint8(m.BiTblID.BtHdrLenID)
1449 buf.EncodeUint16(m.BiSrc)
1450 buf.EncodeUint8(uint8(len(m.BiBytes)))
1451 buf.EncodeBytes(m.BiBytes, 0)
1452 return buf.Bytes(), nil
1454 func (m *BierImpDetails) Unmarshal(b []byte) error {
1455 buf := codec.NewBuffer(b)
1456 m.BiTblID.BtSet = buf.DecodeUint8()
1457 m.BiTblID.BtSubDomain = buf.DecodeUint8()
1458 m.BiTblID.BtHdrLenID = buf.DecodeUint8()
1459 m.BiSrc = buf.DecodeUint16()
1460 m.BiNBytes = buf.DecodeUint8()
1461 m.BiBytes = make([]byte, m.BiNBytes)
1462 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
1466 // BierImpDump defines message 'bier_imp_dump'.
1467 type BierImpDump struct{}
1469 func (m *BierImpDump) Reset() { *m = BierImpDump{} }
1470 func (*BierImpDump) GetMessageName() string { return "bier_imp_dump" }
1471 func (*BierImpDump) GetCrcString() string { return "51077d14" }
1472 func (*BierImpDump) GetMessageType() api.MessageType {
1473 return api.RequestMessage
1476 func (m *BierImpDump) Size() (size int) {
1482 func (m *BierImpDump) Marshal(b []byte) ([]byte, error) {
1484 b = make([]byte, m.Size())
1486 buf := codec.NewBuffer(b)
1487 return buf.Bytes(), nil
1489 func (m *BierImpDump) Unmarshal(b []byte) error {
1493 // BierRouteAddDel defines message 'bier_route_add_del'.
1494 type BierRouteAddDel struct {
1495 BrIsAdd bool `binapi:"bool,name=br_is_add" json:"br_is_add,omitempty"`
1496 BrIsReplace bool `binapi:"bool,name=br_is_replace" json:"br_is_replace,omitempty"`
1497 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
1500 func (m *BierRouteAddDel) Reset() { *m = BierRouteAddDel{} }
1501 func (*BierRouteAddDel) GetMessageName() string { return "bier_route_add_del" }
1502 func (*BierRouteAddDel) GetCrcString() string { return "f29edca0" }
1503 func (*BierRouteAddDel) GetMessageType() api.MessageType {
1504 return api.RequestMessage
1507 func (m *BierRouteAddDel) Size() (size int) {
1511 size += 1 // m.BrIsAdd
1512 size += 1 // m.BrIsReplace
1513 size += 4 // m.BrRoute.BrBp
1514 size += 1 // m.BrRoute.BrTblID.BtSet
1515 size += 1 // m.BrRoute.BrTblID.BtSubDomain
1516 size += 1 // m.BrRoute.BrTblID.BtHdrLenID
1517 size += 1 // m.BrRoute.BrNPaths
1518 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
1521 if j2 < len(m.BrRoute.BrPaths) {
1522 s2 = m.BrRoute.BrPaths[j2]
1524 size += 4 // s2.SwIfIndex
1525 size += 4 // s2.TableID
1526 size += 4 // s2.RpfID
1527 size += 1 // s2.Weight
1528 size += 1 // s2.Preference
1529 size += 4 // s2.Type
1530 size += 4 // s2.Flags
1531 size += 4 // s2.Proto
1532 size += 1 * 16 // s2.Nh.Address
1533 size += 4 // s2.Nh.ViaLabel
1534 size += 4 // s2.Nh.ObjID
1535 size += 4 // s2.Nh.ClassifyTableIndex
1536 size += 1 // s2.NLabels
1537 for j3 := 0; j3 < 16; j3++ {
1538 size += 1 // s2.LabelStack[j3].IsUniform
1539 size += 4 // s2.LabelStack[j3].Label
1540 size += 1 // s2.LabelStack[j3].TTL
1541 size += 1 // s2.LabelStack[j3].Exp
1546 func (m *BierRouteAddDel) Marshal(b []byte) ([]byte, error) {
1548 b = make([]byte, m.Size())
1550 buf := codec.NewBuffer(b)
1551 buf.EncodeBool(m.BrIsAdd)
1552 buf.EncodeBool(m.BrIsReplace)
1553 buf.EncodeUint32(m.BrRoute.BrBp)
1554 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet)
1555 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain)
1556 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID)
1557 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
1558 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1559 var v1 FibPath // BrPaths
1560 if j1 < len(m.BrRoute.BrPaths) {
1561 v1 = m.BrRoute.BrPaths[j1]
1563 buf.EncodeUint32(v1.SwIfIndex)
1564 buf.EncodeUint32(v1.TableID)
1565 buf.EncodeUint32(v1.RpfID)
1566 buf.EncodeUint8(v1.Weight)
1567 buf.EncodeUint8(v1.Preference)
1568 buf.EncodeUint32(uint32(v1.Type))
1569 buf.EncodeUint32(uint32(v1.Flags))
1570 buf.EncodeUint32(uint32(v1.Proto))
1571 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
1572 buf.EncodeUint32(v1.Nh.ViaLabel)
1573 buf.EncodeUint32(v1.Nh.ObjID)
1574 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
1575 buf.EncodeUint8(v1.NLabels)
1576 for j2 := 0; j2 < 16; j2++ {
1577 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
1578 buf.EncodeUint32(v1.LabelStack[j2].Label)
1579 buf.EncodeUint8(v1.LabelStack[j2].TTL)
1580 buf.EncodeUint8(v1.LabelStack[j2].Exp)
1583 return buf.Bytes(), nil
1585 func (m *BierRouteAddDel) Unmarshal(b []byte) error {
1586 buf := codec.NewBuffer(b)
1587 m.BrIsAdd = buf.DecodeBool()
1588 m.BrIsReplace = buf.DecodeBool()
1589 m.BrRoute.BrBp = buf.DecodeUint32()
1590 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
1591 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
1592 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
1593 m.BrRoute.BrNPaths = buf.DecodeUint8()
1594 m.BrRoute.BrPaths = make([]FibPath, m.BrRoute.BrNPaths)
1595 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1596 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
1597 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
1598 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
1599 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
1600 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
1601 m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
1602 m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
1603 m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
1604 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1605 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
1606 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
1607 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
1608 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
1609 for j2 := 0; j2 < 16; j2++ {
1610 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
1611 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
1612 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
1613 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
1619 // BierRouteAddDelReply defines message 'bier_route_add_del_reply'.
1620 type BierRouteAddDelReply struct {
1621 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1624 func (m *BierRouteAddDelReply) Reset() { *m = BierRouteAddDelReply{} }
1625 func (*BierRouteAddDelReply) GetMessageName() string { return "bier_route_add_del_reply" }
1626 func (*BierRouteAddDelReply) GetCrcString() string { return "e8d4e804" }
1627 func (*BierRouteAddDelReply) GetMessageType() api.MessageType {
1628 return api.ReplyMessage
1631 func (m *BierRouteAddDelReply) Size() (size int) {
1635 size += 4 // m.Retval
1638 func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
1640 b = make([]byte, m.Size())
1642 buf := codec.NewBuffer(b)
1643 buf.EncodeInt32(m.Retval)
1644 return buf.Bytes(), nil
1646 func (m *BierRouteAddDelReply) Unmarshal(b []byte) error {
1647 buf := codec.NewBuffer(b)
1648 m.Retval = buf.DecodeInt32()
1652 // BierRouteDetails defines message 'bier_route_details'.
1653 type BierRouteDetails struct {
1654 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
1657 func (m *BierRouteDetails) Reset() { *m = BierRouteDetails{} }
1658 func (*BierRouteDetails) GetMessageName() string { return "bier_route_details" }
1659 func (*BierRouteDetails) GetCrcString() string { return "39ee6a56" }
1660 func (*BierRouteDetails) GetMessageType() api.MessageType {
1661 return api.ReplyMessage
1664 func (m *BierRouteDetails) Size() (size int) {
1668 size += 4 // m.BrRoute.BrBp
1669 size += 1 // m.BrRoute.BrTblID.BtSet
1670 size += 1 // m.BrRoute.BrTblID.BtSubDomain
1671 size += 1 // m.BrRoute.BrTblID.BtHdrLenID
1672 size += 1 // m.BrRoute.BrNPaths
1673 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
1676 if j2 < len(m.BrRoute.BrPaths) {
1677 s2 = m.BrRoute.BrPaths[j2]
1679 size += 4 // s2.SwIfIndex
1680 size += 4 // s2.TableID
1681 size += 4 // s2.RpfID
1682 size += 1 // s2.Weight
1683 size += 1 // s2.Preference
1684 size += 4 // s2.Type
1685 size += 4 // s2.Flags
1686 size += 4 // s2.Proto
1687 size += 1 * 16 // s2.Nh.Address
1688 size += 4 // s2.Nh.ViaLabel
1689 size += 4 // s2.Nh.ObjID
1690 size += 4 // s2.Nh.ClassifyTableIndex
1691 size += 1 // s2.NLabels
1692 for j3 := 0; j3 < 16; j3++ {
1693 size += 1 // s2.LabelStack[j3].IsUniform
1694 size += 4 // s2.LabelStack[j3].Label
1695 size += 1 // s2.LabelStack[j3].TTL
1696 size += 1 // s2.LabelStack[j3].Exp
1701 func (m *BierRouteDetails) Marshal(b []byte) ([]byte, error) {
1703 b = make([]byte, m.Size())
1705 buf := codec.NewBuffer(b)
1706 buf.EncodeUint32(m.BrRoute.BrBp)
1707 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet)
1708 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain)
1709 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID)
1710 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
1711 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1712 var v1 FibPath // BrPaths
1713 if j1 < len(m.BrRoute.BrPaths) {
1714 v1 = m.BrRoute.BrPaths[j1]
1716 buf.EncodeUint32(v1.SwIfIndex)
1717 buf.EncodeUint32(v1.TableID)
1718 buf.EncodeUint32(v1.RpfID)
1719 buf.EncodeUint8(v1.Weight)
1720 buf.EncodeUint8(v1.Preference)
1721 buf.EncodeUint32(uint32(v1.Type))
1722 buf.EncodeUint32(uint32(v1.Flags))
1723 buf.EncodeUint32(uint32(v1.Proto))
1724 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
1725 buf.EncodeUint32(v1.Nh.ViaLabel)
1726 buf.EncodeUint32(v1.Nh.ObjID)
1727 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
1728 buf.EncodeUint8(v1.NLabels)
1729 for j2 := 0; j2 < 16; j2++ {
1730 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
1731 buf.EncodeUint32(v1.LabelStack[j2].Label)
1732 buf.EncodeUint8(v1.LabelStack[j2].TTL)
1733 buf.EncodeUint8(v1.LabelStack[j2].Exp)
1736 return buf.Bytes(), nil
1738 func (m *BierRouteDetails) Unmarshal(b []byte) error {
1739 buf := codec.NewBuffer(b)
1740 m.BrRoute.BrBp = buf.DecodeUint32()
1741 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
1742 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
1743 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
1744 m.BrRoute.BrNPaths = buf.DecodeUint8()
1745 m.BrRoute.BrPaths = make([]FibPath, m.BrRoute.BrNPaths)
1746 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1747 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
1748 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
1749 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
1750 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
1751 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
1752 m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
1753 m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
1754 m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
1755 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1756 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
1757 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
1758 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
1759 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
1760 for j2 := 0; j2 < 16; j2++ {
1761 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
1762 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
1763 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
1764 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
1770 // BierRouteDump defines message 'bier_route_dump'.
1771 type BierRouteDump struct {
1772 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
1775 func (m *BierRouteDump) Reset() { *m = BierRouteDump{} }
1776 func (*BierRouteDump) GetMessageName() string { return "bier_route_dump" }
1777 func (*BierRouteDump) GetCrcString() string { return "38339846" }
1778 func (*BierRouteDump) GetMessageType() api.MessageType {
1779 return api.RequestMessage
1782 func (m *BierRouteDump) Size() (size int) {
1786 size += 1 // m.BrTblID.BtSet
1787 size += 1 // m.BrTblID.BtSubDomain
1788 size += 1 // m.BrTblID.BtHdrLenID
1791 func (m *BierRouteDump) Marshal(b []byte) ([]byte, error) {
1793 b = make([]byte, m.Size())
1795 buf := codec.NewBuffer(b)
1796 buf.EncodeUint8(m.BrTblID.BtSet)
1797 buf.EncodeUint8(m.BrTblID.BtSubDomain)
1798 buf.EncodeUint8(m.BrTblID.BtHdrLenID)
1799 return buf.Bytes(), nil
1801 func (m *BierRouteDump) Unmarshal(b []byte) error {
1802 buf := codec.NewBuffer(b)
1803 m.BrTblID.BtSet = buf.DecodeUint8()
1804 m.BrTblID.BtSubDomain = buf.DecodeUint8()
1805 m.BrTblID.BtHdrLenID = buf.DecodeUint8()
1809 // BierTableAddDel defines message 'bier_table_add_del'.
1810 type BierTableAddDel struct {
1811 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1812 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1813 BtIsAdd bool `binapi:"bool,name=bt_is_add" json:"bt_is_add,omitempty"`
1816 func (m *BierTableAddDel) Reset() { *m = BierTableAddDel{} }
1817 func (*BierTableAddDel) GetMessageName() string { return "bier_table_add_del" }
1818 func (*BierTableAddDel) GetCrcString() string { return "35e59209" }
1819 func (*BierTableAddDel) GetMessageType() api.MessageType {
1820 return api.RequestMessage
1823 func (m *BierTableAddDel) Size() (size int) {
1827 size += 1 // m.BtTblID.BtSet
1828 size += 1 // m.BtTblID.BtSubDomain
1829 size += 1 // m.BtTblID.BtHdrLenID
1830 size += 4 // m.BtLabel
1831 size += 1 // m.BtIsAdd
1834 func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) {
1836 b = make([]byte, m.Size())
1838 buf := codec.NewBuffer(b)
1839 buf.EncodeUint8(m.BtTblID.BtSet)
1840 buf.EncodeUint8(m.BtTblID.BtSubDomain)
1841 buf.EncodeUint8(m.BtTblID.BtHdrLenID)
1842 buf.EncodeUint32(m.BtLabel)
1843 buf.EncodeBool(m.BtIsAdd)
1844 return buf.Bytes(), nil
1846 func (m *BierTableAddDel) Unmarshal(b []byte) error {
1847 buf := codec.NewBuffer(b)
1848 m.BtTblID.BtSet = buf.DecodeUint8()
1849 m.BtTblID.BtSubDomain = buf.DecodeUint8()
1850 m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1851 m.BtLabel = buf.DecodeUint32()
1852 m.BtIsAdd = buf.DecodeBool()
1856 // BierTableAddDelReply defines message 'bier_table_add_del_reply'.
1857 type BierTableAddDelReply struct {
1858 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1861 func (m *BierTableAddDelReply) Reset() { *m = BierTableAddDelReply{} }
1862 func (*BierTableAddDelReply) GetMessageName() string { return "bier_table_add_del_reply" }
1863 func (*BierTableAddDelReply) GetCrcString() string { return "e8d4e804" }
1864 func (*BierTableAddDelReply) GetMessageType() api.MessageType {
1865 return api.ReplyMessage
1868 func (m *BierTableAddDelReply) Size() (size int) {
1872 size += 4 // m.Retval
1875 func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) {
1877 b = make([]byte, m.Size())
1879 buf := codec.NewBuffer(b)
1880 buf.EncodeInt32(m.Retval)
1881 return buf.Bytes(), nil
1883 func (m *BierTableAddDelReply) Unmarshal(b []byte) error {
1884 buf := codec.NewBuffer(b)
1885 m.Retval = buf.DecodeInt32()
1889 // BierTableDetails defines message 'bier_table_details'.
1890 type BierTableDetails struct {
1891 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1892 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1895 func (m *BierTableDetails) Reset() { *m = BierTableDetails{} }
1896 func (*BierTableDetails) GetMessageName() string { return "bier_table_details" }
1897 func (*BierTableDetails) GetCrcString() string { return "fc44a9dd" }
1898 func (*BierTableDetails) GetMessageType() api.MessageType {
1899 return api.ReplyMessage
1902 func (m *BierTableDetails) Size() (size int) {
1906 size += 4 // m.BtLabel
1907 size += 1 // m.BtTblID.BtSet
1908 size += 1 // m.BtTblID.BtSubDomain
1909 size += 1 // m.BtTblID.BtHdrLenID
1912 func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) {
1914 b = make([]byte, m.Size())
1916 buf := codec.NewBuffer(b)
1917 buf.EncodeUint32(m.BtLabel)
1918 buf.EncodeUint8(m.BtTblID.BtSet)
1919 buf.EncodeUint8(m.BtTblID.BtSubDomain)
1920 buf.EncodeUint8(m.BtTblID.BtHdrLenID)
1921 return buf.Bytes(), nil
1923 func (m *BierTableDetails) Unmarshal(b []byte) error {
1924 buf := codec.NewBuffer(b)
1925 m.BtLabel = buf.DecodeUint32()
1926 m.BtTblID.BtSet = buf.DecodeUint8()
1927 m.BtTblID.BtSubDomain = buf.DecodeUint8()
1928 m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1932 // BierTableDump defines message 'bier_table_dump'.
1933 type BierTableDump struct{}
1935 func (m *BierTableDump) Reset() { *m = BierTableDump{} }
1936 func (*BierTableDump) GetMessageName() string { return "bier_table_dump" }
1937 func (*BierTableDump) GetCrcString() string { return "51077d14" }
1938 func (*BierTableDump) GetMessageType() api.MessageType {
1939 return api.RequestMessage
1942 func (m *BierTableDump) Size() (size int) {
1948 func (m *BierTableDump) Marshal(b []byte) ([]byte, error) {
1950 b = make([]byte, m.Size())
1952 buf := codec.NewBuffer(b)
1953 return buf.Bytes(), nil
1955 func (m *BierTableDump) Unmarshal(b []byte) error {
1959 func init() { file_bier_binapi_init() }
1960 func file_bier_binapi_init() {
1961 api.RegisterMessage((*BierDispEntryAddDel)(nil), "bier_disp_entry_add_del_648323eb")
1962 api.RegisterMessage((*BierDispEntryAddDelReply)(nil), "bier_disp_entry_add_del_reply_e8d4e804")
1963 api.RegisterMessage((*BierDispEntryDetails)(nil), "bier_disp_entry_details_e5b039a9")
1964 api.RegisterMessage((*BierDispEntryDump)(nil), "bier_disp_entry_dump_b5fa54ad")
1965 api.RegisterMessage((*BierDispTableAddDel)(nil), "bier_disp_table_add_del_889657ac")
1966 api.RegisterMessage((*BierDispTableAddDelReply)(nil), "bier_disp_table_add_del_reply_e8d4e804")
1967 api.RegisterMessage((*BierDispTableDetails)(nil), "bier_disp_table_details_d27942c0")
1968 api.RegisterMessage((*BierDispTableDump)(nil), "bier_disp_table_dump_51077d14")
1969 api.RegisterMessage((*BierImpAdd)(nil), "bier_imp_add_3856dc3d")
1970 api.RegisterMessage((*BierImpAddReply)(nil), "bier_imp_add_reply_d49c5793")
1971 api.RegisterMessage((*BierImpDel)(nil), "bier_imp_del_7d45edf6")
1972 api.RegisterMessage((*BierImpDelReply)(nil), "bier_imp_del_reply_e8d4e804")
1973 api.RegisterMessage((*BierImpDetails)(nil), "bier_imp_details_b76192df")
1974 api.RegisterMessage((*BierImpDump)(nil), "bier_imp_dump_51077d14")
1975 api.RegisterMessage((*BierRouteAddDel)(nil), "bier_route_add_del_f29edca0")
1976 api.RegisterMessage((*BierRouteAddDelReply)(nil), "bier_route_add_del_reply_e8d4e804")
1977 api.RegisterMessage((*BierRouteDetails)(nil), "bier_route_details_39ee6a56")
1978 api.RegisterMessage((*BierRouteDump)(nil), "bier_route_dump_38339846")
1979 api.RegisterMessage((*BierTableAddDel)(nil), "bier_table_add_del_35e59209")
1980 api.RegisterMessage((*BierTableAddDelReply)(nil), "bier_table_add_del_reply_e8d4e804")
1981 api.RegisterMessage((*BierTableDetails)(nil), "bier_table_details_fc44a9dd")
1982 api.RegisterMessage((*BierTableDump)(nil), "bier_table_dump_51077d14")
1985 // Messages returns list of all messages in this module.
1986 func AllMessages() []api.Message {
1987 return []api.Message{
1988 (*BierDispEntryAddDel)(nil),
1989 (*BierDispEntryAddDelReply)(nil),
1990 (*BierDispEntryDetails)(nil),
1991 (*BierDispEntryDump)(nil),
1992 (*BierDispTableAddDel)(nil),
1993 (*BierDispTableAddDelReply)(nil),
1994 (*BierDispTableDetails)(nil),
1995 (*BierDispTableDump)(nil),
1997 (*BierImpAddReply)(nil),
1999 (*BierImpDelReply)(nil),
2000 (*BierImpDetails)(nil),
2001 (*BierImpDump)(nil),
2002 (*BierRouteAddDel)(nil),
2003 (*BierRouteAddDelReply)(nil),
2004 (*BierRouteDetails)(nil),
2005 (*BierRouteDump)(nil),
2006 (*BierTableAddDel)(nil),
2007 (*BierTableAddDelReply)(nil),
2008 (*BierTableDetails)(nil),
2009 (*BierTableDump)(nil),