1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: .vppapi/core/punt.api.json
7 // Package punt contains generated bindings for API file punt.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 = 0x51716f7f
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 // IPDscp defines enum 'ip_dscp'.
71 IP_API_DSCP_CS0 IPDscp = 0
72 IP_API_DSCP_CS1 IPDscp = 8
73 IP_API_DSCP_AF11 IPDscp = 10
74 IP_API_DSCP_AF12 IPDscp = 12
75 IP_API_DSCP_AF13 IPDscp = 14
76 IP_API_DSCP_CS2 IPDscp = 16
77 IP_API_DSCP_AF21 IPDscp = 18
78 IP_API_DSCP_AF22 IPDscp = 20
79 IP_API_DSCP_AF23 IPDscp = 22
80 IP_API_DSCP_CS3 IPDscp = 24
81 IP_API_DSCP_AF31 IPDscp = 26
82 IP_API_DSCP_AF32 IPDscp = 28
83 IP_API_DSCP_AF33 IPDscp = 30
84 IP_API_DSCP_CS4 IPDscp = 32
85 IP_API_DSCP_AF41 IPDscp = 34
86 IP_API_DSCP_AF42 IPDscp = 36
87 IP_API_DSCP_AF43 IPDscp = 38
88 IP_API_DSCP_CS5 IPDscp = 40
89 IP_API_DSCP_EF IPDscp = 46
90 IP_API_DSCP_CS6 IPDscp = 48
91 IP_API_DSCP_CS7 IPDscp = 50
95 IPDscp_name = map[uint8]string{
98 10: "IP_API_DSCP_AF11",
99 12: "IP_API_DSCP_AF12",
100 14: "IP_API_DSCP_AF13",
101 16: "IP_API_DSCP_CS2",
102 18: "IP_API_DSCP_AF21",
103 20: "IP_API_DSCP_AF22",
104 22: "IP_API_DSCP_AF23",
105 24: "IP_API_DSCP_CS3",
106 26: "IP_API_DSCP_AF31",
107 28: "IP_API_DSCP_AF32",
108 30: "IP_API_DSCP_AF33",
109 32: "IP_API_DSCP_CS4",
110 34: "IP_API_DSCP_AF41",
111 36: "IP_API_DSCP_AF42",
112 38: "IP_API_DSCP_AF43",
113 40: "IP_API_DSCP_CS5",
114 46: "IP_API_DSCP_EF",
115 48: "IP_API_DSCP_CS6",
116 50: "IP_API_DSCP_CS7",
118 IPDscp_value = map[string]uint8{
119 "IP_API_DSCP_CS0": 0,
120 "IP_API_DSCP_CS1": 8,
121 "IP_API_DSCP_AF11": 10,
122 "IP_API_DSCP_AF12": 12,
123 "IP_API_DSCP_AF13": 14,
124 "IP_API_DSCP_CS2": 16,
125 "IP_API_DSCP_AF21": 18,
126 "IP_API_DSCP_AF22": 20,
127 "IP_API_DSCP_AF23": 22,
128 "IP_API_DSCP_CS3": 24,
129 "IP_API_DSCP_AF31": 26,
130 "IP_API_DSCP_AF32": 28,
131 "IP_API_DSCP_AF33": 30,
132 "IP_API_DSCP_CS4": 32,
133 "IP_API_DSCP_AF41": 34,
134 "IP_API_DSCP_AF42": 36,
135 "IP_API_DSCP_AF43": 38,
136 "IP_API_DSCP_CS5": 40,
137 "IP_API_DSCP_EF": 46,
138 "IP_API_DSCP_CS6": 48,
139 "IP_API_DSCP_CS7": 50,
143 func (x IPDscp) String() string {
144 s, ok := IPDscp_name[uint8(x)]
148 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
151 // IPEcn defines enum 'ip_ecn'.
155 IP_API_ECN_NONE IPEcn = 0
156 IP_API_ECN_ECT0 IPEcn = 1
157 IP_API_ECN_ECT1 IPEcn = 2
158 IP_API_ECN_CE IPEcn = 3
162 IPEcn_name = map[uint8]string{
163 0: "IP_API_ECN_NONE",
164 1: "IP_API_ECN_ECT0",
165 2: "IP_API_ECN_ECT1",
168 IPEcn_value = map[string]uint8{
169 "IP_API_ECN_NONE": 0,
170 "IP_API_ECN_ECT0": 1,
171 "IP_API_ECN_ECT1": 2,
176 func (x IPEcn) String() string {
177 s, ok := IPEcn_name[uint8(x)]
181 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
184 // IPProto defines enum 'ip_proto'.
188 IP_API_PROTO_HOPOPT IPProto = 0
189 IP_API_PROTO_ICMP IPProto = 1
190 IP_API_PROTO_IGMP IPProto = 2
191 IP_API_PROTO_TCP IPProto = 6
192 IP_API_PROTO_UDP IPProto = 17
193 IP_API_PROTO_GRE IPProto = 47
194 IP_API_PROTO_AH IPProto = 50
195 IP_API_PROTO_ESP IPProto = 51
196 IP_API_PROTO_EIGRP IPProto = 88
197 IP_API_PROTO_OSPF IPProto = 89
198 IP_API_PROTO_SCTP IPProto = 132
199 IP_API_PROTO_RESERVED IPProto = 255
203 IPProto_name = map[uint32]string{
204 0: "IP_API_PROTO_HOPOPT",
205 1: "IP_API_PROTO_ICMP",
206 2: "IP_API_PROTO_IGMP",
207 6: "IP_API_PROTO_TCP",
208 17: "IP_API_PROTO_UDP",
209 47: "IP_API_PROTO_GRE",
210 50: "IP_API_PROTO_AH",
211 51: "IP_API_PROTO_ESP",
212 88: "IP_API_PROTO_EIGRP",
213 89: "IP_API_PROTO_OSPF",
214 132: "IP_API_PROTO_SCTP",
215 255: "IP_API_PROTO_RESERVED",
217 IPProto_value = map[string]uint32{
218 "IP_API_PROTO_HOPOPT": 0,
219 "IP_API_PROTO_ICMP": 1,
220 "IP_API_PROTO_IGMP": 2,
221 "IP_API_PROTO_TCP": 6,
222 "IP_API_PROTO_UDP": 17,
223 "IP_API_PROTO_GRE": 47,
224 "IP_API_PROTO_AH": 50,
225 "IP_API_PROTO_ESP": 51,
226 "IP_API_PROTO_EIGRP": 88,
227 "IP_API_PROTO_OSPF": 89,
228 "IP_API_PROTO_SCTP": 132,
229 "IP_API_PROTO_RESERVED": 255,
233 func (x IPProto) String() string {
234 s, ok := IPProto_name[uint32(x)]
238 return "IPProto(" + strconv.Itoa(int(x)) + ")"
241 // PuntType defines enum 'punt_type'.
245 PUNT_API_TYPE_L4 PuntType = 1
246 PUNT_API_TYPE_IP_PROTO PuntType = 2
247 PUNT_API_TYPE_EXCEPTION PuntType = 3
251 PuntType_name = map[uint32]string{
252 1: "PUNT_API_TYPE_L4",
253 2: "PUNT_API_TYPE_IP_PROTO",
254 3: "PUNT_API_TYPE_EXCEPTION",
256 PuntType_value = map[string]uint32{
257 "PUNT_API_TYPE_L4": 1,
258 "PUNT_API_TYPE_IP_PROTO": 2,
259 "PUNT_API_TYPE_EXCEPTION": 3,
263 func (x PuntType) String() string {
264 s, ok := PuntType_name[uint32(x)]
268 return "PuntType(" + strconv.Itoa(int(x)) + ")"
271 // AddressWithPrefix defines alias 'address_with_prefix'.
272 type AddressWithPrefix Prefix
274 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
275 prefix, err := ParsePrefix(s)
277 return AddressWithPrefix{}, err
279 return AddressWithPrefix(prefix), nil
282 func (x AddressWithPrefix) String() string {
283 return Prefix(x).String()
286 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
287 return []byte(x.String()), nil
290 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
291 prefix, err := ParseAddressWithPrefix(string(text))
299 // IP4Address defines alias 'ip4_address'.
300 type IP4Address [4]uint8
302 func ParseIP4Address(s string) (IP4Address, error) {
303 ip := net.ParseIP(s).To4()
305 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
307 var ipaddr IP4Address
308 copy(ipaddr[:], ip.To4())
312 func (x IP4Address) ToIP() net.IP {
313 return net.IP(x[:]).To4()
316 func (x IP4Address) String() string {
317 return x.ToIP().String()
320 func (x *IP4Address) MarshalText() ([]byte, error) {
321 return []byte(x.String()), nil
324 func (x *IP4Address) UnmarshalText(text []byte) error {
325 ipaddr, err := ParseIP4Address(string(text))
333 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
334 type IP4AddressWithPrefix IP4Prefix
336 // IP6Address defines alias 'ip6_address'.
337 type IP6Address [16]uint8
339 func ParseIP6Address(s string) (IP6Address, error) {
340 ip := net.ParseIP(s).To16()
342 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
344 var ipaddr IP6Address
345 copy(ipaddr[:], ip.To16())
349 func (x IP6Address) ToIP() net.IP {
350 return net.IP(x[:]).To16()
353 func (x IP6Address) String() string {
354 return x.ToIP().String()
357 func (x *IP6Address) MarshalText() ([]byte, error) {
358 return []byte(x.String()), nil
361 func (x *IP6Address) UnmarshalText(text []byte) error {
362 ipaddr, err := ParseIP6Address(string(text))
370 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
371 type IP6AddressWithPrefix IP6Prefix
373 // Address defines type 'address'.
374 type Address struct {
375 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
376 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
379 func ParseAddress(s string) (Address, error) {
382 return Address{}, fmt.Errorf("invalid address: %s", s)
384 return AddressFromIP(ip), nil
387 func AddressFromIP(ip net.IP) Address {
390 addr.Af = ADDRESS_IP6
392 copy(ip6[:], ip.To16())
395 addr.Af = ADDRESS_IP4
397 copy(ip4[:], ip.To4())
403 func (x Address) ToIP() net.IP {
404 if x.Af == ADDRESS_IP6 {
406 return net.IP(ip6[:]).To16()
409 return net.IP(ip4[:]).To4()
413 func (x Address) String() string {
414 return x.ToIP().String()
417 func (x *Address) MarshalText() ([]byte, error) {
418 return []byte(x.String()), nil
421 func (x *Address) UnmarshalText(text []byte) error {
422 addr, err := ParseAddress(string(text))
430 // IP4Prefix defines type 'ip4_prefix'.
431 type IP4Prefix struct {
432 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
433 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
436 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
437 hasPrefix := strings.Contains(s, "/")
439 ip, network, err := net.ParseCIDR(s)
441 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
443 maskSize, _ := network.Mask.Size()
444 prefix.Len = byte(maskSize)
445 prefix.Address, err = ParseIP4Address(ip.String())
447 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
451 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
453 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
455 prefix.Len = byte(defaultMaskSize)
456 prefix.Address, err = ParseIP4Address(ip.String())
458 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
464 func (x IP4Prefix) ToIPNet() *net.IPNet {
465 mask := net.CIDRMask(int(x.Len), 32)
466 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
470 func (x IP4Prefix) String() string {
471 ip := x.Address.String()
472 return ip + "/" + strconv.Itoa(int(x.Len))
475 func (x *IP4Prefix) MarshalText() ([]byte, error) {
476 return []byte(x.String()), nil
479 func (x *IP4Prefix) UnmarshalText(text []byte) error {
480 prefix, err := ParseIP4Prefix(string(text))
488 // IP6Prefix defines type 'ip6_prefix'.
489 type IP6Prefix struct {
490 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
491 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
494 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
495 hasPrefix := strings.Contains(s, "/")
497 ip, network, err := net.ParseCIDR(s)
499 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
501 maskSize, _ := network.Mask.Size()
502 prefix.Len = byte(maskSize)
503 prefix.Address, err = ParseIP6Address(ip.String())
505 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
509 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
511 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
513 prefix.Len = byte(defaultMaskSize)
514 prefix.Address, err = ParseIP6Address(ip.String())
516 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
522 func (x IP6Prefix) ToIPNet() *net.IPNet {
523 mask := net.CIDRMask(int(x.Len), 128)
524 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
528 func (x IP6Prefix) String() string {
529 ip := x.Address.String()
530 return ip + "/" + strconv.Itoa(int(x.Len))
533 func (x *IP6Prefix) MarshalText() ([]byte, error) {
534 return []byte(x.String()), nil
537 func (x *IP6Prefix) UnmarshalText(text []byte) error {
538 prefix, err := ParseIP6Prefix(string(text))
546 // Mprefix defines type 'mprefix'.
547 type Mprefix struct {
548 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
549 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
550 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
551 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
554 // Prefix defines type 'prefix'.
556 Address Address `binapi:"address,name=address" json:"address,omitempty"`
557 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
560 func ParsePrefix(ip string) (prefix Prefix, err error) {
561 hasPrefix := strings.Contains(ip, "/")
563 netIP, network, err := net.ParseCIDR(ip)
565 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
567 maskSize, _ := network.Mask.Size()
568 prefix.Len = byte(maskSize)
569 prefix.Address, err = ParseAddress(netIP.String())
571 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
574 netIP := net.ParseIP(ip)
575 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
576 if netIP.To4() == nil {
577 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
579 prefix.Len = byte(defaultMaskSize)
580 prefix.Address, err = ParseAddress(netIP.String())
582 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
588 func (x Prefix) ToIPNet() *net.IPNet {
590 if x.Address.Af == ADDRESS_IP4 {
591 mask = net.CIDRMask(int(x.Len), 32)
593 mask = net.CIDRMask(int(x.Len), 128)
595 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
599 func (x Prefix) String() string {
600 ip := x.Address.String()
601 return ip + "/" + strconv.Itoa(int(x.Len))
604 func (x *Prefix) MarshalText() ([]byte, error) {
605 return []byte(x.String()), nil
608 func (x *Prefix) UnmarshalText(text []byte) error {
609 prefix, err := ParsePrefix(string(text))
617 // PrefixMatcher defines type 'prefix_matcher'.
618 type PrefixMatcher struct {
619 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
620 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
623 // Punt defines type 'punt'.
625 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
626 Punt PuntUnion `binapi:"punt_union,name=punt" json:"punt,omitempty"`
629 // PuntException defines type 'punt_exception'.
630 type PuntException struct {
631 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
634 // PuntIPProto defines type 'punt_ip_proto'.
635 type PuntIPProto struct {
636 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
637 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
640 // PuntL4 defines type 'punt_l4'.
642 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
643 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
644 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
647 // PuntReason defines type 'punt_reason'.
648 type PuntReason struct {
649 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
650 Name string `binapi:"string[],name=name" json:"name,omitempty"`
653 // AddressUnion defines union 'address_union'.
654 type AddressUnion struct {
655 // AddressUnion can be one of:
658 XXX_UnionData [16]byte
661 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
665 func (u *AddressUnion) SetIP4(a IP4Address) {
666 buf := codec.NewBuffer(u.XXX_UnionData[:])
667 buf.EncodeBytes(a[:], 4)
669 func (u *AddressUnion) GetIP4() (a IP4Address) {
670 buf := codec.NewBuffer(u.XXX_UnionData[:])
671 copy(a[:], buf.DecodeBytes(4))
675 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
679 func (u *AddressUnion) SetIP6(a IP6Address) {
680 buf := codec.NewBuffer(u.XXX_UnionData[:])
681 buf.EncodeBytes(a[:], 16)
683 func (u *AddressUnion) GetIP6() (a IP6Address) {
684 buf := codec.NewBuffer(u.XXX_UnionData[:])
685 copy(a[:], buf.DecodeBytes(16))
689 // PuntUnion defines union 'punt_union'.
690 type PuntUnion struct {
691 // PuntUnion can be one of:
692 // - Exception *PuntException
694 // - IPProto *PuntIPProto
695 XXX_UnionData [10]byte
698 func PuntUnionException(a PuntException) (u PuntUnion) {
702 func (u *PuntUnion) SetException(a PuntException) {
703 buf := codec.NewBuffer(u.XXX_UnionData[:])
704 buf.EncodeUint32(a.ID)
706 func (u *PuntUnion) GetException() (a PuntException) {
707 buf := codec.NewBuffer(u.XXX_UnionData[:])
708 a.ID = buf.DecodeUint32()
712 func PuntUnionL4(a PuntL4) (u PuntUnion) {
716 func (u *PuntUnion) SetL4(a PuntL4) {
717 buf := codec.NewBuffer(u.XXX_UnionData[:])
718 buf.EncodeUint32(uint32(a.Af))
719 buf.EncodeUint32(uint32(a.Protocol))
720 buf.EncodeUint16(a.Port)
722 func (u *PuntUnion) GetL4() (a PuntL4) {
723 buf := codec.NewBuffer(u.XXX_UnionData[:])
724 a.Af = AddressFamily(buf.DecodeUint32())
725 a.Protocol = IPProto(buf.DecodeUint32())
726 a.Port = buf.DecodeUint16()
730 func PuntUnionIPProto(a PuntIPProto) (u PuntUnion) {
734 func (u *PuntUnion) SetIPProto(a PuntIPProto) {
735 buf := codec.NewBuffer(u.XXX_UnionData[:])
736 buf.EncodeUint32(uint32(a.Af))
737 buf.EncodeUint32(uint32(a.Protocol))
739 func (u *PuntUnion) GetIPProto() (a PuntIPProto) {
740 buf := codec.NewBuffer(u.XXX_UnionData[:])
741 a.Af = AddressFamily(buf.DecodeUint32())
742 a.Protocol = IPProto(buf.DecodeUint32())
746 // PuntReasonDetails defines message 'punt_reason_details'.
747 type PuntReasonDetails struct {
748 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
751 func (m *PuntReasonDetails) Reset() { *m = PuntReasonDetails{} }
752 func (*PuntReasonDetails) GetMessageName() string { return "punt_reason_details" }
753 func (*PuntReasonDetails) GetCrcString() string { return "2c9d4a40" }
754 func (*PuntReasonDetails) GetMessageType() api.MessageType {
755 return api.ReplyMessage
758 func (m *PuntReasonDetails) Size() (size int) {
762 size += 4 // m.Reason.ID
763 size += 4 + len(m.Reason.Name) // m.Reason.Name
766 func (m *PuntReasonDetails) Marshal(b []byte) ([]byte, error) {
768 b = make([]byte, m.Size())
770 buf := codec.NewBuffer(b)
771 buf.EncodeUint32(m.Reason.ID)
772 buf.EncodeString(m.Reason.Name, 0)
773 return buf.Bytes(), nil
775 func (m *PuntReasonDetails) Unmarshal(b []byte) error {
776 buf := codec.NewBuffer(b)
777 m.Reason.ID = buf.DecodeUint32()
778 m.Reason.Name = buf.DecodeString(0)
782 // PuntReasonDump defines message 'punt_reason_dump'.
783 type PuntReasonDump struct {
784 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
787 func (m *PuntReasonDump) Reset() { *m = PuntReasonDump{} }
788 func (*PuntReasonDump) GetMessageName() string { return "punt_reason_dump" }
789 func (*PuntReasonDump) GetCrcString() string { return "5c0dd4fe" }
790 func (*PuntReasonDump) GetMessageType() api.MessageType {
791 return api.RequestMessage
794 func (m *PuntReasonDump) Size() (size int) {
798 size += 4 // m.Reason.ID
799 size += 4 + len(m.Reason.Name) // m.Reason.Name
802 func (m *PuntReasonDump) Marshal(b []byte) ([]byte, error) {
804 b = make([]byte, m.Size())
806 buf := codec.NewBuffer(b)
807 buf.EncodeUint32(m.Reason.ID)
808 buf.EncodeString(m.Reason.Name, 0)
809 return buf.Bytes(), nil
811 func (m *PuntReasonDump) Unmarshal(b []byte) error {
812 buf := codec.NewBuffer(b)
813 m.Reason.ID = buf.DecodeUint32()
814 m.Reason.Name = buf.DecodeString(0)
818 // PuntSocketDeregister defines message 'punt_socket_deregister'.
819 type PuntSocketDeregister struct {
820 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
823 func (m *PuntSocketDeregister) Reset() { *m = PuntSocketDeregister{} }
824 func (*PuntSocketDeregister) GetMessageName() string { return "punt_socket_deregister" }
825 func (*PuntSocketDeregister) GetCrcString() string { return "98a444f4" }
826 func (*PuntSocketDeregister) GetMessageType() api.MessageType {
827 return api.RequestMessage
830 func (m *PuntSocketDeregister) Size() (size int) {
834 size += 4 // m.Punt.Type
835 size += 1 * 10 // m.Punt.Punt
838 func (m *PuntSocketDeregister) Marshal(b []byte) ([]byte, error) {
840 b = make([]byte, m.Size())
842 buf := codec.NewBuffer(b)
843 buf.EncodeUint32(uint32(m.Punt.Type))
844 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
845 return buf.Bytes(), nil
847 func (m *PuntSocketDeregister) Unmarshal(b []byte) error {
848 buf := codec.NewBuffer(b)
849 m.Punt.Type = PuntType(buf.DecodeUint32())
850 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
854 // PuntSocketDeregisterReply defines message 'punt_socket_deregister_reply'.
855 type PuntSocketDeregisterReply struct {
856 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
859 func (m *PuntSocketDeregisterReply) Reset() { *m = PuntSocketDeregisterReply{} }
860 func (*PuntSocketDeregisterReply) GetMessageName() string { return "punt_socket_deregister_reply" }
861 func (*PuntSocketDeregisterReply) GetCrcString() string { return "e8d4e804" }
862 func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType {
863 return api.ReplyMessage
866 func (m *PuntSocketDeregisterReply) Size() (size int) {
870 size += 4 // m.Retval
873 func (m *PuntSocketDeregisterReply) Marshal(b []byte) ([]byte, error) {
875 b = make([]byte, m.Size())
877 buf := codec.NewBuffer(b)
878 buf.EncodeInt32(m.Retval)
879 return buf.Bytes(), nil
881 func (m *PuntSocketDeregisterReply) Unmarshal(b []byte) error {
882 buf := codec.NewBuffer(b)
883 m.Retval = buf.DecodeInt32()
887 // PuntSocketDetails defines message 'punt_socket_details'.
888 type PuntSocketDetails struct {
889 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
890 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
893 func (m *PuntSocketDetails) Reset() { *m = PuntSocketDetails{} }
894 func (*PuntSocketDetails) GetMessageName() string { return "punt_socket_details" }
895 func (*PuntSocketDetails) GetCrcString() string { return "1de0ce75" }
896 func (*PuntSocketDetails) GetMessageType() api.MessageType {
897 return api.ReplyMessage
900 func (m *PuntSocketDetails) Size() (size int) {
904 size += 4 // m.Punt.Type
905 size += 1 * 10 // m.Punt.Punt
906 size += 108 // m.Pathname
909 func (m *PuntSocketDetails) Marshal(b []byte) ([]byte, error) {
911 b = make([]byte, m.Size())
913 buf := codec.NewBuffer(b)
914 buf.EncodeUint32(uint32(m.Punt.Type))
915 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
916 buf.EncodeString(m.Pathname, 108)
917 return buf.Bytes(), nil
919 func (m *PuntSocketDetails) Unmarshal(b []byte) error {
920 buf := codec.NewBuffer(b)
921 m.Punt.Type = PuntType(buf.DecodeUint32())
922 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
923 m.Pathname = buf.DecodeString(108)
927 // PuntSocketDump defines message 'punt_socket_dump'.
928 type PuntSocketDump struct {
929 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
932 func (m *PuntSocketDump) Reset() { *m = PuntSocketDump{} }
933 func (*PuntSocketDump) GetMessageName() string { return "punt_socket_dump" }
934 func (*PuntSocketDump) GetCrcString() string { return "52974935" }
935 func (*PuntSocketDump) GetMessageType() api.MessageType {
936 return api.RequestMessage
939 func (m *PuntSocketDump) Size() (size int) {
946 func (m *PuntSocketDump) Marshal(b []byte) ([]byte, error) {
948 b = make([]byte, m.Size())
950 buf := codec.NewBuffer(b)
951 buf.EncodeUint32(uint32(m.Type))
952 return buf.Bytes(), nil
954 func (m *PuntSocketDump) Unmarshal(b []byte) error {
955 buf := codec.NewBuffer(b)
956 m.Type = PuntType(buf.DecodeUint32())
960 // PuntSocketRegister defines message 'punt_socket_register'.
961 type PuntSocketRegister struct {
962 HeaderVersion uint32 `binapi:"u32,name=header_version" json:"header_version,omitempty"`
963 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
964 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
967 func (m *PuntSocketRegister) Reset() { *m = PuntSocketRegister{} }
968 func (*PuntSocketRegister) GetMessageName() string { return "punt_socket_register" }
969 func (*PuntSocketRegister) GetCrcString() string { return "c8cd10fa" }
970 func (*PuntSocketRegister) GetMessageType() api.MessageType {
971 return api.RequestMessage
974 func (m *PuntSocketRegister) Size() (size int) {
978 size += 4 // m.HeaderVersion
979 size += 4 // m.Punt.Type
980 size += 1 * 10 // m.Punt.Punt
981 size += 108 // m.Pathname
984 func (m *PuntSocketRegister) Marshal(b []byte) ([]byte, error) {
986 b = make([]byte, m.Size())
988 buf := codec.NewBuffer(b)
989 buf.EncodeUint32(m.HeaderVersion)
990 buf.EncodeUint32(uint32(m.Punt.Type))
991 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
992 buf.EncodeString(m.Pathname, 108)
993 return buf.Bytes(), nil
995 func (m *PuntSocketRegister) Unmarshal(b []byte) error {
996 buf := codec.NewBuffer(b)
997 m.HeaderVersion = buf.DecodeUint32()
998 m.Punt.Type = PuntType(buf.DecodeUint32())
999 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
1000 m.Pathname = buf.DecodeString(108)
1004 // PuntSocketRegisterReply defines message 'punt_socket_register_reply'.
1005 type PuntSocketRegisterReply struct {
1006 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1007 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
1010 func (m *PuntSocketRegisterReply) Reset() { *m = PuntSocketRegisterReply{} }
1011 func (*PuntSocketRegisterReply) GetMessageName() string { return "punt_socket_register_reply" }
1012 func (*PuntSocketRegisterReply) GetCrcString() string { return "bd30ae90" }
1013 func (*PuntSocketRegisterReply) GetMessageType() api.MessageType {
1014 return api.ReplyMessage
1017 func (m *PuntSocketRegisterReply) Size() (size int) {
1021 size += 4 // m.Retval
1022 size += 108 // m.Pathname
1025 func (m *PuntSocketRegisterReply) Marshal(b []byte) ([]byte, error) {
1027 b = make([]byte, m.Size())
1029 buf := codec.NewBuffer(b)
1030 buf.EncodeInt32(m.Retval)
1031 buf.EncodeString(m.Pathname, 108)
1032 return buf.Bytes(), nil
1034 func (m *PuntSocketRegisterReply) Unmarshal(b []byte) error {
1035 buf := codec.NewBuffer(b)
1036 m.Retval = buf.DecodeInt32()
1037 m.Pathname = buf.DecodeString(108)
1041 // SetPunt defines message 'set_punt'.
1042 type SetPunt struct {
1043 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1044 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
1047 func (m *SetPunt) Reset() { *m = SetPunt{} }
1048 func (*SetPunt) GetMessageName() string { return "set_punt" }
1049 func (*SetPunt) GetCrcString() string { return "83799618" }
1050 func (*SetPunt) GetMessageType() api.MessageType {
1051 return api.RequestMessage
1054 func (m *SetPunt) Size() (size int) {
1058 size += 1 // m.IsAdd
1059 size += 4 // m.Punt.Type
1060 size += 1 * 10 // m.Punt.Punt
1063 func (m *SetPunt) Marshal(b []byte) ([]byte, error) {
1065 b = make([]byte, m.Size())
1067 buf := codec.NewBuffer(b)
1068 buf.EncodeBool(m.IsAdd)
1069 buf.EncodeUint32(uint32(m.Punt.Type))
1070 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
1071 return buf.Bytes(), nil
1073 func (m *SetPunt) Unmarshal(b []byte) error {
1074 buf := codec.NewBuffer(b)
1075 m.IsAdd = buf.DecodeBool()
1076 m.Punt.Type = PuntType(buf.DecodeUint32())
1077 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
1081 // SetPuntReply defines message 'set_punt_reply'.
1082 type SetPuntReply struct {
1083 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1086 func (m *SetPuntReply) Reset() { *m = SetPuntReply{} }
1087 func (*SetPuntReply) GetMessageName() string { return "set_punt_reply" }
1088 func (*SetPuntReply) GetCrcString() string { return "e8d4e804" }
1089 func (*SetPuntReply) GetMessageType() api.MessageType {
1090 return api.ReplyMessage
1093 func (m *SetPuntReply) Size() (size int) {
1097 size += 4 // m.Retval
1100 func (m *SetPuntReply) Marshal(b []byte) ([]byte, error) {
1102 b = make([]byte, m.Size())
1104 buf := codec.NewBuffer(b)
1105 buf.EncodeInt32(m.Retval)
1106 return buf.Bytes(), nil
1108 func (m *SetPuntReply) Unmarshal(b []byte) error {
1109 buf := codec.NewBuffer(b)
1110 m.Retval = buf.DecodeInt32()
1114 func init() { file_punt_binapi_init() }
1115 func file_punt_binapi_init() {
1116 api.RegisterMessage((*PuntReasonDetails)(nil), "punt_reason_details_2c9d4a40")
1117 api.RegisterMessage((*PuntReasonDump)(nil), "punt_reason_dump_5c0dd4fe")
1118 api.RegisterMessage((*PuntSocketDeregister)(nil), "punt_socket_deregister_98a444f4")
1119 api.RegisterMessage((*PuntSocketDeregisterReply)(nil), "punt_socket_deregister_reply_e8d4e804")
1120 api.RegisterMessage((*PuntSocketDetails)(nil), "punt_socket_details_1de0ce75")
1121 api.RegisterMessage((*PuntSocketDump)(nil), "punt_socket_dump_52974935")
1122 api.RegisterMessage((*PuntSocketRegister)(nil), "punt_socket_register_c8cd10fa")
1123 api.RegisterMessage((*PuntSocketRegisterReply)(nil), "punt_socket_register_reply_bd30ae90")
1124 api.RegisterMessage((*SetPunt)(nil), "set_punt_83799618")
1125 api.RegisterMessage((*SetPuntReply)(nil), "set_punt_reply_e8d4e804")
1128 // Messages returns list of all messages in this module.
1129 func AllMessages() []api.Message {
1130 return []api.Message{
1131 (*PuntReasonDetails)(nil),
1132 (*PuntReasonDump)(nil),
1133 (*PuntSocketDeregister)(nil),
1134 (*PuntSocketDeregisterReply)(nil),
1135 (*PuntSocketDetails)(nil),
1136 (*PuntSocketDump)(nil),
1137 (*PuntSocketRegister)(nil),
1138 (*PuntSocketRegisterReply)(nil),
1140 (*SetPuntReply)(nil),