c9806dfa61f57a1542a7bdd2997a605a8c748f12
[govpp.git] / binapi / arp / arp.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package arp contains generated bindings for API file arp.api.
7 //
8 // Contents:
9 //   1 struct
10 //   8 messages
11 //
12 package arp
13
14 import (
15         api "git.fd.io/govpp.git/api"
16         _ "git.fd.io/govpp.git/binapi/ethernet_types"
17         interface_types "git.fd.io/govpp.git/binapi/interface_types"
18         ip_types "git.fd.io/govpp.git/binapi/ip_types"
19         codec "git.fd.io/govpp.git/codec"
20 )
21
22 // This is a compile-time assertion to ensure that this generated file
23 // is compatible with the GoVPP api package it is being compiled against.
24 // A compilation error at this line likely means your copy of the
25 // GoVPP api package needs to be updated.
26 const _ = api.GoVppAPIPackageIsVersion2
27
28 const (
29         APIFile    = "arp"
30         APIVersion = "1.0.0"
31         VersionCrc = 0x79ca86f2
32 )
33
34 // ProxyArp defines type 'proxy_arp'.
35 type ProxyArp struct {
36         TableID uint32              `binapi:"u32,name=table_id" json:"table_id,omitempty"`
37         Low     ip_types.IP4Address `binapi:"ip4_address,name=low" json:"low,omitempty"`
38         Hi      ip_types.IP4Address `binapi:"ip4_address,name=hi" json:"hi,omitempty"`
39 }
40
41 // ProxyArpAddDel defines message 'proxy_arp_add_del'.
42 type ProxyArpAddDel struct {
43         IsAdd bool     `binapi:"bool,name=is_add" json:"is_add,omitempty"`
44         Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"`
45 }
46
47 func (m *ProxyArpAddDel) Reset()               { *m = ProxyArpAddDel{} }
48 func (*ProxyArpAddDel) GetMessageName() string { return "proxy_arp_add_del" }
49 func (*ProxyArpAddDel) GetCrcString() string   { return "85486cbd" }
50 func (*ProxyArpAddDel) GetMessageType() api.MessageType {
51         return api.RequestMessage
52 }
53
54 func (m *ProxyArpAddDel) Size() (size int) {
55         if m == nil {
56                 return 0
57         }
58         size += 1     // m.IsAdd
59         size += 4     // m.Proxy.TableID
60         size += 1 * 4 // m.Proxy.Low
61         size += 1 * 4 // m.Proxy.Hi
62         return size
63 }
64 func (m *ProxyArpAddDel) Marshal(b []byte) ([]byte, error) {
65         if b == nil {
66                 b = make([]byte, m.Size())
67         }
68         buf := codec.NewBuffer(b)
69         buf.EncodeBool(m.IsAdd)
70         buf.EncodeUint32(m.Proxy.TableID)
71         buf.EncodeBytes(m.Proxy.Low[:], 4)
72         buf.EncodeBytes(m.Proxy.Hi[:], 4)
73         return buf.Bytes(), nil
74 }
75 func (m *ProxyArpAddDel) Unmarshal(b []byte) error {
76         buf := codec.NewBuffer(b)
77         m.IsAdd = buf.DecodeBool()
78         m.Proxy.TableID = buf.DecodeUint32()
79         copy(m.Proxy.Low[:], buf.DecodeBytes(4))
80         copy(m.Proxy.Hi[:], buf.DecodeBytes(4))
81         return nil
82 }
83
84 // ProxyArpAddDelReply defines message 'proxy_arp_add_del_reply'.
85 type ProxyArpAddDelReply struct {
86         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
87 }
88
89 func (m *ProxyArpAddDelReply) Reset()               { *m = ProxyArpAddDelReply{} }
90 func (*ProxyArpAddDelReply) GetMessageName() string { return "proxy_arp_add_del_reply" }
91 func (*ProxyArpAddDelReply) GetCrcString() string   { return "e8d4e804" }
92 func (*ProxyArpAddDelReply) GetMessageType() api.MessageType {
93         return api.ReplyMessage
94 }
95
96 func (m *ProxyArpAddDelReply) Size() (size int) {
97         if m == nil {
98                 return 0
99         }
100         size += 4 // m.Retval
101         return size
102 }
103 func (m *ProxyArpAddDelReply) Marshal(b []byte) ([]byte, error) {
104         if b == nil {
105                 b = make([]byte, m.Size())
106         }
107         buf := codec.NewBuffer(b)
108         buf.EncodeInt32(m.Retval)
109         return buf.Bytes(), nil
110 }
111 func (m *ProxyArpAddDelReply) Unmarshal(b []byte) error {
112         buf := codec.NewBuffer(b)
113         m.Retval = buf.DecodeInt32()
114         return nil
115 }
116
117 // ProxyArpDetails defines message 'proxy_arp_details'.
118 type ProxyArpDetails struct {
119         Proxy ProxyArp `binapi:"proxy_arp,name=proxy" json:"proxy,omitempty"`
120 }
121
122 func (m *ProxyArpDetails) Reset()               { *m = ProxyArpDetails{} }
123 func (*ProxyArpDetails) GetMessageName() string { return "proxy_arp_details" }
124 func (*ProxyArpDetails) GetCrcString() string   { return "9228c150" }
125 func (*ProxyArpDetails) GetMessageType() api.MessageType {
126         return api.ReplyMessage
127 }
128
129 func (m *ProxyArpDetails) Size() (size int) {
130         if m == nil {
131                 return 0
132         }
133         size += 4     // m.Proxy.TableID
134         size += 1 * 4 // m.Proxy.Low
135         size += 1 * 4 // m.Proxy.Hi
136         return size
137 }
138 func (m *ProxyArpDetails) Marshal(b []byte) ([]byte, error) {
139         if b == nil {
140                 b = make([]byte, m.Size())
141         }
142         buf := codec.NewBuffer(b)
143         buf.EncodeUint32(m.Proxy.TableID)
144         buf.EncodeBytes(m.Proxy.Low[:], 4)
145         buf.EncodeBytes(m.Proxy.Hi[:], 4)
146         return buf.Bytes(), nil
147 }
148 func (m *ProxyArpDetails) Unmarshal(b []byte) error {
149         buf := codec.NewBuffer(b)
150         m.Proxy.TableID = buf.DecodeUint32()
151         copy(m.Proxy.Low[:], buf.DecodeBytes(4))
152         copy(m.Proxy.Hi[:], buf.DecodeBytes(4))
153         return nil
154 }
155
156 // ProxyArpDump defines message 'proxy_arp_dump'.
157 type ProxyArpDump struct{}
158
159 func (m *ProxyArpDump) Reset()               { *m = ProxyArpDump{} }
160 func (*ProxyArpDump) GetMessageName() string { return "proxy_arp_dump" }
161 func (*ProxyArpDump) GetCrcString() string   { return "51077d14" }
162 func (*ProxyArpDump) GetMessageType() api.MessageType {
163         return api.RequestMessage
164 }
165
166 func (m *ProxyArpDump) Size() (size int) {
167         if m == nil {
168                 return 0
169         }
170         return size
171 }
172 func (m *ProxyArpDump) Marshal(b []byte) ([]byte, error) {
173         if b == nil {
174                 b = make([]byte, m.Size())
175         }
176         buf := codec.NewBuffer(b)
177         return buf.Bytes(), nil
178 }
179 func (m *ProxyArpDump) Unmarshal(b []byte) error {
180         return nil
181 }
182
183 // ProxyArpIntfcDetails defines message 'proxy_arp_intfc_details'.
184 type ProxyArpIntfcDetails struct {
185         SwIfIndex uint32 `binapi:"u32,name=sw_if_index" json:"sw_if_index,omitempty"`
186 }
187
188 func (m *ProxyArpIntfcDetails) Reset()               { *m = ProxyArpIntfcDetails{} }
189 func (*ProxyArpIntfcDetails) GetMessageName() string { return "proxy_arp_intfc_details" }
190 func (*ProxyArpIntfcDetails) GetCrcString() string   { return "f6458e5f" }
191 func (*ProxyArpIntfcDetails) GetMessageType() api.MessageType {
192         return api.ReplyMessage
193 }
194
195 func (m *ProxyArpIntfcDetails) Size() (size int) {
196         if m == nil {
197                 return 0
198         }
199         size += 4 // m.SwIfIndex
200         return size
201 }
202 func (m *ProxyArpIntfcDetails) Marshal(b []byte) ([]byte, error) {
203         if b == nil {
204                 b = make([]byte, m.Size())
205         }
206         buf := codec.NewBuffer(b)
207         buf.EncodeUint32(m.SwIfIndex)
208         return buf.Bytes(), nil
209 }
210 func (m *ProxyArpIntfcDetails) Unmarshal(b []byte) error {
211         buf := codec.NewBuffer(b)
212         m.SwIfIndex = buf.DecodeUint32()
213         return nil
214 }
215
216 // ProxyArpIntfcDump defines message 'proxy_arp_intfc_dump'.
217 type ProxyArpIntfcDump struct{}
218
219 func (m *ProxyArpIntfcDump) Reset()               { *m = ProxyArpIntfcDump{} }
220 func (*ProxyArpIntfcDump) GetMessageName() string { return "proxy_arp_intfc_dump" }
221 func (*ProxyArpIntfcDump) GetCrcString() string   { return "51077d14" }
222 func (*ProxyArpIntfcDump) GetMessageType() api.MessageType {
223         return api.RequestMessage
224 }
225
226 func (m *ProxyArpIntfcDump) Size() (size int) {
227         if m == nil {
228                 return 0
229         }
230         return size
231 }
232 func (m *ProxyArpIntfcDump) Marshal(b []byte) ([]byte, error) {
233         if b == nil {
234                 b = make([]byte, m.Size())
235         }
236         buf := codec.NewBuffer(b)
237         return buf.Bytes(), nil
238 }
239 func (m *ProxyArpIntfcDump) Unmarshal(b []byte) error {
240         return nil
241 }
242
243 // ProxyArpIntfcEnableDisable defines message 'proxy_arp_intfc_enable_disable'.
244 type ProxyArpIntfcEnableDisable struct {
245         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
246         Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
247 }
248
249 func (m *ProxyArpIntfcEnableDisable) Reset()               { *m = ProxyArpIntfcEnableDisable{} }
250 func (*ProxyArpIntfcEnableDisable) GetMessageName() string { return "proxy_arp_intfc_enable_disable" }
251 func (*ProxyArpIntfcEnableDisable) GetCrcString() string   { return "ae6cfcfb" }
252 func (*ProxyArpIntfcEnableDisable) GetMessageType() api.MessageType {
253         return api.RequestMessage
254 }
255
256 func (m *ProxyArpIntfcEnableDisable) Size() (size int) {
257         if m == nil {
258                 return 0
259         }
260         size += 4 // m.SwIfIndex
261         size += 1 // m.Enable
262         return size
263 }
264 func (m *ProxyArpIntfcEnableDisable) Marshal(b []byte) ([]byte, error) {
265         if b == nil {
266                 b = make([]byte, m.Size())
267         }
268         buf := codec.NewBuffer(b)
269         buf.EncodeUint32(uint32(m.SwIfIndex))
270         buf.EncodeBool(m.Enable)
271         return buf.Bytes(), nil
272 }
273 func (m *ProxyArpIntfcEnableDisable) Unmarshal(b []byte) error {
274         buf := codec.NewBuffer(b)
275         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
276         m.Enable = buf.DecodeBool()
277         return nil
278 }
279
280 // ProxyArpIntfcEnableDisableReply defines message 'proxy_arp_intfc_enable_disable_reply'.
281 type ProxyArpIntfcEnableDisableReply struct {
282         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
283 }
284
285 func (m *ProxyArpIntfcEnableDisableReply) Reset() { *m = ProxyArpIntfcEnableDisableReply{} }
286 func (*ProxyArpIntfcEnableDisableReply) GetMessageName() string {
287         return "proxy_arp_intfc_enable_disable_reply"
288 }
289 func (*ProxyArpIntfcEnableDisableReply) GetCrcString() string { return "e8d4e804" }
290 func (*ProxyArpIntfcEnableDisableReply) GetMessageType() api.MessageType {
291         return api.ReplyMessage
292 }
293
294 func (m *ProxyArpIntfcEnableDisableReply) Size() (size int) {
295         if m == nil {
296                 return 0
297         }
298         size += 4 // m.Retval
299         return size
300 }
301 func (m *ProxyArpIntfcEnableDisableReply) Marshal(b []byte) ([]byte, error) {
302         if b == nil {
303                 b = make([]byte, m.Size())
304         }
305         buf := codec.NewBuffer(b)
306         buf.EncodeInt32(m.Retval)
307         return buf.Bytes(), nil
308 }
309 func (m *ProxyArpIntfcEnableDisableReply) Unmarshal(b []byte) error {
310         buf := codec.NewBuffer(b)
311         m.Retval = buf.DecodeInt32()
312         return nil
313 }
314
315 func init() { file_arp_binapi_init() }
316 func file_arp_binapi_init() {
317         api.RegisterMessage((*ProxyArpAddDel)(nil), "proxy_arp_add_del_85486cbd")
318         api.RegisterMessage((*ProxyArpAddDelReply)(nil), "proxy_arp_add_del_reply_e8d4e804")
319         api.RegisterMessage((*ProxyArpDetails)(nil), "proxy_arp_details_9228c150")
320         api.RegisterMessage((*ProxyArpDump)(nil), "proxy_arp_dump_51077d14")
321         api.RegisterMessage((*ProxyArpIntfcDetails)(nil), "proxy_arp_intfc_details_f6458e5f")
322         api.RegisterMessage((*ProxyArpIntfcDump)(nil), "proxy_arp_intfc_dump_51077d14")
323         api.RegisterMessage((*ProxyArpIntfcEnableDisable)(nil), "proxy_arp_intfc_enable_disable_ae6cfcfb")
324         api.RegisterMessage((*ProxyArpIntfcEnableDisableReply)(nil), "proxy_arp_intfc_enable_disable_reply_e8d4e804")
325 }
326
327 // Messages returns list of all messages in this module.
328 func AllMessages() []api.Message {
329         return []api.Message{
330                 (*ProxyArpAddDel)(nil),
331                 (*ProxyArpAddDelReply)(nil),
332                 (*ProxyArpDetails)(nil),
333                 (*ProxyArpDump)(nil),
334                 (*ProxyArpIntfcDetails)(nil),
335                 (*ProxyArpIntfcDump)(nil),
336                 (*ProxyArpIntfcEnableDisable)(nil),
337                 (*ProxyArpIntfcEnableDisableReply)(nil),
338         }
339 }