1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.6.0-dev
5 // source: /usr/share/vpp/api/plugins/arping.api.json
7 // Package arping contains generated bindings for API file arping.api.
15 api "go.fd.io/govpp/api"
16 interface_types "go.fd.io/govpp/binapi/interface_types"
17 ip_types "go.fd.io/govpp/binapi/ip_types"
18 codec "go.fd.io/govpp/codec"
21 // This is a compile-time assertion to ensure that this generated file
22 // is compatible with the GoVPP api package it is being compiled against.
23 // A compilation error at this line likely means your copy of the
24 // GoVPP api package needs to be updated.
25 const _ = api.GoVppAPIPackageIsVersion2
30 VersionCrc = 0x666f91cc
33 // Arping defines message 'arping'.
35 Address ip_types.Address `binapi:"address,name=address" json:"address,omitempty"`
36 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
37 IsGarp bool `binapi:"bool,name=is_garp" json:"is_garp,omitempty"`
38 Repeat uint32 `binapi:"u32,name=repeat,default=1" json:"repeat,omitempty"`
39 Interval float64 `binapi:"f64,name=interval,default=1" json:"interval,omitempty"`
42 func (m *Arping) Reset() { *m = Arping{} }
43 func (*Arping) GetMessageName() string { return "arping" }
44 func (*Arping) GetCrcString() string { return "48817482" }
45 func (*Arping) GetMessageType() api.MessageType {
46 return api.RequestMessage
49 func (m *Arping) Size() (size int) {
53 size += 1 // m.Address.Af
54 size += 1 * 16 // m.Address.Un
55 size += 4 // m.SwIfIndex
58 size += 8 // m.Interval
61 func (m *Arping) Marshal(b []byte) ([]byte, error) {
63 b = make([]byte, m.Size())
65 buf := codec.NewBuffer(b)
66 buf.EncodeUint8(uint8(m.Address.Af))
67 buf.EncodeBytes(m.Address.Un.XXX_UnionData[:], 16)
68 buf.EncodeUint32(uint32(m.SwIfIndex))
69 buf.EncodeBool(m.IsGarp)
70 buf.EncodeUint32(m.Repeat)
71 buf.EncodeFloat64(m.Interval)
72 return buf.Bytes(), nil
74 func (m *Arping) Unmarshal(b []byte) error {
75 buf := codec.NewBuffer(b)
76 m.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
77 copy(m.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
78 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
79 m.IsGarp = buf.DecodeBool()
80 m.Repeat = buf.DecodeUint32()
81 m.Interval = buf.DecodeFloat64()
85 // ArpingReply defines message 'arping_reply'.
86 type ArpingReply struct {
87 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
88 ReplyCount uint32 `binapi:"u32,name=reply_count" json:"reply_count,omitempty"`
91 func (m *ArpingReply) Reset() { *m = ArpingReply{} }
92 func (*ArpingReply) GetMessageName() string { return "arping_reply" }
93 func (*ArpingReply) GetCrcString() string { return "bb9d1cbd" }
94 func (*ArpingReply) GetMessageType() api.MessageType {
95 return api.ReplyMessage
98 func (m *ArpingReply) Size() (size int) {
102 size += 4 // m.Retval
103 size += 4 // m.ReplyCount
106 func (m *ArpingReply) Marshal(b []byte) ([]byte, error) {
108 b = make([]byte, m.Size())
110 buf := codec.NewBuffer(b)
111 buf.EncodeInt32(m.Retval)
112 buf.EncodeUint32(m.ReplyCount)
113 return buf.Bytes(), nil
115 func (m *ArpingReply) Unmarshal(b []byte) error {
116 buf := codec.NewBuffer(b)
117 m.Retval = buf.DecodeInt32()
118 m.ReplyCount = buf.DecodeUint32()
122 func init() { file_arping_binapi_init() }
123 func file_arping_binapi_init() {
124 api.RegisterMessage((*Arping)(nil), "arping_48817482")
125 api.RegisterMessage((*ArpingReply)(nil), "arping_reply_bb9d1cbd")
128 // Messages returns list of all messages in this module.
129 func AllMessages() []api.Message {
130 return []api.Message{