1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0-dev
6 // Package udp_ping contains generated bindings for API file udp_ping.api.
14 api "git.fd.io/govpp.git/api"
15 ip_types "git.fd.io/govpp.git/binapi/ip_types"
16 codec "git.fd.io/govpp.git/codec"
19 // This is a compile-time assertion to ensure that this generated file
20 // is compatible with the GoVPP api package it is being compiled against.
21 // A compilation error at this line likely means your copy of the
22 // GoVPP api package needs to be updated.
23 const _ = api.GoVppAPIPackageIsVersion2
28 VersionCrc = 0x3b2c67de
31 // UDPPingAddDel defines message 'udp_ping_add_del'.
32 type UDPPingAddDel struct {
33 SrcIPAddress ip_types.Address `binapi:"address,name=src_ip_address" json:"src_ip_address,omitempty"`
34 DstIPAddress ip_types.Address `binapi:"address,name=dst_ip_address" json:"dst_ip_address,omitempty"`
35 StartSrcPort uint16 `binapi:"u16,name=start_src_port" json:"start_src_port,omitempty"`
36 EndSrcPort uint16 `binapi:"u16,name=end_src_port" json:"end_src_port,omitempty"`
37 StartDstPort uint16 `binapi:"u16,name=start_dst_port" json:"start_dst_port,omitempty"`
38 EndDstPort uint16 `binapi:"u16,name=end_dst_port" json:"end_dst_port,omitempty"`
39 Interval uint16 `binapi:"u16,name=interval" json:"interval,omitempty"`
40 Dis uint8 `binapi:"u8,name=dis" json:"dis,omitempty"`
41 FaultDet uint8 `binapi:"u8,name=fault_det" json:"fault_det,omitempty"`
42 Reserve []byte `binapi:"u8[3],name=reserve" json:"reserve,omitempty"`
45 func (m *UDPPingAddDel) Reset() { *m = UDPPingAddDel{} }
46 func (*UDPPingAddDel) GetMessageName() string { return "udp_ping_add_del" }
47 func (*UDPPingAddDel) GetCrcString() string { return "c692b188" }
48 func (*UDPPingAddDel) GetMessageType() api.MessageType {
49 return api.RequestMessage
52 func (m *UDPPingAddDel) Size() (size int) {
56 size += 1 // m.SrcIPAddress.Af
57 size += 1 * 16 // m.SrcIPAddress.Un
58 size += 1 // m.DstIPAddress.Af
59 size += 1 * 16 // m.DstIPAddress.Un
60 size += 2 // m.StartSrcPort
61 size += 2 // m.EndSrcPort
62 size += 2 // m.StartDstPort
63 size += 2 // m.EndDstPort
64 size += 2 // m.Interval
66 size += 1 // m.FaultDet
67 size += 1 * 3 // m.Reserve
70 func (m *UDPPingAddDel) Marshal(b []byte) ([]byte, error) {
72 b = make([]byte, m.Size())
74 buf := codec.NewBuffer(b)
75 buf.EncodeUint8(uint8(m.SrcIPAddress.Af))
76 buf.EncodeBytes(m.SrcIPAddress.Un.XXX_UnionData[:], 16)
77 buf.EncodeUint8(uint8(m.DstIPAddress.Af))
78 buf.EncodeBytes(m.DstIPAddress.Un.XXX_UnionData[:], 16)
79 buf.EncodeUint16(m.StartSrcPort)
80 buf.EncodeUint16(m.EndSrcPort)
81 buf.EncodeUint16(m.StartDstPort)
82 buf.EncodeUint16(m.EndDstPort)
83 buf.EncodeUint16(m.Interval)
84 buf.EncodeUint8(m.Dis)
85 buf.EncodeUint8(m.FaultDet)
86 buf.EncodeBytes(m.Reserve, 3)
87 return buf.Bytes(), nil
89 func (m *UDPPingAddDel) Unmarshal(b []byte) error {
90 buf := codec.NewBuffer(b)
91 m.SrcIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
92 copy(m.SrcIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
93 m.DstIPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
94 copy(m.DstIPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
95 m.StartSrcPort = buf.DecodeUint16()
96 m.EndSrcPort = buf.DecodeUint16()
97 m.StartDstPort = buf.DecodeUint16()
98 m.EndDstPort = buf.DecodeUint16()
99 m.Interval = buf.DecodeUint16()
100 m.Dis = buf.DecodeUint8()
101 m.FaultDet = buf.DecodeUint8()
102 m.Reserve = make([]byte, 3)
103 copy(m.Reserve, buf.DecodeBytes(len(m.Reserve)))
107 // UDPPingAddDelReply defines message 'udp_ping_add_del_reply'.
108 type UDPPingAddDelReply struct {
109 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
112 func (m *UDPPingAddDelReply) Reset() { *m = UDPPingAddDelReply{} }
113 func (*UDPPingAddDelReply) GetMessageName() string { return "udp_ping_add_del_reply" }
114 func (*UDPPingAddDelReply) GetCrcString() string { return "e8d4e804" }
115 func (*UDPPingAddDelReply) GetMessageType() api.MessageType {
116 return api.ReplyMessage
119 func (m *UDPPingAddDelReply) Size() (size int) {
123 size += 4 // m.Retval
126 func (m *UDPPingAddDelReply) Marshal(b []byte) ([]byte, error) {
128 b = make([]byte, m.Size())
130 buf := codec.NewBuffer(b)
131 buf.EncodeInt32(m.Retval)
132 return buf.Bytes(), nil
134 func (m *UDPPingAddDelReply) Unmarshal(b []byte) error {
135 buf := codec.NewBuffer(b)
136 m.Retval = buf.DecodeInt32()
140 // UDPPingExport defines message 'udp_ping_export'.
141 type UDPPingExport struct {
142 Enable bool `binapi:"bool,name=enable" json:"enable,omitempty"`
145 func (m *UDPPingExport) Reset() { *m = UDPPingExport{} }
146 func (*UDPPingExport) GetMessageName() string { return "udp_ping_export" }
147 func (*UDPPingExport) GetCrcString() string { return "b3e225d2" }
148 func (*UDPPingExport) GetMessageType() api.MessageType {
149 return api.RequestMessage
152 func (m *UDPPingExport) Size() (size int) {
156 size += 1 // m.Enable
159 func (m *UDPPingExport) Marshal(b []byte) ([]byte, error) {
161 b = make([]byte, m.Size())
163 buf := codec.NewBuffer(b)
164 buf.EncodeBool(m.Enable)
165 return buf.Bytes(), nil
167 func (m *UDPPingExport) Unmarshal(b []byte) error {
168 buf := codec.NewBuffer(b)
169 m.Enable = buf.DecodeBool()
173 // UDPPingExportReply defines message 'udp_ping_export_reply'.
174 type UDPPingExportReply struct {
175 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
178 func (m *UDPPingExportReply) Reset() { *m = UDPPingExportReply{} }
179 func (*UDPPingExportReply) GetMessageName() string { return "udp_ping_export_reply" }
180 func (*UDPPingExportReply) GetCrcString() string { return "e8d4e804" }
181 func (*UDPPingExportReply) GetMessageType() api.MessageType {
182 return api.ReplyMessage
185 func (m *UDPPingExportReply) Size() (size int) {
189 size += 4 // m.Retval
192 func (m *UDPPingExportReply) Marshal(b []byte) ([]byte, error) {
194 b = make([]byte, m.Size())
196 buf := codec.NewBuffer(b)
197 buf.EncodeInt32(m.Retval)
198 return buf.Bytes(), nil
200 func (m *UDPPingExportReply) Unmarshal(b []byte) error {
201 buf := codec.NewBuffer(b)
202 m.Retval = buf.DecodeInt32()
206 func init() { file_udp_ping_binapi_init() }
207 func file_udp_ping_binapi_init() {
208 api.RegisterMessage((*UDPPingAddDel)(nil), "udp_ping_add_del_c692b188")
209 api.RegisterMessage((*UDPPingAddDelReply)(nil), "udp_ping_add_del_reply_e8d4e804")
210 api.RegisterMessage((*UDPPingExport)(nil), "udp_ping_export_b3e225d2")
211 api.RegisterMessage((*UDPPingExportReply)(nil), "udp_ping_export_reply_e8d4e804")
214 // Messages returns list of all messages in this module.
215 func AllMessages() []api.Message {
216 return []api.Message{
217 (*UDPPingAddDel)(nil),
218 (*UDPPingAddDelReply)(nil),
219 (*UDPPingExport)(nil),
220 (*UDPPingExportReply)(nil),