binapigen: fix union size
[govpp.git] / binapi / ip6_nd / ip6_nd.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/ip6_nd.api.json
6
7 // Package ip6_nd contains generated bindings for API file ip6_nd.api.
8 //
9 // Contents:
10 //   1 struct
11 //  13 messages
12 //
13 package ip6_nd
14
15 import (
16         api "git.fd.io/govpp.git/api"
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    = "ip6_nd"
30         APIVersion = "1.0.0"
31         VersionCrc = 0x877c10de
32 )
33
34 // IP6RaPrefixInfo defines type 'ip6_ra_prefix_info'.
35 type IP6RaPrefixInfo struct {
36         Prefix        ip_types.Prefix `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
37         Flags         uint8           `binapi:"u8,name=flags" json:"flags,omitempty"`
38         ValidTime     uint32          `binapi:"u32,name=valid_time" json:"valid_time,omitempty"`
39         PreferredTime uint32          `binapi:"u32,name=preferred_time" json:"preferred_time,omitempty"`
40 }
41
42 // IP6RaEvent defines message 'ip6_ra_event'.
43 type IP6RaEvent struct {
44         PID                                                 uint32                         `binapi:"u32,name=pid" json:"pid,omitempty"`
45         SwIfIndex                                           interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
46         RouterAddr                                          ip_types.IP6Address            `binapi:"ip6_address,name=router_addr" json:"router_addr,omitempty"`
47         CurrentHopLimit                                     uint8                          `binapi:"u8,name=current_hop_limit" json:"current_hop_limit,omitempty"`
48         Flags                                               uint8                          `binapi:"u8,name=flags" json:"flags,omitempty"`
49         RouterLifetimeInSec                                 uint16                         `binapi:"u16,name=router_lifetime_in_sec" json:"router_lifetime_in_sec,omitempty"`
50         NeighborReachableTimeInMsec                         uint32                         `binapi:"u32,name=neighbor_reachable_time_in_msec" json:"neighbor_reachable_time_in_msec,omitempty"`
51         TimeInMsecBetweenRetransmittedNeighborSolicitations uint32                         `binapi:"u32,name=time_in_msec_between_retransmitted_neighbor_solicitations" json:"time_in_msec_between_retransmitted_neighbor_solicitations,omitempty"`
52         NPrefixes                                           uint32                         `binapi:"u32,name=n_prefixes" json:"-"`
53         Prefixes                                            []IP6RaPrefixInfo              `binapi:"ip6_ra_prefix_info[n_prefixes],name=prefixes" json:"prefixes,omitempty"`
54 }
55
56 func (m *IP6RaEvent) Reset()               { *m = IP6RaEvent{} }
57 func (*IP6RaEvent) GetMessageName() string { return "ip6_ra_event" }
58 func (*IP6RaEvent) GetCrcString() string   { return "47e8cfbe" }
59 func (*IP6RaEvent) GetMessageType() api.MessageType {
60         return api.EventMessage
61 }
62
63 func (m *IP6RaEvent) Size() (size int) {
64         if m == nil {
65                 return 0
66         }
67         size += 4      // m.PID
68         size += 4      // m.SwIfIndex
69         size += 1 * 16 // m.RouterAddr
70         size += 1      // m.CurrentHopLimit
71         size += 1      // m.Flags
72         size += 2      // m.RouterLifetimeInSec
73         size += 4      // m.NeighborReachableTimeInMsec
74         size += 4      // m.TimeInMsecBetweenRetransmittedNeighborSolicitations
75         size += 4      // m.NPrefixes
76         for j1 := 0; j1 < len(m.Prefixes); j1++ {
77                 var s1 IP6RaPrefixInfo
78                 _ = s1
79                 if j1 < len(m.Prefixes) {
80                         s1 = m.Prefixes[j1]
81                 }
82                 size += 1      // s1.Prefix.Address.Af
83                 size += 1 * 16 // s1.Prefix.Address.Un
84                 size += 1      // s1.Prefix.Len
85                 size += 1      // s1.Flags
86                 size += 4      // s1.ValidTime
87                 size += 4      // s1.PreferredTime
88         }
89         return size
90 }
91 func (m *IP6RaEvent) Marshal(b []byte) ([]byte, error) {
92         if b == nil {
93                 b = make([]byte, m.Size())
94         }
95         buf := codec.NewBuffer(b)
96         buf.EncodeUint32(m.PID)
97         buf.EncodeUint32(uint32(m.SwIfIndex))
98         buf.EncodeBytes(m.RouterAddr[:], 16)
99         buf.EncodeUint8(m.CurrentHopLimit)
100         buf.EncodeUint8(m.Flags)
101         buf.EncodeUint16(m.RouterLifetimeInSec)
102         buf.EncodeUint32(m.NeighborReachableTimeInMsec)
103         buf.EncodeUint32(m.TimeInMsecBetweenRetransmittedNeighborSolicitations)
104         buf.EncodeUint32(uint32(len(m.Prefixes)))
105         for j0 := 0; j0 < len(m.Prefixes); j0++ {
106                 var v0 IP6RaPrefixInfo // Prefixes
107                 if j0 < len(m.Prefixes) {
108                         v0 = m.Prefixes[j0]
109                 }
110                 buf.EncodeUint8(uint8(v0.Prefix.Address.Af))
111                 buf.EncodeBytes(v0.Prefix.Address.Un.XXX_UnionData[:], 16)
112                 buf.EncodeUint8(v0.Prefix.Len)
113                 buf.EncodeUint8(v0.Flags)
114                 buf.EncodeUint32(v0.ValidTime)
115                 buf.EncodeUint32(v0.PreferredTime)
116         }
117         return buf.Bytes(), nil
118 }
119 func (m *IP6RaEvent) Unmarshal(b []byte) error {
120         buf := codec.NewBuffer(b)
121         m.PID = buf.DecodeUint32()
122         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
123         copy(m.RouterAddr[:], buf.DecodeBytes(16))
124         m.CurrentHopLimit = buf.DecodeUint8()
125         m.Flags = buf.DecodeUint8()
126         m.RouterLifetimeInSec = buf.DecodeUint16()
127         m.NeighborReachableTimeInMsec = buf.DecodeUint32()
128         m.TimeInMsecBetweenRetransmittedNeighborSolicitations = buf.DecodeUint32()
129         m.NPrefixes = buf.DecodeUint32()
130         m.Prefixes = make([]IP6RaPrefixInfo, m.NPrefixes)
131         for j0 := 0; j0 < len(m.Prefixes); j0++ {
132                 m.Prefixes[j0].Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
133                 copy(m.Prefixes[j0].Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
134                 m.Prefixes[j0].Prefix.Len = buf.DecodeUint8()
135                 m.Prefixes[j0].Flags = buf.DecodeUint8()
136                 m.Prefixes[j0].ValidTime = buf.DecodeUint32()
137                 m.Prefixes[j0].PreferredTime = buf.DecodeUint32()
138         }
139         return nil
140 }
141
142 // IP6ndProxyAddDel defines message 'ip6nd_proxy_add_del'.
143 type IP6ndProxyAddDel struct {
144         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
145         IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
146         IP        ip_types.IP6Address            `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
147 }
148
149 func (m *IP6ndProxyAddDel) Reset()               { *m = IP6ndProxyAddDel{} }
150 func (*IP6ndProxyAddDel) GetMessageName() string { return "ip6nd_proxy_add_del" }
151 func (*IP6ndProxyAddDel) GetCrcString() string   { return "3fdf6659" }
152 func (*IP6ndProxyAddDel) GetMessageType() api.MessageType {
153         return api.RequestMessage
154 }
155
156 func (m *IP6ndProxyAddDel) Size() (size int) {
157         if m == nil {
158                 return 0
159         }
160         size += 4      // m.SwIfIndex
161         size += 1      // m.IsAdd
162         size += 1 * 16 // m.IP
163         return size
164 }
165 func (m *IP6ndProxyAddDel) Marshal(b []byte) ([]byte, error) {
166         if b == nil {
167                 b = make([]byte, m.Size())
168         }
169         buf := codec.NewBuffer(b)
170         buf.EncodeUint32(uint32(m.SwIfIndex))
171         buf.EncodeBool(m.IsAdd)
172         buf.EncodeBytes(m.IP[:], 16)
173         return buf.Bytes(), nil
174 }
175 func (m *IP6ndProxyAddDel) Unmarshal(b []byte) error {
176         buf := codec.NewBuffer(b)
177         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
178         m.IsAdd = buf.DecodeBool()
179         copy(m.IP[:], buf.DecodeBytes(16))
180         return nil
181 }
182
183 // IP6ndProxyAddDelReply defines message 'ip6nd_proxy_add_del_reply'.
184 type IP6ndProxyAddDelReply struct {
185         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
186 }
187
188 func (m *IP6ndProxyAddDelReply) Reset()               { *m = IP6ndProxyAddDelReply{} }
189 func (*IP6ndProxyAddDelReply) GetMessageName() string { return "ip6nd_proxy_add_del_reply" }
190 func (*IP6ndProxyAddDelReply) GetCrcString() string   { return "e8d4e804" }
191 func (*IP6ndProxyAddDelReply) GetMessageType() api.MessageType {
192         return api.ReplyMessage
193 }
194
195 func (m *IP6ndProxyAddDelReply) Size() (size int) {
196         if m == nil {
197                 return 0
198         }
199         size += 4 // m.Retval
200         return size
201 }
202 func (m *IP6ndProxyAddDelReply) Marshal(b []byte) ([]byte, error) {
203         if b == nil {
204                 b = make([]byte, m.Size())
205         }
206         buf := codec.NewBuffer(b)
207         buf.EncodeInt32(m.Retval)
208         return buf.Bytes(), nil
209 }
210 func (m *IP6ndProxyAddDelReply) Unmarshal(b []byte) error {
211         buf := codec.NewBuffer(b)
212         m.Retval = buf.DecodeInt32()
213         return nil
214 }
215
216 // IP6ndProxyDetails defines message 'ip6nd_proxy_details'.
217 type IP6ndProxyDetails struct {
218         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
219         IP        ip_types.IP6Address            `binapi:"ip6_address,name=ip" json:"ip,omitempty"`
220 }
221
222 func (m *IP6ndProxyDetails) Reset()               { *m = IP6ndProxyDetails{} }
223 func (*IP6ndProxyDetails) GetMessageName() string { return "ip6nd_proxy_details" }
224 func (*IP6ndProxyDetails) GetCrcString() string   { return "d35be8ff" }
225 func (*IP6ndProxyDetails) GetMessageType() api.MessageType {
226         return api.ReplyMessage
227 }
228
229 func (m *IP6ndProxyDetails) Size() (size int) {
230         if m == nil {
231                 return 0
232         }
233         size += 4      // m.SwIfIndex
234         size += 1 * 16 // m.IP
235         return size
236 }
237 func (m *IP6ndProxyDetails) Marshal(b []byte) ([]byte, error) {
238         if b == nil {
239                 b = make([]byte, m.Size())
240         }
241         buf := codec.NewBuffer(b)
242         buf.EncodeUint32(uint32(m.SwIfIndex))
243         buf.EncodeBytes(m.IP[:], 16)
244         return buf.Bytes(), nil
245 }
246 func (m *IP6ndProxyDetails) Unmarshal(b []byte) error {
247         buf := codec.NewBuffer(b)
248         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
249         copy(m.IP[:], buf.DecodeBytes(16))
250         return nil
251 }
252
253 // IP6ndProxyDump defines message 'ip6nd_proxy_dump'.
254 type IP6ndProxyDump struct{}
255
256 func (m *IP6ndProxyDump) Reset()               { *m = IP6ndProxyDump{} }
257 func (*IP6ndProxyDump) GetMessageName() string { return "ip6nd_proxy_dump" }
258 func (*IP6ndProxyDump) GetCrcString() string   { return "51077d14" }
259 func (*IP6ndProxyDump) GetMessageType() api.MessageType {
260         return api.RequestMessage
261 }
262
263 func (m *IP6ndProxyDump) Size() (size int) {
264         if m == nil {
265                 return 0
266         }
267         return size
268 }
269 func (m *IP6ndProxyDump) Marshal(b []byte) ([]byte, error) {
270         if b == nil {
271                 b = make([]byte, m.Size())
272         }
273         buf := codec.NewBuffer(b)
274         return buf.Bytes(), nil
275 }
276 func (m *IP6ndProxyDump) Unmarshal(b []byte) error {
277         return nil
278 }
279
280 // IP6ndSendRouterSolicitation defines message 'ip6nd_send_router_solicitation'.
281 type IP6ndSendRouterSolicitation struct {
282         Irt       uint32                         `binapi:"u32,name=irt" json:"irt,omitempty"`
283         Mrt       uint32                         `binapi:"u32,name=mrt" json:"mrt,omitempty"`
284         Mrc       uint32                         `binapi:"u32,name=mrc" json:"mrc,omitempty"`
285         Mrd       uint32                         `binapi:"u32,name=mrd" json:"mrd,omitempty"`
286         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
287         Stop      bool                           `binapi:"bool,name=stop" json:"stop,omitempty"`
288 }
289
290 func (m *IP6ndSendRouterSolicitation) Reset()               { *m = IP6ndSendRouterSolicitation{} }
291 func (*IP6ndSendRouterSolicitation) GetMessageName() string { return "ip6nd_send_router_solicitation" }
292 func (*IP6ndSendRouterSolicitation) GetCrcString() string   { return "e5de609c" }
293 func (*IP6ndSendRouterSolicitation) GetMessageType() api.MessageType {
294         return api.RequestMessage
295 }
296
297 func (m *IP6ndSendRouterSolicitation) Size() (size int) {
298         if m == nil {
299                 return 0
300         }
301         size += 4 // m.Irt
302         size += 4 // m.Mrt
303         size += 4 // m.Mrc
304         size += 4 // m.Mrd
305         size += 4 // m.SwIfIndex
306         size += 1 // m.Stop
307         return size
308 }
309 func (m *IP6ndSendRouterSolicitation) Marshal(b []byte) ([]byte, error) {
310         if b == nil {
311                 b = make([]byte, m.Size())
312         }
313         buf := codec.NewBuffer(b)
314         buf.EncodeUint32(m.Irt)
315         buf.EncodeUint32(m.Mrt)
316         buf.EncodeUint32(m.Mrc)
317         buf.EncodeUint32(m.Mrd)
318         buf.EncodeUint32(uint32(m.SwIfIndex))
319         buf.EncodeBool(m.Stop)
320         return buf.Bytes(), nil
321 }
322 func (m *IP6ndSendRouterSolicitation) Unmarshal(b []byte) error {
323         buf := codec.NewBuffer(b)
324         m.Irt = buf.DecodeUint32()
325         m.Mrt = buf.DecodeUint32()
326         m.Mrc = buf.DecodeUint32()
327         m.Mrd = buf.DecodeUint32()
328         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
329         m.Stop = buf.DecodeBool()
330         return nil
331 }
332
333 // IP6ndSendRouterSolicitationReply defines message 'ip6nd_send_router_solicitation_reply'.
334 type IP6ndSendRouterSolicitationReply struct {
335         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
336 }
337
338 func (m *IP6ndSendRouterSolicitationReply) Reset() { *m = IP6ndSendRouterSolicitationReply{} }
339 func (*IP6ndSendRouterSolicitationReply) GetMessageName() string {
340         return "ip6nd_send_router_solicitation_reply"
341 }
342 func (*IP6ndSendRouterSolicitationReply) GetCrcString() string { return "e8d4e804" }
343 func (*IP6ndSendRouterSolicitationReply) GetMessageType() api.MessageType {
344         return api.ReplyMessage
345 }
346
347 func (m *IP6ndSendRouterSolicitationReply) Size() (size int) {
348         if m == nil {
349                 return 0
350         }
351         size += 4 // m.Retval
352         return size
353 }
354 func (m *IP6ndSendRouterSolicitationReply) Marshal(b []byte) ([]byte, error) {
355         if b == nil {
356                 b = make([]byte, m.Size())
357         }
358         buf := codec.NewBuffer(b)
359         buf.EncodeInt32(m.Retval)
360         return buf.Bytes(), nil
361 }
362 func (m *IP6ndSendRouterSolicitationReply) Unmarshal(b []byte) error {
363         buf := codec.NewBuffer(b)
364         m.Retval = buf.DecodeInt32()
365         return nil
366 }
367
368 // SwInterfaceIP6ndRaConfig defines message 'sw_interface_ip6nd_ra_config'.
369 type SwInterfaceIP6ndRaConfig struct {
370         SwIfIndex       interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
371         Suppress        uint8                          `binapi:"u8,name=suppress" json:"suppress,omitempty"`
372         Managed         uint8                          `binapi:"u8,name=managed" json:"managed,omitempty"`
373         Other           uint8                          `binapi:"u8,name=other" json:"other,omitempty"`
374         LlOption        uint8                          `binapi:"u8,name=ll_option" json:"ll_option,omitempty"`
375         SendUnicast     uint8                          `binapi:"u8,name=send_unicast" json:"send_unicast,omitempty"`
376         Cease           uint8                          `binapi:"u8,name=cease" json:"cease,omitempty"`
377         IsNo            bool                           `binapi:"bool,name=is_no" json:"is_no,omitempty"`
378         DefaultRouter   uint8                          `binapi:"u8,name=default_router" json:"default_router,omitempty"`
379         MaxInterval     uint32                         `binapi:"u32,name=max_interval" json:"max_interval,omitempty"`
380         MinInterval     uint32                         `binapi:"u32,name=min_interval" json:"min_interval,omitempty"`
381         Lifetime        uint32                         `binapi:"u32,name=lifetime" json:"lifetime,omitempty"`
382         InitialCount    uint32                         `binapi:"u32,name=initial_count" json:"initial_count,omitempty"`
383         InitialInterval uint32                         `binapi:"u32,name=initial_interval" json:"initial_interval,omitempty"`
384 }
385
386 func (m *SwInterfaceIP6ndRaConfig) Reset()               { *m = SwInterfaceIP6ndRaConfig{} }
387 func (*SwInterfaceIP6ndRaConfig) GetMessageName() string { return "sw_interface_ip6nd_ra_config" }
388 func (*SwInterfaceIP6ndRaConfig) GetCrcString() string   { return "3eb00b1c" }
389 func (*SwInterfaceIP6ndRaConfig) GetMessageType() api.MessageType {
390         return api.RequestMessage
391 }
392
393 func (m *SwInterfaceIP6ndRaConfig) Size() (size int) {
394         if m == nil {
395                 return 0
396         }
397         size += 4 // m.SwIfIndex
398         size += 1 // m.Suppress
399         size += 1 // m.Managed
400         size += 1 // m.Other
401         size += 1 // m.LlOption
402         size += 1 // m.SendUnicast
403         size += 1 // m.Cease
404         size += 1 // m.IsNo
405         size += 1 // m.DefaultRouter
406         size += 4 // m.MaxInterval
407         size += 4 // m.MinInterval
408         size += 4 // m.Lifetime
409         size += 4 // m.InitialCount
410         size += 4 // m.InitialInterval
411         return size
412 }
413 func (m *SwInterfaceIP6ndRaConfig) Marshal(b []byte) ([]byte, error) {
414         if b == nil {
415                 b = make([]byte, m.Size())
416         }
417         buf := codec.NewBuffer(b)
418         buf.EncodeUint32(uint32(m.SwIfIndex))
419         buf.EncodeUint8(m.Suppress)
420         buf.EncodeUint8(m.Managed)
421         buf.EncodeUint8(m.Other)
422         buf.EncodeUint8(m.LlOption)
423         buf.EncodeUint8(m.SendUnicast)
424         buf.EncodeUint8(m.Cease)
425         buf.EncodeBool(m.IsNo)
426         buf.EncodeUint8(m.DefaultRouter)
427         buf.EncodeUint32(m.MaxInterval)
428         buf.EncodeUint32(m.MinInterval)
429         buf.EncodeUint32(m.Lifetime)
430         buf.EncodeUint32(m.InitialCount)
431         buf.EncodeUint32(m.InitialInterval)
432         return buf.Bytes(), nil
433 }
434 func (m *SwInterfaceIP6ndRaConfig) Unmarshal(b []byte) error {
435         buf := codec.NewBuffer(b)
436         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
437         m.Suppress = buf.DecodeUint8()
438         m.Managed = buf.DecodeUint8()
439         m.Other = buf.DecodeUint8()
440         m.LlOption = buf.DecodeUint8()
441         m.SendUnicast = buf.DecodeUint8()
442         m.Cease = buf.DecodeUint8()
443         m.IsNo = buf.DecodeBool()
444         m.DefaultRouter = buf.DecodeUint8()
445         m.MaxInterval = buf.DecodeUint32()
446         m.MinInterval = buf.DecodeUint32()
447         m.Lifetime = buf.DecodeUint32()
448         m.InitialCount = buf.DecodeUint32()
449         m.InitialInterval = buf.DecodeUint32()
450         return nil
451 }
452
453 // SwInterfaceIP6ndRaConfigReply defines message 'sw_interface_ip6nd_ra_config_reply'.
454 type SwInterfaceIP6ndRaConfigReply struct {
455         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
456 }
457
458 func (m *SwInterfaceIP6ndRaConfigReply) Reset() { *m = SwInterfaceIP6ndRaConfigReply{} }
459 func (*SwInterfaceIP6ndRaConfigReply) GetMessageName() string {
460         return "sw_interface_ip6nd_ra_config_reply"
461 }
462 func (*SwInterfaceIP6ndRaConfigReply) GetCrcString() string { return "e8d4e804" }
463 func (*SwInterfaceIP6ndRaConfigReply) GetMessageType() api.MessageType {
464         return api.ReplyMessage
465 }
466
467 func (m *SwInterfaceIP6ndRaConfigReply) Size() (size int) {
468         if m == nil {
469                 return 0
470         }
471         size += 4 // m.Retval
472         return size
473 }
474 func (m *SwInterfaceIP6ndRaConfigReply) Marshal(b []byte) ([]byte, error) {
475         if b == nil {
476                 b = make([]byte, m.Size())
477         }
478         buf := codec.NewBuffer(b)
479         buf.EncodeInt32(m.Retval)
480         return buf.Bytes(), nil
481 }
482 func (m *SwInterfaceIP6ndRaConfigReply) Unmarshal(b []byte) error {
483         buf := codec.NewBuffer(b)
484         m.Retval = buf.DecodeInt32()
485         return nil
486 }
487
488 // SwInterfaceIP6ndRaPrefix defines message 'sw_interface_ip6nd_ra_prefix'.
489 type SwInterfaceIP6ndRaPrefix struct {
490         SwIfIndex    interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
491         Prefix       ip_types.Prefix                `binapi:"prefix,name=prefix" json:"prefix,omitempty"`
492         UseDefault   bool                           `binapi:"bool,name=use_default" json:"use_default,omitempty"`
493         NoAdvertise  bool                           `binapi:"bool,name=no_advertise" json:"no_advertise,omitempty"`
494         OffLink      bool                           `binapi:"bool,name=off_link" json:"off_link,omitempty"`
495         NoAutoconfig bool                           `binapi:"bool,name=no_autoconfig" json:"no_autoconfig,omitempty"`
496         NoOnlink     bool                           `binapi:"bool,name=no_onlink" json:"no_onlink,omitempty"`
497         IsNo         bool                           `binapi:"bool,name=is_no" json:"is_no,omitempty"`
498         ValLifetime  uint32                         `binapi:"u32,name=val_lifetime" json:"val_lifetime,omitempty"`
499         PrefLifetime uint32                         `binapi:"u32,name=pref_lifetime" json:"pref_lifetime,omitempty"`
500 }
501
502 func (m *SwInterfaceIP6ndRaPrefix) Reset()               { *m = SwInterfaceIP6ndRaPrefix{} }
503 func (*SwInterfaceIP6ndRaPrefix) GetMessageName() string { return "sw_interface_ip6nd_ra_prefix" }
504 func (*SwInterfaceIP6ndRaPrefix) GetCrcString() string   { return "e098785f" }
505 func (*SwInterfaceIP6ndRaPrefix) GetMessageType() api.MessageType {
506         return api.RequestMessage
507 }
508
509 func (m *SwInterfaceIP6ndRaPrefix) Size() (size int) {
510         if m == nil {
511                 return 0
512         }
513         size += 4      // m.SwIfIndex
514         size += 1      // m.Prefix.Address.Af
515         size += 1 * 16 // m.Prefix.Address.Un
516         size += 1      // m.Prefix.Len
517         size += 1      // m.UseDefault
518         size += 1      // m.NoAdvertise
519         size += 1      // m.OffLink
520         size += 1      // m.NoAutoconfig
521         size += 1      // m.NoOnlink
522         size += 1      // m.IsNo
523         size += 4      // m.ValLifetime
524         size += 4      // m.PrefLifetime
525         return size
526 }
527 func (m *SwInterfaceIP6ndRaPrefix) Marshal(b []byte) ([]byte, error) {
528         if b == nil {
529                 b = make([]byte, m.Size())
530         }
531         buf := codec.NewBuffer(b)
532         buf.EncodeUint32(uint32(m.SwIfIndex))
533         buf.EncodeUint8(uint8(m.Prefix.Address.Af))
534         buf.EncodeBytes(m.Prefix.Address.Un.XXX_UnionData[:], 16)
535         buf.EncodeUint8(m.Prefix.Len)
536         buf.EncodeBool(m.UseDefault)
537         buf.EncodeBool(m.NoAdvertise)
538         buf.EncodeBool(m.OffLink)
539         buf.EncodeBool(m.NoAutoconfig)
540         buf.EncodeBool(m.NoOnlink)
541         buf.EncodeBool(m.IsNo)
542         buf.EncodeUint32(m.ValLifetime)
543         buf.EncodeUint32(m.PrefLifetime)
544         return buf.Bytes(), nil
545 }
546 func (m *SwInterfaceIP6ndRaPrefix) Unmarshal(b []byte) error {
547         buf := codec.NewBuffer(b)
548         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
549         m.Prefix.Address.Af = ip_types.AddressFamily(buf.DecodeUint8())
550         copy(m.Prefix.Address.Un.XXX_UnionData[:], buf.DecodeBytes(16))
551         m.Prefix.Len = buf.DecodeUint8()
552         m.UseDefault = buf.DecodeBool()
553         m.NoAdvertise = buf.DecodeBool()
554         m.OffLink = buf.DecodeBool()
555         m.NoAutoconfig = buf.DecodeBool()
556         m.NoOnlink = buf.DecodeBool()
557         m.IsNo = buf.DecodeBool()
558         m.ValLifetime = buf.DecodeUint32()
559         m.PrefLifetime = buf.DecodeUint32()
560         return nil
561 }
562
563 // SwInterfaceIP6ndRaPrefixReply defines message 'sw_interface_ip6nd_ra_prefix_reply'.
564 type SwInterfaceIP6ndRaPrefixReply struct {
565         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
566 }
567
568 func (m *SwInterfaceIP6ndRaPrefixReply) Reset() { *m = SwInterfaceIP6ndRaPrefixReply{} }
569 func (*SwInterfaceIP6ndRaPrefixReply) GetMessageName() string {
570         return "sw_interface_ip6nd_ra_prefix_reply"
571 }
572 func (*SwInterfaceIP6ndRaPrefixReply) GetCrcString() string { return "e8d4e804" }
573 func (*SwInterfaceIP6ndRaPrefixReply) GetMessageType() api.MessageType {
574         return api.ReplyMessage
575 }
576
577 func (m *SwInterfaceIP6ndRaPrefixReply) Size() (size int) {
578         if m == nil {
579                 return 0
580         }
581         size += 4 // m.Retval
582         return size
583 }
584 func (m *SwInterfaceIP6ndRaPrefixReply) Marshal(b []byte) ([]byte, error) {
585         if b == nil {
586                 b = make([]byte, m.Size())
587         }
588         buf := codec.NewBuffer(b)
589         buf.EncodeInt32(m.Retval)
590         return buf.Bytes(), nil
591 }
592 func (m *SwInterfaceIP6ndRaPrefixReply) Unmarshal(b []byte) error {
593         buf := codec.NewBuffer(b)
594         m.Retval = buf.DecodeInt32()
595         return nil
596 }
597
598 // WantIP6RaEvents defines message 'want_ip6_ra_events'.
599 type WantIP6RaEvents struct {
600         Enable bool   `binapi:"bool,name=enable" json:"enable,omitempty"`
601         PID    uint32 `binapi:"u32,name=pid" json:"pid,omitempty"`
602 }
603
604 func (m *WantIP6RaEvents) Reset()               { *m = WantIP6RaEvents{} }
605 func (*WantIP6RaEvents) GetMessageName() string { return "want_ip6_ra_events" }
606 func (*WantIP6RaEvents) GetCrcString() string   { return "3ec6d6c2" }
607 func (*WantIP6RaEvents) GetMessageType() api.MessageType {
608         return api.RequestMessage
609 }
610
611 func (m *WantIP6RaEvents) Size() (size int) {
612         if m == nil {
613                 return 0
614         }
615         size += 1 // m.Enable
616         size += 4 // m.PID
617         return size
618 }
619 func (m *WantIP6RaEvents) Marshal(b []byte) ([]byte, error) {
620         if b == nil {
621                 b = make([]byte, m.Size())
622         }
623         buf := codec.NewBuffer(b)
624         buf.EncodeBool(m.Enable)
625         buf.EncodeUint32(m.PID)
626         return buf.Bytes(), nil
627 }
628 func (m *WantIP6RaEvents) Unmarshal(b []byte) error {
629         buf := codec.NewBuffer(b)
630         m.Enable = buf.DecodeBool()
631         m.PID = buf.DecodeUint32()
632         return nil
633 }
634
635 // WantIP6RaEventsReply defines message 'want_ip6_ra_events_reply'.
636 type WantIP6RaEventsReply struct {
637         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
638 }
639
640 func (m *WantIP6RaEventsReply) Reset()               { *m = WantIP6RaEventsReply{} }
641 func (*WantIP6RaEventsReply) GetMessageName() string { return "want_ip6_ra_events_reply" }
642 func (*WantIP6RaEventsReply) GetCrcString() string   { return "e8d4e804" }
643 func (*WantIP6RaEventsReply) GetMessageType() api.MessageType {
644         return api.ReplyMessage
645 }
646
647 func (m *WantIP6RaEventsReply) Size() (size int) {
648         if m == nil {
649                 return 0
650         }
651         size += 4 // m.Retval
652         return size
653 }
654 func (m *WantIP6RaEventsReply) Marshal(b []byte) ([]byte, error) {
655         if b == nil {
656                 b = make([]byte, m.Size())
657         }
658         buf := codec.NewBuffer(b)
659         buf.EncodeInt32(m.Retval)
660         return buf.Bytes(), nil
661 }
662 func (m *WantIP6RaEventsReply) Unmarshal(b []byte) error {
663         buf := codec.NewBuffer(b)
664         m.Retval = buf.DecodeInt32()
665         return nil
666 }
667
668 func init() { file_ip6_nd_binapi_init() }
669 func file_ip6_nd_binapi_init() {
670         api.RegisterMessage((*IP6RaEvent)(nil), "ip6_ra_event_47e8cfbe")
671         api.RegisterMessage((*IP6ndProxyAddDel)(nil), "ip6nd_proxy_add_del_3fdf6659")
672         api.RegisterMessage((*IP6ndProxyAddDelReply)(nil), "ip6nd_proxy_add_del_reply_e8d4e804")
673         api.RegisterMessage((*IP6ndProxyDetails)(nil), "ip6nd_proxy_details_d35be8ff")
674         api.RegisterMessage((*IP6ndProxyDump)(nil), "ip6nd_proxy_dump_51077d14")
675         api.RegisterMessage((*IP6ndSendRouterSolicitation)(nil), "ip6nd_send_router_solicitation_e5de609c")
676         api.RegisterMessage((*IP6ndSendRouterSolicitationReply)(nil), "ip6nd_send_router_solicitation_reply_e8d4e804")
677         api.RegisterMessage((*SwInterfaceIP6ndRaConfig)(nil), "sw_interface_ip6nd_ra_config_3eb00b1c")
678         api.RegisterMessage((*SwInterfaceIP6ndRaConfigReply)(nil), "sw_interface_ip6nd_ra_config_reply_e8d4e804")
679         api.RegisterMessage((*SwInterfaceIP6ndRaPrefix)(nil), "sw_interface_ip6nd_ra_prefix_e098785f")
680         api.RegisterMessage((*SwInterfaceIP6ndRaPrefixReply)(nil), "sw_interface_ip6nd_ra_prefix_reply_e8d4e804")
681         api.RegisterMessage((*WantIP6RaEvents)(nil), "want_ip6_ra_events_3ec6d6c2")
682         api.RegisterMessage((*WantIP6RaEventsReply)(nil), "want_ip6_ra_events_reply_e8d4e804")
683 }
684
685 // Messages returns list of all messages in this module.
686 func AllMessages() []api.Message {
687         return []api.Message{
688                 (*IP6RaEvent)(nil),
689                 (*IP6ndProxyAddDel)(nil),
690                 (*IP6ndProxyAddDelReply)(nil),
691                 (*IP6ndProxyDetails)(nil),
692                 (*IP6ndProxyDump)(nil),
693                 (*IP6ndSendRouterSolicitation)(nil),
694                 (*IP6ndSendRouterSolicitationReply)(nil),
695                 (*SwInterfaceIP6ndRaConfig)(nil),
696                 (*SwInterfaceIP6ndRaConfigReply)(nil),
697                 (*SwInterfaceIP6ndRaPrefix)(nil),
698                 (*SwInterfaceIP6ndRaPrefixReply)(nil),
699                 (*WantIP6RaEvents)(nil),
700                 (*WantIP6RaEventsReply)(nil),
701         }
702 }