1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.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 = 0x3b2c67de
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 "c692b188" }
49 func (*UDPPingAddDel) GetMessageType() api.MessageType {
50 return api.RequestMessage
53 func (m *UDPPingAddDel) Size() int {
58 size += 1 // m.SrcIPAddress.Af
59 size += 1 * 16 // m.SrcIPAddress.Un
60 size += 1 // m.DstIPAddress.Af
61 size += 1 * 16 // m.DstIPAddress.Un
62 size += 2 // m.StartSrcPort
63 size += 2 // m.EndSrcPort
64 size += 2 // m.StartDstPort
65 size += 2 // m.EndDstPort
66 size += 2 // m.Interval
68 size += 1 // m.FaultDet
69 size += 1 * 3 // m.Reserve
72 func (m *UDPPingAddDel) Marshal(b []byte) ([]byte, error) {
75 buf = codec.NewBuffer(make([]byte, m.Size()))
77 buf = codec.NewBuffer(b)
79 buf.EncodeUint8(uint8(m.SrcIPAddress.Af))
80 buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 0)
81 buf.EncodeUint8(uint8(m.DstIPAddress.Af))
82 buf.EncodeBytes(m.DstIPAddress.Un.XXX_UnionData[:], 0)
83 buf.EncodeUint16(uint16(m.StartSrcPort))
84 buf.EncodeUint16(uint16(m.EndSrcPort))
85 buf.EncodeUint16(uint16(m.StartDstPort))
86 buf.EncodeUint16(uint16(m.EndDstPort))
87 buf.EncodeUint16(uint16(m.Interval))
88 buf.EncodeUint8(uint8(m.Dis))
89 buf.EncodeUint8(uint8(m.FaultDet))
90 buf.EncodeBytes(m.Reserve[:], 3)
91 return buf.Bytes(), nil
93 func (m *UDPPingAddDel) Unmarshal(b []byte) error {
94 buf := codec.NewBuffer(b)
95 m.SrcIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
96 copy(m.SrcIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
97 m.DstIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
98 copy(m.DstIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
99 m.StartSrcPort = buf.DecodeUint16()
100 m.EndSrcPort = buf.DecodeUint16()
101 m.StartDstPort = buf.DecodeUint16()
102 m.EndDstPort = buf.DecodeUint16()
103 m.Interval = buf.DecodeUint16()
104 m.Dis = buf.DecodeUint8()
105 m.FaultDet = buf.DecodeUint8()
106 copy(m.Reserve[:], buf.DecodeBytes(3))
110 // UDPPingAddDelReply defines message 'udp_ping_add_del_reply'.
111 type UDPPingAddDelReply struct {
112 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
115 func (m *UDPPingAddDelReply) Reset() { *m = UDPPingAddDelReply{} }
116 func (*UDPPingAddDelReply) GetMessageName() string { return "udp_ping_add_del_reply" }
117 func (*UDPPingAddDelReply) GetCrcString() string { return "e8d4e804" }
118 func (*UDPPingAddDelReply) GetMessageType() api.MessageType {
119 return api.ReplyMessage
122 func (m *UDPPingAddDelReply) Size() int {
127 size += 4 // m.Retval
130 func (m *UDPPingAddDelReply) Marshal(b []byte) ([]byte, error) {
131 var buf *codec.Buffer
133 buf = codec.NewBuffer(make([]byte, m.Size()))
135 buf = codec.NewBuffer(b)
137 buf.EncodeUint32(uint32(m.Retval))
138 return buf.Bytes(), nil
140 func (m *UDPPingAddDelReply) Unmarshal(b []byte) error {
141 buf := codec.NewBuffer(b)
142 m.Retval = int32(buf.DecodeUint32())
146 // UDPPingExport defines message 'udp_ping_export'.
147 type UDPPingExport struct {
148 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
151 func (m *UDPPingExport) Reset() { *m = UDPPingExport{} }
152 func (*UDPPingExport) GetMessageName() string { return "udp_ping_export" }
153 func (*UDPPingExport) GetCrcString() string { return "b3e225d2" }
154 func (*UDPPingExport) GetMessageType() api.MessageType {
155 return api.RequestMessage
158 func (m *UDPPingExport) Size() int {
163 size += 1 // m.Enable
166 func (m *UDPPingExport) Marshal(b []byte) ([]byte, error) {
167 var buf *codec.Buffer
169 buf = codec.NewBuffer(make([]byte, m.Size()))
171 buf = codec.NewBuffer(b)
173 buf.EncodeBool(m.Enable)
174 return buf.Bytes(), nil
176 func (m *UDPPingExport) Unmarshal(b []byte) error {
177 buf := codec.NewBuffer(b)
178 m.Enable = buf.DecodeBool()
182 // UDPPingExportReply defines message 'udp_ping_export_reply'.
183 type UDPPingExportReply struct {
184 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
187 func (m *UDPPingExportReply) Reset() { *m = UDPPingExportReply{} }
188 func (*UDPPingExportReply) GetMessageName() string { return "udp_ping_export_reply" }
189 func (*UDPPingExportReply) GetCrcString() string { return "e8d4e804" }
190 func (*UDPPingExportReply) GetMessageType() api.MessageType {
191 return api.ReplyMessage
194 func (m *UDPPingExportReply) Size() int {
199 size += 4 // m.Retval
202 func (m *UDPPingExportReply) Marshal(b []byte) ([]byte, error) {
203 var buf *codec.Buffer
205 buf = codec.NewBuffer(make([]byte, m.Size()))
207 buf = codec.NewBuffer(b)
209 buf.EncodeUint32(uint32(m.Retval))
210 return buf.Bytes(), nil
212 func (m *UDPPingExportReply) Unmarshal(b []byte) error {
213 buf := codec.NewBuffer(b)
214 m.Retval = int32(buf.DecodeUint32())
218 func init() { file_udp_ping_binapi_init() }
219 func file_udp_ping_binapi_init() {
220 api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_c692b188")
221 api.RegisterMessage((*UDPPingAddDelReply)(nil), "udp_ping_add_del_reply_e8d4e804")
222 api.RegisterMessage((*UDPPingExport)(nil), "udp_ping_export_b3e225d2")
223 api.RegisterMessage((*UDPPingExportReply)(nil), "udp_ping_export_reply_e8d4e804")
226 // Messages returns list of all messages in this module.
227 func AllMessages() []api.Message {
228 return []api.Message{
229 (*UDPPingAddDel)(nil),
230 (*UDPPingAddDelReply)(nil),
231 (*UDPPingExport)(nil),
232 (*UDPPingExportReply)(nil),