1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.5.0-dev
5 // source: /usr/share/vpp/api/plugins/udp_ping.api.json
7 // Package udp_ping contains generated bindings for API file udp_ping.api.
15 api "git.fd.io/govpp.git/api"
16 ip_types "git.fd.io/govpp.git/binapi/ip_types"
17 codec "git.fd.io/govpp.git/codec"
20 // This is a compile-time assertion to ensure that this generated file
21 // is compatible with the GoVPP api package it is being compiled against.
22 // A compilation error at this line likely means your copy of the
23 // GoVPP api package needs to be updated.
24 const _ = api.GoVppAPIPackageIsVersion2
29 VersionCrc = 0x16d961db
32 // UDPPingAddDel defines message 'udp_ping_add_del'.
33 type UDPPingAddDel struct {
34 SrcIPAddress ip_types.Address `binapi:"address,name=src_ip_address" json:"src_ip_address,omitempty"`
35 DstIPAddress ip_types.Address `binapi:"address,name=dst_ip_address" json:"dst_ip_address,omitempty"`
36 StartSrcPort uint16 `binapi:"u16,name=start_src_port" json:"start_src_port,omitempty"`
37 EndSrcPort uint16 `binapi:"u16,name=end_src_port" json:"end_src_port,omitempty"`
38 StartDstPort uint16 `binapi:"u16,name=start_dst_port" json:"start_dst_port,omitempty"`
39 EndDstPort uint16 `binapi:"u16,name=end_dst_port" json:"end_dst_port,omitempty"`
40 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"`
41 Dis uint8 `binapi:"u8,name=dis" json:"dis,omitempty"`
42 FaultDet uint8 `binapi:"u8,name=fault_det" json:"fault_det,omitempty"`
43 Reserve []byte `binapi:"u8[3],name=reserve" json:"reserve,omitempty"`
46 func (m *UDPPingAddDel) Reset() { *m = UDPPingAddDel{} }
47 func (*UDPPingAddDel) GetMessageName() string { return "udp_ping_add_del" }
48 func (*UDPPingAddDel) GetCrcString() string { return "fa2628fc" }
49 func (*UDPPingAddDel) GetMessageType() api.MessageType {
50 return api.RequestMessage
53 func (m *UDPPingAddDel) Size() (size int) {
57 size += 1 // m.SrcIPAddress.Af
58 size += 1 * 16 // m.SrcIPAddress.Un
59 size += 1 // m.DstIPAddress.Af
60 size += 1 * 16 // m.DstIPAddress.Un
61 size += 2 // m.StartSrcPort
62 size += 2 // m.EndSrcPort
63 size += 2 // m.StartDstPort
64 size += 2 // m.EndDstPort
65 size += 2 // m.Interval
67 size += 1 // m.FaultDet
68 size += 1 * 3 // m.Reserve
71 func (m *UDPPingAddDel) Marshal(b []byte) ([]byte, error) {
73 b = make([]byte, m.Size())
75 buf := codec.NewBuffer(b)
76 buf.EncodeUint8(uint8(m.SrcIPAddress.Af))
77 buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 16)
78 buf.EncodeUint8(uint8(m.DstIPAddress.Af))
79 buf.EncodeBytes(m.DstIPAddress.Un.XXX_UnionData[:], 16)
80 buf.EncodeUint16(m.StartSrcPort)
81 buf.EncodeUint16(m.EndSrcPort)
82 buf.EncodeUint16(m.StartDstPort)
83 buf.EncodeUint16(m.EndDstPort)
84 buf.EncodeUint16(m.Interval)
85 buf.EncodeUint8(m.Dis)
86 buf.EncodeUint8(m.FaultDet)
87 buf.EncodeBytes(m.Reserve, 3)
88 return buf.Bytes(), nil
90 func (m *UDPPingAddDel) Unmarshal(b []byte) error {
91 buf := codec.NewBuffer(b)
92 m.SrcIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
93 copy(m.SrcIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
94 m.DstIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
95 copy(m.DstIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
96 m.StartSrcPort = buf.DecodeUint16()
97 m.EndSrcPort = buf.DecodeUint16()
98 m.StartDstPort = buf.DecodeUint16()
99 m.EndDstPort = buf.DecodeUint16()
100 m.Interval = buf.DecodeUint16()
101 m.Dis = buf.DecodeUint8()
102 m.FaultDet = buf.DecodeUint8()
103 m.Reserve = make([]byte, 3)
104 copy(m.Reserve, buf.DecodeBytes(len(m.Reserve)))
108 // UDPPingAddDelReply defines message 'udp_ping_add_del_reply'.
109 type UDPPingAddDelReply struct {
110 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
113 func (m *UDPPingAddDelReply) Reset() { *m = UDPPingAddDelReply{} }
114 func (*UDPPingAddDelReply) GetMessageName() string { return "udp_ping_add_del_reply" }
115 func (*UDPPingAddDelReply) GetCrcString() string { return "e8d4e804" }
116 func (*UDPPingAddDelReply) GetMessageType() api.MessageType {
117 return api.ReplyMessage
120 func (m *UDPPingAddDelReply) Size() (size int) {
124 size += 4 // m.Retval
127 func (m *UDPPingAddDelReply) Marshal(b []byte) ([]byte, error) {
129 b = make([]byte, m.Size())
131 buf := codec.NewBuffer(b)
132 buf.EncodeInt32(m.Retval)
133 return buf.Bytes(), nil
135 func (m *UDPPingAddDelReply) Unmarshal(b []byte) error {
136 buf := codec.NewBuffer(b)
137 m.Retval = buf.DecodeInt32()
141 // UDPPingExport defines message 'udp_ping_export'.
142 type UDPPingExport struct {
143 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
146 func (m *UDPPingExport) Reset() { *m = UDPPingExport{} }
147 func (*UDPPingExport) GetMessageName() string { return "udp_ping_export" }
148 func (*UDPPingExport) GetCrcString() string { return "b3e225d2" }
149 func (*UDPPingExport) GetMessageType() api.MessageType {
150 return api.RequestMessage
153 func (m *UDPPingExport) Size() (size int) {
157 size += 1 // m.Enable
160 func (m *UDPPingExport) Marshal(b []byte) ([]byte, error) {
162 b = make([]byte, m.Size())
164 buf := codec.NewBuffer(b)
165 buf.EncodeBool(m.Enable)
166 return buf.Bytes(), nil
168 func (m *UDPPingExport) Unmarshal(b []byte) error {
169 buf := codec.NewBuffer(b)
170 m.Enable = buf.DecodeBool()
174 // UDPPingExportReply defines message 'udp_ping_export_reply'.
175 type UDPPingExportReply struct {
176 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
179 func (m *UDPPingExportReply) Reset() { *m = UDPPingExportReply{} }
180 func (*UDPPingExportReply) GetMessageName() string { return "udp_ping_export_reply" }
181 func (*UDPPingExportReply) GetCrcString() string { return "e8d4e804" }
182 func (*UDPPingExportReply) GetMessageType() api.MessageType {
183 return api.ReplyMessage
186 func (m *UDPPingExportReply) Size() (size int) {
190 size += 4 // m.Retval
193 func (m *UDPPingExportReply) Marshal(b []byte) ([]byte, error) {
195 b = make([]byte, m.Size())
197 buf := codec.NewBuffer(b)
198 buf.EncodeInt32(m.Retval)
199 return buf.Bytes(), nil
201 func (m *UDPPingExportReply) Unmarshal(b []byte) error {
202 buf := codec.NewBuffer(b)
203 m.Retval = buf.DecodeInt32()
207 func init() { file_udp_ping_binapi_init() }
208 func file_udp_ping_binapi_init() {
209 api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_fa2628fc")
210 api.RegisterMessage((*UDPPingAddDelReply)(nil), "udp_ping_add_del_reply_e8d4e804")
211 api.RegisterMessage((*UDPPingExport)(nil), "udp_ping_export_b3e225d2")
212 api.RegisterMessage((*UDPPingExportReply)(nil), "udp_ping_export_reply_e8d4e804")
215 // Messages returns list of all messages in this module.
216 func AllMessages() []api.Message {
217 return []api.Message{
218 (*UDPPingAddDel)(nil),
219 (*UDPPingAddDelReply)(nil),
220 (*UDPPingExport)(nil),
221 (*UDPPingExportReply)(nil),