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