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