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