Improve binapi generator
[govpp.git] / binapi / ip_neighbor / ip_neighbor.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/ip_neighbor.api.json
6
7 // Package ip_neighbor contains generated bindings for API file ip_neighbor.api.
8 //
9 // Contents:
10 //   1 enum
11 //   1 struct
12 //  15 messages
13 //
14 package ip_neighbor
15
16 import (
17         api "git.fd.io/govpp.git/api"
18         ethernet_types "git.fd.io/govpp.git/binapi/ethernet_types"
19         interface_types "git.fd.io/govpp.git/binapi/interface_types"
20         ip_types "git.fd.io/govpp.git/binapi/ip_types"
21         codec "git.fd.io/govpp.git/codec"
22         "strconv"
23 )
24
25 // This is a compile-time assertion to ensure that this generated file
26 // is compatible with the GoVPP api package it is being compiled against.
27 // A compilation error at this line likely means your copy of the
28 // GoVPP api package needs to be updated.
29 const _ = api.GoVppAPIPackageIsVersion2
30
31 const (
32         APIFile    = "ip_neighbor"
33         APIVersion = "1.0.0"
34         VersionCrc = 0xe6512b94
35 )
36
37 // IPNeighborFlags defines enum 'ip_neighbor_flags'.
38 type IPNeighborFlags uint8
39
40 const (
41         IP_API_NEIGHBOR_FLAG_NONE         IPNeighborFlags = 0
42         IP_API_NEIGHBOR_FLAG_STATIC       IPNeighborFlags = 1
43         IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY IPNeighborFlags = 2
44 )
45
46 var (
47         IPNeighborFlags_name = map[uint8]string{
48                 0: "IP_API_NEIGHBOR_FLAG_NONE",
49                 1: "IP_API_NEIGHBOR_FLAG_STATIC",
50                 2: "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY",
51         }
52         IPNeighborFlags_value = map[string]uint8{
53                 "IP_API_NEIGHBOR_FLAG_NONE":         0,
54                 "IP_API_NEIGHBOR_FLAG_STATIC":       1,
55                 "IP_API_NEIGHBOR_FLAG_NO_FIB_ENTRY": 2,
56         }
57 )
58
59 func (x IPNeighborFlags) String() string {
60         s, ok := IPNeighborFlags_name[uint8(x)]
61         if ok {
62                 return s
63         }
64         str := func(n uint8) string {
65                 s, ok := IPNeighborFlags_name[uint8(n)]
66                 if ok {
67                         return s
68                 }
69                 return "IPNeighborFlags(" + strconv.Itoa(int(n)) + ")"
70         }
71         for i := uint8(0); i <= 8; i++ {
72                 val := uint8(x)
73                 if val&(1<<i) != 0 {
74                         if s != "" {
75                                 s += "|"
76                         }
77                         s += str(1 << i)
78                 }
79         }
80         if s == "" {
81                 return str(uint8(x))
82         }
83         return s
84 }
85
86 // IPNeighbor defines type 'ip_neighbor'.
87 type IPNeighbor struct {
88         SwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
89         Flags      IPNeighborFlags                `binapi:"ip_neighbor_flags,name=flags" json:"flags,omitempty"`
90         MacAddress ethernet_types.MacAddress      `binapi:"mac_address,name=mac_address" json:"mac_address,omitempty"`
91         IPAddress  ip_types.Address               `binapi:"address,name=ip_address" json:"ip_address,omitempty"`
92 }
93
94 // IPNeighborAddDel defines message 'ip_neighbor_add_del'.
95 type IPNeighborAddDel struct {
96         IsAdd    bool       `binapi:"bool,name=is_add" json:"is_add,omitempty"`
97         Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
98 }
99
100 func (m *IPNeighborAddDel) Reset()               { *m = IPNeighborAddDel{} }
101 func (*IPNeighborAddDel) GetMessageName() string { return "ip_neighbor_add_del" }
102 func (*IPNeighborAddDel) GetCrcString() string   { return "105518b6" }
103 func (*IPNeighborAddDel) GetMessageType() api.MessageType {
104         return api.RequestMessage
105 }
106
107 func (m *IPNeighborAddDel) Size() int {
108         if m == nil {
109                 return 0
110         }
111         var size int
112         size += 1      // m.IsAdd
113         size += 4      // m.Neighbor.SwIfIndex
114         size += 1      // m.Neighbor.Flags
115         size += 1 * 6  // m.Neighbor.MacAddress
116         size += 1      // m.Neighbor.IPAddress.Af
117         size += 1 * 16 // m.Neighbor.IPAddress.Un
118         return size
119 }
120 func (m *IPNeighborAddDel) Marshal(b []byte) ([]byte, error) {
121         var buf *codec.Buffer
122         if b == nil {
123                 buf = codec.NewBuffer(make([]byte, m.Size()))
124         } else {
125                 buf = codec.NewBuffer(b)
126         }
127         buf.EncodeBool(m.IsAdd)
128         buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex))
129         buf.EncodeUint8(uint8(m.Neighbor.Flags))
130         buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
131         buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
132         buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
133         return buf.Bytes(), nil
134 }
135 func (m *IPNeighborAddDel) Unmarshal(b []byte) error {
136         buf := codec.NewBuffer(b)
137         m.IsAdd = buf.DecodeBool()
138         m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
139         m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
140         copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
141         m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
142         copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
143         return nil
144 }
145
146 // IPNeighborAddDelReply defines message 'ip_neighbor_add_del_reply'.
147 type IPNeighborAddDelReply struct {
148         Retval     int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
149         StatsIndex uint32 `binapi:"u32,name=stats_index" json:"stats_index,omitempty"`
150 }
151
152 func (m *IPNeighborAddDelReply) Reset()               { *m = IPNeighborAddDelReply{} }
153 func (*IPNeighborAddDelReply) GetMessageName() string { return "ip_neighbor_add_del_reply" }
154 func (*IPNeighborAddDelReply) GetCrcString() string   { return "1992deab" }
155 func (*IPNeighborAddDelReply) GetMessageType() api.MessageType {
156         return api.ReplyMessage
157 }
158
159 func (m *IPNeighborAddDelReply) Size() int {
160         if m == nil {
161                 return 0
162         }
163         var size int
164         size += 4 // m.Retval
165         size += 4 // m.StatsIndex
166         return size
167 }
168 func (m *IPNeighborAddDelReply) Marshal(b []byte) ([]byte, error) {
169         var buf *codec.Buffer
170         if b == nil {
171                 buf = codec.NewBuffer(make([]byte, m.Size()))
172         } else {
173                 buf = codec.NewBuffer(b)
174         }
175         buf.EncodeUint32(uint32(m.Retval))
176         buf.EncodeUint32(uint32(m.StatsIndex))
177         return buf.Bytes(), nil
178 }
179 func (m *IPNeighborAddDelReply) Unmarshal(b []byte) error {
180         buf := codec.NewBuffer(b)
181         m.Retval = int32(buf.DecodeUint32())
182         m.StatsIndex = buf.DecodeUint32()
183         return nil
184 }
185
186 // IPNeighborConfig defines message 'ip_neighbor_config'.
187 type IPNeighborConfig struct {
188         Af        ip_types.AddressFamily `binapi:"address_family,name=af" json:"af,omitempty"`
189         MaxNumber uint32                 `binapi:"u32,name=max_number" json:"max_number,omitempty"`
190         MaxAge    uint32                 `binapi:"u32,name=max_age" json:"max_age,omitempty"`
191         Recycle   bool                   `binapi:"bool,name=recycle" json:"recycle,omitempty"`
192 }
193
194 func (m *IPNeighborConfig) Reset()               { *m = IPNeighborConfig{} }
195 func (*IPNeighborConfig) GetMessageName() string { return "ip_neighbor_config" }
196 func (*IPNeighborConfig) GetCrcString() string   { return "f4a5cf44" }
197 func (*IPNeighborConfig) GetMessageType() api.MessageType {
198         return api.RequestMessage
199 }
200
201 func (m *IPNeighborConfig) Size() int {
202         if m == nil {
203                 return 0
204         }
205         var size int
206         size += 1 // m.Af
207         size += 4 // m.MaxNumber
208         size += 4 // m.MaxAge
209         size += 1 // m.Recycle
210         return size
211 }
212 func (m *IPNeighborConfig) Marshal(b []byte) ([]byte, error) {
213         var buf *codec.Buffer
214         if b == nil {
215                 buf = codec.NewBuffer(make([]byte, m.Size()))
216         } else {
217                 buf = codec.NewBuffer(b)
218         }
219         buf.EncodeUint8(uint8(m.Af))
220         buf.EncodeUint32(uint32(m.MaxNumber))
221         buf.EncodeUint32(uint32(m.MaxAge))
222         buf.EncodeBool(m.Recycle)
223         return buf.Bytes(), nil
224 }
225 func (m *IPNeighborConfig) Unmarshal(b []byte) error {
226         buf := codec.NewBuffer(b)
227         m.Af = ip_types.AddressFamily(buf.DecodeUint8())
228         m.MaxNumber = buf.DecodeUint32()
229         m.MaxAge = buf.DecodeUint32()
230         m.Recycle = buf.DecodeBool()
231         return nil
232 }
233
234 // IPNeighborConfigReply defines message 'ip_neighbor_config_reply'.
235 type IPNeighborConfigReply struct {
236         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
237 }
238
239 func (m *IPNeighborConfigReply) Reset()               { *m = IPNeighborConfigReply{} }
240 func (*IPNeighborConfigReply) GetMessageName() string { return "ip_neighbor_config_reply" }
241 func (*IPNeighborConfigReply) GetCrcString() string   { return "e8d4e804" }
242 func (*IPNeighborConfigReply) GetMessageType() api.MessageType {
243         return api.ReplyMessage
244 }
245
246 func (m *IPNeighborConfigReply) Size() int {
247         if m == nil {
248                 return 0
249         }
250         var size int
251         size += 4 // m.Retval
252         return size
253 }
254 func (m *IPNeighborConfigReply) Marshal(b []byte) ([]byte, error) {
255         var buf *codec.Buffer
256         if b == nil {
257                 buf = codec.NewBuffer(make([]byte, m.Size()))
258         } else {
259                 buf = codec.NewBuffer(b)
260         }
261         buf.EncodeUint32(uint32(m.Retval))
262         return buf.Bytes(), nil
263 }
264 func (m *IPNeighborConfigReply) Unmarshal(b []byte) error {
265         buf := codec.NewBuffer(b)
266         m.Retval = int32(buf.DecodeUint32())
267         return nil
268 }
269
270 // IPNeighborDetails defines message 'ip_neighbor_details'.
271 type IPNeighborDetails struct {
272         Age      float64    `binapi:"f64,name=age" json:"age,omitempty"`
273         Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
274 }
275
276 func (m *IPNeighborDetails) Reset()               { *m = IPNeighborDetails{} }
277 func (*IPNeighborDetails) GetMessageName() string { return "ip_neighbor_details" }
278 func (*IPNeighborDetails) GetCrcString() string   { return "870e80b9" }
279 func (*IPNeighborDetails) GetMessageType() api.MessageType {
280         return api.ReplyMessage
281 }
282
283 func (m *IPNeighborDetails) Size() int {
284         if m == nil {
285                 return 0
286         }
287         var size int
288         size += 8      // m.Age
289         size += 4      // m.Neighbor.SwIfIndex
290         size += 1      // m.Neighbor.Flags
291         size += 1 * 6  // m.Neighbor.MacAddress
292         size += 1      // m.Neighbor.IPAddress.Af
293         size += 1 * 16 // m.Neighbor.IPAddress.Un
294         return size
295 }
296 func (m *IPNeighborDetails) Marshal(b []byte) ([]byte, error) {
297         var buf *codec.Buffer
298         if b == nil {
299                 buf = codec.NewBuffer(make([]byte, m.Size()))
300         } else {
301                 buf = codec.NewBuffer(b)
302         }
303         buf.EncodeFloat64(float64(m.Age))
304         buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex))
305         buf.EncodeUint8(uint8(m.Neighbor.Flags))
306         buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
307         buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
308         buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
309         return buf.Bytes(), nil
310 }
311 func (m *IPNeighborDetails) Unmarshal(b []byte) error {
312         buf := codec.NewBuffer(b)
313         m.Age = float64(buf.DecodeFloat64())
314         m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
315         m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
316         copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
317         m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
318         copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
319         return nil
320 }
321
322 // IPNeighborDump defines message 'ip_neighbor_dump'.
323 type IPNeighborDump struct {
324         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
325         Af        ip_types.AddressFamily         `binapi:"address_family,name=af" json:"af,omitempty"`
326 }
327
328 func (m *IPNeighborDump) Reset()               { *m = IPNeighborDump{} }
329 func (*IPNeighborDump) GetMessageName() string { return "ip_neighbor_dump" }
330 func (*IPNeighborDump) GetCrcString() string   { return "cd831298" }
331 func (*IPNeighborDump) GetMessageType() api.MessageType {
332         return api.RequestMessage
333 }
334
335 func (m *IPNeighborDump) Size() int {
336         if m == nil {
337                 return 0
338         }
339         var size int
340         size += 4 // m.SwIfIndex
341         size += 1 // m.Af
342         return size
343 }
344 func (m *IPNeighborDump) Marshal(b []byte) ([]byte, error) {
345         var buf *codec.Buffer
346         if b == nil {
347                 buf = codec.NewBuffer(make([]byte, m.Size()))
348         } else {
349                 buf = codec.NewBuffer(b)
350         }
351         buf.EncodeUint32(uint32(m.SwIfIndex))
352         buf.EncodeUint8(uint8(m.Af))
353         return buf.Bytes(), nil
354 }
355 func (m *IPNeighborDump) Unmarshal(b []byte) error {
356         buf := codec.NewBuffer(b)
357         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
358         m.Af = ip_types.AddressFamily(buf.DecodeUint8())
359         return nil
360 }
361
362 // IPNeighborEvent defines message 'ip_neighbor_event'.
363 type IPNeighborEvent struct {
364         PID      uint32     `binapi:"u32,name=pid" json:"pid,omitempty"`
365         Neighbor IPNeighbor `binapi:"ip_neighbor,name=neighbor" json:"neighbor,omitempty"`
366 }
367
368 func (m *IPNeighborEvent) Reset()               { *m = IPNeighborEvent{} }
369 func (*IPNeighborEvent) GetMessageName() string { return "ip_neighbor_event" }
370 func (*IPNeighborEvent) GetCrcString() string   { return "83933131" }
371 func (*IPNeighborEvent) GetMessageType() api.MessageType {
372         return api.EventMessage
373 }
374
375 func (m *IPNeighborEvent) Size() int {
376         if m == nil {
377                 return 0
378         }
379         var size int
380         size += 4      // m.PID
381         size += 4      // m.Neighbor.SwIfIndex
382         size += 1      // m.Neighbor.Flags
383         size += 1 * 6  // m.Neighbor.MacAddress
384         size += 1      // m.Neighbor.IPAddress.Af
385         size += 1 * 16 // m.Neighbor.IPAddress.Un
386         return size
387 }
388 func (m *IPNeighborEvent) Marshal(b []byte) ([]byte, error) {
389         var buf *codec.Buffer
390         if b == nil {
391                 buf = codec.NewBuffer(make([]byte, m.Size()))
392         } else {
393                 buf = codec.NewBuffer(b)
394         }
395         buf.EncodeUint32(uint32(m.PID))
396         buf.EncodeUint32(uint32(m.Neighbor.SwIfIndex))
397         buf.EncodeUint8(uint8(m.Neighbor.Flags))
398         buf.EncodeBytes(m.Neighbor.MacAddress[:], 6)
399         buf.EncodeUint8(uint8(m.Neighbor.IPAddress.Af))
400         buf.EncodeBytes(m.Neighbor.IPAddress.Un.XXX_UnionData[:], 0)
401         return buf.Bytes(), nil
402 }
403 func (m *IPNeighborEvent) Unmarshal(b []byte) error {
404         buf := codec.NewBuffer(b)
405         m.PID = buf.DecodeUint32()
406         m.Neighbor.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
407         m.Neighbor.Flags = IPNeighborFlags(buf.DecodeUint8())
408         copy(m.Neighbor.MacAddress[:], buf.DecodeBytes(6))
409         m.Neighbor.IPAddress.Af = ip_types.AddressFamily(buf.DecodeUint8())
410         copy(m.Neighbor.IPAddress.Un.XXX_UnionData[:], buf.DecodeBytes(16))
411         return nil
412 }
413
414 // IPNeighborFlush defines message 'ip_neighbor_flush'.
415 type IPNeighborFlush struct {
416         Af        ip_types.AddressFamily         `binapi:"address_family,name=af" json:"af,omitempty"`
417         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
418 }
419
420 func (m *IPNeighborFlush) Reset()               { *m = IPNeighborFlush{} }
421 func (*IPNeighborFlush) GetMessageName() string { return "ip_neighbor_flush" }
422 func (*IPNeighborFlush) GetCrcString() string   { return "16aa35d2" }
423 func (*IPNeighborFlush) GetMessageType() api.MessageType {
424         return api.RequestMessage
425 }
426
427 func (m *IPNeighborFlush) Size() int {
428         if m == nil {
429                 return 0
430         }
431         var size int
432         size += 1 // m.Af
433         size += 4 // m.SwIfIndex
434         return size
435 }
436 func (m *IPNeighborFlush) Marshal(b []byte) ([]byte, error) {
437         var buf *codec.Buffer
438         if b == nil {
439                 buf = codec.NewBuffer(make([]byte, m.Size()))
440         } else {
441                 buf = codec.NewBuffer(b)
442         }
443         buf.EncodeUint8(uint8(m.Af))
444         buf.EncodeUint32(uint32(m.SwIfIndex))
445         return buf.Bytes(), nil
446 }
447 func (m *IPNeighborFlush) Unmarshal(b []byte) error {
448         buf := codec.NewBuffer(b)
449         m.Af = ip_types.AddressFamily(buf.DecodeUint8())
450         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
451         return nil
452 }
453
454 // IPNeighborFlushReply defines message 'ip_neighbor_flush_reply'.
455 type IPNeighborFlushReply struct {
456         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
457 }
458
459 func (m *IPNeighborFlushReply) Reset()               { *m = IPNeighborFlushReply{} }
460 func (*IPNeighborFlushReply) GetMessageName() string { return "ip_neighbor_flush_reply" }
461 func (*IPNeighborFlushReply) GetCrcString() string   { return "e8d4e804" }
462 func (*IPNeighborFlushReply) GetMessageType() api.MessageType {
463         return api.ReplyMessage
464 }
465
466 func (m *IPNeighborFlushReply) Size() int {
467         if m == nil {
468                 return 0
469         }
470         var size int
471         size += 4 // m.Retval
472         return size
473 }
474 func (m *IPNeighborFlushReply) Marshal(b []byte) ([]byte, error) {
475         var buf *codec.Buffer
476         if b == nil {
477                 buf = codec.NewBuffer(make([]byte, m.Size()))
478         } else {
479                 buf = codec.NewBuffer(b)
480         }
481         buf.EncodeUint32(uint32(m.Retval))
482         return buf.Bytes(), nil
483 }
484 func (m *IPNeighborFlushReply) Unmarshal(b []byte) error {
485         buf := codec.NewBuffer(b)
486         m.Retval = int32(buf.DecodeUint32())
487         return nil
488 }
489
490 // IPNeighborReplaceBegin defines message 'ip_neighbor_replace_begin'.
491 type IPNeighborReplaceBegin struct{}
492
493 func (m *IPNeighborReplaceBegin) Reset()               { *m = IPNeighborReplaceBegin{} }
494 func (*IPNeighborReplaceBegin) GetMessageName() string { return "ip_neighbor_replace_begin" }
495 func (*IPNeighborReplaceBegin) GetCrcString() string   { return "51077d14" }
496 func (*IPNeighborReplaceBegin) GetMessageType() api.MessageType {
497         return api.RequestMessage
498 }
499
500 func (m *IPNeighborReplaceBegin) Size() int {
501         if m == nil {
502                 return 0
503         }
504         var size int
505         return size
506 }
507 func (m *IPNeighborReplaceBegin) Marshal(b []byte) ([]byte, error) {
508         var buf *codec.Buffer
509         if b == nil {
510                 buf = codec.NewBuffer(make([]byte, m.Size()))
511         } else {
512                 buf = codec.NewBuffer(b)
513         }
514         return buf.Bytes(), nil
515 }
516 func (m *IPNeighborReplaceBegin) Unmarshal(b []byte) error {
517         return nil
518 }
519
520 // IPNeighborReplaceBeginReply defines message 'ip_neighbor_replace_begin_reply'.
521 type IPNeighborReplaceBeginReply struct {
522         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
523 }
524
525 func (m *IPNeighborReplaceBeginReply) Reset()               { *m = IPNeighborReplaceBeginReply{} }
526 func (*IPNeighborReplaceBeginReply) GetMessageName() string { return "ip_neighbor_replace_begin_reply" }
527 func (*IPNeighborReplaceBeginReply) GetCrcString() string   { return "e8d4e804" }
528 func (*IPNeighborReplaceBeginReply) GetMessageType() api.MessageType {
529         return api.ReplyMessage
530 }
531
532 func (m *IPNeighborReplaceBeginReply) Size() int {
533         if m == nil {
534                 return 0
535         }
536         var size int
537         size += 4 // m.Retval
538         return size
539 }
540 func (m *IPNeighborReplaceBeginReply) Marshal(b []byte) ([]byte, error) {
541         var buf *codec.Buffer
542         if b == nil {
543                 buf = codec.NewBuffer(make([]byte, m.Size()))
544         } else {
545                 buf = codec.NewBuffer(b)
546         }
547         buf.EncodeUint32(uint32(m.Retval))
548         return buf.Bytes(), nil
549 }
550 func (m *IPNeighborReplaceBeginReply) Unmarshal(b []byte) error {
551         buf := codec.NewBuffer(b)
552         m.Retval = int32(buf.DecodeUint32())
553         return nil
554 }
555
556 // IPNeighborReplaceEnd defines message 'ip_neighbor_replace_end'.
557 type IPNeighborReplaceEnd struct{}
558
559 func (m *IPNeighborReplaceEnd) Reset()               { *m = IPNeighborReplaceEnd{} }
560 func (*IPNeighborReplaceEnd) GetMessageName() string { return "ip_neighbor_replace_end" }
561 func (*IPNeighborReplaceEnd) GetCrcString() string   { return "51077d14" }
562 func (*IPNeighborReplaceEnd) GetMessageType() api.MessageType {
563         return api.RequestMessage
564 }
565
566 func (m *IPNeighborReplaceEnd) Size() int {
567         if m == nil {
568                 return 0
569         }
570         var size int
571         return size
572 }
573 func (m *IPNeighborReplaceEnd) Marshal(b []byte) ([]byte, error) {
574         var buf *codec.Buffer
575         if b == nil {
576                 buf = codec.NewBuffer(make([]byte, m.Size()))
577         } else {
578                 buf = codec.NewBuffer(b)
579         }
580         return buf.Bytes(), nil
581 }
582 func (m *IPNeighborReplaceEnd) Unmarshal(b []byte) error {
583         return nil
584 }
585
586 // IPNeighborReplaceEndReply defines message 'ip_neighbor_replace_end_reply'.
587 type IPNeighborReplaceEndReply struct {
588         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
589 }
590
591 func (m *IPNeighborReplaceEndReply) Reset()               { *m = IPNeighborReplaceEndReply{} }
592 func (*IPNeighborReplaceEndReply) GetMessageName() string { return "ip_neighbor_replace_end_reply" }
593 func (*IPNeighborReplaceEndReply) GetCrcString() string   { return "e8d4e804" }
594 func (*IPNeighborReplaceEndReply) GetMessageType() api.MessageType {
595         return api.ReplyMessage
596 }
597
598 func (m *IPNeighborReplaceEndReply) Size() int {
599         if m == nil {
600                 return 0
601         }
602         var size int
603         size += 4 // m.Retval
604         return size
605 }
606 func (m *IPNeighborReplaceEndReply) Marshal(b []byte) ([]byte, error) {
607         var buf *codec.Buffer
608         if b == nil {
609                 buf = codec.NewBuffer(make([]byte, m.Size()))
610         } else {
611                 buf = codec.NewBuffer(b)
612         }
613         buf.EncodeUint32(uint32(m.Retval))
614         return buf.Bytes(), nil
615 }
616 func (m *IPNeighborReplaceEndReply) Unmarshal(b []byte) error {
617         buf := codec.NewBuffer(b)
618         m.Retval = int32(buf.DecodeUint32())
619         return nil
620 }
621
622 // WantIPNeighborEvents defines message 'want_ip_neighbor_events'.
623 type WantIPNeighborEvents struct {
624         Enable    bool                           `binapi:"bool,name=enable" json:"enable,omitempty"`
625         PID       uint32                         `binapi:"u32,name=pid" json:"pid,omitempty"`
626         IP        ip_types.Address               `binapi:"address,name=ip" json:"ip,omitempty"`
627         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index,default=%!s(float64=4.294967295e+09)" json:"sw_if_index,omitempty"`
628 }
629
630 func (m *WantIPNeighborEvents) Reset()               { *m = WantIPNeighborEvents{} }
631 func (*WantIPNeighborEvents) GetMessageName() string { return "want_ip_neighbor_events" }
632 func (*WantIPNeighborEvents) GetCrcString() string   { return "1a312870" }
633 func (*WantIPNeighborEvents) GetMessageType() api.MessageType {
634         return api.RequestMessage
635 }
636
637 func (m *WantIPNeighborEvents) Size() int {
638         if m == nil {
639                 return 0
640         }
641         var size int
642         size += 1      // m.Enable
643         size += 4      // m.PID
644         size += 1      // m.IP.Af
645         size += 1 * 16 // m.IP.Un
646         size += 4      // m.SwIfIndex
647         return size
648 }
649 func (m *WantIPNeighborEvents) Marshal(b []byte) ([]byte, error) {
650         var buf *codec.Buffer
651         if b == nil {
652                 buf = codec.NewBuffer(make([]byte, m.Size()))
653         } else {
654                 buf = codec.NewBuffer(b)
655         }
656         buf.EncodeBool(m.Enable)
657         buf.EncodeUint32(uint32(m.PID))
658         buf.EncodeUint8(uint8(m.IP.Af))
659         buf.EncodeBytes(m.IP.Un.XXX_UnionData[:], 0)
660         buf.EncodeUint32(uint32(m.SwIfIndex))
661         return buf.Bytes(), nil
662 }
663 func (m *WantIPNeighborEvents) Unmarshal(b []byte) error {
664         buf := codec.NewBuffer(b)
665         m.Enable = buf.DecodeBool()
666         m.PID = buf.DecodeUint32()
667         m.IP.Af = ip_types.AddressFamily(buf.DecodeUint8())
668         copy(m.IP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
669         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
670         return nil
671 }
672
673 // WantIPNeighborEventsReply defines message 'want_ip_neighbor_events_reply'.
674 type WantIPNeighborEventsReply struct {
675         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
676 }
677
678 func (m *WantIPNeighborEventsReply) Reset()               { *m = WantIPNeighborEventsReply{} }
679 func (*WantIPNeighborEventsReply) GetMessageName() string { return "want_ip_neighbor_events_reply" }
680 func (*WantIPNeighborEventsReply) GetCrcString() string   { return "e8d4e804" }
681 func (*WantIPNeighborEventsReply) GetMessageType() api.MessageType {
682         return api.ReplyMessage
683 }
684
685 func (m *WantIPNeighborEventsReply) Size() int {
686         if m == nil {
687                 return 0
688         }
689         var size int
690         size += 4 // m.Retval
691         return size
692 }
693 func (m *WantIPNeighborEventsReply) Marshal(b []byte) ([]byte, error) {
694         var buf *codec.Buffer
695         if b == nil {
696                 buf = codec.NewBuffer(make([]byte, m.Size()))
697         } else {
698                 buf = codec.NewBuffer(b)
699         }
700         buf.EncodeUint32(uint32(m.Retval))
701         return buf.Bytes(), nil
702 }
703 func (m *WantIPNeighborEventsReply) Unmarshal(b []byte) error {
704         buf := codec.NewBuffer(b)
705         m.Retval = int32(buf.DecodeUint32())
706         return nil
707 }
708
709 func init() { file_ip_neighbor_binapi_init() }
710 func file_ip_neighbor_binapi_init() {
711         api.RegisterMessage((*IPNeighborAddDel)(nil), "ip_neighbor_add_del_105518b6")
712         api.RegisterMessage((*IPNeighborAddDelReply)(nil), "ip_neighbor_add_del_reply_1992deab")
713         api.RegisterMessage((*IPNeighborConfig)(nil), "ip_neighbor_config_f4a5cf44")
714         api.RegisterMessage((*IPNeighborConfigReply)(nil), "ip_neighbor_config_reply_e8d4e804")
715         api.RegisterMessage((*IPNeighborDetails)(nil), "ip_neighbor_details_870e80b9")
716         api.RegisterMessage((*IPNeighborDump)(nil), "ip_neighbor_dump_cd831298")
717         api.RegisterMessage((*IPNeighborEvent)(nil), "ip_neighbor_event_83933131")
718         api.RegisterMessage((*IPNeighborFlush)(nil), "ip_neighbor_flush_16aa35d2")
719         api.RegisterMessage((*IPNeighborFlushReply)(nil), "ip_neighbor_flush_reply_e8d4e804")
720         api.RegisterMessage((*IPNeighborReplaceBegin)(nil), "ip_neighbor_replace_begin_51077d14")
721         api.RegisterMessage((*IPNeighborReplaceBeginReply)(nil), "ip_neighbor_replace_begin_reply_e8d4e804")
722         api.RegisterMessage((*IPNeighborReplaceEnd)(nil), "ip_neighbor_replace_end_51077d14")
723         api.RegisterMessage((*IPNeighborReplaceEndReply)(nil), "ip_neighbor_replace_end_reply_e8d4e804")
724         api.RegisterMessage((*WantIPNeighborEvents)(nil), "want_ip_neighbor_events_1a312870")
725         api.RegisterMessage((*WantIPNeighborEventsReply)(nil), "want_ip_neighbor_events_reply_e8d4e804")
726 }
727
728 // Messages returns list of all messages in this module.
729 func AllMessages() []api.Message {
730         return []api.Message{
731                 (*IPNeighborAddDel)(nil),
732                 (*IPNeighborAddDelReply)(nil),
733                 (*IPNeighborConfig)(nil),
734                 (*IPNeighborConfigReply)(nil),
735                 (*IPNeighborDetails)(nil),
736                 (*IPNeighborDump)(nil),
737                 (*IPNeighborEvent)(nil),
738                 (*IPNeighborFlush)(nil),
739                 (*IPNeighborFlushReply)(nil),
740                 (*IPNeighborReplaceBegin)(nil),
741                 (*IPNeighborReplaceBeginReply)(nil),
742                 (*IPNeighborReplaceEnd)(nil),
743                 (*IPNeighborReplaceEndReply)(nil),
744                 (*WantIPNeighborEvents)(nil),
745                 (*WantIPNeighborEventsReply)(nil),
746         }
747 }