1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/bier.api.json
7 // Package bier contains generated bindings for API file bier.api.
20 api "git.fd.io/govpp.git/api"
21 codec "git.fd.io/govpp.git/codec"
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
36 VersionCrc = 0x27c878c4
39 // AddressFamily defines enum 'address_family'.
40 type AddressFamily uint32
43 ADDRESS_IP4 AddressFamily = 0
44 ADDRESS_IP6 AddressFamily = 1
48 AddressFamily_name = map[uint32]string{
52 AddressFamily_value = map[string]uint32{
58 func (x AddressFamily) String() string {
59 s, ok := AddressFamily_name[uint32(x)]
63 return "AddressFamily(" + strconv.Itoa(int(x)) + ")"
66 // FibPathFlags defines enum 'fib_path_flags'.
67 type FibPathFlags uint32
70 FIB_API_PATH_FLAG_NONE FibPathFlags = 0
71 FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED FibPathFlags = 1
72 FIB_API_PATH_FLAG_RESOLVE_VIA_HOST FibPathFlags = 2
73 FIB_API_PATH_FLAG_POP_PW_CW FibPathFlags = 4
77 FibPathFlags_name = map[uint32]string{
78 0: "FIB_API_PATH_FLAG_NONE",
79 1: "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED",
80 2: "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST",
81 4: "FIB_API_PATH_FLAG_POP_PW_CW",
83 FibPathFlags_value = map[string]uint32{
84 "FIB_API_PATH_FLAG_NONE": 0,
85 "FIB_API_PATH_FLAG_RESOLVE_VIA_ATTACHED": 1,
86 "FIB_API_PATH_FLAG_RESOLVE_VIA_HOST": 2,
87 "FIB_API_PATH_FLAG_POP_PW_CW": 4,
91 func (x FibPathFlags) String() string {
92 s, ok := FibPathFlags_name[uint32(x)]
96 str := func(n uint32) string {
97 s, ok := FibPathFlags_name[uint32(n)]
101 return "FibPathFlags(" + strconv.Itoa(int(n)) + ")"
103 for i := uint32(0); i <= 32; i++ {
113 return str(uint32(x))
118 // FibPathNhProto defines enum 'fib_path_nh_proto'.
119 type FibPathNhProto uint32
122 FIB_API_PATH_NH_PROTO_IP4 FibPathNhProto = 0
123 FIB_API_PATH_NH_PROTO_IP6 FibPathNhProto = 1
124 FIB_API_PATH_NH_PROTO_MPLS FibPathNhProto = 2
125 FIB_API_PATH_NH_PROTO_ETHERNET FibPathNhProto = 3
126 FIB_API_PATH_NH_PROTO_BIER FibPathNhProto = 4
130 FibPathNhProto_name = map[uint32]string{
131 0: "FIB_API_PATH_NH_PROTO_IP4",
132 1: "FIB_API_PATH_NH_PROTO_IP6",
133 2: "FIB_API_PATH_NH_PROTO_MPLS",
134 3: "FIB_API_PATH_NH_PROTO_ETHERNET",
135 4: "FIB_API_PATH_NH_PROTO_BIER",
137 FibPathNhProto_value = map[string]uint32{
138 "FIB_API_PATH_NH_PROTO_IP4": 0,
139 "FIB_API_PATH_NH_PROTO_IP6": 1,
140 "FIB_API_PATH_NH_PROTO_MPLS": 2,
141 "FIB_API_PATH_NH_PROTO_ETHERNET": 3,
142 "FIB_API_PATH_NH_PROTO_BIER": 4,
146 func (x FibPathNhProto) String() string {
147 s, ok := FibPathNhProto_name[uint32(x)]
151 return "FibPathNhProto(" + strconv.Itoa(int(x)) + ")"
154 // FibPathType defines enum 'fib_path_type'.
155 type FibPathType uint32
158 FIB_API_PATH_TYPE_NORMAL FibPathType = 0
159 FIB_API_PATH_TYPE_LOCAL FibPathType = 1
160 FIB_API_PATH_TYPE_DROP FibPathType = 2
161 FIB_API_PATH_TYPE_UDP_ENCAP FibPathType = 3
162 FIB_API_PATH_TYPE_BIER_IMP FibPathType = 4
163 FIB_API_PATH_TYPE_ICMP_UNREACH FibPathType = 5
164 FIB_API_PATH_TYPE_ICMP_PROHIBIT FibPathType = 6
165 FIB_API_PATH_TYPE_SOURCE_LOOKUP FibPathType = 7
166 FIB_API_PATH_TYPE_DVR FibPathType = 8
167 FIB_API_PATH_TYPE_INTERFACE_RX FibPathType = 9
168 FIB_API_PATH_TYPE_CLASSIFY FibPathType = 10
172 FibPathType_name = map[uint32]string{
173 0: "FIB_API_PATH_TYPE_NORMAL",
174 1: "FIB_API_PATH_TYPE_LOCAL",
175 2: "FIB_API_PATH_TYPE_DROP",
176 3: "FIB_API_PATH_TYPE_UDP_ENCAP",
177 4: "FIB_API_PATH_TYPE_BIER_IMP",
178 5: "FIB_API_PATH_TYPE_ICMP_UNREACH",
179 6: "FIB_API_PATH_TYPE_ICMP_PROHIBIT",
180 7: "FIB_API_PATH_TYPE_SOURCE_LOOKUP",
181 8: "FIB_API_PATH_TYPE_DVR",
182 9: "FIB_API_PATH_TYPE_INTERFACE_RX",
183 10: "FIB_API_PATH_TYPE_CLASSIFY",
185 FibPathType_value = map[string]uint32{
186 "FIB_API_PATH_TYPE_NORMAL": 0,
187 "FIB_API_PATH_TYPE_LOCAL": 1,
188 "FIB_API_PATH_TYPE_DROP": 2,
189 "FIB_API_PATH_TYPE_UDP_ENCAP": 3,
190 "FIB_API_PATH_TYPE_BIER_IMP": 4,
191 "FIB_API_PATH_TYPE_ICMP_UNREACH": 5,
192 "FIB_API_PATH_TYPE_ICMP_PROHIBIT": 6,
193 "FIB_API_PATH_TYPE_SOURCE_LOOKUP": 7,
194 "FIB_API_PATH_TYPE_DVR": 8,
195 "FIB_API_PATH_TYPE_INTERFACE_RX": 9,
196 "FIB_API_PATH_TYPE_CLASSIFY": 10,
200 func (x FibPathType) String() string {
201 s, ok := FibPathType_name[uint32(x)]
205 return "FibPathType(" + strconv.Itoa(int(x)) + ")"
208 // IPDscp defines enum 'ip_dscp'.
212 IP_API_DSCP_CS0 IPDscp = 0
213 IP_API_DSCP_CS1 IPDscp = 8
214 IP_API_DSCP_AF11 IPDscp = 10
215 IP_API_DSCP_AF12 IPDscp = 12
216 IP_API_DSCP_AF13 IPDscp = 14
217 IP_API_DSCP_CS2 IPDscp = 16
218 IP_API_DSCP_AF21 IPDscp = 18
219 IP_API_DSCP_AF22 IPDscp = 20
220 IP_API_DSCP_AF23 IPDscp = 22
221 IP_API_DSCP_CS3 IPDscp = 24
222 IP_API_DSCP_AF31 IPDscp = 26
223 IP_API_DSCP_AF32 IPDscp = 28
224 IP_API_DSCP_AF33 IPDscp = 30
225 IP_API_DSCP_CS4 IPDscp = 32
226 IP_API_DSCP_AF41 IPDscp = 34
227 IP_API_DSCP_AF42 IPDscp = 36
228 IP_API_DSCP_AF43 IPDscp = 38
229 IP_API_DSCP_CS5 IPDscp = 40
230 IP_API_DSCP_EF IPDscp = 46
231 IP_API_DSCP_CS6 IPDscp = 48
232 IP_API_DSCP_CS7 IPDscp = 50
236 IPDscp_name = map[uint8]string{
237 0: "IP_API_DSCP_CS0",
238 8: "IP_API_DSCP_CS1",
239 10: "IP_API_DSCP_AF11",
240 12: "IP_API_DSCP_AF12",
241 14: "IP_API_DSCP_AF13",
242 16: "IP_API_DSCP_CS2",
243 18: "IP_API_DSCP_AF21",
244 20: "IP_API_DSCP_AF22",
245 22: "IP_API_DSCP_AF23",
246 24: "IP_API_DSCP_CS3",
247 26: "IP_API_DSCP_AF31",
248 28: "IP_API_DSCP_AF32",
249 30: "IP_API_DSCP_AF33",
250 32: "IP_API_DSCP_CS4",
251 34: "IP_API_DSCP_AF41",
252 36: "IP_API_DSCP_AF42",
253 38: "IP_API_DSCP_AF43",
254 40: "IP_API_DSCP_CS5",
255 46: "IP_API_DSCP_EF",
256 48: "IP_API_DSCP_CS6",
257 50: "IP_API_DSCP_CS7",
259 IPDscp_value = map[string]uint8{
260 "IP_API_DSCP_CS0": 0,
261 "IP_API_DSCP_CS1": 8,
262 "IP_API_DSCP_AF11": 10,
263 "IP_API_DSCP_AF12": 12,
264 "IP_API_DSCP_AF13": 14,
265 "IP_API_DSCP_CS2": 16,
266 "IP_API_DSCP_AF21": 18,
267 "IP_API_DSCP_AF22": 20,
268 "IP_API_DSCP_AF23": 22,
269 "IP_API_DSCP_CS3": 24,
270 "IP_API_DSCP_AF31": 26,
271 "IP_API_DSCP_AF32": 28,
272 "IP_API_DSCP_AF33": 30,
273 "IP_API_DSCP_CS4": 32,
274 "IP_API_DSCP_AF41": 34,
275 "IP_API_DSCP_AF42": 36,
276 "IP_API_DSCP_AF43": 38,
277 "IP_API_DSCP_CS5": 40,
278 "IP_API_DSCP_EF": 46,
279 "IP_API_DSCP_CS6": 48,
280 "IP_API_DSCP_CS7": 50,
284 func (x IPDscp) String() string {
285 s, ok := IPDscp_name[uint8(x)]
289 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
292 // IPEcn defines enum 'ip_ecn'.
296 IP_API_ECN_NONE IPEcn = 0
297 IP_API_ECN_ECT0 IPEcn = 1
298 IP_API_ECN_ECT1 IPEcn = 2
299 IP_API_ECN_CE IPEcn = 3
303 IPEcn_name = map[uint8]string{
304 0: "IP_API_ECN_NONE",
305 1: "IP_API_ECN_ECT0",
306 2: "IP_API_ECN_ECT1",
309 IPEcn_value = map[string]uint8{
310 "IP_API_ECN_NONE": 0,
311 "IP_API_ECN_ECT0": 1,
312 "IP_API_ECN_ECT1": 2,
317 func (x IPEcn) String() string {
318 s, ok := IPEcn_name[uint8(x)]
322 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
325 // IPProto defines enum 'ip_proto'.
329 IP_API_PROTO_HOPOPT IPProto = 0
330 IP_API_PROTO_ICMP IPProto = 1
331 IP_API_PROTO_IGMP IPProto = 2
332 IP_API_PROTO_TCP IPProto = 6
333 IP_API_PROTO_UDP IPProto = 17
334 IP_API_PROTO_GRE IPProto = 47
335 IP_API_PROTO_AH IPProto = 50
336 IP_API_PROTO_ESP IPProto = 51
337 IP_API_PROTO_EIGRP IPProto = 88
338 IP_API_PROTO_OSPF IPProto = 89
339 IP_API_PROTO_SCTP IPProto = 132
340 IP_API_PROTO_RESERVED IPProto = 255
344 IPProto_name = map[uint32]string{
345 0: "IP_API_PROTO_HOPOPT",
346 1: "IP_API_PROTO_ICMP",
347 2: "IP_API_PROTO_IGMP",
348 6: "IP_API_PROTO_TCP",
349 17: "IP_API_PROTO_UDP",
350 47: "IP_API_PROTO_GRE",
351 50: "IP_API_PROTO_AH",
352 51: "IP_API_PROTO_ESP",
353 88: "IP_API_PROTO_EIGRP",
354 89: "IP_API_PROTO_OSPF",
355 132: "IP_API_PROTO_SCTP",
356 255: "IP_API_PROTO_RESERVED",
358 IPProto_value = map[string]uint32{
359 "IP_API_PROTO_HOPOPT": 0,
360 "IP_API_PROTO_ICMP": 1,
361 "IP_API_PROTO_IGMP": 2,
362 "IP_API_PROTO_TCP": 6,
363 "IP_API_PROTO_UDP": 17,
364 "IP_API_PROTO_GRE": 47,
365 "IP_API_PROTO_AH": 50,
366 "IP_API_PROTO_ESP": 51,
367 "IP_API_PROTO_EIGRP": 88,
368 "IP_API_PROTO_OSPF": 89,
369 "IP_API_PROTO_SCTP": 132,
370 "IP_API_PROTO_RESERVED": 255,
374 func (x IPProto) String() string {
375 s, ok := IPProto_name[uint32(x)]
379 return "IPProto(" + strconv.Itoa(int(x)) + ")"
382 // AddressWithPrefix defines alias 'address_with_prefix'.
383 type AddressWithPrefix Prefix
385 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
386 prefix, err := ParsePrefix(s)
388 return AddressWithPrefix{}, err
390 return AddressWithPrefix(prefix), nil
392 func (x AddressWithPrefix) String() string {
393 return Prefix(x).String()
395 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
396 return []byte(x.String()), nil
398 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
399 prefix, err := ParseAddressWithPrefix(string(text))
407 // IP4Address defines alias 'ip4_address'.
408 type IP4Address [4]uint8
410 func ParseIP4Address(s string) (IP4Address, error) {
411 ip := net.ParseIP(s).To4()
413 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
415 var ipaddr IP4Address
416 copy(ipaddr[:], ip.To4())
420 func (x IP4Address) ToIP() net.IP {
421 return net.IP(x[:]).To4()
423 func (x IP4Address) String() string {
424 return x.ToIP().String()
426 func (x *IP4Address) MarshalText() ([]byte, error) {
427 return []byte(x.String()), nil
429 func (x *IP4Address) UnmarshalText(text []byte) error {
430 ipaddr, err := ParseIP4Address(string(text))
438 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
439 type IP4AddressWithPrefix IP4Prefix
441 // IP6Address defines alias 'ip6_address'.
442 type IP6Address [16]uint8
444 func ParseIP6Address(s string) (IP6Address, error) {
445 ip := net.ParseIP(s).To16()
447 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
449 var ipaddr IP6Address
450 copy(ipaddr[:], ip.To16())
454 func (x IP6Address) ToIP() net.IP {
455 return net.IP(x[:]).To16()
457 func (x IP6Address) String() string {
458 return x.ToIP().String()
460 func (x *IP6Address) MarshalText() ([]byte, error) {
461 return []byte(x.String()), nil
463 func (x *IP6Address) UnmarshalText(text []byte) error {
464 ipaddr, err := ParseIP6Address(string(text))
472 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
473 type IP6AddressWithPrefix IP6Prefix
475 // Address defines type 'address'.
476 type Address struct {
477 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
478 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
481 func ParseAddress(s string) (Address, error) {
484 return Address{}, fmt.Errorf("invalid address: %s", s)
488 addr.Af = ADDRESS_IP6
490 copy(ip6[:], ip.To16())
493 addr.Af = ADDRESS_IP4
495 copy(ip4[:], ip.To4())
500 func (x Address) ToIP() net.IP {
501 if x.Af == ADDRESS_IP6 {
503 return net.IP(ip6[:]).To16()
506 return net.IP(ip4[:]).To4()
509 func (x Address) String() string {
510 return x.ToIP().String()
512 func (x *Address) MarshalText() ([]byte, error) {
513 return []byte(x.String()), nil
515 func (x *Address) UnmarshalText(text []byte) error {
516 addr, err := ParseAddress(string(text))
524 // BierRoute defines type 'bier_route'.
525 type BierRoute struct {
526 BrBp uint32 `binapi:"u32,name=br_bp" json:"br_bp,omitempty"`
527 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
528 BrNPaths uint8 `binapi:"u8,name=br_n_paths" json:"-"`
529 BrPaths []FibPath `binapi:"fib_path[br_n_paths],name=br_paths" json:"br_paths,omitempty"`
532 // BierTableID defines type 'bier_table_id'.
533 type BierTableID struct {
534 BtSet uint8 `binapi:"u8,name=bt_set" json:"bt_set,omitempty"`
535 BtSubDomain uint8 `binapi:"u8,name=bt_sub_domain" json:"bt_sub_domain,omitempty"`
536 BtHdrLenID uint8 `binapi:"u8,name=bt_hdr_len_id" json:"bt_hdr_len_id,omitempty"`
539 // FibMplsLabel defines type 'fib_mpls_label'.
540 type FibMplsLabel struct {
541 IsUniform uint8 `binapi:"u8,name=is_uniform" json:"is_uniform,omitempty"`
542 Label uint32 `binapi:"u32,name=label" json:"label,omitempty"`
543 TTL uint8 `binapi:"u8,name=ttl" json:"ttl,omitempty"`
544 Exp uint8 `binapi:"u8,name=exp" json:"exp,omitempty"`
547 // FibPath defines type 'fib_path'.
548 type FibPath struct {
549 SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
550 TableID uint32 `binapi:"u32,name=table_id" json:"table_id,omitempty"`
551 RpfID uint32 `binapi:"u32,name=rpf_id" json:"rpf_id,omitempty"`
552 Weight uint8 `binapi:"u8,name=weight" json:"weight,omitempty"`
553 Preference uint8 `binapi:"u8,name=preference" json:"preference,omitempty"`
554 Type FibPathType `binapi:"fib_path_type,name=type" json:"type,omitempty"`
555 Flags FibPathFlags `binapi:"fib_path_flags,name=flags" json:"flags,omitempty"`
556 Proto FibPathNhProto `binapi:"fib_path_nh_proto,name=proto" json:"proto,omitempty"`
557 Nh FibPathNh `binapi:"fib_path_nh,name=nh" json:"nh,omitempty"`
558 NLabels uint8 `binapi:"u8,name=n_labels" json:"n_labels,omitempty"`
559 LabelStack [16]FibMplsLabel `binapi:"fib_mpls_label[16],name=label_stack" json:"label_stack,omitempty"`
562 // FibPathNh defines type 'fib_path_nh'.
563 type FibPathNh struct {
564 Address AddressUnion `binapi:"address_union,name=address" json:"address,omitempty"`
565 ViaLabel uint32 `binapi:"u32,name=via_label" json:"via_label,omitempty"`
566 ObjID uint32 `binapi:"u32,name=obj_id" json:"obj_id,omitempty"`
567 ClassifyTableIndex uint32 `binapi:"u32,name=classify_table_index" json:"classify_table_index,omitempty"`
570 // IP4Prefix defines type 'ip4_prefix'.
571 type IP4Prefix struct {
572 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
573 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
576 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
577 hasPrefix := strings.Contains(s, "/")
579 ip, network, err := net.ParseCIDR(s)
581 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
583 maskSize, _ := network.Mask.Size()
584 prefix.Len = byte(maskSize)
585 prefix.Address, err = ParseIP4Address(ip.String())
587 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
591 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
593 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
595 prefix.Len = byte(defaultMaskSize)
596 prefix.Address, err = ParseIP4Address(ip.String())
598 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
603 func (x IP4Prefix) ToIPNet() *net.IPNet {
604 mask := net.CIDRMask(int(x.Len), 32)
605 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
608 func (x IP4Prefix) String() string {
609 ip := x.Address.String()
610 return ip + "/" + strconv.Itoa(int(x.Len))
612 func (x *IP4Prefix) MarshalText() ([]byte, error) {
613 return []byte(x.String()), nil
615 func (x *IP4Prefix) UnmarshalText(text []byte) error {
616 prefix, err := ParseIP4Prefix(string(text))
624 // IP6Prefix defines type 'ip6_prefix'.
625 type IP6Prefix struct {
626 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
627 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
630 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
631 hasPrefix := strings.Contains(s, "/")
633 ip, network, err := net.ParseCIDR(s)
635 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
637 maskSize, _ := network.Mask.Size()
638 prefix.Len = byte(maskSize)
639 prefix.Address, err = ParseIP6Address(ip.String())
641 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
645 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
647 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
649 prefix.Len = byte(defaultMaskSize)
650 prefix.Address, err = ParseIP6Address(ip.String())
652 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
657 func (x IP6Prefix) ToIPNet() *net.IPNet {
658 mask := net.CIDRMask(int(x.Len), 128)
659 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
662 func (x IP6Prefix) String() string {
663 ip := x.Address.String()
664 return ip + "/" + strconv.Itoa(int(x.Len))
666 func (x *IP6Prefix) MarshalText() ([]byte, error) {
667 return []byte(x.String()), nil
669 func (x *IP6Prefix) UnmarshalText(text []byte) error {
670 prefix, err := ParseIP6Prefix(string(text))
678 // Mprefix defines type 'mprefix'.
679 type Mprefix struct {
680 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
681 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
682 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
683 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
686 // Prefix defines type 'prefix'.
688 Address Address `binapi:"address,name=address" json:"address,omitempty"`
689 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
692 func ParsePrefix(ip string) (prefix Prefix, err error) {
693 hasPrefix := strings.Contains(ip, "/")
695 netIP, network, err := net.ParseCIDR(ip)
697 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
699 maskSize, _ := network.Mask.Size()
700 prefix.Len = byte(maskSize)
701 prefix.Address, err = ParseAddress(netIP.String())
703 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
706 netIP := net.ParseIP(ip)
707 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
708 if netIP.To4() == nil {
709 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
711 prefix.Len = byte(defaultMaskSize)
712 prefix.Address, err = ParseAddress(netIP.String())
714 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
719 func (x Prefix) ToIPNet() *net.IPNet {
721 if x.Address.Af == ADDRESS_IP4 {
722 mask = net.CIDRMask(int(x.Len), 32)
724 mask = net.CIDRMask(int(x.Len), 128)
726 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
729 func (x Prefix) String() string {
730 ip := x.Address.String()
731 return ip + "/" + strconv.Itoa(int(x.Len))
733 func (x *Prefix) MarshalText() ([]byte, error) {
734 return []byte(x.String()), nil
736 func (x *Prefix) UnmarshalText(text []byte) error {
737 prefix, err := ParsePrefix(string(text))
745 // PrefixMatcher defines type 'prefix_matcher'.
746 type PrefixMatcher struct {
747 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
748 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
751 // AddressUnion defines union 'address_union'.
752 type AddressUnion struct {
755 XXX_UnionData [16]byte
758 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
762 func (u *AddressUnion) SetIP4(a IP4Address) {
763 buf := codec.NewBuffer(u.XXX_UnionData[:])
764 buf.EncodeBytes(a[:], 4)
766 func (u *AddressUnion) GetIP4() (a IP4Address) {
767 buf := codec.NewBuffer(u.XXX_UnionData[:])
768 copy(a[:], buf.DecodeBytes(4))
772 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
776 func (u *AddressUnion) SetIP6(a IP6Address) {
777 buf := codec.NewBuffer(u.XXX_UnionData[:])
778 buf.EncodeBytes(a[:], 16)
780 func (u *AddressUnion) GetIP6() (a IP6Address) {
781 buf := codec.NewBuffer(u.XXX_UnionData[:])
782 copy(a[:], buf.DecodeBytes(16))
786 // BierDispEntryAddDel defines message 'bier_disp_entry_add_del'.
787 type BierDispEntryAddDel struct {
788 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
789 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
790 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
791 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
792 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
793 BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
796 func (m *BierDispEntryAddDel) Reset() { *m = BierDispEntryAddDel{} }
797 func (*BierDispEntryAddDel) GetMessageName() string { return "bier_disp_entry_add_del" }
798 func (*BierDispEntryAddDel) GetCrcString() string { return "648323eb" }
799 func (*BierDispEntryAddDel) GetMessageType() api.MessageType {
800 return api.RequestMessage
803 func (m *BierDispEntryAddDel) Size() (size int) {
808 size += 4 // m.BdeTblID
809 size += 1 // m.BdeIsAdd
810 size += 1 // m.BdePayloadProto
811 size += 1 // m.BdeNPaths
812 for j1 := 0; j1 < len(m.BdePaths); j1++ {
815 if j1 < len(m.BdePaths) {
818 size += 4 // s1.SwIfIndex
819 size += 4 // s1.TableID
820 size += 4 // s1.RpfID
821 size += 1 // s1.Weight
822 size += 1 // s1.Preference
824 size += 4 // s1.Flags
825 size += 4 // s1.Proto
826 size += 1 * 16 // s1.Nh.Address
827 size += 4 // s1.Nh.ViaLabel
828 size += 4 // s1.Nh.ObjID
829 size += 4 // s1.Nh.ClassifyTableIndex
830 size += 1 // s1.NLabels
831 for j2 := 0; j2 < 16; j2++ {
832 size += 1 // s1.LabelStack[j2].IsUniform
833 size += 4 // s1.LabelStack[j2].Label
834 size += 1 // s1.LabelStack[j2].TTL
835 size += 1 // s1.LabelStack[j2].Exp
840 func (m *BierDispEntryAddDel) Marshal(b []byte) ([]byte, error) {
842 b = make([]byte, m.Size())
844 buf := codec.NewBuffer(b)
845 buf.EncodeUint16(m.BdeBp)
846 buf.EncodeUint32(m.BdeTblID)
847 buf.EncodeBool(m.BdeIsAdd)
848 buf.EncodeUint8(m.BdePayloadProto)
849 buf.EncodeUint8(uint8(len(m.BdePaths)))
850 for j0 := 0; j0 < len(m.BdePaths); j0++ {
851 var v0 FibPath // BdePaths
852 if j0 < len(m.BdePaths) {
855 buf.EncodeUint32(v0.SwIfIndex)
856 buf.EncodeUint32(v0.TableID)
857 buf.EncodeUint32(v0.RpfID)
858 buf.EncodeUint8(v0.Weight)
859 buf.EncodeUint8(v0.Preference)
860 buf.EncodeUint32(uint32(v0.Type))
861 buf.EncodeUint32(uint32(v0.Flags))
862 buf.EncodeUint32(uint32(v0.Proto))
863 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16)
864 buf.EncodeUint32(v0.Nh.ViaLabel)
865 buf.EncodeUint32(v0.Nh.ObjID)
866 buf.EncodeUint32(v0.Nh.ClassifyTableIndex)
867 buf.EncodeUint8(v0.NLabels)
868 for j1 := 0; j1 < 16; j1++ {
869 buf.EncodeUint8(v0.LabelStack[j1].IsUniform)
870 buf.EncodeUint32(v0.LabelStack[j1].Label)
871 buf.EncodeUint8(v0.LabelStack[j1].TTL)
872 buf.EncodeUint8(v0.LabelStack[j1].Exp)
875 return buf.Bytes(), nil
877 func (m *BierDispEntryAddDel) Unmarshal(b []byte) error {
878 buf := codec.NewBuffer(b)
879 m.BdeBp = buf.DecodeUint16()
880 m.BdeTblID = buf.DecodeUint32()
881 m.BdeIsAdd = buf.DecodeBool()
882 m.BdePayloadProto = buf.DecodeUint8()
883 m.BdeNPaths = buf.DecodeUint8()
884 m.BdePaths = make([]FibPath, m.BdeNPaths)
885 for j0 := 0; j0 < len(m.BdePaths); j0++ {
886 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
887 m.BdePaths[j0].TableID = buf.DecodeUint32()
888 m.BdePaths[j0].RpfID = buf.DecodeUint32()
889 m.BdePaths[j0].Weight = buf.DecodeUint8()
890 m.BdePaths[j0].Preference = buf.DecodeUint8()
891 m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
892 m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
893 m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
894 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
895 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
896 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
897 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
898 m.BdePaths[j0].NLabels = buf.DecodeUint8()
899 for j1 := 0; j1 < 16; j1++ {
900 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
901 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
902 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
903 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
909 // BierDispEntryAddDelReply defines message 'bier_disp_entry_add_del_reply'.
910 type BierDispEntryAddDelReply struct {
911 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
914 func (m *BierDispEntryAddDelReply) Reset() { *m = BierDispEntryAddDelReply{} }
915 func (*BierDispEntryAddDelReply) GetMessageName() string { return "bier_disp_entry_add_del_reply" }
916 func (*BierDispEntryAddDelReply) GetCrcString() string { return "e8d4e804" }
917 func (*BierDispEntryAddDelReply) GetMessageType() api.MessageType {
918 return api.ReplyMessage
921 func (m *BierDispEntryAddDelReply) Size() (size int) {
925 size += 4 // m.Retval
928 func (m *BierDispEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
930 b = make([]byte, m.Size())
932 buf := codec.NewBuffer(b)
933 buf.EncodeInt32(m.Retval)
934 return buf.Bytes(), nil
936 func (m *BierDispEntryAddDelReply) Unmarshal(b []byte) error {
937 buf := codec.NewBuffer(b)
938 m.Retval = buf.DecodeInt32()
942 // BierDispEntryDetails defines message 'bier_disp_entry_details'.
943 type BierDispEntryDetails struct {
944 BdeBp uint16 `binapi:"u16,name=bde_bp" json:"bde_bp,omitempty"`
945 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
946 BdeIsAdd bool `binapi:"bool,name=bde_is_add" json:"bde_is_add,omitempty"`
947 BdePayloadProto uint8 `binapi:"u8,name=bde_payload_proto" json:"bde_payload_proto,omitempty"`
948 BdeNPaths uint8 `binapi:"u8,name=bde_n_paths" json:"-"`
949 BdePaths []FibPath `binapi:"fib_path[bde_n_paths],name=bde_paths" json:"bde_paths,omitempty"`
952 func (m *BierDispEntryDetails) Reset() { *m = BierDispEntryDetails{} }
953 func (*BierDispEntryDetails) GetMessageName() string { return "bier_disp_entry_details" }
954 func (*BierDispEntryDetails) GetCrcString() string { return "e5b039a9" }
955 func (*BierDispEntryDetails) GetMessageType() api.MessageType {
956 return api.ReplyMessage
959 func (m *BierDispEntryDetails) Size() (size int) {
964 size += 4 // m.BdeTblID
965 size += 1 // m.BdeIsAdd
966 size += 1 // m.BdePayloadProto
967 size += 1 // m.BdeNPaths
968 for j1 := 0; j1 < len(m.BdePaths); j1++ {
971 if j1 < len(m.BdePaths) {
974 size += 4 // s1.SwIfIndex
975 size += 4 // s1.TableID
976 size += 4 // s1.RpfID
977 size += 1 // s1.Weight
978 size += 1 // s1.Preference
980 size += 4 // s1.Flags
981 size += 4 // s1.Proto
982 size += 1 * 16 // s1.Nh.Address
983 size += 4 // s1.Nh.ViaLabel
984 size += 4 // s1.Nh.ObjID
985 size += 4 // s1.Nh.ClassifyTableIndex
986 size += 1 // s1.NLabels
987 for j2 := 0; j2 < 16; j2++ {
988 size += 1 // s1.LabelStack[j2].IsUniform
989 size += 4 // s1.LabelStack[j2].Label
990 size += 1 // s1.LabelStack[j2].TTL
991 size += 1 // s1.LabelStack[j2].Exp
996 func (m *BierDispEntryDetails) Marshal(b []byte) ([]byte, error) {
998 b = make([]byte, m.Size())
1000 buf := codec.NewBuffer(b)
1001 buf.EncodeUint16(m.BdeBp)
1002 buf.EncodeUint32(m.BdeTblID)
1003 buf.EncodeBool(m.BdeIsAdd)
1004 buf.EncodeUint8(m.BdePayloadProto)
1005 buf.EncodeUint8(uint8(len(m.BdePaths)))
1006 for j0 := 0; j0 < len(m.BdePaths); j0++ {
1007 var v0 FibPath // BdePaths
1008 if j0 < len(m.BdePaths) {
1011 buf.EncodeUint32(v0.SwIfIndex)
1012 buf.EncodeUint32(v0.TableID)
1013 buf.EncodeUint32(v0.RpfID)
1014 buf.EncodeUint8(v0.Weight)
1015 buf.EncodeUint8(v0.Preference)
1016 buf.EncodeUint32(uint32(v0.Type))
1017 buf.EncodeUint32(uint32(v0.Flags))
1018 buf.EncodeUint32(uint32(v0.Proto))
1019 buf.EncodeBytes(v0.Nh.Address.XXX_UnionData[:], 16)
1020 buf.EncodeUint32(v0.Nh.ViaLabel)
1021 buf.EncodeUint32(v0.Nh.ObjID)
1022 buf.EncodeUint32(v0.Nh.ClassifyTableIndex)
1023 buf.EncodeUint8(v0.NLabels)
1024 for j1 := 0; j1 < 16; j1++ {
1025 buf.EncodeUint8(v0.LabelStack[j1].IsUniform)
1026 buf.EncodeUint32(v0.LabelStack[j1].Label)
1027 buf.EncodeUint8(v0.LabelStack[j1].TTL)
1028 buf.EncodeUint8(v0.LabelStack[j1].Exp)
1031 return buf.Bytes(), nil
1033 func (m *BierDispEntryDetails) Unmarshal(b []byte) error {
1034 buf := codec.NewBuffer(b)
1035 m.BdeBp = buf.DecodeUint16()
1036 m.BdeTblID = buf.DecodeUint32()
1037 m.BdeIsAdd = buf.DecodeBool()
1038 m.BdePayloadProto = buf.DecodeUint8()
1039 m.BdeNPaths = buf.DecodeUint8()
1040 m.BdePaths = make([]FibPath, m.BdeNPaths)
1041 for j0 := 0; j0 < len(m.BdePaths); j0++ {
1042 m.BdePaths[j0].SwIfIndex = buf.DecodeUint32()
1043 m.BdePaths[j0].TableID = buf.DecodeUint32()
1044 m.BdePaths[j0].RpfID = buf.DecodeUint32()
1045 m.BdePaths[j0].Weight = buf.DecodeUint8()
1046 m.BdePaths[j0].Preference = buf.DecodeUint8()
1047 m.BdePaths[j0].Type = FibPathType(buf.DecodeUint32())
1048 m.BdePaths[j0].Flags = FibPathFlags(buf.DecodeUint32())
1049 m.BdePaths[j0].Proto = FibPathNhProto(buf.DecodeUint32())
1050 copy(m.BdePaths[j0].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1051 m.BdePaths[j0].Nh.ViaLabel = buf.DecodeUint32()
1052 m.BdePaths[j0].Nh.ObjID = buf.DecodeUint32()
1053 m.BdePaths[j0].Nh.ClassifyTableIndex = buf.DecodeUint32()
1054 m.BdePaths[j0].NLabels = buf.DecodeUint8()
1055 for j1 := 0; j1 < 16; j1++ {
1056 m.BdePaths[j0].LabelStack[j1].IsUniform = buf.DecodeUint8()
1057 m.BdePaths[j0].LabelStack[j1].Label = buf.DecodeUint32()
1058 m.BdePaths[j0].LabelStack[j1].TTL = buf.DecodeUint8()
1059 m.BdePaths[j0].LabelStack[j1].Exp = buf.DecodeUint8()
1065 // BierDispEntryDump defines message 'bier_disp_entry_dump'.
1066 type BierDispEntryDump struct {
1067 BdeTblID uint32 `binapi:"u32,name=bde_tbl_id" json:"bde_tbl_id,omitempty"`
1070 func (m *BierDispEntryDump) Reset() { *m = BierDispEntryDump{} }
1071 func (*BierDispEntryDump) GetMessageName() string { return "bier_disp_entry_dump" }
1072 func (*BierDispEntryDump) GetCrcString() string { return "b5fa54ad" }
1073 func (*BierDispEntryDump) GetMessageType() api.MessageType {
1074 return api.RequestMessage
1077 func (m *BierDispEntryDump) Size() (size int) {
1081 size += 4 // m.BdeTblID
1084 func (m *BierDispEntryDump) Marshal(b []byte) ([]byte, error) {
1086 b = make([]byte, m.Size())
1088 buf := codec.NewBuffer(b)
1089 buf.EncodeUint32(m.BdeTblID)
1090 return buf.Bytes(), nil
1092 func (m *BierDispEntryDump) Unmarshal(b []byte) error {
1093 buf := codec.NewBuffer(b)
1094 m.BdeTblID = buf.DecodeUint32()
1098 // BierDispTableAddDel defines message 'bier_disp_table_add_del'.
1099 type BierDispTableAddDel struct {
1100 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
1101 BdtIsAdd bool `binapi:"bool,name=bdt_is_add" json:"bdt_is_add,omitempty"`
1104 func (m *BierDispTableAddDel) Reset() { *m = BierDispTableAddDel{} }
1105 func (*BierDispTableAddDel) GetMessageName() string { return "bier_disp_table_add_del" }
1106 func (*BierDispTableAddDel) GetCrcString() string { return "889657ac" }
1107 func (*BierDispTableAddDel) GetMessageType() api.MessageType {
1108 return api.RequestMessage
1111 func (m *BierDispTableAddDel) Size() (size int) {
1115 size += 4 // m.BdtTblID
1116 size += 1 // m.BdtIsAdd
1119 func (m *BierDispTableAddDel) Marshal(b []byte) ([]byte, error) {
1121 b = make([]byte, m.Size())
1123 buf := codec.NewBuffer(b)
1124 buf.EncodeUint32(m.BdtTblID)
1125 buf.EncodeBool(m.BdtIsAdd)
1126 return buf.Bytes(), nil
1128 func (m *BierDispTableAddDel) Unmarshal(b []byte) error {
1129 buf := codec.NewBuffer(b)
1130 m.BdtTblID = buf.DecodeUint32()
1131 m.BdtIsAdd = buf.DecodeBool()
1135 // BierDispTableAddDelReply defines message 'bier_disp_table_add_del_reply'.
1136 type BierDispTableAddDelReply struct {
1137 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1140 func (m *BierDispTableAddDelReply) Reset() { *m = BierDispTableAddDelReply{} }
1141 func (*BierDispTableAddDelReply) GetMessageName() string { return "bier_disp_table_add_del_reply" }
1142 func (*BierDispTableAddDelReply) GetCrcString() string { return "e8d4e804" }
1143 func (*BierDispTableAddDelReply) GetMessageType() api.MessageType {
1144 return api.ReplyMessage
1147 func (m *BierDispTableAddDelReply) Size() (size int) {
1151 size += 4 // m.Retval
1154 func (m *BierDispTableAddDelReply) Marshal(b []byte) ([]byte, error) {
1156 b = make([]byte, m.Size())
1158 buf := codec.NewBuffer(b)
1159 buf.EncodeInt32(m.Retval)
1160 return buf.Bytes(), nil
1162 func (m *BierDispTableAddDelReply) Unmarshal(b []byte) error {
1163 buf := codec.NewBuffer(b)
1164 m.Retval = buf.DecodeInt32()
1168 // BierDispTableDetails defines message 'bier_disp_table_details'.
1169 type BierDispTableDetails struct {
1170 BdtTblID uint32 `binapi:"u32,name=bdt_tbl_id" json:"bdt_tbl_id,omitempty"`
1173 func (m *BierDispTableDetails) Reset() { *m = BierDispTableDetails{} }
1174 func (*BierDispTableDetails) GetMessageName() string { return "bier_disp_table_details" }
1175 func (*BierDispTableDetails) GetCrcString() string { return "d27942c0" }
1176 func (*BierDispTableDetails) GetMessageType() api.MessageType {
1177 return api.ReplyMessage
1180 func (m *BierDispTableDetails) Size() (size int) {
1184 size += 4 // m.BdtTblID
1187 func (m *BierDispTableDetails) Marshal(b []byte) ([]byte, error) {
1189 b = make([]byte, m.Size())
1191 buf := codec.NewBuffer(b)
1192 buf.EncodeUint32(m.BdtTblID)
1193 return buf.Bytes(), nil
1195 func (m *BierDispTableDetails) Unmarshal(b []byte) error {
1196 buf := codec.NewBuffer(b)
1197 m.BdtTblID = buf.DecodeUint32()
1201 // BierDispTableDump defines message 'bier_disp_table_dump'.
1202 type BierDispTableDump struct{}
1204 func (m *BierDispTableDump) Reset() { *m = BierDispTableDump{} }
1205 func (*BierDispTableDump) GetMessageName() string { return "bier_disp_table_dump" }
1206 func (*BierDispTableDump) GetCrcString() string { return "51077d14" }
1207 func (*BierDispTableDump) GetMessageType() api.MessageType {
1208 return api.RequestMessage
1211 func (m *BierDispTableDump) Size() (size int) {
1217 func (m *BierDispTableDump) Marshal(b []byte) ([]byte, error) {
1219 b = make([]byte, m.Size())
1221 buf := codec.NewBuffer(b)
1222 return buf.Bytes(), nil
1224 func (m *BierDispTableDump) Unmarshal(b []byte) error {
1228 // BierImpAdd defines message 'bier_imp_add'.
1229 type BierImpAdd struct {
1230 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
1231 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
1232 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
1233 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
1236 func (m *BierImpAdd) Reset() { *m = BierImpAdd{} }
1237 func (*BierImpAdd) GetMessageName() string { return "bier_imp_add" }
1238 func (*BierImpAdd) GetCrcString() string { return "3856dc3d" }
1239 func (*BierImpAdd) GetMessageType() api.MessageType {
1240 return api.RequestMessage
1243 func (m *BierImpAdd) Size() (size int) {
1247 size += 1 // m.BiTblID.BtSet
1248 size += 1 // m.BiTblID.BtSubDomain
1249 size += 1 // m.BiTblID.BtHdrLenID
1250 size += 2 // m.BiSrc
1251 size += 1 // m.BiNBytes
1252 size += 1 * len(m.BiBytes) // m.BiBytes
1255 func (m *BierImpAdd) Marshal(b []byte) ([]byte, error) {
1257 b = make([]byte, m.Size())
1259 buf := codec.NewBuffer(b)
1260 buf.EncodeUint8(m.BiTblID.BtSet)
1261 buf.EncodeUint8(m.BiTblID.BtSubDomain)
1262 buf.EncodeUint8(m.BiTblID.BtHdrLenID)
1263 buf.EncodeUint16(m.BiSrc)
1264 buf.EncodeUint8(uint8(len(m.BiBytes)))
1265 buf.EncodeBytes(m.BiBytes, 0)
1266 return buf.Bytes(), nil
1268 func (m *BierImpAdd) Unmarshal(b []byte) error {
1269 buf := codec.NewBuffer(b)
1270 m.BiTblID.BtSet = buf.DecodeUint8()
1271 m.BiTblID.BtSubDomain = buf.DecodeUint8()
1272 m.BiTblID.BtHdrLenID = buf.DecodeUint8()
1273 m.BiSrc = buf.DecodeUint16()
1274 m.BiNBytes = buf.DecodeUint8()
1275 m.BiBytes = make([]byte, m.BiNBytes)
1276 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
1280 // BierImpAddReply defines message 'bier_imp_add_reply'.
1281 type BierImpAddReply struct {
1282 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1283 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
1286 func (m *BierImpAddReply) Reset() { *m = BierImpAddReply{} }
1287 func (*BierImpAddReply) GetMessageName() string { return "bier_imp_add_reply" }
1288 func (*BierImpAddReply) GetCrcString() string { return "d49c5793" }
1289 func (*BierImpAddReply) GetMessageType() api.MessageType {
1290 return api.ReplyMessage
1293 func (m *BierImpAddReply) Size() (size int) {
1297 size += 4 // m.Retval
1298 size += 4 // m.BiIndex
1301 func (m *BierImpAddReply) Marshal(b []byte) ([]byte, error) {
1303 b = make([]byte, m.Size())
1305 buf := codec.NewBuffer(b)
1306 buf.EncodeInt32(m.Retval)
1307 buf.EncodeUint32(m.BiIndex)
1308 return buf.Bytes(), nil
1310 func (m *BierImpAddReply) Unmarshal(b []byte) error {
1311 buf := codec.NewBuffer(b)
1312 m.Retval = buf.DecodeInt32()
1313 m.BiIndex = buf.DecodeUint32()
1317 // BierImpDel defines message 'bier_imp_del'.
1318 type BierImpDel struct {
1319 BiIndex uint32 `binapi:"u32,name=bi_index" json:"bi_index,omitempty"`
1322 func (m *BierImpDel) Reset() { *m = BierImpDel{} }
1323 func (*BierImpDel) GetMessageName() string { return "bier_imp_del" }
1324 func (*BierImpDel) GetCrcString() string { return "7d45edf6" }
1325 func (*BierImpDel) GetMessageType() api.MessageType {
1326 return api.RequestMessage
1329 func (m *BierImpDel) Size() (size int) {
1333 size += 4 // m.BiIndex
1336 func (m *BierImpDel) Marshal(b []byte) ([]byte, error) {
1338 b = make([]byte, m.Size())
1340 buf := codec.NewBuffer(b)
1341 buf.EncodeUint32(m.BiIndex)
1342 return buf.Bytes(), nil
1344 func (m *BierImpDel) Unmarshal(b []byte) error {
1345 buf := codec.NewBuffer(b)
1346 m.BiIndex = buf.DecodeUint32()
1350 // BierImpDelReply defines message 'bier_imp_del_reply'.
1351 type BierImpDelReply struct {
1352 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1355 func (m *BierImpDelReply) Reset() { *m = BierImpDelReply{} }
1356 func (*BierImpDelReply) GetMessageName() string { return "bier_imp_del_reply" }
1357 func (*BierImpDelReply) GetCrcString() string { return "e8d4e804" }
1358 func (*BierImpDelReply) GetMessageType() api.MessageType {
1359 return api.ReplyMessage
1362 func (m *BierImpDelReply) Size() (size int) {
1366 size += 4 // m.Retval
1369 func (m *BierImpDelReply) Marshal(b []byte) ([]byte, error) {
1371 b = make([]byte, m.Size())
1373 buf := codec.NewBuffer(b)
1374 buf.EncodeInt32(m.Retval)
1375 return buf.Bytes(), nil
1377 func (m *BierImpDelReply) Unmarshal(b []byte) error {
1378 buf := codec.NewBuffer(b)
1379 m.Retval = buf.DecodeInt32()
1383 // BierImpDetails defines message 'bier_imp_details'.
1384 type BierImpDetails struct {
1385 BiTblID BierTableID `binapi:"bier_table_id,name=bi_tbl_id" json:"bi_tbl_id,omitempty"`
1386 BiSrc uint16 `binapi:"u16,name=bi_src" json:"bi_src,omitempty"`
1387 BiNBytes uint8 `binapi:"u8,name=bi_n_bytes" json:"-"`
1388 BiBytes []byte `binapi:"u8[bi_n_bytes],name=bi_bytes" json:"bi_bytes,omitempty"`
1391 func (m *BierImpDetails) Reset() { *m = BierImpDetails{} }
1392 func (*BierImpDetails) GetMessageName() string { return "bier_imp_details" }
1393 func (*BierImpDetails) GetCrcString() string { return "b76192df" }
1394 func (*BierImpDetails) GetMessageType() api.MessageType {
1395 return api.ReplyMessage
1398 func (m *BierImpDetails) Size() (size int) {
1402 size += 1 // m.BiTblID.BtSet
1403 size += 1 // m.BiTblID.BtSubDomain
1404 size += 1 // m.BiTblID.BtHdrLenID
1405 size += 2 // m.BiSrc
1406 size += 1 // m.BiNBytes
1407 size += 1 * len(m.BiBytes) // m.BiBytes
1410 func (m *BierImpDetails) Marshal(b []byte) ([]byte, error) {
1412 b = make([]byte, m.Size())
1414 buf := codec.NewBuffer(b)
1415 buf.EncodeUint8(m.BiTblID.BtSet)
1416 buf.EncodeUint8(m.BiTblID.BtSubDomain)
1417 buf.EncodeUint8(m.BiTblID.BtHdrLenID)
1418 buf.EncodeUint16(m.BiSrc)
1419 buf.EncodeUint8(uint8(len(m.BiBytes)))
1420 buf.EncodeBytes(m.BiBytes, 0)
1421 return buf.Bytes(), nil
1423 func (m *BierImpDetails) Unmarshal(b []byte) error {
1424 buf := codec.NewBuffer(b)
1425 m.BiTblID.BtSet = buf.DecodeUint8()
1426 m.BiTblID.BtSubDomain = buf.DecodeUint8()
1427 m.BiTblID.BtHdrLenID = buf.DecodeUint8()
1428 m.BiSrc = buf.DecodeUint16()
1429 m.BiNBytes = buf.DecodeUint8()
1430 m.BiBytes = make([]byte, m.BiNBytes)
1431 copy(m.BiBytes, buf.DecodeBytes(len(m.BiBytes)))
1435 // BierImpDump defines message 'bier_imp_dump'.
1436 type BierImpDump struct{}
1438 func (m *BierImpDump) Reset() { *m = BierImpDump{} }
1439 func (*BierImpDump) GetMessageName() string { return "bier_imp_dump" }
1440 func (*BierImpDump) GetCrcString() string { return "51077d14" }
1441 func (*BierImpDump) GetMessageType() api.MessageType {
1442 return api.RequestMessage
1445 func (m *BierImpDump) Size() (size int) {
1451 func (m *BierImpDump) Marshal(b []byte) ([]byte, error) {
1453 b = make([]byte, m.Size())
1455 buf := codec.NewBuffer(b)
1456 return buf.Bytes(), nil
1458 func (m *BierImpDump) Unmarshal(b []byte) error {
1462 // BierRouteAddDel defines message 'bier_route_add_del'.
1463 type BierRouteAddDel struct {
1464 BrIsAdd bool `binapi:"bool,name=br_is_add" json:"br_is_add,omitempty"`
1465 BrIsReplace bool `binapi:"bool,name=br_is_replace" json:"br_is_replace,omitempty"`
1466 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
1469 func (m *BierRouteAddDel) Reset() { *m = BierRouteAddDel{} }
1470 func (*BierRouteAddDel) GetMessageName() string { return "bier_route_add_del" }
1471 func (*BierRouteAddDel) GetCrcString() string { return "f29edca0" }
1472 func (*BierRouteAddDel) GetMessageType() api.MessageType {
1473 return api.RequestMessage
1476 func (m *BierRouteAddDel) Size() (size int) {
1480 size += 1 // m.BrIsAdd
1481 size += 1 // m.BrIsReplace
1482 size += 4 // m.BrRoute.BrBp
1483 size += 1 // m.BrRoute.BrTblID.BtSet
1484 size += 1 // m.BrRoute.BrTblID.BtSubDomain
1485 size += 1 // m.BrRoute.BrTblID.BtHdrLenID
1486 size += 1 // m.BrRoute.BrNPaths
1487 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
1490 if j2 < len(m.BrRoute.BrPaths) {
1491 s2 = m.BrRoute.BrPaths[j2]
1493 size += 4 // s2.SwIfIndex
1494 size += 4 // s2.TableID
1495 size += 4 // s2.RpfID
1496 size += 1 // s2.Weight
1497 size += 1 // s2.Preference
1498 size += 4 // s2.Type
1499 size += 4 // s2.Flags
1500 size += 4 // s2.Proto
1501 size += 1 * 16 // s2.Nh.Address
1502 size += 4 // s2.Nh.ViaLabel
1503 size += 4 // s2.Nh.ObjID
1504 size += 4 // s2.Nh.ClassifyTableIndex
1505 size += 1 // s2.NLabels
1506 for j3 := 0; j3 < 16; j3++ {
1507 size += 1 // s2.LabelStack[j3].IsUniform
1508 size += 4 // s2.LabelStack[j3].Label
1509 size += 1 // s2.LabelStack[j3].TTL
1510 size += 1 // s2.LabelStack[j3].Exp
1515 func (m *BierRouteAddDel) Marshal(b []byte) ([]byte, error) {
1517 b = make([]byte, m.Size())
1519 buf := codec.NewBuffer(b)
1520 buf.EncodeBool(m.BrIsAdd)
1521 buf.EncodeBool(m.BrIsReplace)
1522 buf.EncodeUint32(m.BrRoute.BrBp)
1523 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet)
1524 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain)
1525 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID)
1526 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
1527 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1528 var v1 FibPath // BrPaths
1529 if j1 < len(m.BrRoute.BrPaths) {
1530 v1 = m.BrRoute.BrPaths[j1]
1532 buf.EncodeUint32(v1.SwIfIndex)
1533 buf.EncodeUint32(v1.TableID)
1534 buf.EncodeUint32(v1.RpfID)
1535 buf.EncodeUint8(v1.Weight)
1536 buf.EncodeUint8(v1.Preference)
1537 buf.EncodeUint32(uint32(v1.Type))
1538 buf.EncodeUint32(uint32(v1.Flags))
1539 buf.EncodeUint32(uint32(v1.Proto))
1540 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
1541 buf.EncodeUint32(v1.Nh.ViaLabel)
1542 buf.EncodeUint32(v1.Nh.ObjID)
1543 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
1544 buf.EncodeUint8(v1.NLabels)
1545 for j2 := 0; j2 < 16; j2++ {
1546 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
1547 buf.EncodeUint32(v1.LabelStack[j2].Label)
1548 buf.EncodeUint8(v1.LabelStack[j2].TTL)
1549 buf.EncodeUint8(v1.LabelStack[j2].Exp)
1552 return buf.Bytes(), nil
1554 func (m *BierRouteAddDel) Unmarshal(b []byte) error {
1555 buf := codec.NewBuffer(b)
1556 m.BrIsAdd = buf.DecodeBool()
1557 m.BrIsReplace = buf.DecodeBool()
1558 m.BrRoute.BrBp = buf.DecodeUint32()
1559 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
1560 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
1561 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
1562 m.BrRoute.BrNPaths = buf.DecodeUint8()
1563 m.BrRoute.BrPaths = make([]FibPath, m.BrRoute.BrNPaths)
1564 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1565 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
1566 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
1567 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
1568 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
1569 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
1570 m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
1571 m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
1572 m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
1573 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1574 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
1575 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
1576 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
1577 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
1578 for j2 := 0; j2 < 16; j2++ {
1579 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
1580 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
1581 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
1582 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
1588 // BierRouteAddDelReply defines message 'bier_route_add_del_reply'.
1589 type BierRouteAddDelReply struct {
1590 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1593 func (m *BierRouteAddDelReply) Reset() { *m = BierRouteAddDelReply{} }
1594 func (*BierRouteAddDelReply) GetMessageName() string { return "bier_route_add_del_reply" }
1595 func (*BierRouteAddDelReply) GetCrcString() string { return "e8d4e804" }
1596 func (*BierRouteAddDelReply) GetMessageType() api.MessageType {
1597 return api.ReplyMessage
1600 func (m *BierRouteAddDelReply) Size() (size int) {
1604 size += 4 // m.Retval
1607 func (m *BierRouteAddDelReply) Marshal(b []byte) ([]byte, error) {
1609 b = make([]byte, m.Size())
1611 buf := codec.NewBuffer(b)
1612 buf.EncodeInt32(m.Retval)
1613 return buf.Bytes(), nil
1615 func (m *BierRouteAddDelReply) Unmarshal(b []byte) error {
1616 buf := codec.NewBuffer(b)
1617 m.Retval = buf.DecodeInt32()
1621 // BierRouteDetails defines message 'bier_route_details'.
1622 type BierRouteDetails struct {
1623 BrRoute BierRoute `binapi:"bier_route,name=br_route" json:"br_route,omitempty"`
1626 func (m *BierRouteDetails) Reset() { *m = BierRouteDetails{} }
1627 func (*BierRouteDetails) GetMessageName() string { return "bier_route_details" }
1628 func (*BierRouteDetails) GetCrcString() string { return "39ee6a56" }
1629 func (*BierRouteDetails) GetMessageType() api.MessageType {
1630 return api.ReplyMessage
1633 func (m *BierRouteDetails) Size() (size int) {
1637 size += 4 // m.BrRoute.BrBp
1638 size += 1 // m.BrRoute.BrTblID.BtSet
1639 size += 1 // m.BrRoute.BrTblID.BtSubDomain
1640 size += 1 // m.BrRoute.BrTblID.BtHdrLenID
1641 size += 1 // m.BrRoute.BrNPaths
1642 for j2 := 0; j2 < len(m.BrRoute.BrPaths); j2++ {
1645 if j2 < len(m.BrRoute.BrPaths) {
1646 s2 = m.BrRoute.BrPaths[j2]
1648 size += 4 // s2.SwIfIndex
1649 size += 4 // s2.TableID
1650 size += 4 // s2.RpfID
1651 size += 1 // s2.Weight
1652 size += 1 // s2.Preference
1653 size += 4 // s2.Type
1654 size += 4 // s2.Flags
1655 size += 4 // s2.Proto
1656 size += 1 * 16 // s2.Nh.Address
1657 size += 4 // s2.Nh.ViaLabel
1658 size += 4 // s2.Nh.ObjID
1659 size += 4 // s2.Nh.ClassifyTableIndex
1660 size += 1 // s2.NLabels
1661 for j3 := 0; j3 < 16; j3++ {
1662 size += 1 // s2.LabelStack[j3].IsUniform
1663 size += 4 // s2.LabelStack[j3].Label
1664 size += 1 // s2.LabelStack[j3].TTL
1665 size += 1 // s2.LabelStack[j3].Exp
1670 func (m *BierRouteDetails) Marshal(b []byte) ([]byte, error) {
1672 b = make([]byte, m.Size())
1674 buf := codec.NewBuffer(b)
1675 buf.EncodeUint32(m.BrRoute.BrBp)
1676 buf.EncodeUint8(m.BrRoute.BrTblID.BtSet)
1677 buf.EncodeUint8(m.BrRoute.BrTblID.BtSubDomain)
1678 buf.EncodeUint8(m.BrRoute.BrTblID.BtHdrLenID)
1679 buf.EncodeUint8(uint8(len(m.BrRoute.BrPaths)))
1680 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1681 var v1 FibPath // BrPaths
1682 if j1 < len(m.BrRoute.BrPaths) {
1683 v1 = m.BrRoute.BrPaths[j1]
1685 buf.EncodeUint32(v1.SwIfIndex)
1686 buf.EncodeUint32(v1.TableID)
1687 buf.EncodeUint32(v1.RpfID)
1688 buf.EncodeUint8(v1.Weight)
1689 buf.EncodeUint8(v1.Preference)
1690 buf.EncodeUint32(uint32(v1.Type))
1691 buf.EncodeUint32(uint32(v1.Flags))
1692 buf.EncodeUint32(uint32(v1.Proto))
1693 buf.EncodeBytes(v1.Nh.Address.XXX_UnionData[:], 16)
1694 buf.EncodeUint32(v1.Nh.ViaLabel)
1695 buf.EncodeUint32(v1.Nh.ObjID)
1696 buf.EncodeUint32(v1.Nh.ClassifyTableIndex)
1697 buf.EncodeUint8(v1.NLabels)
1698 for j2 := 0; j2 < 16; j2++ {
1699 buf.EncodeUint8(v1.LabelStack[j2].IsUniform)
1700 buf.EncodeUint32(v1.LabelStack[j2].Label)
1701 buf.EncodeUint8(v1.LabelStack[j2].TTL)
1702 buf.EncodeUint8(v1.LabelStack[j2].Exp)
1705 return buf.Bytes(), nil
1707 func (m *BierRouteDetails) Unmarshal(b []byte) error {
1708 buf := codec.NewBuffer(b)
1709 m.BrRoute.BrBp = buf.DecodeUint32()
1710 m.BrRoute.BrTblID.BtSet = buf.DecodeUint8()
1711 m.BrRoute.BrTblID.BtSubDomain = buf.DecodeUint8()
1712 m.BrRoute.BrTblID.BtHdrLenID = buf.DecodeUint8()
1713 m.BrRoute.BrNPaths = buf.DecodeUint8()
1714 m.BrRoute.BrPaths = make([]FibPath, m.BrRoute.BrNPaths)
1715 for j1 := 0; j1 < len(m.BrRoute.BrPaths); j1++ {
1716 m.BrRoute.BrPaths[j1].SwIfIndex = buf.DecodeUint32()
1717 m.BrRoute.BrPaths[j1].TableID = buf.DecodeUint32()
1718 m.BrRoute.BrPaths[j1].RpfID = buf.DecodeUint32()
1719 m.BrRoute.BrPaths[j1].Weight = buf.DecodeUint8()
1720 m.BrRoute.BrPaths[j1].Preference = buf.DecodeUint8()
1721 m.BrRoute.BrPaths[j1].Type = FibPathType(buf.DecodeUint32())
1722 m.BrRoute.BrPaths[j1].Flags = FibPathFlags(buf.DecodeUint32())
1723 m.BrRoute.BrPaths[j1].Proto = FibPathNhProto(buf.DecodeUint32())
1724 copy(m.BrRoute.BrPaths[j1].Nh.Address.XXX_UnionData[:], buf.DecodeBytes(16))
1725 m.BrRoute.BrPaths[j1].Nh.ViaLabel = buf.DecodeUint32()
1726 m.BrRoute.BrPaths[j1].Nh.ObjID = buf.DecodeUint32()
1727 m.BrRoute.BrPaths[j1].Nh.ClassifyTableIndex = buf.DecodeUint32()
1728 m.BrRoute.BrPaths[j1].NLabels = buf.DecodeUint8()
1729 for j2 := 0; j2 < 16; j2++ {
1730 m.BrRoute.BrPaths[j1].LabelStack[j2].IsUniform = buf.DecodeUint8()
1731 m.BrRoute.BrPaths[j1].LabelStack[j2].Label = buf.DecodeUint32()
1732 m.BrRoute.BrPaths[j1].LabelStack[j2].TTL = buf.DecodeUint8()
1733 m.BrRoute.BrPaths[j1].LabelStack[j2].Exp = buf.DecodeUint8()
1739 // BierRouteDump defines message 'bier_route_dump'.
1740 type BierRouteDump struct {
1741 BrTblID BierTableID `binapi:"bier_table_id,name=br_tbl_id" json:"br_tbl_id,omitempty"`
1744 func (m *BierRouteDump) Reset() { *m = BierRouteDump{} }
1745 func (*BierRouteDump) GetMessageName() string { return "bier_route_dump" }
1746 func (*BierRouteDump) GetCrcString() string { return "38339846" }
1747 func (*BierRouteDump) GetMessageType() api.MessageType {
1748 return api.RequestMessage
1751 func (m *BierRouteDump) Size() (size int) {
1755 size += 1 // m.BrTblID.BtSet
1756 size += 1 // m.BrTblID.BtSubDomain
1757 size += 1 // m.BrTblID.BtHdrLenID
1760 func (m *BierRouteDump) Marshal(b []byte) ([]byte, error) {
1762 b = make([]byte, m.Size())
1764 buf := codec.NewBuffer(b)
1765 buf.EncodeUint8(m.BrTblID.BtSet)
1766 buf.EncodeUint8(m.BrTblID.BtSubDomain)
1767 buf.EncodeUint8(m.BrTblID.BtHdrLenID)
1768 return buf.Bytes(), nil
1770 func (m *BierRouteDump) Unmarshal(b []byte) error {
1771 buf := codec.NewBuffer(b)
1772 m.BrTblID.BtSet = buf.DecodeUint8()
1773 m.BrTblID.BtSubDomain = buf.DecodeUint8()
1774 m.BrTblID.BtHdrLenID = buf.DecodeUint8()
1778 // BierTableAddDel defines message 'bier_table_add_del'.
1779 type BierTableAddDel struct {
1780 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1781 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1782 BtIsAdd bool `binapi:"bool,name=bt_is_add" json:"bt_is_add,omitempty"`
1785 func (m *BierTableAddDel) Reset() { *m = BierTableAddDel{} }
1786 func (*BierTableAddDel) GetMessageName() string { return "bier_table_add_del" }
1787 func (*BierTableAddDel) GetCrcString() string { return "35e59209" }
1788 func (*BierTableAddDel) GetMessageType() api.MessageType {
1789 return api.RequestMessage
1792 func (m *BierTableAddDel) Size() (size int) {
1796 size += 1 // m.BtTblID.BtSet
1797 size += 1 // m.BtTblID.BtSubDomain
1798 size += 1 // m.BtTblID.BtHdrLenID
1799 size += 4 // m.BtLabel
1800 size += 1 // m.BtIsAdd
1803 func (m *BierTableAddDel) Marshal(b []byte) ([]byte, error) {
1805 b = make([]byte, m.Size())
1807 buf := codec.NewBuffer(b)
1808 buf.EncodeUint8(m.BtTblID.BtSet)
1809 buf.EncodeUint8(m.BtTblID.BtSubDomain)
1810 buf.EncodeUint8(m.BtTblID.BtHdrLenID)
1811 buf.EncodeUint32(m.BtLabel)
1812 buf.EncodeBool(m.BtIsAdd)
1813 return buf.Bytes(), nil
1815 func (m *BierTableAddDel) Unmarshal(b []byte) error {
1816 buf := codec.NewBuffer(b)
1817 m.BtTblID.BtSet = buf.DecodeUint8()
1818 m.BtTblID.BtSubDomain = buf.DecodeUint8()
1819 m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1820 m.BtLabel = buf.DecodeUint32()
1821 m.BtIsAdd = buf.DecodeBool()
1825 // BierTableAddDelReply defines message 'bier_table_add_del_reply'.
1826 type BierTableAddDelReply struct {
1827 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1830 func (m *BierTableAddDelReply) Reset() { *m = BierTableAddDelReply{} }
1831 func (*BierTableAddDelReply) GetMessageName() string { return "bier_table_add_del_reply" }
1832 func (*BierTableAddDelReply) GetCrcString() string { return "e8d4e804" }
1833 func (*BierTableAddDelReply) GetMessageType() api.MessageType {
1834 return api.ReplyMessage
1837 func (m *BierTableAddDelReply) Size() (size int) {
1841 size += 4 // m.Retval
1844 func (m *BierTableAddDelReply) Marshal(b []byte) ([]byte, error) {
1846 b = make([]byte, m.Size())
1848 buf := codec.NewBuffer(b)
1849 buf.EncodeInt32(m.Retval)
1850 return buf.Bytes(), nil
1852 func (m *BierTableAddDelReply) Unmarshal(b []byte) error {
1853 buf := codec.NewBuffer(b)
1854 m.Retval = buf.DecodeInt32()
1858 // BierTableDetails defines message 'bier_table_details'.
1859 type BierTableDetails struct {
1860 BtLabel uint32 `binapi:"u32,name=bt_label" json:"bt_label,omitempty"`
1861 BtTblID BierTableID `binapi:"bier_table_id,name=bt_tbl_id" json:"bt_tbl_id,omitempty"`
1864 func (m *BierTableDetails) Reset() { *m = BierTableDetails{} }
1865 func (*BierTableDetails) GetMessageName() string { return "bier_table_details" }
1866 func (*BierTableDetails) GetCrcString() string { return "fc44a9dd" }
1867 func (*BierTableDetails) GetMessageType() api.MessageType {
1868 return api.ReplyMessage
1871 func (m *BierTableDetails) Size() (size int) {
1875 size += 4 // m.BtLabel
1876 size += 1 // m.BtTblID.BtSet
1877 size += 1 // m.BtTblID.BtSubDomain
1878 size += 1 // m.BtTblID.BtHdrLenID
1881 func (m *BierTableDetails) Marshal(b []byte) ([]byte, error) {
1883 b = make([]byte, m.Size())
1885 buf := codec.NewBuffer(b)
1886 buf.EncodeUint32(m.BtLabel)
1887 buf.EncodeUint8(m.BtTblID.BtSet)
1888 buf.EncodeUint8(m.BtTblID.BtSubDomain)
1889 buf.EncodeUint8(m.BtTblID.BtHdrLenID)
1890 return buf.Bytes(), nil
1892 func (m *BierTableDetails) Unmarshal(b []byte) error {
1893 buf := codec.NewBuffer(b)
1894 m.BtLabel = buf.DecodeUint32()
1895 m.BtTblID.BtSet = buf.DecodeUint8()
1896 m.BtTblID.BtSubDomain = buf.DecodeUint8()
1897 m.BtTblID.BtHdrLenID = buf.DecodeUint8()
1901 // BierTableDump defines message 'bier_table_dump'.
1902 type BierTableDump struct{}
1904 func (m *BierTableDump) Reset() { *m = BierTableDump{} }
1905 func (*BierTableDump) GetMessageName() string { return "bier_table_dump" }
1906 func (*BierTableDump) GetCrcString() string { return "51077d14" }
1907 func (*BierTableDump) GetMessageType() api.MessageType {
1908 return api.RequestMessage
1911 func (m *BierTableDump) Size() (size int) {
1917 func (m *BierTableDump) Marshal(b []byte) ([]byte, error) {
1919 b = make([]byte, m.Size())
1921 buf := codec.NewBuffer(b)
1922 return buf.Bytes(), nil
1924 func (m *BierTableDump) Unmarshal(b []byte) error {
1928 func init() { file_bier_binapi_init() }
1929 func file_bier_binapi_init() {
1930 api.RegisterMessage((*BierDispEntryAddDel)(nil), "bier_disp_entry_add_del_648323eb")
1931 api.RegisterMessage((*BierDispEntryAddDelReply)(nil), "bier_disp_entry_add_del_reply_e8d4e804")
1932 api.RegisterMessage((*BierDispEntryDetails)(nil), "bier_disp_entry_details_e5b039a9")
1933 api.RegisterMessage((*BierDispEntryDump)(nil), "bier_disp_entry_dump_b5fa54ad")
1934 api.RegisterMessage((*BierDispTableAddDel)(nil), "bier_disp_table_add_del_889657ac")
1935 api.RegisterMessage((*BierDispTableAddDelReply)(nil), "bier_disp_table_add_del_reply_e8d4e804")
1936 api.RegisterMessage((*BierDispTableDetails)(nil), "bier_disp_table_details_d27942c0")
1937 api.RegisterMessage((*BierDispTableDump)(nil), "bier_disp_table_dump_51077d14")
1938 api.RegisterMessage((*BierImpAdd)(nil), "bier_imp_add_3856dc3d")
1939 api.RegisterMessage((*BierImpAddReply)(nil), "bier_imp_add_reply_d49c5793")
1940 api.RegisterMessage((*BierImpDel)(nil), "bier_imp_del_7d45edf6")
1941 api.RegisterMessage((*BierImpDelReply)(nil), "bier_imp_del_reply_e8d4e804")
1942 api.RegisterMessage((*BierImpDetails)(nil), "bier_imp_details_b76192df")
1943 api.RegisterMessage((*BierImpDump)(nil), "bier_imp_dump_51077d14")
1944 api.RegisterMessage((*BierRouteAddDel)(nil), "bier_route_add_del_f29edca0")
1945 api.RegisterMessage((*BierRouteAddDelReply)(nil), "bier_route_add_del_reply_e8d4e804")
1946 api.RegisterMessage((*BierRouteDetails)(nil), "bier_route_details_39ee6a56")
1947 api.RegisterMessage((*BierRouteDump)(nil), "bier_route_dump_38339846")
1948 api.RegisterMessage((*BierTableAddDel)(nil), "bier_table_add_del_35e59209")
1949 api.RegisterMessage((*BierTableAddDelReply)(nil), "bier_table_add_del_reply_e8d4e804")
1950 api.RegisterMessage((*BierTableDetails)(nil), "bier_table_details_fc44a9dd")
1951 api.RegisterMessage((*BierTableDump)(nil), "bier_table_dump_51077d14")
1954 // Messages returns list of all messages in this module.
1955 func AllMessages() []api.Message {
1956 return []api.Message{
1957 (*BierDispEntryAddDel)(nil),
1958 (*BierDispEntryAddDelReply)(nil),
1959 (*BierDispEntryDetails)(nil),
1960 (*BierDispEntryDump)(nil),
1961 (*BierDispTableAddDel)(nil),
1962 (*BierDispTableAddDelReply)(nil),
1963 (*BierDispTableDetails)(nil),
1964 (*BierDispTableDump)(nil),
1966 (*BierImpAddReply)(nil),
1968 (*BierImpDelReply)(nil),
1969 (*BierImpDetails)(nil),
1970 (*BierImpDump)(nil),
1971 (*BierRouteAddDel)(nil),
1972 (*BierRouteAddDelReply)(nil),
1973 (*BierRouteDetails)(nil),
1974 (*BierRouteDump)(nil),
1975 (*BierTableAddDel)(nil),
1976 (*BierTableAddDelReply)(nil),
1977 (*BierTableDetails)(nil),
1978 (*BierTableDump)(nil),