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