bfb757b84ee78edd49026b29d1f6abb709bdfa61
[govpp.git] / binapi / ipsec / ipsec.ba.go
1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
2 // versions:
3 //  binapi-generator: v0.4.0-dev
4 //  VPP:              20.05-release
5
6 // Package ipsec contains generated bindings for API file ipsec.api.
7 //
8 // Contents:
9 //   1 enum
10 //   2 structs
11 //  30 messages
12 //
13 package ipsec
14
15 import (
16         "strconv"
17
18         api "git.fd.io/govpp.git/api"
19         interface_types "git.fd.io/govpp.git/binapi/interface_types"
20         ip_types "git.fd.io/govpp.git/binapi/ip_types"
21         ipsec_types "git.fd.io/govpp.git/binapi/ipsec_types"
22         codec "git.fd.io/govpp.git/codec"
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    = "ipsec"
33         APIVersion = "3.0.2"
34         VersionCrc = 0x6a839805
35 )
36
37 // IpsecSpdAction defines enum 'ipsec_spd_action'.
38 type IpsecSpdAction uint32
39
40 const (
41         IPSEC_API_SPD_ACTION_BYPASS  IpsecSpdAction = 0
42         IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1
43         IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2
44         IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3
45 )
46
47 var (
48         IpsecSpdAction_name = map[uint32]string{
49                 0: "IPSEC_API_SPD_ACTION_BYPASS",
50                 1: "IPSEC_API_SPD_ACTION_DISCARD",
51                 2: "IPSEC_API_SPD_ACTION_RESOLVE",
52                 3: "IPSEC_API_SPD_ACTION_PROTECT",
53         }
54         IpsecSpdAction_value = map[string]uint32{
55                 "IPSEC_API_SPD_ACTION_BYPASS":  0,
56                 "IPSEC_API_SPD_ACTION_DISCARD": 1,
57                 "IPSEC_API_SPD_ACTION_RESOLVE": 2,
58                 "IPSEC_API_SPD_ACTION_PROTECT": 3,
59         }
60 )
61
62 func (x IpsecSpdAction) String() string {
63         s, ok := IpsecSpdAction_name[uint32(x)]
64         if ok {
65                 return s
66         }
67         return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")"
68 }
69
70 // IpsecSpdEntry defines type 'ipsec_spd_entry'.
71 type IpsecSpdEntry struct {
72         SpdID              uint32           `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
73         Priority           int32            `binapi:"i32,name=priority" json:"priority,omitempty"`
74         IsOutbound         bool             `binapi:"bool,name=is_outbound" json:"is_outbound,omitempty"`
75         SaID               uint32           `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
76         Policy             IpsecSpdAction   `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"`
77         Protocol           uint8            `binapi:"u8,name=protocol" json:"protocol,omitempty"`
78         RemoteAddressStart ip_types.Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"`
79         RemoteAddressStop  ip_types.Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"`
80         LocalAddressStart  ip_types.Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"`
81         LocalAddressStop   ip_types.Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"`
82         RemotePortStart    uint16           `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"`
83         RemotePortStop     uint16           `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"`
84         LocalPortStart     uint16           `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"`
85         LocalPortStop      uint16           `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"`
86 }
87
88 // IpsecTunnelProtect defines type 'ipsec_tunnel_protect'.
89 type IpsecTunnelProtect struct {
90         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
91         Nh        ip_types.Address               `binapi:"address,name=nh" json:"nh,omitempty"`
92         SaOut     uint32                         `binapi:"u32,name=sa_out" json:"sa_out,omitempty"`
93         NSaIn     uint8                          `binapi:"u8,name=n_sa_in" json:"-"`
94         SaIn      []uint32                       `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"`
95 }
96
97 // IpsecBackendDetails defines message 'ipsec_backend_details'.
98 type IpsecBackendDetails struct {
99         Name     string                 `binapi:"string[128],name=name" json:"name,omitempty"`
100         Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
101         Index    uint8                  `binapi:"u8,name=index" json:"index,omitempty"`
102         Active   bool                   `binapi:"bool,name=active" json:"active,omitempty"`
103 }
104
105 func (m *IpsecBackendDetails) Reset()               { *m = IpsecBackendDetails{} }
106 func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" }
107 func (*IpsecBackendDetails) GetCrcString() string   { return "ee601c29" }
108 func (*IpsecBackendDetails) GetMessageType() api.MessageType {
109         return api.ReplyMessage
110 }
111
112 func (m *IpsecBackendDetails) Size() (size int) {
113         if m == nil {
114                 return 0
115         }
116         size += 128 // m.Name
117         size += 4   // m.Protocol
118         size += 1   // m.Index
119         size += 1   // m.Active
120         return size
121 }
122 func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) {
123         if b == nil {
124                 b = make([]byte, m.Size())
125         }
126         buf := codec.NewBuffer(b)
127         buf.EncodeString(m.Name, 128)
128         buf.EncodeUint32(uint32(m.Protocol))
129         buf.EncodeUint8(m.Index)
130         buf.EncodeBool(m.Active)
131         return buf.Bytes(), nil
132 }
133 func (m *IpsecBackendDetails) Unmarshal(b []byte) error {
134         buf := codec.NewBuffer(b)
135         m.Name = buf.DecodeString(128)
136         m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
137         m.Index = buf.DecodeUint8()
138         m.Active = buf.DecodeBool()
139         return nil
140 }
141
142 // IpsecBackendDump defines message 'ipsec_backend_dump'.
143 type IpsecBackendDump struct{}
144
145 func (m *IpsecBackendDump) Reset()               { *m = IpsecBackendDump{} }
146 func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" }
147 func (*IpsecBackendDump) GetCrcString() string   { return "51077d14" }
148 func (*IpsecBackendDump) GetMessageType() api.MessageType {
149         return api.RequestMessage
150 }
151
152 func (m *IpsecBackendDump) Size() (size int) {
153         if m == nil {
154                 return 0
155         }
156         return size
157 }
158 func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) {
159         if b == nil {
160                 b = make([]byte, m.Size())
161         }
162         buf := codec.NewBuffer(b)
163         return buf.Bytes(), nil
164 }
165 func (m *IpsecBackendDump) Unmarshal(b []byte) error {
166         return nil
167 }
168
169 // IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'.
170 type IpsecInterfaceAddDelSpd struct {
171         IsAdd     bool                           `binapi:"bool,name=is_add" json:"is_add,omitempty"`
172         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
173         SpdID     uint32                         `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
174 }
175
176 func (m *IpsecInterfaceAddDelSpd) Reset()               { *m = IpsecInterfaceAddDelSpd{} }
177 func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" }
178 func (*IpsecInterfaceAddDelSpd) GetCrcString() string   { return "80f80cbb" }
179 func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType {
180         return api.RequestMessage
181 }
182
183 func (m *IpsecInterfaceAddDelSpd) Size() (size int) {
184         if m == nil {
185                 return 0
186         }
187         size += 1 // m.IsAdd
188         size += 4 // m.SwIfIndex
189         size += 4 // m.SpdID
190         return size
191 }
192 func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) {
193         if b == nil {
194                 b = make([]byte, m.Size())
195         }
196         buf := codec.NewBuffer(b)
197         buf.EncodeBool(m.IsAdd)
198         buf.EncodeUint32(uint32(m.SwIfIndex))
199         buf.EncodeUint32(m.SpdID)
200         return buf.Bytes(), nil
201 }
202 func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error {
203         buf := codec.NewBuffer(b)
204         m.IsAdd = buf.DecodeBool()
205         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
206         m.SpdID = buf.DecodeUint32()
207         return nil
208 }
209
210 // IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'.
211 type IpsecInterfaceAddDelSpdReply struct {
212         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
213 }
214
215 func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} }
216 func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string {
217         return "ipsec_interface_add_del_spd_reply"
218 }
219 func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" }
220 func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType {
221         return api.ReplyMessage
222 }
223
224 func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) {
225         if m == nil {
226                 return 0
227         }
228         size += 4 // m.Retval
229         return size
230 }
231 func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) {
232         if b == nil {
233                 b = make([]byte, m.Size())
234         }
235         buf := codec.NewBuffer(b)
236         buf.EncodeInt32(m.Retval)
237         return buf.Bytes(), nil
238 }
239 func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error {
240         buf := codec.NewBuffer(b)
241         m.Retval = buf.DecodeInt32()
242         return nil
243 }
244
245 // IpsecSaDetails defines message 'ipsec_sa_details'.
246 type IpsecSaDetails struct {
247         Entry          ipsec_types.IpsecSadEntry      `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
248         SwIfIndex      interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
249         Salt           uint32                         `binapi:"u32,name=salt" json:"salt,omitempty"`
250         SeqOutbound    uint64                         `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
251         LastSeqInbound uint64                         `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
252         ReplayWindow   uint64                         `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
253         StatIndex      uint32                         `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
254 }
255
256 func (m *IpsecSaDetails) Reset()               { *m = IpsecSaDetails{} }
257 func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" }
258 func (*IpsecSaDetails) GetCrcString() string   { return "b30c7f41" }
259 func (*IpsecSaDetails) GetMessageType() api.MessageType {
260         return api.ReplyMessage
261 }
262
263 func (m *IpsecSaDetails) Size() (size int) {
264         if m == nil {
265                 return 0
266         }
267         size += 4       // m.Entry.SadID
268         size += 4       // m.Entry.Spi
269         size += 4       // m.Entry.Protocol
270         size += 4       // m.Entry.CryptoAlgorithm
271         size += 1       // m.Entry.CryptoKey.Length
272         size += 1 * 128 // m.Entry.CryptoKey.Data
273         size += 4       // m.Entry.IntegrityAlgorithm
274         size += 1       // m.Entry.IntegrityKey.Length
275         size += 1 * 128 // m.Entry.IntegrityKey.Data
276         size += 4       // m.Entry.Flags
277         size += 1       // m.Entry.TunnelSrc.Af
278         size += 1 * 16  // m.Entry.TunnelSrc.Un
279         size += 1       // m.Entry.TunnelDst.Af
280         size += 1 * 16  // m.Entry.TunnelDst.Un
281         size += 4       // m.Entry.TxTableID
282         size += 4       // m.Entry.Salt
283         size += 2       // m.Entry.UDPSrcPort
284         size += 2       // m.Entry.UDPDstPort
285         size += 4       // m.SwIfIndex
286         size += 4       // m.Salt
287         size += 8       // m.SeqOutbound
288         size += 8       // m.LastSeqInbound
289         size += 8       // m.ReplayWindow
290         size += 4       // m.StatIndex
291         return size
292 }
293 func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) {
294         if b == nil {
295                 b = make([]byte, m.Size())
296         }
297         buf := codec.NewBuffer(b)
298         buf.EncodeUint32(m.Entry.SadID)
299         buf.EncodeUint32(m.Entry.Spi)
300         buf.EncodeUint32(uint32(m.Entry.Protocol))
301         buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
302         buf.EncodeUint8(m.Entry.CryptoKey.Length)
303         buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
304         buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
305         buf.EncodeUint8(m.Entry.IntegrityKey.Length)
306         buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
307         buf.EncodeUint32(uint32(m.Entry.Flags))
308         buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
309         buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
310         buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
311         buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
312         buf.EncodeUint32(m.Entry.TxTableID)
313         buf.EncodeUint32(m.Entry.Salt)
314         buf.EncodeUint16(m.Entry.UDPSrcPort)
315         buf.EncodeUint16(m.Entry.UDPDstPort)
316         buf.EncodeUint32(uint32(m.SwIfIndex))
317         buf.EncodeUint32(m.Salt)
318         buf.EncodeUint64(m.SeqOutbound)
319         buf.EncodeUint64(m.LastSeqInbound)
320         buf.EncodeUint64(m.ReplayWindow)
321         buf.EncodeUint32(m.StatIndex)
322         return buf.Bytes(), nil
323 }
324 func (m *IpsecSaDetails) Unmarshal(b []byte) error {
325         buf := codec.NewBuffer(b)
326         m.Entry.SadID = buf.DecodeUint32()
327         m.Entry.Spi = buf.DecodeUint32()
328         m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
329         m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
330         m.Entry.CryptoKey.Length = buf.DecodeUint8()
331         m.Entry.CryptoKey.Data = make([]byte, 128)
332         copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
333         m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
334         m.Entry.IntegrityKey.Length = buf.DecodeUint8()
335         m.Entry.IntegrityKey.Data = make([]byte, 128)
336         copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
337         m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
338         m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
339         copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
340         m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
341         copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
342         m.Entry.TxTableID = buf.DecodeUint32()
343         m.Entry.Salt = buf.DecodeUint32()
344         m.Entry.UDPSrcPort = buf.DecodeUint16()
345         m.Entry.UDPDstPort = buf.DecodeUint16()
346         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
347         m.Salt = buf.DecodeUint32()
348         m.SeqOutbound = buf.DecodeUint64()
349         m.LastSeqInbound = buf.DecodeUint64()
350         m.ReplayWindow = buf.DecodeUint64()
351         m.StatIndex = buf.DecodeUint32()
352         return nil
353 }
354
355 // IpsecSaDump defines message 'ipsec_sa_dump'.
356 type IpsecSaDump struct {
357         SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
358 }
359
360 func (m *IpsecSaDump) Reset()               { *m = IpsecSaDump{} }
361 func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" }
362 func (*IpsecSaDump) GetCrcString() string   { return "2076c2f4" }
363 func (*IpsecSaDump) GetMessageType() api.MessageType {
364         return api.RequestMessage
365 }
366
367 func (m *IpsecSaDump) Size() (size int) {
368         if m == nil {
369                 return 0
370         }
371         size += 4 // m.SaID
372         return size
373 }
374 func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) {
375         if b == nil {
376                 b = make([]byte, m.Size())
377         }
378         buf := codec.NewBuffer(b)
379         buf.EncodeUint32(m.SaID)
380         return buf.Bytes(), nil
381 }
382 func (m *IpsecSaDump) Unmarshal(b []byte) error {
383         buf := codec.NewBuffer(b)
384         m.SaID = buf.DecodeUint32()
385         return nil
386 }
387
388 // IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'.
389 type IpsecSadEntryAddDel struct {
390         IsAdd bool                      `binapi:"bool,name=is_add" json:"is_add,omitempty"`
391         Entry ipsec_types.IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
392 }
393
394 func (m *IpsecSadEntryAddDel) Reset()               { *m = IpsecSadEntryAddDel{} }
395 func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" }
396 func (*IpsecSadEntryAddDel) GetCrcString() string   { return "b8def364" }
397 func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType {
398         return api.RequestMessage
399 }
400
401 func (m *IpsecSadEntryAddDel) Size() (size int) {
402         if m == nil {
403                 return 0
404         }
405         size += 1       // m.IsAdd
406         size += 4       // m.Entry.SadID
407         size += 4       // m.Entry.Spi
408         size += 4       // m.Entry.Protocol
409         size += 4       // m.Entry.CryptoAlgorithm
410         size += 1       // m.Entry.CryptoKey.Length
411         size += 1 * 128 // m.Entry.CryptoKey.Data
412         size += 4       // m.Entry.IntegrityAlgorithm
413         size += 1       // m.Entry.IntegrityKey.Length
414         size += 1 * 128 // m.Entry.IntegrityKey.Data
415         size += 4       // m.Entry.Flags
416         size += 1       // m.Entry.TunnelSrc.Af
417         size += 1 * 16  // m.Entry.TunnelSrc.Un
418         size += 1       // m.Entry.TunnelDst.Af
419         size += 1 * 16  // m.Entry.TunnelDst.Un
420         size += 4       // m.Entry.TxTableID
421         size += 4       // m.Entry.Salt
422         size += 2       // m.Entry.UDPSrcPort
423         size += 2       // m.Entry.UDPDstPort
424         return size
425 }
426 func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) {
427         if b == nil {
428                 b = make([]byte, m.Size())
429         }
430         buf := codec.NewBuffer(b)
431         buf.EncodeBool(m.IsAdd)
432         buf.EncodeUint32(m.Entry.SadID)
433         buf.EncodeUint32(m.Entry.Spi)
434         buf.EncodeUint32(uint32(m.Entry.Protocol))
435         buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
436         buf.EncodeUint8(m.Entry.CryptoKey.Length)
437         buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
438         buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
439         buf.EncodeUint8(m.Entry.IntegrityKey.Length)
440         buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
441         buf.EncodeUint32(uint32(m.Entry.Flags))
442         buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
443         buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
444         buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
445         buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
446         buf.EncodeUint32(m.Entry.TxTableID)
447         buf.EncodeUint32(m.Entry.Salt)
448         buf.EncodeUint16(m.Entry.UDPSrcPort)
449         buf.EncodeUint16(m.Entry.UDPDstPort)
450         return buf.Bytes(), nil
451 }
452 func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error {
453         buf := codec.NewBuffer(b)
454         m.IsAdd = buf.DecodeBool()
455         m.Entry.SadID = buf.DecodeUint32()
456         m.Entry.Spi = buf.DecodeUint32()
457         m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
458         m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
459         m.Entry.CryptoKey.Length = buf.DecodeUint8()
460         m.Entry.CryptoKey.Data = make([]byte, 128)
461         copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
462         m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
463         m.Entry.IntegrityKey.Length = buf.DecodeUint8()
464         m.Entry.IntegrityKey.Data = make([]byte, 128)
465         copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
466         m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
467         m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
468         copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
469         m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
470         copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
471         m.Entry.TxTableID = buf.DecodeUint32()
472         m.Entry.Salt = buf.DecodeUint32()
473         m.Entry.UDPSrcPort = buf.DecodeUint16()
474         m.Entry.UDPDstPort = buf.DecodeUint16()
475         return nil
476 }
477
478 // IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'.
479 type IpsecSadEntryAddDelReply struct {
480         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
481         StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
482 }
483
484 func (m *IpsecSadEntryAddDelReply) Reset()               { *m = IpsecSadEntryAddDelReply{} }
485 func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" }
486 func (*IpsecSadEntryAddDelReply) GetCrcString() string   { return "9ffac24b" }
487 func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType {
488         return api.ReplyMessage
489 }
490
491 func (m *IpsecSadEntryAddDelReply) Size() (size int) {
492         if m == nil {
493                 return 0
494         }
495         size += 4 // m.Retval
496         size += 4 // m.StatIndex
497         return size
498 }
499 func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
500         if b == nil {
501                 b = make([]byte, m.Size())
502         }
503         buf := codec.NewBuffer(b)
504         buf.EncodeInt32(m.Retval)
505         buf.EncodeUint32(m.StatIndex)
506         return buf.Bytes(), nil
507 }
508 func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error {
509         buf := codec.NewBuffer(b)
510         m.Retval = buf.DecodeInt32()
511         m.StatIndex = buf.DecodeUint32()
512         return nil
513 }
514
515 // IpsecSelectBackend defines message 'ipsec_select_backend'.
516 type IpsecSelectBackend struct {
517         Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
518         Index    uint8                  `binapi:"u8,name=index" json:"index,omitempty"`
519 }
520
521 func (m *IpsecSelectBackend) Reset()               { *m = IpsecSelectBackend{} }
522 func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" }
523 func (*IpsecSelectBackend) GetCrcString() string   { return "5bcfd3b7" }
524 func (*IpsecSelectBackend) GetMessageType() api.MessageType {
525         return api.RequestMessage
526 }
527
528 func (m *IpsecSelectBackend) Size() (size int) {
529         if m == nil {
530                 return 0
531         }
532         size += 4 // m.Protocol
533         size += 1 // m.Index
534         return size
535 }
536 func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) {
537         if b == nil {
538                 b = make([]byte, m.Size())
539         }
540         buf := codec.NewBuffer(b)
541         buf.EncodeUint32(uint32(m.Protocol))
542         buf.EncodeUint8(m.Index)
543         return buf.Bytes(), nil
544 }
545 func (m *IpsecSelectBackend) Unmarshal(b []byte) error {
546         buf := codec.NewBuffer(b)
547         m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
548         m.Index = buf.DecodeUint8()
549         return nil
550 }
551
552 // IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'.
553 type IpsecSelectBackendReply struct {
554         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
555 }
556
557 func (m *IpsecSelectBackendReply) Reset()               { *m = IpsecSelectBackendReply{} }
558 func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" }
559 func (*IpsecSelectBackendReply) GetCrcString() string   { return "e8d4e804" }
560 func (*IpsecSelectBackendReply) GetMessageType() api.MessageType {
561         return api.ReplyMessage
562 }
563
564 func (m *IpsecSelectBackendReply) Size() (size int) {
565         if m == nil {
566                 return 0
567         }
568         size += 4 // m.Retval
569         return size
570 }
571 func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) {
572         if b == nil {
573                 b = make([]byte, m.Size())
574         }
575         buf := codec.NewBuffer(b)
576         buf.EncodeInt32(m.Retval)
577         return buf.Bytes(), nil
578 }
579 func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error {
580         buf := codec.NewBuffer(b)
581         m.Retval = buf.DecodeInt32()
582         return nil
583 }
584
585 // IpsecSpdAddDel defines message 'ipsec_spd_add_del'.
586 type IpsecSpdAddDel struct {
587         IsAdd bool   `binapi:"bool,name=is_add" json:"is_add,omitempty"`
588         SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
589 }
590
591 func (m *IpsecSpdAddDel) Reset()               { *m = IpsecSpdAddDel{} }
592 func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" }
593 func (*IpsecSpdAddDel) GetCrcString() string   { return "20e89a95" }
594 func (*IpsecSpdAddDel) GetMessageType() api.MessageType {
595         return api.RequestMessage
596 }
597
598 func (m *IpsecSpdAddDel) Size() (size int) {
599         if m == nil {
600                 return 0
601         }
602         size += 1 // m.IsAdd
603         size += 4 // m.SpdID
604         return size
605 }
606 func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) {
607         if b == nil {
608                 b = make([]byte, m.Size())
609         }
610         buf := codec.NewBuffer(b)
611         buf.EncodeBool(m.IsAdd)
612         buf.EncodeUint32(m.SpdID)
613         return buf.Bytes(), nil
614 }
615 func (m *IpsecSpdAddDel) Unmarshal(b []byte) error {
616         buf := codec.NewBuffer(b)
617         m.IsAdd = buf.DecodeBool()
618         m.SpdID = buf.DecodeUint32()
619         return nil
620 }
621
622 // IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'.
623 type IpsecSpdAddDelReply struct {
624         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
625 }
626
627 func (m *IpsecSpdAddDelReply) Reset()               { *m = IpsecSpdAddDelReply{} }
628 func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" }
629 func (*IpsecSpdAddDelReply) GetCrcString() string   { return "e8d4e804" }
630 func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType {
631         return api.ReplyMessage
632 }
633
634 func (m *IpsecSpdAddDelReply) Size() (size int) {
635         if m == nil {
636                 return 0
637         }
638         size += 4 // m.Retval
639         return size
640 }
641 func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) {
642         if b == nil {
643                 b = make([]byte, m.Size())
644         }
645         buf := codec.NewBuffer(b)
646         buf.EncodeInt32(m.Retval)
647         return buf.Bytes(), nil
648 }
649 func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error {
650         buf := codec.NewBuffer(b)
651         m.Retval = buf.DecodeInt32()
652         return nil
653 }
654
655 // IpsecSpdDetails defines message 'ipsec_spd_details'.
656 type IpsecSpdDetails struct {
657         Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
658 }
659
660 func (m *IpsecSpdDetails) Reset()               { *m = IpsecSpdDetails{} }
661 func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" }
662 func (*IpsecSpdDetails) GetCrcString() string   { return "f2222790" }
663 func (*IpsecSpdDetails) GetMessageType() api.MessageType {
664         return api.ReplyMessage
665 }
666
667 func (m *IpsecSpdDetails) Size() (size int) {
668         if m == nil {
669                 return 0
670         }
671         size += 4      // m.Entry.SpdID
672         size += 4      // m.Entry.Priority
673         size += 1      // m.Entry.IsOutbound
674         size += 4      // m.Entry.SaID
675         size += 4      // m.Entry.Policy
676         size += 1      // m.Entry.Protocol
677         size += 1      // m.Entry.RemoteAddressStart.Af
678         size += 1 * 16 // m.Entry.RemoteAddressStart.Un
679         size += 1      // m.Entry.RemoteAddressStop.Af
680         size += 1 * 16 // m.Entry.RemoteAddressStop.Un
681         size += 1      // m.Entry.LocalAddressStart.Af
682         size += 1 * 16 // m.Entry.LocalAddressStart.Un
683         size += 1      // m.Entry.LocalAddressStop.Af
684         size += 1 * 16 // m.Entry.LocalAddressStop.Un
685         size += 2      // m.Entry.RemotePortStart
686         size += 2      // m.Entry.RemotePortStop
687         size += 2      // m.Entry.LocalPortStart
688         size += 2      // m.Entry.LocalPortStop
689         return size
690 }
691 func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) {
692         if b == nil {
693                 b = make([]byte, m.Size())
694         }
695         buf := codec.NewBuffer(b)
696         buf.EncodeUint32(m.Entry.SpdID)
697         buf.EncodeInt32(m.Entry.Priority)
698         buf.EncodeBool(m.Entry.IsOutbound)
699         buf.EncodeUint32(m.Entry.SaID)
700         buf.EncodeUint32(uint32(m.Entry.Policy))
701         buf.EncodeUint8(m.Entry.Protocol)
702         buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af))
703         buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
704         buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af))
705         buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
706         buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af))
707         buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
708         buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af))
709         buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
710         buf.EncodeUint16(m.Entry.RemotePortStart)
711         buf.EncodeUint16(m.Entry.RemotePortStop)
712         buf.EncodeUint16(m.Entry.LocalPortStart)
713         buf.EncodeUint16(m.Entry.LocalPortStop)
714         return buf.Bytes(), nil
715 }
716 func (m *IpsecSpdDetails) Unmarshal(b []byte) error {
717         buf := codec.NewBuffer(b)
718         m.Entry.SpdID = buf.DecodeUint32()
719         m.Entry.Priority = buf.DecodeInt32()
720         m.Entry.IsOutbound = buf.DecodeBool()
721         m.Entry.SaID = buf.DecodeUint32()
722         m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
723         m.Entry.Protocol = buf.DecodeUint8()
724         m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
725         copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
726         m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
727         copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
728         m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
729         copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
730         m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
731         copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
732         m.Entry.RemotePortStart = buf.DecodeUint16()
733         m.Entry.RemotePortStop = buf.DecodeUint16()
734         m.Entry.LocalPortStart = buf.DecodeUint16()
735         m.Entry.LocalPortStop = buf.DecodeUint16()
736         return nil
737 }
738
739 // IpsecSpdDump defines message 'ipsec_spd_dump'.
740 type IpsecSpdDump struct {
741         SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
742         SaID  uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
743 }
744
745 func (m *IpsecSpdDump) Reset()               { *m = IpsecSpdDump{} }
746 func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" }
747 func (*IpsecSpdDump) GetCrcString() string   { return "afefbf7d" }
748 func (*IpsecSpdDump) GetMessageType() api.MessageType {
749         return api.RequestMessage
750 }
751
752 func (m *IpsecSpdDump) Size() (size int) {
753         if m == nil {
754                 return 0
755         }
756         size += 4 // m.SpdID
757         size += 4 // m.SaID
758         return size
759 }
760 func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) {
761         if b == nil {
762                 b = make([]byte, m.Size())
763         }
764         buf := codec.NewBuffer(b)
765         buf.EncodeUint32(m.SpdID)
766         buf.EncodeUint32(m.SaID)
767         return buf.Bytes(), nil
768 }
769 func (m *IpsecSpdDump) Unmarshal(b []byte) error {
770         buf := codec.NewBuffer(b)
771         m.SpdID = buf.DecodeUint32()
772         m.SaID = buf.DecodeUint32()
773         return nil
774 }
775
776 // IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'.
777 type IpsecSpdEntryAddDel struct {
778         IsAdd bool          `binapi:"bool,name=is_add" json:"is_add,omitempty"`
779         Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
780 }
781
782 func (m *IpsecSpdEntryAddDel) Reset()               { *m = IpsecSpdEntryAddDel{} }
783 func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" }
784 func (*IpsecSpdEntryAddDel) GetCrcString() string   { return "9f384b8d" }
785 func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType {
786         return api.RequestMessage
787 }
788
789 func (m *IpsecSpdEntryAddDel) Size() (size int) {
790         if m == nil {
791                 return 0
792         }
793         size += 1      // m.IsAdd
794         size += 4      // m.Entry.SpdID
795         size += 4      // m.Entry.Priority
796         size += 1      // m.Entry.IsOutbound
797         size += 4      // m.Entry.SaID
798         size += 4      // m.Entry.Policy
799         size += 1      // m.Entry.Protocol
800         size += 1      // m.Entry.RemoteAddressStart.Af
801         size += 1 * 16 // m.Entry.RemoteAddressStart.Un
802         size += 1      // m.Entry.RemoteAddressStop.Af
803         size += 1 * 16 // m.Entry.RemoteAddressStop.Un
804         size += 1      // m.Entry.LocalAddressStart.Af
805         size += 1 * 16 // m.Entry.LocalAddressStart.Un
806         size += 1      // m.Entry.LocalAddressStop.Af
807         size += 1 * 16 // m.Entry.LocalAddressStop.Un
808         size += 2      // m.Entry.RemotePortStart
809         size += 2      // m.Entry.RemotePortStop
810         size += 2      // m.Entry.LocalPortStart
811         size += 2      // m.Entry.LocalPortStop
812         return size
813 }
814 func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) {
815         if b == nil {
816                 b = make([]byte, m.Size())
817         }
818         buf := codec.NewBuffer(b)
819         buf.EncodeBool(m.IsAdd)
820         buf.EncodeUint32(m.Entry.SpdID)
821         buf.EncodeInt32(m.Entry.Priority)
822         buf.EncodeBool(m.Entry.IsOutbound)
823         buf.EncodeUint32(m.Entry.SaID)
824         buf.EncodeUint32(uint32(m.Entry.Policy))
825         buf.EncodeUint8(m.Entry.Protocol)
826         buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af))
827         buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
828         buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af))
829         buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
830         buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af))
831         buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
832         buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af))
833         buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
834         buf.EncodeUint16(m.Entry.RemotePortStart)
835         buf.EncodeUint16(m.Entry.RemotePortStop)
836         buf.EncodeUint16(m.Entry.LocalPortStart)
837         buf.EncodeUint16(m.Entry.LocalPortStop)
838         return buf.Bytes(), nil
839 }
840 func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error {
841         buf := codec.NewBuffer(b)
842         m.IsAdd = buf.DecodeBool()
843         m.Entry.SpdID = buf.DecodeUint32()
844         m.Entry.Priority = buf.DecodeInt32()
845         m.Entry.IsOutbound = buf.DecodeBool()
846         m.Entry.SaID = buf.DecodeUint32()
847         m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
848         m.Entry.Protocol = buf.DecodeUint8()
849         m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
850         copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
851         m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
852         copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
853         m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
854         copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
855         m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
856         copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
857         m.Entry.RemotePortStart = buf.DecodeUint16()
858         m.Entry.RemotePortStop = buf.DecodeUint16()
859         m.Entry.LocalPortStart = buf.DecodeUint16()
860         m.Entry.LocalPortStop = buf.DecodeUint16()
861         return nil
862 }
863
864 // IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'.
865 type IpsecSpdEntryAddDelReply struct {
866         Retval    int32  `binapi:"i32,name=retval" json:"retval,omitempty"`
867         StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
868 }
869
870 func (m *IpsecSpdEntryAddDelReply) Reset()               { *m = IpsecSpdEntryAddDelReply{} }
871 func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" }
872 func (*IpsecSpdEntryAddDelReply) GetCrcString() string   { return "9ffac24b" }
873 func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType {
874         return api.ReplyMessage
875 }
876
877 func (m *IpsecSpdEntryAddDelReply) Size() (size int) {
878         if m == nil {
879                 return 0
880         }
881         size += 4 // m.Retval
882         size += 4 // m.StatIndex
883         return size
884 }
885 func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
886         if b == nil {
887                 b = make([]byte, m.Size())
888         }
889         buf := codec.NewBuffer(b)
890         buf.EncodeInt32(m.Retval)
891         buf.EncodeUint32(m.StatIndex)
892         return buf.Bytes(), nil
893 }
894 func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error {
895         buf := codec.NewBuffer(b)
896         m.Retval = buf.DecodeInt32()
897         m.StatIndex = buf.DecodeUint32()
898         return nil
899 }
900
901 // IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'.
902 type IpsecSpdInterfaceDetails struct {
903         SpdIndex  uint32                         `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
904         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
905 }
906
907 func (m *IpsecSpdInterfaceDetails) Reset()               { *m = IpsecSpdInterfaceDetails{} }
908 func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" }
909 func (*IpsecSpdInterfaceDetails) GetCrcString() string   { return "7a0bcf3e" }
910 func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType {
911         return api.ReplyMessage
912 }
913
914 func (m *IpsecSpdInterfaceDetails) Size() (size int) {
915         if m == nil {
916                 return 0
917         }
918         size += 4 // m.SpdIndex
919         size += 4 // m.SwIfIndex
920         return size
921 }
922 func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) {
923         if b == nil {
924                 b = make([]byte, m.Size())
925         }
926         buf := codec.NewBuffer(b)
927         buf.EncodeUint32(m.SpdIndex)
928         buf.EncodeUint32(uint32(m.SwIfIndex))
929         return buf.Bytes(), nil
930 }
931 func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error {
932         buf := codec.NewBuffer(b)
933         m.SpdIndex = buf.DecodeUint32()
934         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
935         return nil
936 }
937
938 // IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'.
939 type IpsecSpdInterfaceDump struct {
940         SpdIndex      uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
941         SpdIndexValid uint8  `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"`
942 }
943
944 func (m *IpsecSpdInterfaceDump) Reset()               { *m = IpsecSpdInterfaceDump{} }
945 func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" }
946 func (*IpsecSpdInterfaceDump) GetCrcString() string   { return "8971de19" }
947 func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType {
948         return api.RequestMessage
949 }
950
951 func (m *IpsecSpdInterfaceDump) Size() (size int) {
952         if m == nil {
953                 return 0
954         }
955         size += 4 // m.SpdIndex
956         size += 1 // m.SpdIndexValid
957         return size
958 }
959 func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) {
960         if b == nil {
961                 b = make([]byte, m.Size())
962         }
963         buf := codec.NewBuffer(b)
964         buf.EncodeUint32(m.SpdIndex)
965         buf.EncodeUint8(m.SpdIndexValid)
966         return buf.Bytes(), nil
967 }
968 func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error {
969         buf := codec.NewBuffer(b)
970         m.SpdIndex = buf.DecodeUint32()
971         m.SpdIndexValid = buf.DecodeUint8()
972         return nil
973 }
974
975 // IpsecSpdsDetails defines message 'ipsec_spds_details'.
976 type IpsecSpdsDetails struct {
977         SpdID     uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
978         Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"`
979 }
980
981 func (m *IpsecSpdsDetails) Reset()               { *m = IpsecSpdsDetails{} }
982 func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" }
983 func (*IpsecSpdsDetails) GetCrcString() string   { return "a04bb254" }
984 func (*IpsecSpdsDetails) GetMessageType() api.MessageType {
985         return api.ReplyMessage
986 }
987
988 func (m *IpsecSpdsDetails) Size() (size int) {
989         if m == nil {
990                 return 0
991         }
992         size += 4 // m.SpdID
993         size += 4 // m.Npolicies
994         return size
995 }
996 func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) {
997         if b == nil {
998                 b = make([]byte, m.Size())
999         }
1000         buf := codec.NewBuffer(b)
1001         buf.EncodeUint32(m.SpdID)
1002         buf.EncodeUint32(m.Npolicies)
1003         return buf.Bytes(), nil
1004 }
1005 func (m *IpsecSpdsDetails) Unmarshal(b []byte) error {
1006         buf := codec.NewBuffer(b)
1007         m.SpdID = buf.DecodeUint32()
1008         m.Npolicies = buf.DecodeUint32()
1009         return nil
1010 }
1011
1012 // IpsecSpdsDump defines message 'ipsec_spds_dump'.
1013 type IpsecSpdsDump struct{}
1014
1015 func (m *IpsecSpdsDump) Reset()               { *m = IpsecSpdsDump{} }
1016 func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" }
1017 func (*IpsecSpdsDump) GetCrcString() string   { return "51077d14" }
1018 func (*IpsecSpdsDump) GetMessageType() api.MessageType {
1019         return api.RequestMessage
1020 }
1021
1022 func (m *IpsecSpdsDump) Size() (size int) {
1023         if m == nil {
1024                 return 0
1025         }
1026         return size
1027 }
1028 func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) {
1029         if b == nil {
1030                 b = make([]byte, m.Size())
1031         }
1032         buf := codec.NewBuffer(b)
1033         return buf.Bytes(), nil
1034 }
1035 func (m *IpsecSpdsDump) Unmarshal(b []byte) error {
1036         return nil
1037 }
1038
1039 // IpsecTunnelIfAddDel defines message 'ipsec_tunnel_if_add_del'.
1040 type IpsecTunnelIfAddDel struct {
1041         IsAdd              bool             `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1042         Esn                bool             `binapi:"bool,name=esn" json:"esn,omitempty"`
1043         AntiReplay         bool             `binapi:"bool,name=anti_replay" json:"anti_replay,omitempty"`
1044         LocalIP            ip_types.Address `binapi:"address,name=local_ip" json:"local_ip,omitempty"`
1045         RemoteIP           ip_types.Address `binapi:"address,name=remote_ip" json:"remote_ip,omitempty"`
1046         LocalSpi           uint32           `binapi:"u32,name=local_spi" json:"local_spi,omitempty"`
1047         RemoteSpi          uint32           `binapi:"u32,name=remote_spi" json:"remote_spi,omitempty"`
1048         CryptoAlg          uint8            `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"`
1049         LocalCryptoKeyLen  uint8            `binapi:"u8,name=local_crypto_key_len" json:"local_crypto_key_len,omitempty"`
1050         LocalCryptoKey     []byte           `binapi:"u8[128],name=local_crypto_key" json:"local_crypto_key,omitempty"`
1051         RemoteCryptoKeyLen uint8            `binapi:"u8,name=remote_crypto_key_len" json:"remote_crypto_key_len,omitempty"`
1052         RemoteCryptoKey    []byte           `binapi:"u8[128],name=remote_crypto_key" json:"remote_crypto_key,omitempty"`
1053         IntegAlg           uint8            `binapi:"u8,name=integ_alg" json:"integ_alg,omitempty"`
1054         LocalIntegKeyLen   uint8            `binapi:"u8,name=local_integ_key_len" json:"local_integ_key_len,omitempty"`
1055         LocalIntegKey      []byte           `binapi:"u8[128],name=local_integ_key" json:"local_integ_key,omitempty"`
1056         RemoteIntegKeyLen  uint8            `binapi:"u8,name=remote_integ_key_len" json:"remote_integ_key_len,omitempty"`
1057         RemoteIntegKey     []byte           `binapi:"u8[128],name=remote_integ_key" json:"remote_integ_key,omitempty"`
1058         Renumber           bool             `binapi:"bool,name=renumber" json:"renumber,omitempty"`
1059         ShowInstance       uint32           `binapi:"u32,name=show_instance" json:"show_instance,omitempty"`
1060         UDPEncap           bool             `binapi:"bool,name=udp_encap" json:"udp_encap,omitempty"`
1061         TxTableID          uint32           `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"`
1062         Salt               uint32           `binapi:"u32,name=salt" json:"salt,omitempty"`
1063 }
1064
1065 func (m *IpsecTunnelIfAddDel) Reset()               { *m = IpsecTunnelIfAddDel{} }
1066 func (*IpsecTunnelIfAddDel) GetMessageName() string { return "ipsec_tunnel_if_add_del" }
1067 func (*IpsecTunnelIfAddDel) GetCrcString() string   { return "2b135e68" }
1068 func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType {
1069         return api.RequestMessage
1070 }
1071
1072 func (m *IpsecTunnelIfAddDel) Size() (size int) {
1073         if m == nil {
1074                 return 0
1075         }
1076         size += 1       // m.IsAdd
1077         size += 1       // m.Esn
1078         size += 1       // m.AntiReplay
1079         size += 1       // m.LocalIP.Af
1080         size += 1 * 16  // m.LocalIP.Un
1081         size += 1       // m.RemoteIP.Af
1082         size += 1 * 16  // m.RemoteIP.Un
1083         size += 4       // m.LocalSpi
1084         size += 4       // m.RemoteSpi
1085         size += 1       // m.CryptoAlg
1086         size += 1       // m.LocalCryptoKeyLen
1087         size += 1 * 128 // m.LocalCryptoKey
1088         size += 1       // m.RemoteCryptoKeyLen
1089         size += 1 * 128 // m.RemoteCryptoKey
1090         size += 1       // m.IntegAlg
1091         size += 1       // m.LocalIntegKeyLen
1092         size += 1 * 128 // m.LocalIntegKey
1093         size += 1       // m.RemoteIntegKeyLen
1094         size += 1 * 128 // m.RemoteIntegKey
1095         size += 1       // m.Renumber
1096         size += 4       // m.ShowInstance
1097         size += 1       // m.UDPEncap
1098         size += 4       // m.TxTableID
1099         size += 4       // m.Salt
1100         return size
1101 }
1102 func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) {
1103         if b == nil {
1104                 b = make([]byte, m.Size())
1105         }
1106         buf := codec.NewBuffer(b)
1107         buf.EncodeBool(m.IsAdd)
1108         buf.EncodeBool(m.Esn)
1109         buf.EncodeBool(m.AntiReplay)
1110         buf.EncodeUint8(uint8(m.LocalIP.Af))
1111         buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16)
1112         buf.EncodeUint8(uint8(m.RemoteIP.Af))
1113         buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 16)
1114         buf.EncodeUint32(m.LocalSpi)
1115         buf.EncodeUint32(m.RemoteSpi)
1116         buf.EncodeUint8(m.CryptoAlg)
1117         buf.EncodeUint8(m.LocalCryptoKeyLen)
1118         buf.EncodeBytes(m.LocalCryptoKey, 128)
1119         buf.EncodeUint8(m.RemoteCryptoKeyLen)
1120         buf.EncodeBytes(m.RemoteCryptoKey, 128)
1121         buf.EncodeUint8(m.IntegAlg)
1122         buf.EncodeUint8(m.LocalIntegKeyLen)
1123         buf.EncodeBytes(m.LocalIntegKey, 128)
1124         buf.EncodeUint8(m.RemoteIntegKeyLen)
1125         buf.EncodeBytes(m.RemoteIntegKey, 128)
1126         buf.EncodeBool(m.Renumber)
1127         buf.EncodeUint32(m.ShowInstance)
1128         buf.EncodeBool(m.UDPEncap)
1129         buf.EncodeUint32(m.TxTableID)
1130         buf.EncodeUint32(m.Salt)
1131         return buf.Bytes(), nil
1132 }
1133 func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error {
1134         buf := codec.NewBuffer(b)
1135         m.IsAdd = buf.DecodeBool()
1136         m.Esn = buf.DecodeBool()
1137         m.AntiReplay = buf.DecodeBool()
1138         m.LocalIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
1139         copy(m.LocalIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1140         m.RemoteIP.Af = ip_types.AddressFamily(buf.DecodeUint8())
1141         copy(m.RemoteIP.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1142         m.LocalSpi = buf.DecodeUint32()
1143         m.RemoteSpi = buf.DecodeUint32()
1144         m.CryptoAlg = buf.DecodeUint8()
1145         m.LocalCryptoKeyLen = buf.DecodeUint8()
1146         m.LocalCryptoKey = make([]byte, 128)
1147         copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey)))
1148         m.RemoteCryptoKeyLen = buf.DecodeUint8()
1149         m.RemoteCryptoKey = make([]byte, 128)
1150         copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey)))
1151         m.IntegAlg = buf.DecodeUint8()
1152         m.LocalIntegKeyLen = buf.DecodeUint8()
1153         m.LocalIntegKey = make([]byte, 128)
1154         copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey)))
1155         m.RemoteIntegKeyLen = buf.DecodeUint8()
1156         m.RemoteIntegKey = make([]byte, 128)
1157         copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey)))
1158         m.Renumber = buf.DecodeBool()
1159         m.ShowInstance = buf.DecodeUint32()
1160         m.UDPEncap = buf.DecodeBool()
1161         m.TxTableID = buf.DecodeUint32()
1162         m.Salt = buf.DecodeUint32()
1163         return nil
1164 }
1165
1166 // IpsecTunnelIfAddDelReply defines message 'ipsec_tunnel_if_add_del_reply'.
1167 type IpsecTunnelIfAddDelReply struct {
1168         Retval    int32                          `binapi:"i32,name=retval" json:"retval,omitempty"`
1169         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1170 }
1171
1172 func (m *IpsecTunnelIfAddDelReply) Reset()               { *m = IpsecTunnelIfAddDelReply{} }
1173 func (*IpsecTunnelIfAddDelReply) GetMessageName() string { return "ipsec_tunnel_if_add_del_reply" }
1174 func (*IpsecTunnelIfAddDelReply) GetCrcString() string   { return "5383d31f" }
1175 func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType {
1176         return api.ReplyMessage
1177 }
1178
1179 func (m *IpsecTunnelIfAddDelReply) Size() (size int) {
1180         if m == nil {
1181                 return 0
1182         }
1183         size += 4 // m.Retval
1184         size += 4 // m.SwIfIndex
1185         return size
1186 }
1187 func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) {
1188         if b == nil {
1189                 b = make([]byte, m.Size())
1190         }
1191         buf := codec.NewBuffer(b)
1192         buf.EncodeInt32(m.Retval)
1193         buf.EncodeUint32(uint32(m.SwIfIndex))
1194         return buf.Bytes(), nil
1195 }
1196 func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error {
1197         buf := codec.NewBuffer(b)
1198         m.Retval = buf.DecodeInt32()
1199         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1200         return nil
1201 }
1202
1203 // IpsecTunnelIfSetSa defines message 'ipsec_tunnel_if_set_sa'.
1204 type IpsecTunnelIfSetSa struct {
1205         SwIfIndex  interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1206         SaID       uint32                         `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1207         IsOutbound uint8                          `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"`
1208 }
1209
1210 func (m *IpsecTunnelIfSetSa) Reset()               { *m = IpsecTunnelIfSetSa{} }
1211 func (*IpsecTunnelIfSetSa) GetMessageName() string { return "ipsec_tunnel_if_set_sa" }
1212 func (*IpsecTunnelIfSetSa) GetCrcString() string   { return "f2f87112" }
1213 func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType {
1214         return api.RequestMessage
1215 }
1216
1217 func (m *IpsecTunnelIfSetSa) Size() (size int) {
1218         if m == nil {
1219                 return 0
1220         }
1221         size += 4 // m.SwIfIndex
1222         size += 4 // m.SaID
1223         size += 1 // m.IsOutbound
1224         return size
1225 }
1226 func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) {
1227         if b == nil {
1228                 b = make([]byte, m.Size())
1229         }
1230         buf := codec.NewBuffer(b)
1231         buf.EncodeUint32(uint32(m.SwIfIndex))
1232         buf.EncodeUint32(m.SaID)
1233         buf.EncodeUint8(m.IsOutbound)
1234         return buf.Bytes(), nil
1235 }
1236 func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error {
1237         buf := codec.NewBuffer(b)
1238         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1239         m.SaID = buf.DecodeUint32()
1240         m.IsOutbound = buf.DecodeUint8()
1241         return nil
1242 }
1243
1244 // IpsecTunnelIfSetSaReply defines message 'ipsec_tunnel_if_set_sa_reply'.
1245 type IpsecTunnelIfSetSaReply struct {
1246         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1247 }
1248
1249 func (m *IpsecTunnelIfSetSaReply) Reset()               { *m = IpsecTunnelIfSetSaReply{} }
1250 func (*IpsecTunnelIfSetSaReply) GetMessageName() string { return "ipsec_tunnel_if_set_sa_reply" }
1251 func (*IpsecTunnelIfSetSaReply) GetCrcString() string   { return "e8d4e804" }
1252 func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType {
1253         return api.ReplyMessage
1254 }
1255
1256 func (m *IpsecTunnelIfSetSaReply) Size() (size int) {
1257         if m == nil {
1258                 return 0
1259         }
1260         size += 4 // m.Retval
1261         return size
1262 }
1263 func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) {
1264         if b == nil {
1265                 b = make([]byte, m.Size())
1266         }
1267         buf := codec.NewBuffer(b)
1268         buf.EncodeInt32(m.Retval)
1269         return buf.Bytes(), nil
1270 }
1271 func (m *IpsecTunnelIfSetSaReply) Unmarshal(b []byte) error {
1272         buf := codec.NewBuffer(b)
1273         m.Retval = buf.DecodeInt32()
1274         return nil
1275 }
1276
1277 // IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'.
1278 type IpsecTunnelProtectDel struct {
1279         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1280         Nh        ip_types.Address               `binapi:"address,name=nh" json:"nh,omitempty"`
1281 }
1282
1283 func (m *IpsecTunnelProtectDel) Reset()               { *m = IpsecTunnelProtectDel{} }
1284 func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" }
1285 func (*IpsecTunnelProtectDel) GetCrcString() string   { return "ddd2ba36" }
1286 func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType {
1287         return api.RequestMessage
1288 }
1289
1290 func (m *IpsecTunnelProtectDel) Size() (size int) {
1291         if m == nil {
1292                 return 0
1293         }
1294         size += 4      // m.SwIfIndex
1295         size += 1      // m.Nh.Af
1296         size += 1 * 16 // m.Nh.Un
1297         return size
1298 }
1299 func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) {
1300         if b == nil {
1301                 b = make([]byte, m.Size())
1302         }
1303         buf := codec.NewBuffer(b)
1304         buf.EncodeUint32(uint32(m.SwIfIndex))
1305         buf.EncodeUint8(uint8(m.Nh.Af))
1306         buf.EncodeBytes(m.Nh.Un.XXX_UnionData[:], 16)
1307         return buf.Bytes(), nil
1308 }
1309 func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error {
1310         buf := codec.NewBuffer(b)
1311         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1312         m.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
1313         copy(m.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1314         return nil
1315 }
1316
1317 // IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'.
1318 type IpsecTunnelProtectDelReply struct {
1319         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1320 }
1321
1322 func (m *IpsecTunnelProtectDelReply) Reset()               { *m = IpsecTunnelProtectDelReply{} }
1323 func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" }
1324 func (*IpsecTunnelProtectDelReply) GetCrcString() string   { return "e8d4e804" }
1325 func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType {
1326         return api.ReplyMessage
1327 }
1328
1329 func (m *IpsecTunnelProtectDelReply) Size() (size int) {
1330         if m == nil {
1331                 return 0
1332         }
1333         size += 4 // m.Retval
1334         return size
1335 }
1336 func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) {
1337         if b == nil {
1338                 b = make([]byte, m.Size())
1339         }
1340         buf := codec.NewBuffer(b)
1341         buf.EncodeInt32(m.Retval)
1342         return buf.Bytes(), nil
1343 }
1344 func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error {
1345         buf := codec.NewBuffer(b)
1346         m.Retval = buf.DecodeInt32()
1347         return nil
1348 }
1349
1350 // IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'.
1351 type IpsecTunnelProtectDetails struct {
1352         Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"`
1353 }
1354
1355 func (m *IpsecTunnelProtectDetails) Reset()               { *m = IpsecTunnelProtectDetails{} }
1356 func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" }
1357 func (*IpsecTunnelProtectDetails) GetCrcString() string   { return "ac6c823b" }
1358 func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType {
1359         return api.ReplyMessage
1360 }
1361
1362 func (m *IpsecTunnelProtectDetails) Size() (size int) {
1363         if m == nil {
1364                 return 0
1365         }
1366         size += 4                   // m.Tun.SwIfIndex
1367         size += 1                   // m.Tun.Nh.Af
1368         size += 1 * 16              // m.Tun.Nh.Un
1369         size += 4                   // m.Tun.SaOut
1370         size += 1                   // m.Tun.NSaIn
1371         size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn
1372         return size
1373 }
1374 func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) {
1375         if b == nil {
1376                 b = make([]byte, m.Size())
1377         }
1378         buf := codec.NewBuffer(b)
1379         buf.EncodeUint32(uint32(m.Tun.SwIfIndex))
1380         buf.EncodeUint8(uint8(m.Tun.Nh.Af))
1381         buf.EncodeBytes(m.Tun.Nh.Un.XXX_UnionData[:], 16)
1382         buf.EncodeUint32(m.Tun.SaOut)
1383         buf.EncodeUint8(uint8(len(m.Tun.SaIn)))
1384         for i := 0; i < len(m.Tun.SaIn); i++ {
1385                 var x uint32
1386                 if i < len(m.Tun.SaIn) {
1387                         x = uint32(m.Tun.SaIn[i])
1388                 }
1389                 buf.EncodeUint32(x)
1390         }
1391         return buf.Bytes(), nil
1392 }
1393 func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error {
1394         buf := codec.NewBuffer(b)
1395         m.Tun.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1396         m.Tun.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
1397         copy(m.Tun.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1398         m.Tun.SaOut = buf.DecodeUint32()
1399         m.Tun.NSaIn = buf.DecodeUint8()
1400         m.Tun.SaIn = make([]uint32, m.Tun.NSaIn)
1401         for i := 0; i < len(m.Tun.SaIn); i++ {
1402                 m.Tun.SaIn[i] = buf.DecodeUint32()
1403         }
1404         return nil
1405 }
1406
1407 // IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'.
1408 type IpsecTunnelProtectDump struct {
1409         SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1410 }
1411
1412 func (m *IpsecTunnelProtectDump) Reset()               { *m = IpsecTunnelProtectDump{} }
1413 func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" }
1414 func (*IpsecTunnelProtectDump) GetCrcString() string   { return "f9e6675e" }
1415 func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType {
1416         return api.RequestMessage
1417 }
1418
1419 func (m *IpsecTunnelProtectDump) Size() (size int) {
1420         if m == nil {
1421                 return 0
1422         }
1423         size += 4 // m.SwIfIndex
1424         return size
1425 }
1426 func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) {
1427         if b == nil {
1428                 b = make([]byte, m.Size())
1429         }
1430         buf := codec.NewBuffer(b)
1431         buf.EncodeUint32(uint32(m.SwIfIndex))
1432         return buf.Bytes(), nil
1433 }
1434 func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error {
1435         buf := codec.NewBuffer(b)
1436         m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1437         return nil
1438 }
1439
1440 // IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'.
1441 type IpsecTunnelProtectUpdate struct {
1442         Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"`
1443 }
1444
1445 func (m *IpsecTunnelProtectUpdate) Reset()               { *m = IpsecTunnelProtectUpdate{} }
1446 func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" }
1447 func (*IpsecTunnelProtectUpdate) GetCrcString() string   { return "143f155d" }
1448 func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType {
1449         return api.RequestMessage
1450 }
1451
1452 func (m *IpsecTunnelProtectUpdate) Size() (size int) {
1453         if m == nil {
1454                 return 0
1455         }
1456         size += 4                      // m.Tunnel.SwIfIndex
1457         size += 1                      // m.Tunnel.Nh.Af
1458         size += 1 * 16                 // m.Tunnel.Nh.Un
1459         size += 4                      // m.Tunnel.SaOut
1460         size += 1                      // m.Tunnel.NSaIn
1461         size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn
1462         return size
1463 }
1464 func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) {
1465         if b == nil {
1466                 b = make([]byte, m.Size())
1467         }
1468         buf := codec.NewBuffer(b)
1469         buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
1470         buf.EncodeUint8(uint8(m.Tunnel.Nh.Af))
1471         buf.EncodeBytes(m.Tunnel.Nh.Un.XXX_UnionData[:], 16)
1472         buf.EncodeUint32(m.Tunnel.SaOut)
1473         buf.EncodeUint8(uint8(len(m.Tunnel.SaIn)))
1474         for i := 0; i < len(m.Tunnel.SaIn); i++ {
1475                 var x uint32
1476                 if i < len(m.Tunnel.SaIn) {
1477                         x = uint32(m.Tunnel.SaIn[i])
1478                 }
1479                 buf.EncodeUint32(x)
1480         }
1481         return buf.Bytes(), nil
1482 }
1483 func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error {
1484         buf := codec.NewBuffer(b)
1485         m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1486         m.Tunnel.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
1487         copy(m.Tunnel.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1488         m.Tunnel.SaOut = buf.DecodeUint32()
1489         m.Tunnel.NSaIn = buf.DecodeUint8()
1490         m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn)
1491         for i := 0; i < len(m.Tunnel.SaIn); i++ {
1492                 m.Tunnel.SaIn[i] = buf.DecodeUint32()
1493         }
1494         return nil
1495 }
1496
1497 // IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'.
1498 type IpsecTunnelProtectUpdateReply struct {
1499         Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1500 }
1501
1502 func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} }
1503 func (*IpsecTunnelProtectUpdateReply) GetMessageName() string {
1504         return "ipsec_tunnel_protect_update_reply"
1505 }
1506 func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" }
1507 func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType {
1508         return api.ReplyMessage
1509 }
1510
1511 func (m *IpsecTunnelProtectUpdateReply) Size() (size int) {
1512         if m == nil {
1513                 return 0
1514         }
1515         size += 4 // m.Retval
1516         return size
1517 }
1518 func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) {
1519         if b == nil {
1520                 b = make([]byte, m.Size())
1521         }
1522         buf := codec.NewBuffer(b)
1523         buf.EncodeInt32(m.Retval)
1524         return buf.Bytes(), nil
1525 }
1526 func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error {
1527         buf := codec.NewBuffer(b)
1528         m.Retval = buf.DecodeInt32()
1529         return nil
1530 }
1531
1532 func init() { file_ipsec_binapi_init() }
1533 func file_ipsec_binapi_init() {
1534         api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_ee601c29")
1535         api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14")
1536         api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_80f80cbb")
1537         api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804")
1538         api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_b30c7f41")
1539         api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4")
1540         api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_b8def364")
1541         api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b")
1542         api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_5bcfd3b7")
1543         api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804")
1544         api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_20e89a95")
1545         api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804")
1546         api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_f2222790")
1547         api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d")
1548         api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_9f384b8d")
1549         api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b")
1550         api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_7a0bcf3e")
1551         api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19")
1552         api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254")
1553         api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14")
1554         api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec_tunnel_if_add_del_2b135e68")
1555         api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec_tunnel_if_add_del_reply_5383d31f")
1556         api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec_tunnel_if_set_sa_f2f87112")
1557         api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec_tunnel_if_set_sa_reply_e8d4e804")
1558         api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_ddd2ba36")
1559         api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804")
1560         api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_ac6c823b")
1561         api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e")
1562         api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_143f155d")
1563         api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804")
1564 }
1565
1566 // Messages returns list of all messages in this module.
1567 func AllMessages() []api.Message {
1568         return []api.Message{
1569                 (*IpsecBackendDetails)(nil),
1570                 (*IpsecBackendDump)(nil),
1571                 (*IpsecInterfaceAddDelSpd)(nil),
1572                 (*IpsecInterfaceAddDelSpdReply)(nil),
1573                 (*IpsecSaDetails)(nil),
1574                 (*IpsecSaDump)(nil),
1575                 (*IpsecSadEntryAddDel)(nil),
1576                 (*IpsecSadEntryAddDelReply)(nil),
1577                 (*IpsecSelectBackend)(nil),
1578                 (*IpsecSelectBackendReply)(nil),
1579                 (*IpsecSpdAddDel)(nil),
1580                 (*IpsecSpdAddDelReply)(nil),
1581                 (*IpsecSpdDetails)(nil),
1582                 (*IpsecSpdDump)(nil),
1583                 (*IpsecSpdEntryAddDel)(nil),
1584                 (*IpsecSpdEntryAddDelReply)(nil),
1585                 (*IpsecSpdInterfaceDetails)(nil),
1586                 (*IpsecSpdInterfaceDump)(nil),
1587                 (*IpsecSpdsDetails)(nil),
1588                 (*IpsecSpdsDump)(nil),
1589                 (*IpsecTunnelIfAddDel)(nil),
1590                 (*IpsecTunnelIfAddDelReply)(nil),
1591                 (*IpsecTunnelIfSetSa)(nil),
1592                 (*IpsecTunnelIfSetSaReply)(nil),
1593                 (*IpsecTunnelProtectDel)(nil),
1594                 (*IpsecTunnelProtectDelReply)(nil),
1595                 (*IpsecTunnelProtectDetails)(nil),
1596                 (*IpsecTunnelProtectDump)(nil),
1597                 (*IpsecTunnelProtectUpdate)(nil),
1598                 (*IpsecTunnelProtectUpdateReply)(nil),
1599         }
1600 }