1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
5 // source: .vppapi/core/punt.api.json
7 // Package punt contains generated bindings for API file punt.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 = 0x51716f7f
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 // IPDscp defines enum 'ip_dscp'.
70 IP_API_DSCP_CS0 IPDscp = 0
71 IP_API_DSCP_CS1 IPDscp = 8
72 IP_API_DSCP_AF11 IPDscp = 10
73 IP_API_DSCP_AF12 IPDscp = 12
74 IP_API_DSCP_AF13 IPDscp = 14
75 IP_API_DSCP_CS2 IPDscp = 16
76 IP_API_DSCP_AF21 IPDscp = 18
77 IP_API_DSCP_AF22 IPDscp = 20
78 IP_API_DSCP_AF23 IPDscp = 22
79 IP_API_DSCP_CS3 IPDscp = 24
80 IP_API_DSCP_AF31 IPDscp = 26
81 IP_API_DSCP_AF32 IPDscp = 28
82 IP_API_DSCP_AF33 IPDscp = 30
83 IP_API_DSCP_CS4 IPDscp = 32
84 IP_API_DSCP_AF41 IPDscp = 34
85 IP_API_DSCP_AF42 IPDscp = 36
86 IP_API_DSCP_AF43 IPDscp = 38
87 IP_API_DSCP_CS5 IPDscp = 40
88 IP_API_DSCP_EF IPDscp = 46
89 IP_API_DSCP_CS6 IPDscp = 48
90 IP_API_DSCP_CS7 IPDscp = 50
94 IPDscp_name = map[uint8]string{
97 10: "IP_API_DSCP_AF11",
98 12: "IP_API_DSCP_AF12",
99 14: "IP_API_DSCP_AF13",
100 16: "IP_API_DSCP_CS2",
101 18: "IP_API_DSCP_AF21",
102 20: "IP_API_DSCP_AF22",
103 22: "IP_API_DSCP_AF23",
104 24: "IP_API_DSCP_CS3",
105 26: "IP_API_DSCP_AF31",
106 28: "IP_API_DSCP_AF32",
107 30: "IP_API_DSCP_AF33",
108 32: "IP_API_DSCP_CS4",
109 34: "IP_API_DSCP_AF41",
110 36: "IP_API_DSCP_AF42",
111 38: "IP_API_DSCP_AF43",
112 40: "IP_API_DSCP_CS5",
113 46: "IP_API_DSCP_EF",
114 48: "IP_API_DSCP_CS6",
115 50: "IP_API_DSCP_CS7",
117 IPDscp_value = map[string]uint8{
118 "IP_API_DSCP_CS0": 0,
119 "IP_API_DSCP_CS1": 8,
120 "IP_API_DSCP_AF11": 10,
121 "IP_API_DSCP_AF12": 12,
122 "IP_API_DSCP_AF13": 14,
123 "IP_API_DSCP_CS2": 16,
124 "IP_API_DSCP_AF21": 18,
125 "IP_API_DSCP_AF22": 20,
126 "IP_API_DSCP_AF23": 22,
127 "IP_API_DSCP_CS3": 24,
128 "IP_API_DSCP_AF31": 26,
129 "IP_API_DSCP_AF32": 28,
130 "IP_API_DSCP_AF33": 30,
131 "IP_API_DSCP_CS4": 32,
132 "IP_API_DSCP_AF41": 34,
133 "IP_API_DSCP_AF42": 36,
134 "IP_API_DSCP_AF43": 38,
135 "IP_API_DSCP_CS5": 40,
136 "IP_API_DSCP_EF": 46,
137 "IP_API_DSCP_CS6": 48,
138 "IP_API_DSCP_CS7": 50,
142 func (x IPDscp) String() string {
143 s, ok := IPDscp_name[uint8(x)]
147 return "IPDscp(" + strconv.Itoa(int(x)) + ")"
150 // IPEcn defines enum 'ip_ecn'.
154 IP_API_ECN_NONE IPEcn = 0
155 IP_API_ECN_ECT0 IPEcn = 1
156 IP_API_ECN_ECT1 IPEcn = 2
157 IP_API_ECN_CE IPEcn = 3
161 IPEcn_name = map[uint8]string{
162 0: "IP_API_ECN_NONE",
163 1: "IP_API_ECN_ECT0",
164 2: "IP_API_ECN_ECT1",
167 IPEcn_value = map[string]uint8{
168 "IP_API_ECN_NONE": 0,
169 "IP_API_ECN_ECT0": 1,
170 "IP_API_ECN_ECT1": 2,
175 func (x IPEcn) String() string {
176 s, ok := IPEcn_name[uint8(x)]
180 return "IPEcn(" + strconv.Itoa(int(x)) + ")"
183 // IPProto defines enum 'ip_proto'.
187 IP_API_PROTO_HOPOPT IPProto = 0
188 IP_API_PROTO_ICMP IPProto = 1
189 IP_API_PROTO_IGMP IPProto = 2
190 IP_API_PROTO_TCP IPProto = 6
191 IP_API_PROTO_UDP IPProto = 17
192 IP_API_PROTO_GRE IPProto = 47
193 IP_API_PROTO_AH IPProto = 50
194 IP_API_PROTO_ESP IPProto = 51
195 IP_API_PROTO_EIGRP IPProto = 88
196 IP_API_PROTO_OSPF IPProto = 89
197 IP_API_PROTO_SCTP IPProto = 132
198 IP_API_PROTO_RESERVED IPProto = 255
202 IPProto_name = map[uint32]string{
203 0: "IP_API_PROTO_HOPOPT",
204 1: "IP_API_PROTO_ICMP",
205 2: "IP_API_PROTO_IGMP",
206 6: "IP_API_PROTO_TCP",
207 17: "IP_API_PROTO_UDP",
208 47: "IP_API_PROTO_GRE",
209 50: "IP_API_PROTO_AH",
210 51: "IP_API_PROTO_ESP",
211 88: "IP_API_PROTO_EIGRP",
212 89: "IP_API_PROTO_OSPF",
213 132: "IP_API_PROTO_SCTP",
214 255: "IP_API_PROTO_RESERVED",
216 IPProto_value = map[string]uint32{
217 "IP_API_PROTO_HOPOPT": 0,
218 "IP_API_PROTO_ICMP": 1,
219 "IP_API_PROTO_IGMP": 2,
220 "IP_API_PROTO_TCP": 6,
221 "IP_API_PROTO_UDP": 17,
222 "IP_API_PROTO_GRE": 47,
223 "IP_API_PROTO_AH": 50,
224 "IP_API_PROTO_ESP": 51,
225 "IP_API_PROTO_EIGRP": 88,
226 "IP_API_PROTO_OSPF": 89,
227 "IP_API_PROTO_SCTP": 132,
228 "IP_API_PROTO_RESERVED": 255,
232 func (x IPProto) String() string {
233 s, ok := IPProto_name[uint32(x)]
237 return "IPProto(" + strconv.Itoa(int(x)) + ")"
240 // PuntType defines enum 'punt_type'.
244 PUNT_API_TYPE_L4 PuntType = 1
245 PUNT_API_TYPE_IP_PROTO PuntType = 2
246 PUNT_API_TYPE_EXCEPTION PuntType = 3
250 PuntType_name = map[uint32]string{
251 1: "PUNT_API_TYPE_L4",
252 2: "PUNT_API_TYPE_IP_PROTO",
253 3: "PUNT_API_TYPE_EXCEPTION",
255 PuntType_value = map[string]uint32{
256 "PUNT_API_TYPE_L4": 1,
257 "PUNT_API_TYPE_IP_PROTO": 2,
258 "PUNT_API_TYPE_EXCEPTION": 3,
262 func (x PuntType) String() string {
263 s, ok := PuntType_name[uint32(x)]
267 return "PuntType(" + strconv.Itoa(int(x)) + ")"
270 // AddressWithPrefix defines alias 'address_with_prefix'.
271 type AddressWithPrefix Prefix
273 func ParseAddressWithPrefix(s string) (AddressWithPrefix, error) {
274 prefix, err := ParsePrefix(s)
276 return AddressWithPrefix{}, err
278 return AddressWithPrefix(prefix), nil
280 func (x AddressWithPrefix) String() string {
281 return Prefix(x).String()
283 func (x *AddressWithPrefix) MarshalText() ([]byte, error) {
284 return []byte(x.String()), nil
286 func (x *AddressWithPrefix) UnmarshalText(text []byte) error {
287 prefix, err := ParseAddressWithPrefix(string(text))
295 // IP4Address defines alias 'ip4_address'.
296 type IP4Address [4]uint8
298 func ParseIP4Address(s string) (IP4Address, error) {
299 ip := net.ParseIP(s).To4()
301 return IP4Address{}, fmt.Errorf("invalid IP address: %s", s)
303 var ipaddr IP4Address
304 copy(ipaddr[:], ip.To4())
308 func (x IP4Address) ToIP() net.IP {
309 return net.IP(x[:]).To4()
311 func (x IP4Address) String() string {
312 return x.ToIP().String()
314 func (x *IP4Address) MarshalText() ([]byte, error) {
315 return []byte(x.String()), nil
317 func (x *IP4Address) UnmarshalText(text []byte) error {
318 ipaddr, err := ParseIP4Address(string(text))
326 // IP4AddressWithPrefix defines alias 'ip4_address_with_prefix'.
327 type IP4AddressWithPrefix IP4Prefix
329 // IP6Address defines alias 'ip6_address'.
330 type IP6Address [16]uint8
332 func ParseIP6Address(s string) (IP6Address, error) {
333 ip := net.ParseIP(s).To16()
335 return IP6Address{}, fmt.Errorf("invalid IP address: %s", s)
337 var ipaddr IP6Address
338 copy(ipaddr[:], ip.To16())
342 func (x IP6Address) ToIP() net.IP {
343 return net.IP(x[:]).To16()
345 func (x IP6Address) String() string {
346 return x.ToIP().String()
348 func (x *IP6Address) MarshalText() ([]byte, error) {
349 return []byte(x.String()), nil
351 func (x *IP6Address) UnmarshalText(text []byte) error {
352 ipaddr, err := ParseIP6Address(string(text))
360 // IP6AddressWithPrefix defines alias 'ip6_address_with_prefix'.
361 type IP6AddressWithPrefix IP6Prefix
363 // Address defines type 'address'.
364 type Address struct {
365 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
366 Un AddressUnion `binapi:"address_union,name=un" json:"un,omitempty"`
369 func ParseAddress(s string) (Address, error) {
372 return Address{}, fmt.Errorf("invalid address: %s", s)
376 addr.Af = ADDRESS_IP6
378 copy(ip6[:], ip.To16())
381 addr.Af = ADDRESS_IP4
383 copy(ip4[:], ip.To4())
388 func (x Address) ToIP() net.IP {
389 if x.Af == ADDRESS_IP6 {
391 return net.IP(ip6[:]).To16()
394 return net.IP(ip4[:]).To4()
397 func (x Address) String() string {
398 return x.ToIP().String()
400 func (x *Address) MarshalText() ([]byte, error) {
401 return []byte(x.String()), nil
403 func (x *Address) UnmarshalText(text []byte) error {
404 addr, err := ParseAddress(string(text))
412 // IP4Prefix defines type 'ip4_prefix'.
413 type IP4Prefix struct {
414 Address IP4Address `binapi:"ip4_address,name=address" json:"address,omitempty"`
415 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
418 func ParseIP4Prefix(s string) (prefix IP4Prefix, err error) {
419 hasPrefix := strings.Contains(s, "/")
421 ip, network, err := net.ParseCIDR(s)
423 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
425 maskSize, _ := network.Mask.Size()
426 prefix.Len = byte(maskSize)
427 prefix.Address, err = ParseIP4Address(ip.String())
429 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
433 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
435 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
437 prefix.Len = byte(defaultMaskSize)
438 prefix.Address, err = ParseIP4Address(ip.String())
440 return IP4Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
445 func (x IP4Prefix) ToIPNet() *net.IPNet {
446 mask := net.CIDRMask(int(x.Len), 32)
447 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
450 func (x IP4Prefix) String() string {
451 ip := x.Address.String()
452 return ip + "/" + strconv.Itoa(int(x.Len))
454 func (x *IP4Prefix) MarshalText() ([]byte, error) {
455 return []byte(x.String()), nil
457 func (x *IP4Prefix) UnmarshalText(text []byte) error {
458 prefix, err := ParseIP4Prefix(string(text))
466 // IP6Prefix defines type 'ip6_prefix'.
467 type IP6Prefix struct {
468 Address IP6Address `binapi:"ip6_address,name=address" json:"address,omitempty"`
469 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
472 func ParseIP6Prefix(s string) (prefix IP6Prefix, err error) {
473 hasPrefix := strings.Contains(s, "/")
475 ip, network, err := net.ParseCIDR(s)
477 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
479 maskSize, _ := network.Mask.Size()
480 prefix.Len = byte(maskSize)
481 prefix.Address, err = ParseIP6Address(ip.String())
483 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
487 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
489 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
491 prefix.Len = byte(defaultMaskSize)
492 prefix.Address, err = ParseIP6Address(ip.String())
494 return IP6Prefix{}, fmt.Errorf("invalid IP %s: %s", s, err)
499 func (x IP6Prefix) ToIPNet() *net.IPNet {
500 mask := net.CIDRMask(int(x.Len), 128)
501 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
504 func (x IP6Prefix) String() string {
505 ip := x.Address.String()
506 return ip + "/" + strconv.Itoa(int(x.Len))
508 func (x *IP6Prefix) MarshalText() ([]byte, error) {
509 return []byte(x.String()), nil
511 func (x *IP6Prefix) UnmarshalText(text []byte) error {
512 prefix, err := ParseIP6Prefix(string(text))
520 // Mprefix defines type 'mprefix'.
521 type Mprefix struct {
522 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
523 GrpAddressLength uint16 `binapi:"u16,name=grp_address_length" json:"grp_address_length,omitempty"`
524 GrpAddress AddressUnion `binapi:"address_union,name=grp_address" json:"grp_address,omitempty"`
525 SrcAddress AddressUnion `binapi:"address_union,name=src_address" json:"src_address,omitempty"`
528 // Prefix defines type 'prefix'.
530 Address Address `binapi:"address,name=address" json:"address,omitempty"`
531 Len uint8 `binapi:"u8,name=len" json:"len,omitempty"`
534 func ParsePrefix(ip string) (prefix Prefix, err error) {
535 hasPrefix := strings.Contains(ip, "/")
537 netIP, network, err := net.ParseCIDR(ip)
539 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
541 maskSize, _ := network.Mask.Size()
542 prefix.Len = byte(maskSize)
543 prefix.Address, err = ParseAddress(netIP.String())
545 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
548 netIP := net.ParseIP(ip)
549 defaultMaskSize, _ := net.CIDRMask(32, 32).Size()
550 if netIP.To4() == nil {
551 defaultMaskSize, _ = net.CIDRMask(128, 128).Size()
553 prefix.Len = byte(defaultMaskSize)
554 prefix.Address, err = ParseAddress(netIP.String())
556 return Prefix{}, fmt.Errorf("invalid IP %s: %s", ip, err)
561 func (x Prefix) ToIPNet() *net.IPNet {
563 if x.Address.Af == ADDRESS_IP4 {
564 mask = net.CIDRMask(int(x.Len), 32)
566 mask = net.CIDRMask(int(x.Len), 128)
568 ipnet := &net.IPNet{IP: x.Address.ToIP(), Mask: mask}
571 func (x Prefix) String() string {
572 ip := x.Address.String()
573 return ip + "/" + strconv.Itoa(int(x.Len))
575 func (x *Prefix) MarshalText() ([]byte, error) {
576 return []byte(x.String()), nil
578 func (x *Prefix) UnmarshalText(text []byte) error {
579 prefix, err := ParsePrefix(string(text))
587 // PrefixMatcher defines type 'prefix_matcher'.
588 type PrefixMatcher struct {
589 Le uint8 `binapi:"u8,name=le" json:"le,omitempty"`
590 Ge uint8 `binapi:"u8,name=ge" json:"ge,omitempty"`
593 // Punt defines type 'punt'.
595 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
596 Punt PuntUnion `binapi:"punt_union,name=punt" json:"punt,omitempty"`
599 // PuntException defines type 'punt_exception'.
600 type PuntException struct {
601 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
604 // PuntIPProto defines type 'punt_ip_proto'.
605 type PuntIPProto struct {
606 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
607 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
610 // PuntL4 defines type 'punt_l4'.
612 Af AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
613 Protocol IPProto `binapi:"ip_proto,name=protocol" json:"protocol,omitempty"`
614 Port uint16 `binapi:"u16,name=port" json:"port,omitempty"`
617 // PuntReason defines type 'punt_reason'.
618 type PuntReason struct {
619 ID uint32 `binapi:"u32,name=id" json:"id,omitempty"`
620 Name string `binapi:"string[],name=name" json:"name,omitempty"`
623 // AddressUnion defines union 'address_union'.
624 type AddressUnion struct {
627 XXX_UnionData [16]byte
630 func AddressUnionIP4(a IP4Address) (u AddressUnion) {
634 func (u *AddressUnion) SetIP4(a IP4Address) {
635 buf := codec.NewBuffer(u.XXX_UnionData[:])
636 buf.EncodeBytes(a[:], 4)
638 func (u *AddressUnion) GetIP4() (a IP4Address) {
639 buf := codec.NewBuffer(u.XXX_UnionData[:])
640 copy(a[:], buf.DecodeBytes(4))
644 func AddressUnionIP6(a IP6Address) (u AddressUnion) {
648 func (u *AddressUnion) SetIP6(a IP6Address) {
649 buf := codec.NewBuffer(u.XXX_UnionData[:])
650 buf.EncodeBytes(a[:], 16)
652 func (u *AddressUnion) GetIP6() (a IP6Address) {
653 buf := codec.NewBuffer(u.XXX_UnionData[:])
654 copy(a[:], buf.DecodeBytes(16))
658 // PuntUnion defines union 'punt_union'.
659 type PuntUnion struct {
660 // Exception *PuntException
662 // IPProto *PuntIPProto
663 XXX_UnionData [10]byte
666 func PuntUnionException(a PuntException) (u PuntUnion) {
670 func (u *PuntUnion) SetException(a PuntException) {
671 buf := codec.NewBuffer(u.XXX_UnionData[:])
672 buf.EncodeUint32(a.ID)
674 func (u *PuntUnion) GetException() (a PuntException) {
675 buf := codec.NewBuffer(u.XXX_UnionData[:])
676 a.ID = buf.DecodeUint32()
680 func PuntUnionL4(a PuntL4) (u PuntUnion) {
684 func (u *PuntUnion) SetL4(a PuntL4) {
685 buf := codec.NewBuffer(u.XXX_UnionData[:])
686 buf.EncodeUint32(uint32(a.Af))
687 buf.EncodeUint32(uint32(a.Protocol))
688 buf.EncodeUint16(a.Port)
690 func (u *PuntUnion) GetL4() (a PuntL4) {
691 buf := codec.NewBuffer(u.XXX_UnionData[:])
692 a.Af = AddressFamily(buf.DecodeUint32())
693 a.Protocol = IPProto(buf.DecodeUint32())
694 a.Port = buf.DecodeUint16()
698 func PuntUnionIPProto(a PuntIPProto) (u PuntUnion) {
702 func (u *PuntUnion) SetIPProto(a PuntIPProto) {
703 buf := codec.NewBuffer(u.XXX_UnionData[:])
704 buf.EncodeUint32(uint32(a.Af))
705 buf.EncodeUint32(uint32(a.Protocol))
707 func (u *PuntUnion) GetIPProto() (a PuntIPProto) {
708 buf := codec.NewBuffer(u.XXX_UnionData[:])
709 a.Af = AddressFamily(buf.DecodeUint32())
710 a.Protocol = IPProto(buf.DecodeUint32())
714 // PuntReasonDetails defines message 'punt_reason_details'.
715 type PuntReasonDetails struct {
716 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
719 func (m *PuntReasonDetails) Reset() { *m = PuntReasonDetails{} }
720 func (*PuntReasonDetails) GetMessageName() string { return "punt_reason_details" }
721 func (*PuntReasonDetails) GetCrcString() string { return "2c9d4a40" }
722 func (*PuntReasonDetails) GetMessageType() api.MessageType {
723 return api.ReplyMessage
726 func (m *PuntReasonDetails) Size() (size int) {
730 size += 4 // m.Reason.ID
731 size += 4 + len(m.Reason.Name) // m.Reason.Name
734 func (m *PuntReasonDetails) Marshal(b []byte) ([]byte, error) {
736 b = make([]byte, m.Size())
738 buf := codec.NewBuffer(b)
739 buf.EncodeUint32(m.Reason.ID)
740 buf.EncodeString(m.Reason.Name, 0)
741 return buf.Bytes(), nil
743 func (m *PuntReasonDetails) Unmarshal(b []byte) error {
744 buf := codec.NewBuffer(b)
745 m.Reason.ID = buf.DecodeUint32()
746 m.Reason.Name = buf.DecodeString(0)
750 // PuntReasonDump defines message 'punt_reason_dump'.
751 type PuntReasonDump struct {
752 Reason PuntReason `binapi:"punt_reason,name=reason" json:"reason,omitempty"`
755 func (m *PuntReasonDump) Reset() { *m = PuntReasonDump{} }
756 func (*PuntReasonDump) GetMessageName() string { return "punt_reason_dump" }
757 func (*PuntReasonDump) GetCrcString() string { return "5c0dd4fe" }
758 func (*PuntReasonDump) GetMessageType() api.MessageType {
759 return api.RequestMessage
762 func (m *PuntReasonDump) Size() (size int) {
766 size += 4 // m.Reason.ID
767 size += 4 + len(m.Reason.Name) // m.Reason.Name
770 func (m *PuntReasonDump) Marshal(b []byte) ([]byte, error) {
772 b = make([]byte, m.Size())
774 buf := codec.NewBuffer(b)
775 buf.EncodeUint32(m.Reason.ID)
776 buf.EncodeString(m.Reason.Name, 0)
777 return buf.Bytes(), nil
779 func (m *PuntReasonDump) Unmarshal(b []byte) error {
780 buf := codec.NewBuffer(b)
781 m.Reason.ID = buf.DecodeUint32()
782 m.Reason.Name = buf.DecodeString(0)
786 // PuntSocketDeregister defines message 'punt_socket_deregister'.
787 type PuntSocketDeregister struct {
788 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
791 func (m *PuntSocketDeregister) Reset() { *m = PuntSocketDeregister{} }
792 func (*PuntSocketDeregister) GetMessageName() string { return "punt_socket_deregister" }
793 func (*PuntSocketDeregister) GetCrcString() string { return "98a444f4" }
794 func (*PuntSocketDeregister) GetMessageType() api.MessageType {
795 return api.RequestMessage
798 func (m *PuntSocketDeregister) Size() (size int) {
802 size += 4 // m.Punt.Type
803 size += 1 * 10 // m.Punt.Punt
806 func (m *PuntSocketDeregister) Marshal(b []byte) ([]byte, error) {
808 b = make([]byte, m.Size())
810 buf := codec.NewBuffer(b)
811 buf.EncodeUint32(uint32(m.Punt.Type))
812 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
813 return buf.Bytes(), nil
815 func (m *PuntSocketDeregister) Unmarshal(b []byte) error {
816 buf := codec.NewBuffer(b)
817 m.Punt.Type = PuntType(buf.DecodeUint32())
818 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
822 // PuntSocketDeregisterReply defines message 'punt_socket_deregister_reply'.
823 type PuntSocketDeregisterReply struct {
824 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
827 func (m *PuntSocketDeregisterReply) Reset() { *m = PuntSocketDeregisterReply{} }
828 func (*PuntSocketDeregisterReply) GetMessageName() string { return "punt_socket_deregister_reply" }
829 func (*PuntSocketDeregisterReply) GetCrcString() string { return "e8d4e804" }
830 func (*PuntSocketDeregisterReply) GetMessageType() api.MessageType {
831 return api.ReplyMessage
834 func (m *PuntSocketDeregisterReply) Size() (size int) {
838 size += 4 // m.Retval
841 func (m *PuntSocketDeregisterReply) Marshal(b []byte) ([]byte, error) {
843 b = make([]byte, m.Size())
845 buf := codec.NewBuffer(b)
846 buf.EncodeInt32(m.Retval)
847 return buf.Bytes(), nil
849 func (m *PuntSocketDeregisterReply) Unmarshal(b []byte) error {
850 buf := codec.NewBuffer(b)
851 m.Retval = buf.DecodeInt32()
855 // PuntSocketDetails defines message 'punt_socket_details'.
856 type PuntSocketDetails struct {
857 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
858 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
861 func (m *PuntSocketDetails) Reset() { *m = PuntSocketDetails{} }
862 func (*PuntSocketDetails) GetMessageName() string { return "punt_socket_details" }
863 func (*PuntSocketDetails) GetCrcString() string { return "1de0ce75" }
864 func (*PuntSocketDetails) GetMessageType() api.MessageType {
865 return api.ReplyMessage
868 func (m *PuntSocketDetails) Size() (size int) {
872 size += 4 // m.Punt.Type
873 size += 1 * 10 // m.Punt.Punt
874 size += 108 // m.Pathname
877 func (m *PuntSocketDetails) Marshal(b []byte) ([]byte, error) {
879 b = make([]byte, m.Size())
881 buf := codec.NewBuffer(b)
882 buf.EncodeUint32(uint32(m.Punt.Type))
883 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
884 buf.EncodeString(m.Pathname, 108)
885 return buf.Bytes(), nil
887 func (m *PuntSocketDetails) Unmarshal(b []byte) error {
888 buf := codec.NewBuffer(b)
889 m.Punt.Type = PuntType(buf.DecodeUint32())
890 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
891 m.Pathname = buf.DecodeString(108)
895 // PuntSocketDump defines message 'punt_socket_dump'.
896 type PuntSocketDump struct {
897 Type PuntType `binapi:"punt_type,name=type" json:"type,omitempty"`
900 func (m *PuntSocketDump) Reset() { *m = PuntSocketDump{} }
901 func (*PuntSocketDump) GetMessageName() string { return "punt_socket_dump" }
902 func (*PuntSocketDump) GetCrcString() string { return "52974935" }
903 func (*PuntSocketDump) GetMessageType() api.MessageType {
904 return api.RequestMessage
907 func (m *PuntSocketDump) Size() (size int) {
914 func (m *PuntSocketDump) Marshal(b []byte) ([]byte, error) {
916 b = make([]byte, m.Size())
918 buf := codec.NewBuffer(b)
919 buf.EncodeUint32(uint32(m.Type))
920 return buf.Bytes(), nil
922 func (m *PuntSocketDump) Unmarshal(b []byte) error {
923 buf := codec.NewBuffer(b)
924 m.Type = PuntType(buf.DecodeUint32())
928 // PuntSocketRegister defines message 'punt_socket_register'.
929 type PuntSocketRegister struct {
930 HeaderVersion uint32 `binapi:"u32,name=header_version" json:"header_version,omitempty"`
931 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
932 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
935 func (m *PuntSocketRegister) Reset() { *m = PuntSocketRegister{} }
936 func (*PuntSocketRegister) GetMessageName() string { return "punt_socket_register" }
937 func (*PuntSocketRegister) GetCrcString() string { return "c8cd10fa" }
938 func (*PuntSocketRegister) GetMessageType() api.MessageType {
939 return api.RequestMessage
942 func (m *PuntSocketRegister) Size() (size int) {
946 size += 4 // m.HeaderVersion
947 size += 4 // m.Punt.Type
948 size += 1 * 10 // m.Punt.Punt
949 size += 108 // m.Pathname
952 func (m *PuntSocketRegister) Marshal(b []byte) ([]byte, error) {
954 b = make([]byte, m.Size())
956 buf := codec.NewBuffer(b)
957 buf.EncodeUint32(m.HeaderVersion)
958 buf.EncodeUint32(uint32(m.Punt.Type))
959 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
960 buf.EncodeString(m.Pathname, 108)
961 return buf.Bytes(), nil
963 func (m *PuntSocketRegister) Unmarshal(b []byte) error {
964 buf := codec.NewBuffer(b)
965 m.HeaderVersion = buf.DecodeUint32()
966 m.Punt.Type = PuntType(buf.DecodeUint32())
967 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
968 m.Pathname = buf.DecodeString(108)
972 // PuntSocketRegisterReply defines message 'punt_socket_register_reply'.
973 type PuntSocketRegisterReply struct {
974 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
975 Pathname string `binapi:"string[108],name=pathname" json:"pathname,omitempty"`
978 func (m *PuntSocketRegisterReply) Reset() { *m = PuntSocketRegisterReply{} }
979 func (*PuntSocketRegisterReply) GetMessageName() string { return "punt_socket_register_reply" }
980 func (*PuntSocketRegisterReply) GetCrcString() string { return "bd30ae90" }
981 func (*PuntSocketRegisterReply) GetMessageType() api.MessageType {
982 return api.ReplyMessage
985 func (m *PuntSocketRegisterReply) Size() (size int) {
989 size += 4 // m.Retval
990 size += 108 // m.Pathname
993 func (m *PuntSocketRegisterReply) Marshal(b []byte) ([]byte, error) {
995 b = make([]byte, m.Size())
997 buf := codec.NewBuffer(b)
998 buf.EncodeInt32(m.Retval)
999 buf.EncodeString(m.Pathname, 108)
1000 return buf.Bytes(), nil
1002 func (m *PuntSocketRegisterReply) Unmarshal(b []byte) error {
1003 buf := codec.NewBuffer(b)
1004 m.Retval = buf.DecodeInt32()
1005 m.Pathname = buf.DecodeString(108)
1009 // SetPunt defines message 'set_punt'.
1010 type SetPunt struct {
1011 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1012 Punt Punt `binapi:"punt,name=punt" json:"punt,omitempty"`
1015 func (m *SetPunt) Reset() { *m = SetPunt{} }
1016 func (*SetPunt) GetMessageName() string { return "set_punt" }
1017 func (*SetPunt) GetCrcString() string { return "83799618" }
1018 func (*SetPunt) GetMessageType() api.MessageType {
1019 return api.RequestMessage
1022 func (m *SetPunt) Size() (size int) {
1026 size += 1 // m.IsAdd
1027 size += 4 // m.Punt.Type
1028 size += 1 * 10 // m.Punt.Punt
1031 func (m *SetPunt) Marshal(b []byte) ([]byte, error) {
1033 b = make([]byte, m.Size())
1035 buf := codec.NewBuffer(b)
1036 buf.EncodeBool(m.IsAdd)
1037 buf.EncodeUint32(uint32(m.Punt.Type))
1038 buf.EncodeBytes(m.Punt.Punt.XXX_UnionData[:], 10)
1039 return buf.Bytes(), nil
1041 func (m *SetPunt) Unmarshal(b []byte) error {
1042 buf := codec.NewBuffer(b)
1043 m.IsAdd = buf.DecodeBool()
1044 m.Punt.Type = PuntType(buf.DecodeUint32())
1045 copy(m.Punt.Punt.XXX_UnionData[:], buf.DecodeBytes(10))
1049 // SetPuntReply defines message 'set_punt_reply'.
1050 type SetPuntReply struct {
1051 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1054 func (m *SetPuntReply) Reset() { *m = SetPuntReply{} }
1055 func (*SetPuntReply) GetMessageName() string { return "set_punt_reply" }
1056 func (*SetPuntReply) GetCrcString() string { return "e8d4e804" }
1057 func (*SetPuntReply) GetMessageType() api.MessageType {
1058 return api.ReplyMessage
1061 func (m *SetPuntReply) Size() (size int) {
1065 size += 4 // m.Retval
1068 func (m *SetPuntReply) Marshal(b []byte) ([]byte, error) {
1070 b = make([]byte, m.Size())
1072 buf := codec.NewBuffer(b)
1073 buf.EncodeInt32(m.Retval)
1074 return buf.Bytes(), nil
1076 func (m *SetPuntReply) Unmarshal(b []byte) error {
1077 buf := codec.NewBuffer(b)
1078 m.Retval = buf.DecodeInt32()
1082 func init() { file_punt_binapi_init() }
1083 func file_punt_binapi_init() {
1084 api.RegisterMessage((*PuntReasonDetails)(nil), "punt_reason_details_2c9d4a40")
1085 api.RegisterMessage((*PuntReasonDump)(nil), "punt_reason_dump_5c0dd4fe")
1086 api.RegisterMessage((*PuntSocketDeregister)(nil), "punt_socket_deregister_98a444f4")
1087 api.RegisterMessage((*PuntSocketDeregisterReply)(nil), "punt_socket_deregister_reply_e8d4e804")
1088 api.RegisterMessage((*PuntSocketDetails)(nil), "punt_socket_details_1de0ce75")
1089 api.RegisterMessage((*PuntSocketDump)(nil), "punt_socket_dump_52974935")
1090 api.RegisterMessage((*PuntSocketRegister)(nil), "punt_socket_register_c8cd10fa")
1091 api.RegisterMessage((*PuntSocketRegisterReply)(nil), "punt_socket_register_reply_bd30ae90")
1092 api.RegisterMessage((*SetPunt)(nil), "set_punt_83799618")
1093 api.RegisterMessage((*SetPuntReply)(nil), "set_punt_reply_e8d4e804")
1096 // Messages returns list of all messages in this module.
1097 func AllMessages() []api.Message {
1098 return []api.Message{
1099 (*PuntReasonDetails)(nil),
1100 (*PuntReasonDump)(nil),
1101 (*PuntSocketDeregister)(nil),
1102 (*PuntSocketDeregisterReply)(nil),
1103 (*PuntSocketDetails)(nil),
1104 (*PuntSocketDump)(nil),
1105 (*PuntSocketRegister)(nil),
1106 (*PuntSocketRegisterReply)(nil),
1108 (*SetPuntReply)(nil),