1 // Code generated by GoVPP's binapi-generator. DO NOT EDIT.
3 // binapi-generator: v0.4.0
5 // source: /usr/share/vpp/api/core/ipsec.api.json
7 // Package ipsec contains generated bindings for API file ipsec.api.
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 tunnel_types "git.fd.io/govpp.git/binapi/tunnel_types"
24 codec "git.fd.io/govpp.git/codec"
27 // This is a compile-time assertion to ensure that this generated file
28 // is compatible with the GoVPP api package it is being compiled against.
29 // A compilation error at this line likely means your copy of the
30 // GoVPP api package needs to be updated.
31 const _ = api.GoVppAPIPackageIsVersion2
36 VersionCrc = 0x196d64b0
39 // IpsecSpdAction defines enum 'ipsec_spd_action'.
40 type IpsecSpdAction uint32
43 IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0
44 IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1
45 IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2
46 IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3
50 IpsecSpdAction_name = map[uint32]string{
51 0: "IPSEC_API_SPD_ACTION_BYPASS",
52 1: "IPSEC_API_SPD_ACTION_DISCARD",
53 2: "IPSEC_API_SPD_ACTION_RESOLVE",
54 3: "IPSEC_API_SPD_ACTION_PROTECT",
56 IpsecSpdAction_value = map[string]uint32{
57 "IPSEC_API_SPD_ACTION_BYPASS": 0,
58 "IPSEC_API_SPD_ACTION_DISCARD": 1,
59 "IPSEC_API_SPD_ACTION_RESOLVE": 2,
60 "IPSEC_API_SPD_ACTION_PROTECT": 3,
64 func (x IpsecSpdAction) String() string {
65 s, ok := IpsecSpdAction_name[uint32(x)]
69 return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")"
72 // IpsecItf defines type 'ipsec_itf'.
73 type IpsecItf struct {
74 UserInstance uint32 `binapi:"u32,name=user_instance,default=4294967295" json:"user_instance,omitempty"`
75 Mode tunnel_types.TunnelMode `binapi:"tunnel_mode,name=mode" json:"mode,omitempty"`
76 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
79 // IpsecSpdEntry defines type 'ipsec_spd_entry'.
80 type IpsecSpdEntry struct {
81 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
82 Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"`
83 IsOutbound bool `binapi:"bool,name=is_outbound" json:"is_outbound,omitempty"`
84 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
85 Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"`
86 Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"`
87 RemoteAddressStart ip_types.Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"`
88 RemoteAddressStop ip_types.Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"`
89 LocalAddressStart ip_types.Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"`
90 LocalAddressStop ip_types.Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"`
91 RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"`
92 RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"`
93 LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"`
94 LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"`
97 // IpsecTunnelProtect defines type 'ipsec_tunnel_protect'.
98 type IpsecTunnelProtect struct {
99 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
100 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"`
101 SaOut uint32 `binapi:"u32,name=sa_out" json:"sa_out,omitempty"`
102 NSaIn uint8 `binapi:"u8,name=n_sa_in" json:"-"`
103 SaIn []uint32 `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"`
106 // IpsecBackendDetails defines message 'ipsec_backend_details'.
107 type IpsecBackendDetails struct {
108 Name string `binapi:"string[128],name=name" json:"name,omitempty"`
109 Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
110 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
111 Active bool `binapi:"bool,name=active" json:"active,omitempty"`
114 func (m *IpsecBackendDetails) Reset() { *m = IpsecBackendDetails{} }
115 func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" }
116 func (*IpsecBackendDetails) GetCrcString() string { return "ee601c29" }
117 func (*IpsecBackendDetails) GetMessageType() api.MessageType {
118 return api.ReplyMessage
121 func (m *IpsecBackendDetails) Size() (size int) {
125 size += 128 // m.Name
126 size += 4 // m.Protocol
128 size += 1 // m.Active
131 func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) {
133 b = make([]byte, m.Size())
135 buf := codec.NewBuffer(b)
136 buf.EncodeString(m.Name, 128)
137 buf.EncodeUint32(uint32(m.Protocol))
138 buf.EncodeUint8(m.Index)
139 buf.EncodeBool(m.Active)
140 return buf.Bytes(), nil
142 func (m *IpsecBackendDetails) Unmarshal(b []byte) error {
143 buf := codec.NewBuffer(b)
144 m.Name = buf.DecodeString(128)
145 m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
146 m.Index = buf.DecodeUint8()
147 m.Active = buf.DecodeBool()
151 // IpsecBackendDump defines message 'ipsec_backend_dump'.
152 type IpsecBackendDump struct{}
154 func (m *IpsecBackendDump) Reset() { *m = IpsecBackendDump{} }
155 func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" }
156 func (*IpsecBackendDump) GetCrcString() string { return "51077d14" }
157 func (*IpsecBackendDump) GetMessageType() api.MessageType {
158 return api.RequestMessage
161 func (m *IpsecBackendDump) Size() (size int) {
167 func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) {
169 b = make([]byte, m.Size())
171 buf := codec.NewBuffer(b)
172 return buf.Bytes(), nil
174 func (m *IpsecBackendDump) Unmarshal(b []byte) error {
178 // IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'.
179 type IpsecInterfaceAddDelSpd struct {
180 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
181 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
182 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
185 func (m *IpsecInterfaceAddDelSpd) Reset() { *m = IpsecInterfaceAddDelSpd{} }
186 func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" }
187 func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "80f80cbb" }
188 func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType {
189 return api.RequestMessage
192 func (m *IpsecInterfaceAddDelSpd) Size() (size int) {
197 size += 4 // m.SwIfIndex
201 func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) {
203 b = make([]byte, m.Size())
205 buf := codec.NewBuffer(b)
206 buf.EncodeBool(m.IsAdd)
207 buf.EncodeUint32(uint32(m.SwIfIndex))
208 buf.EncodeUint32(m.SpdID)
209 return buf.Bytes(), nil
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()
219 // IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'.
220 type IpsecInterfaceAddDelSpdReply struct {
221 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
224 func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} }
225 func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string {
226 return "ipsec_interface_add_del_spd_reply"
228 func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" }
229 func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType {
230 return api.ReplyMessage
233 func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) {
237 size += 4 // m.Retval
240 func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) {
242 b = make([]byte, m.Size())
244 buf := codec.NewBuffer(b)
245 buf.EncodeInt32(m.Retval)
246 return buf.Bytes(), nil
248 func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error {
249 buf := codec.NewBuffer(b)
250 m.Retval = buf.DecodeInt32()
254 // IpsecItfCreate defines message 'ipsec_itf_create'.
255 type IpsecItfCreate struct {
256 Itf IpsecItf `binapi:"ipsec_itf,name=itf" json:"itf,omitempty"`
259 func (m *IpsecItfCreate) Reset() { *m = IpsecItfCreate{} }
260 func (*IpsecItfCreate) GetMessageName() string { return "ipsec_itf_create" }
261 func (*IpsecItfCreate) GetCrcString() string { return "6f50b3bc" }
262 func (*IpsecItfCreate) GetMessageType() api.MessageType {
263 return api.RequestMessage
266 func (m *IpsecItfCreate) Size() (size int) {
270 size += 4 // m.Itf.UserInstance
271 size += 1 // m.Itf.Mode
272 size += 4 // m.Itf.SwIfIndex
275 func (m *IpsecItfCreate) Marshal(b []byte) ([]byte, error) {
277 b = make([]byte, m.Size())
279 buf := codec.NewBuffer(b)
280 buf.EncodeUint32(m.Itf.UserInstance)
281 buf.EncodeUint8(uint8(m.Itf.Mode))
282 buf.EncodeUint32(uint32(m.Itf.SwIfIndex))
283 return buf.Bytes(), nil
285 func (m *IpsecItfCreate) Unmarshal(b []byte) error {
286 buf := codec.NewBuffer(b)
287 m.Itf.UserInstance = buf.DecodeUint32()
288 m.Itf.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
289 m.Itf.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
293 // IpsecItfCreateReply defines message 'ipsec_itf_create_reply'.
294 type IpsecItfCreateReply struct {
295 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
296 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
299 func (m *IpsecItfCreateReply) Reset() { *m = IpsecItfCreateReply{} }
300 func (*IpsecItfCreateReply) GetMessageName() string { return "ipsec_itf_create_reply" }
301 func (*IpsecItfCreateReply) GetCrcString() string { return "5383d31f" }
302 func (*IpsecItfCreateReply) GetMessageType() api.MessageType {
303 return api.ReplyMessage
306 func (m *IpsecItfCreateReply) Size() (size int) {
310 size += 4 // m.Retval
311 size += 4 // m.SwIfIndex
314 func (m *IpsecItfCreateReply) Marshal(b []byte) ([]byte, error) {
316 b = make([]byte, m.Size())
318 buf := codec.NewBuffer(b)
319 buf.EncodeInt32(m.Retval)
320 buf.EncodeUint32(uint32(m.SwIfIndex))
321 return buf.Bytes(), nil
323 func (m *IpsecItfCreateReply) Unmarshal(b []byte) error {
324 buf := codec.NewBuffer(b)
325 m.Retval = buf.DecodeInt32()
326 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
330 // IpsecItfDelete defines message 'ipsec_itf_delete'.
331 type IpsecItfDelete struct {
332 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
335 func (m *IpsecItfDelete) Reset() { *m = IpsecItfDelete{} }
336 func (*IpsecItfDelete) GetMessageName() string { return "ipsec_itf_delete" }
337 func (*IpsecItfDelete) GetCrcString() string { return "f9e6675e" }
338 func (*IpsecItfDelete) GetMessageType() api.MessageType {
339 return api.RequestMessage
342 func (m *IpsecItfDelete) Size() (size int) {
346 size += 4 // m.SwIfIndex
349 func (m *IpsecItfDelete) Marshal(b []byte) ([]byte, error) {
351 b = make([]byte, m.Size())
353 buf := codec.NewBuffer(b)
354 buf.EncodeUint32(uint32(m.SwIfIndex))
355 return buf.Bytes(), nil
357 func (m *IpsecItfDelete) Unmarshal(b []byte) error {
358 buf := codec.NewBuffer(b)
359 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
363 // IpsecItfDeleteReply defines message 'ipsec_itf_delete_reply'.
364 type IpsecItfDeleteReply struct {
365 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
368 func (m *IpsecItfDeleteReply) Reset() { *m = IpsecItfDeleteReply{} }
369 func (*IpsecItfDeleteReply) GetMessageName() string { return "ipsec_itf_delete_reply" }
370 func (*IpsecItfDeleteReply) GetCrcString() string { return "e8d4e804" }
371 func (*IpsecItfDeleteReply) GetMessageType() api.MessageType {
372 return api.ReplyMessage
375 func (m *IpsecItfDeleteReply) Size() (size int) {
379 size += 4 // m.Retval
382 func (m *IpsecItfDeleteReply) Marshal(b []byte) ([]byte, error) {
384 b = make([]byte, m.Size())
386 buf := codec.NewBuffer(b)
387 buf.EncodeInt32(m.Retval)
388 return buf.Bytes(), nil
390 func (m *IpsecItfDeleteReply) Unmarshal(b []byte) error {
391 buf := codec.NewBuffer(b)
392 m.Retval = buf.DecodeInt32()
396 // IpsecItfDetails defines message 'ipsec_itf_details'.
397 type IpsecItfDetails struct {
398 Itf IpsecItf `binapi:"ipsec_itf,name=itf" json:"itf,omitempty"`
401 func (m *IpsecItfDetails) Reset() { *m = IpsecItfDetails{} }
402 func (*IpsecItfDetails) GetMessageName() string { return "ipsec_itf_details" }
403 func (*IpsecItfDetails) GetCrcString() string { return "548a73b8" }
404 func (*IpsecItfDetails) GetMessageType() api.MessageType {
405 return api.ReplyMessage
408 func (m *IpsecItfDetails) Size() (size int) {
412 size += 4 // m.Itf.UserInstance
413 size += 1 // m.Itf.Mode
414 size += 4 // m.Itf.SwIfIndex
417 func (m *IpsecItfDetails) Marshal(b []byte) ([]byte, error) {
419 b = make([]byte, m.Size())
421 buf := codec.NewBuffer(b)
422 buf.EncodeUint32(m.Itf.UserInstance)
423 buf.EncodeUint8(uint8(m.Itf.Mode))
424 buf.EncodeUint32(uint32(m.Itf.SwIfIndex))
425 return buf.Bytes(), nil
427 func (m *IpsecItfDetails) Unmarshal(b []byte) error {
428 buf := codec.NewBuffer(b)
429 m.Itf.UserInstance = buf.DecodeUint32()
430 m.Itf.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
431 m.Itf.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
435 // IpsecItfDump defines message 'ipsec_itf_dump'.
436 type IpsecItfDump struct {
437 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
440 func (m *IpsecItfDump) Reset() { *m = IpsecItfDump{} }
441 func (*IpsecItfDump) GetMessageName() string { return "ipsec_itf_dump" }
442 func (*IpsecItfDump) GetCrcString() string { return "f9e6675e" }
443 func (*IpsecItfDump) GetMessageType() api.MessageType {
444 return api.RequestMessage
447 func (m *IpsecItfDump) Size() (size int) {
451 size += 4 // m.SwIfIndex
454 func (m *IpsecItfDump) Marshal(b []byte) ([]byte, error) {
456 b = make([]byte, m.Size())
458 buf := codec.NewBuffer(b)
459 buf.EncodeUint32(uint32(m.SwIfIndex))
460 return buf.Bytes(), nil
462 func (m *IpsecItfDump) Unmarshal(b []byte) error {
463 buf := codec.NewBuffer(b)
464 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
468 // IpsecSaDetails defines message 'ipsec_sa_details'.
469 // Deprecated: the message will be removed in the future versions
470 type IpsecSaDetails struct {
471 Entry ipsec_types.IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
472 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
473 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
474 SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
475 LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
476 ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
477 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
480 func (m *IpsecSaDetails) Reset() { *m = IpsecSaDetails{} }
481 func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" }
482 func (*IpsecSaDetails) GetCrcString() string { return "345d14a7" }
483 func (*IpsecSaDetails) GetMessageType() api.MessageType {
484 return api.ReplyMessage
487 func (m *IpsecSaDetails) Size() (size int) {
491 size += 4 // m.Entry.SadID
492 size += 4 // m.Entry.Spi
493 size += 4 // m.Entry.Protocol
494 size += 4 // m.Entry.CryptoAlgorithm
495 size += 1 // m.Entry.CryptoKey.Length
496 size += 1 * 128 // m.Entry.CryptoKey.Data
497 size += 4 // m.Entry.IntegrityAlgorithm
498 size += 1 // m.Entry.IntegrityKey.Length
499 size += 1 * 128 // m.Entry.IntegrityKey.Data
500 size += 4 // m.Entry.Flags
501 size += 1 // m.Entry.TunnelSrc.Af
502 size += 1 * 16 // m.Entry.TunnelSrc.Un
503 size += 1 // m.Entry.TunnelDst.Af
504 size += 1 * 16 // m.Entry.TunnelDst.Un
505 size += 4 // m.Entry.TxTableID
506 size += 4 // m.Entry.Salt
507 size += 2 // m.Entry.UDPSrcPort
508 size += 2 // m.Entry.UDPDstPort
509 size += 4 // m.SwIfIndex
511 size += 8 // m.SeqOutbound
512 size += 8 // m.LastSeqInbound
513 size += 8 // m.ReplayWindow
514 size += 4 // m.StatIndex
517 func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) {
519 b = make([]byte, m.Size())
521 buf := codec.NewBuffer(b)
522 buf.EncodeUint32(m.Entry.SadID)
523 buf.EncodeUint32(m.Entry.Spi)
524 buf.EncodeUint32(uint32(m.Entry.Protocol))
525 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
526 buf.EncodeUint8(m.Entry.CryptoKey.Length)
527 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
528 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
529 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
530 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
531 buf.EncodeUint32(uint32(m.Entry.Flags))
532 buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
533 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
534 buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
535 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
536 buf.EncodeUint32(m.Entry.TxTableID)
537 buf.EncodeUint32(m.Entry.Salt)
538 buf.EncodeUint16(m.Entry.UDPSrcPort)
539 buf.EncodeUint16(m.Entry.UDPDstPort)
540 buf.EncodeUint32(uint32(m.SwIfIndex))
541 buf.EncodeUint32(m.Salt)
542 buf.EncodeUint64(m.SeqOutbound)
543 buf.EncodeUint64(m.LastSeqInbound)
544 buf.EncodeUint64(m.ReplayWindow)
545 buf.EncodeUint32(m.StatIndex)
546 return buf.Bytes(), nil
548 func (m *IpsecSaDetails) Unmarshal(b []byte) error {
549 buf := codec.NewBuffer(b)
550 m.Entry.SadID = buf.DecodeUint32()
551 m.Entry.Spi = buf.DecodeUint32()
552 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
553 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
554 m.Entry.CryptoKey.Length = buf.DecodeUint8()
555 m.Entry.CryptoKey.Data = make([]byte, 128)
556 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
557 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
558 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
559 m.Entry.IntegrityKey.Data = make([]byte, 128)
560 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
561 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
562 m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
563 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
564 m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
565 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
566 m.Entry.TxTableID = buf.DecodeUint32()
567 m.Entry.Salt = buf.DecodeUint32()
568 m.Entry.UDPSrcPort = buf.DecodeUint16()
569 m.Entry.UDPDstPort = buf.DecodeUint16()
570 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
571 m.Salt = buf.DecodeUint32()
572 m.SeqOutbound = buf.DecodeUint64()
573 m.LastSeqInbound = buf.DecodeUint64()
574 m.ReplayWindow = buf.DecodeUint64()
575 m.StatIndex = buf.DecodeUint32()
579 // IpsecSaDump defines message 'ipsec_sa_dump'.
580 // Deprecated: the message will be removed in the future versions
581 type IpsecSaDump struct {
582 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
585 func (m *IpsecSaDump) Reset() { *m = IpsecSaDump{} }
586 func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" }
587 func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" }
588 func (*IpsecSaDump) GetMessageType() api.MessageType {
589 return api.RequestMessage
592 func (m *IpsecSaDump) Size() (size int) {
599 func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) {
601 b = make([]byte, m.Size())
603 buf := codec.NewBuffer(b)
604 buf.EncodeUint32(m.SaID)
605 return buf.Bytes(), nil
607 func (m *IpsecSaDump) Unmarshal(b []byte) error {
608 buf := codec.NewBuffer(b)
609 m.SaID = buf.DecodeUint32()
613 // IpsecSaV2Details defines message 'ipsec_sa_v2_details'.
614 type IpsecSaV2Details struct {
615 Entry ipsec_types.IpsecSadEntryV2 `binapi:"ipsec_sad_entry_v2,name=entry" json:"entry,omitempty"`
616 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
617 Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"`
618 SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
619 LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
620 ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
621 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
624 func (m *IpsecSaV2Details) Reset() { *m = IpsecSaV2Details{} }
625 func (*IpsecSaV2Details) GetMessageName() string { return "ipsec_sa_v2_details" }
626 func (*IpsecSaV2Details) GetCrcString() string { return "e2130051" }
627 func (*IpsecSaV2Details) GetMessageType() api.MessageType {
628 return api.ReplyMessage
631 func (m *IpsecSaV2Details) Size() (size int) {
635 size += 4 // m.Entry.SadID
636 size += 4 // m.Entry.Spi
637 size += 4 // m.Entry.Protocol
638 size += 4 // m.Entry.CryptoAlgorithm
639 size += 1 // m.Entry.CryptoKey.Length
640 size += 1 * 128 // m.Entry.CryptoKey.Data
641 size += 4 // m.Entry.IntegrityAlgorithm
642 size += 1 // m.Entry.IntegrityKey.Length
643 size += 1 * 128 // m.Entry.IntegrityKey.Data
644 size += 4 // m.Entry.Flags
645 size += 1 // m.Entry.TunnelSrc.Af
646 size += 1 * 16 // m.Entry.TunnelSrc.Un
647 size += 1 // m.Entry.TunnelDst.Af
648 size += 1 * 16 // m.Entry.TunnelDst.Un
649 size += 1 // m.Entry.TunnelFlags
650 size += 1 // m.Entry.Dscp
651 size += 4 // m.Entry.TxTableID
652 size += 4 // m.Entry.Salt
653 size += 2 // m.Entry.UDPSrcPort
654 size += 2 // m.Entry.UDPDstPort
655 size += 4 // m.SwIfIndex
657 size += 8 // m.SeqOutbound
658 size += 8 // m.LastSeqInbound
659 size += 8 // m.ReplayWindow
660 size += 4 // m.StatIndex
663 func (m *IpsecSaV2Details) Marshal(b []byte) ([]byte, error) {
665 b = make([]byte, m.Size())
667 buf := codec.NewBuffer(b)
668 buf.EncodeUint32(m.Entry.SadID)
669 buf.EncodeUint32(m.Entry.Spi)
670 buf.EncodeUint32(uint32(m.Entry.Protocol))
671 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
672 buf.EncodeUint8(m.Entry.CryptoKey.Length)
673 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
674 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
675 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
676 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
677 buf.EncodeUint32(uint32(m.Entry.Flags))
678 buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
679 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
680 buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
681 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
682 buf.EncodeUint8(uint8(m.Entry.TunnelFlags))
683 buf.EncodeUint8(uint8(m.Entry.Dscp))
684 buf.EncodeUint32(m.Entry.TxTableID)
685 buf.EncodeUint32(m.Entry.Salt)
686 buf.EncodeUint16(m.Entry.UDPSrcPort)
687 buf.EncodeUint16(m.Entry.UDPDstPort)
688 buf.EncodeUint32(uint32(m.SwIfIndex))
689 buf.EncodeUint32(m.Salt)
690 buf.EncodeUint64(m.SeqOutbound)
691 buf.EncodeUint64(m.LastSeqInbound)
692 buf.EncodeUint64(m.ReplayWindow)
693 buf.EncodeUint32(m.StatIndex)
694 return buf.Bytes(), nil
696 func (m *IpsecSaV2Details) Unmarshal(b []byte) error {
697 buf := codec.NewBuffer(b)
698 m.Entry.SadID = buf.DecodeUint32()
699 m.Entry.Spi = buf.DecodeUint32()
700 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
701 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
702 m.Entry.CryptoKey.Length = buf.DecodeUint8()
703 m.Entry.CryptoKey.Data = make([]byte, 128)
704 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
705 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
706 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
707 m.Entry.IntegrityKey.Data = make([]byte, 128)
708 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
709 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
710 m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
711 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
712 m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
713 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
714 m.Entry.TunnelFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
715 m.Entry.Dscp = ip_types.IPDscp(buf.DecodeUint8())
716 m.Entry.TxTableID = buf.DecodeUint32()
717 m.Entry.Salt = buf.DecodeUint32()
718 m.Entry.UDPSrcPort = buf.DecodeUint16()
719 m.Entry.UDPDstPort = buf.DecodeUint16()
720 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
721 m.Salt = buf.DecodeUint32()
722 m.SeqOutbound = buf.DecodeUint64()
723 m.LastSeqInbound = buf.DecodeUint64()
724 m.ReplayWindow = buf.DecodeUint64()
725 m.StatIndex = buf.DecodeUint32()
729 // IpsecSaV2Dump defines message 'ipsec_sa_v2_dump'.
730 type IpsecSaV2Dump struct {
731 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
734 func (m *IpsecSaV2Dump) Reset() { *m = IpsecSaV2Dump{} }
735 func (*IpsecSaV2Dump) GetMessageName() string { return "ipsec_sa_v2_dump" }
736 func (*IpsecSaV2Dump) GetCrcString() string { return "2076c2f4" }
737 func (*IpsecSaV2Dump) GetMessageType() api.MessageType {
738 return api.RequestMessage
741 func (m *IpsecSaV2Dump) Size() (size int) {
748 func (m *IpsecSaV2Dump) Marshal(b []byte) ([]byte, error) {
750 b = make([]byte, m.Size())
752 buf := codec.NewBuffer(b)
753 buf.EncodeUint32(m.SaID)
754 return buf.Bytes(), nil
756 func (m *IpsecSaV2Dump) Unmarshal(b []byte) error {
757 buf := codec.NewBuffer(b)
758 m.SaID = buf.DecodeUint32()
762 // IpsecSaV3Details defines message 'ipsec_sa_v3_details'.
763 type IpsecSaV3Details struct {
764 Entry ipsec_types.IpsecSadEntryV3 `binapi:"ipsec_sad_entry_v3,name=entry" json:"entry,omitempty"`
765 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
766 SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"`
767 LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"`
768 ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"`
769 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
772 func (m *IpsecSaV3Details) Reset() { *m = IpsecSaV3Details{} }
773 func (*IpsecSaV3Details) GetMessageName() string { return "ipsec_sa_v3_details" }
774 func (*IpsecSaV3Details) GetCrcString() string { return "2fc991ee" }
775 func (*IpsecSaV3Details) GetMessageType() api.MessageType {
776 return api.ReplyMessage
779 func (m *IpsecSaV3Details) Size() (size int) {
783 size += 4 // m.Entry.SadID
784 size += 4 // m.Entry.Spi
785 size += 4 // m.Entry.Protocol
786 size += 4 // m.Entry.CryptoAlgorithm
787 size += 1 // m.Entry.CryptoKey.Length
788 size += 1 * 128 // m.Entry.CryptoKey.Data
789 size += 4 // m.Entry.IntegrityAlgorithm
790 size += 1 // m.Entry.IntegrityKey.Length
791 size += 1 * 128 // m.Entry.IntegrityKey.Data
792 size += 4 // m.Entry.Flags
793 size += 4 // m.Entry.Tunnel.Instance
794 size += 1 // m.Entry.Tunnel.Src.Af
795 size += 1 * 16 // m.Entry.Tunnel.Src.Un
796 size += 1 // m.Entry.Tunnel.Dst.Af
797 size += 1 * 16 // m.Entry.Tunnel.Dst.Un
798 size += 4 // m.Entry.Tunnel.SwIfIndex
799 size += 4 // m.Entry.Tunnel.TableID
800 size += 1 // m.Entry.Tunnel.EncapDecapFlags
801 size += 1 // m.Entry.Tunnel.Mode
802 size += 1 // m.Entry.Tunnel.Flags
803 size += 1 // m.Entry.Tunnel.Dscp
804 size += 1 // m.Entry.Tunnel.HopLimit
805 size += 4 // m.Entry.Salt
806 size += 2 // m.Entry.UDPSrcPort
807 size += 2 // m.Entry.UDPDstPort
808 size += 4 // m.SwIfIndex
809 size += 8 // m.SeqOutbound
810 size += 8 // m.LastSeqInbound
811 size += 8 // m.ReplayWindow
812 size += 4 // m.StatIndex
815 func (m *IpsecSaV3Details) Marshal(b []byte) ([]byte, error) {
817 b = make([]byte, m.Size())
819 buf := codec.NewBuffer(b)
820 buf.EncodeUint32(m.Entry.SadID)
821 buf.EncodeUint32(m.Entry.Spi)
822 buf.EncodeUint32(uint32(m.Entry.Protocol))
823 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
824 buf.EncodeUint8(m.Entry.CryptoKey.Length)
825 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
826 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
827 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
828 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
829 buf.EncodeUint32(uint32(m.Entry.Flags))
830 buf.EncodeUint32(m.Entry.Tunnel.Instance)
831 buf.EncodeUint8(uint8(m.Entry.Tunnel.Src.Af))
832 buf.EncodeBytes(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], 16)
833 buf.EncodeUint8(uint8(m.Entry.Tunnel.Dst.Af))
834 buf.EncodeBytes(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], 16)
835 buf.EncodeUint32(uint32(m.Entry.Tunnel.SwIfIndex))
836 buf.EncodeUint32(m.Entry.Tunnel.TableID)
837 buf.EncodeUint8(uint8(m.Entry.Tunnel.EncapDecapFlags))
838 buf.EncodeUint8(uint8(m.Entry.Tunnel.Mode))
839 buf.EncodeUint8(uint8(m.Entry.Tunnel.Flags))
840 buf.EncodeUint8(uint8(m.Entry.Tunnel.Dscp))
841 buf.EncodeUint8(m.Entry.Tunnel.HopLimit)
842 buf.EncodeUint32(m.Entry.Salt)
843 buf.EncodeUint16(m.Entry.UDPSrcPort)
844 buf.EncodeUint16(m.Entry.UDPDstPort)
845 buf.EncodeUint32(uint32(m.SwIfIndex))
846 buf.EncodeUint64(m.SeqOutbound)
847 buf.EncodeUint64(m.LastSeqInbound)
848 buf.EncodeUint64(m.ReplayWindow)
849 buf.EncodeUint32(m.StatIndex)
850 return buf.Bytes(), nil
852 func (m *IpsecSaV3Details) Unmarshal(b []byte) error {
853 buf := codec.NewBuffer(b)
854 m.Entry.SadID = buf.DecodeUint32()
855 m.Entry.Spi = buf.DecodeUint32()
856 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
857 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
858 m.Entry.CryptoKey.Length = buf.DecodeUint8()
859 m.Entry.CryptoKey.Data = make([]byte, 128)
860 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
861 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
862 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
863 m.Entry.IntegrityKey.Data = make([]byte, 128)
864 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
865 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
866 m.Entry.Tunnel.Instance = buf.DecodeUint32()
867 m.Entry.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
868 copy(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
869 m.Entry.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
870 copy(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
871 m.Entry.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
872 m.Entry.Tunnel.TableID = buf.DecodeUint32()
873 m.Entry.Tunnel.EncapDecapFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
874 m.Entry.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
875 m.Entry.Tunnel.Flags = tunnel_types.TunnelFlags(buf.DecodeUint8())
876 m.Entry.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
877 m.Entry.Tunnel.HopLimit = buf.DecodeUint8()
878 m.Entry.Salt = buf.DecodeUint32()
879 m.Entry.UDPSrcPort = buf.DecodeUint16()
880 m.Entry.UDPDstPort = buf.DecodeUint16()
881 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
882 m.SeqOutbound = buf.DecodeUint64()
883 m.LastSeqInbound = buf.DecodeUint64()
884 m.ReplayWindow = buf.DecodeUint64()
885 m.StatIndex = buf.DecodeUint32()
889 // IpsecSaV3Dump defines message 'ipsec_sa_v3_dump'.
890 type IpsecSaV3Dump struct {
891 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
894 func (m *IpsecSaV3Dump) Reset() { *m = IpsecSaV3Dump{} }
895 func (*IpsecSaV3Dump) GetMessageName() string { return "ipsec_sa_v3_dump" }
896 func (*IpsecSaV3Dump) GetCrcString() string { return "2076c2f4" }
897 func (*IpsecSaV3Dump) GetMessageType() api.MessageType {
898 return api.RequestMessage
901 func (m *IpsecSaV3Dump) Size() (size int) {
908 func (m *IpsecSaV3Dump) Marshal(b []byte) ([]byte, error) {
910 b = make([]byte, m.Size())
912 buf := codec.NewBuffer(b)
913 buf.EncodeUint32(m.SaID)
914 return buf.Bytes(), nil
916 func (m *IpsecSaV3Dump) Unmarshal(b []byte) error {
917 buf := codec.NewBuffer(b)
918 m.SaID = buf.DecodeUint32()
922 // IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'.
923 // Deprecated: the message will be removed in the future versions
924 type IpsecSadEntryAddDel struct {
925 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
926 Entry ipsec_types.IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"`
929 func (m *IpsecSadEntryAddDel) Reset() { *m = IpsecSadEntryAddDel{} }
930 func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" }
931 func (*IpsecSadEntryAddDel) GetCrcString() string { return "ab64b5c6" }
932 func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType {
933 return api.RequestMessage
936 func (m *IpsecSadEntryAddDel) Size() (size int) {
941 size += 4 // m.Entry.SadID
942 size += 4 // m.Entry.Spi
943 size += 4 // m.Entry.Protocol
944 size += 4 // m.Entry.CryptoAlgorithm
945 size += 1 // m.Entry.CryptoKey.Length
946 size += 1 * 128 // m.Entry.CryptoKey.Data
947 size += 4 // m.Entry.IntegrityAlgorithm
948 size += 1 // m.Entry.IntegrityKey.Length
949 size += 1 * 128 // m.Entry.IntegrityKey.Data
950 size += 4 // m.Entry.Flags
951 size += 1 // m.Entry.TunnelSrc.Af
952 size += 1 * 16 // m.Entry.TunnelSrc.Un
953 size += 1 // m.Entry.TunnelDst.Af
954 size += 1 * 16 // m.Entry.TunnelDst.Un
955 size += 4 // m.Entry.TxTableID
956 size += 4 // m.Entry.Salt
957 size += 2 // m.Entry.UDPSrcPort
958 size += 2 // m.Entry.UDPDstPort
961 func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) {
963 b = make([]byte, m.Size())
965 buf := codec.NewBuffer(b)
966 buf.EncodeBool(m.IsAdd)
967 buf.EncodeUint32(m.Entry.SadID)
968 buf.EncodeUint32(m.Entry.Spi)
969 buf.EncodeUint32(uint32(m.Entry.Protocol))
970 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
971 buf.EncodeUint8(m.Entry.CryptoKey.Length)
972 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
973 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
974 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
975 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
976 buf.EncodeUint32(uint32(m.Entry.Flags))
977 buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
978 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
979 buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
980 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
981 buf.EncodeUint32(m.Entry.TxTableID)
982 buf.EncodeUint32(m.Entry.Salt)
983 buf.EncodeUint16(m.Entry.UDPSrcPort)
984 buf.EncodeUint16(m.Entry.UDPDstPort)
985 return buf.Bytes(), nil
987 func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error {
988 buf := codec.NewBuffer(b)
989 m.IsAdd = buf.DecodeBool()
990 m.Entry.SadID = buf.DecodeUint32()
991 m.Entry.Spi = buf.DecodeUint32()
992 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
993 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
994 m.Entry.CryptoKey.Length = buf.DecodeUint8()
995 m.Entry.CryptoKey.Data = make([]byte, 128)
996 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
997 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
998 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
999 m.Entry.IntegrityKey.Data = make([]byte, 128)
1000 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1001 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
1002 m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
1003 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1004 m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
1005 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1006 m.Entry.TxTableID = buf.DecodeUint32()
1007 m.Entry.Salt = buf.DecodeUint32()
1008 m.Entry.UDPSrcPort = buf.DecodeUint16()
1009 m.Entry.UDPDstPort = buf.DecodeUint16()
1013 // IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'.
1014 // Deprecated: the message will be removed in the future versions
1015 type IpsecSadEntryAddDelReply struct {
1016 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1017 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1020 func (m *IpsecSadEntryAddDelReply) Reset() { *m = IpsecSadEntryAddDelReply{} }
1021 func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" }
1022 func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1023 func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType {
1024 return api.ReplyMessage
1027 func (m *IpsecSadEntryAddDelReply) Size() (size int) {
1031 size += 4 // m.Retval
1032 size += 4 // m.StatIndex
1035 func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1037 b = make([]byte, m.Size())
1039 buf := codec.NewBuffer(b)
1040 buf.EncodeInt32(m.Retval)
1041 buf.EncodeUint32(m.StatIndex)
1042 return buf.Bytes(), nil
1044 func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error {
1045 buf := codec.NewBuffer(b)
1046 m.Retval = buf.DecodeInt32()
1047 m.StatIndex = buf.DecodeUint32()
1051 // IpsecSadEntryAddDelV2 defines message 'ipsec_sad_entry_add_del_v2'.
1052 type IpsecSadEntryAddDelV2 struct {
1053 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1054 Entry ipsec_types.IpsecSadEntryV2 `binapi:"ipsec_sad_entry_v2,name=entry" json:"entry,omitempty"`
1057 func (m *IpsecSadEntryAddDelV2) Reset() { *m = IpsecSadEntryAddDelV2{} }
1058 func (*IpsecSadEntryAddDelV2) GetMessageName() string { return "ipsec_sad_entry_add_del_v2" }
1059 func (*IpsecSadEntryAddDelV2) GetCrcString() string { return "aca78b27" }
1060 func (*IpsecSadEntryAddDelV2) GetMessageType() api.MessageType {
1061 return api.RequestMessage
1064 func (m *IpsecSadEntryAddDelV2) Size() (size int) {
1068 size += 1 // m.IsAdd
1069 size += 4 // m.Entry.SadID
1070 size += 4 // m.Entry.Spi
1071 size += 4 // m.Entry.Protocol
1072 size += 4 // m.Entry.CryptoAlgorithm
1073 size += 1 // m.Entry.CryptoKey.Length
1074 size += 1 * 128 // m.Entry.CryptoKey.Data
1075 size += 4 // m.Entry.IntegrityAlgorithm
1076 size += 1 // m.Entry.IntegrityKey.Length
1077 size += 1 * 128 // m.Entry.IntegrityKey.Data
1078 size += 4 // m.Entry.Flags
1079 size += 1 // m.Entry.TunnelSrc.Af
1080 size += 1 * 16 // m.Entry.TunnelSrc.Un
1081 size += 1 // m.Entry.TunnelDst.Af
1082 size += 1 * 16 // m.Entry.TunnelDst.Un
1083 size += 1 // m.Entry.TunnelFlags
1084 size += 1 // m.Entry.Dscp
1085 size += 4 // m.Entry.TxTableID
1086 size += 4 // m.Entry.Salt
1087 size += 2 // m.Entry.UDPSrcPort
1088 size += 2 // m.Entry.UDPDstPort
1091 func (m *IpsecSadEntryAddDelV2) Marshal(b []byte) ([]byte, error) {
1093 b = make([]byte, m.Size())
1095 buf := codec.NewBuffer(b)
1096 buf.EncodeBool(m.IsAdd)
1097 buf.EncodeUint32(m.Entry.SadID)
1098 buf.EncodeUint32(m.Entry.Spi)
1099 buf.EncodeUint32(uint32(m.Entry.Protocol))
1100 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1101 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1102 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1103 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1104 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1105 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1106 buf.EncodeUint32(uint32(m.Entry.Flags))
1107 buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af))
1108 buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16)
1109 buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af))
1110 buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16)
1111 buf.EncodeUint8(uint8(m.Entry.TunnelFlags))
1112 buf.EncodeUint8(uint8(m.Entry.Dscp))
1113 buf.EncodeUint32(m.Entry.TxTableID)
1114 buf.EncodeUint32(m.Entry.Salt)
1115 buf.EncodeUint16(m.Entry.UDPSrcPort)
1116 buf.EncodeUint16(m.Entry.UDPDstPort)
1117 return buf.Bytes(), nil
1119 func (m *IpsecSadEntryAddDelV2) Unmarshal(b []byte) error {
1120 buf := codec.NewBuffer(b)
1121 m.IsAdd = buf.DecodeBool()
1122 m.Entry.SadID = buf.DecodeUint32()
1123 m.Entry.Spi = buf.DecodeUint32()
1124 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
1125 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
1126 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1127 m.Entry.CryptoKey.Data = make([]byte, 128)
1128 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1129 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
1130 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1131 m.Entry.IntegrityKey.Data = make([]byte, 128)
1132 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1133 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
1134 m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8())
1135 copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1136 m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8())
1137 copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1138 m.Entry.TunnelFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
1139 m.Entry.Dscp = ip_types.IPDscp(buf.DecodeUint8())
1140 m.Entry.TxTableID = buf.DecodeUint32()
1141 m.Entry.Salt = buf.DecodeUint32()
1142 m.Entry.UDPSrcPort = buf.DecodeUint16()
1143 m.Entry.UDPDstPort = buf.DecodeUint16()
1147 // IpsecSadEntryAddDelV2Reply defines message 'ipsec_sad_entry_add_del_v2_reply'.
1148 type IpsecSadEntryAddDelV2Reply struct {
1149 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1150 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1153 func (m *IpsecSadEntryAddDelV2Reply) Reset() { *m = IpsecSadEntryAddDelV2Reply{} }
1154 func (*IpsecSadEntryAddDelV2Reply) GetMessageName() string { return "ipsec_sad_entry_add_del_v2_reply" }
1155 func (*IpsecSadEntryAddDelV2Reply) GetCrcString() string { return "9ffac24b" }
1156 func (*IpsecSadEntryAddDelV2Reply) GetMessageType() api.MessageType {
1157 return api.ReplyMessage
1160 func (m *IpsecSadEntryAddDelV2Reply) Size() (size int) {
1164 size += 4 // m.Retval
1165 size += 4 // m.StatIndex
1168 func (m *IpsecSadEntryAddDelV2Reply) Marshal(b []byte) ([]byte, error) {
1170 b = make([]byte, m.Size())
1172 buf := codec.NewBuffer(b)
1173 buf.EncodeInt32(m.Retval)
1174 buf.EncodeUint32(m.StatIndex)
1175 return buf.Bytes(), nil
1177 func (m *IpsecSadEntryAddDelV2Reply) Unmarshal(b []byte) error {
1178 buf := codec.NewBuffer(b)
1179 m.Retval = buf.DecodeInt32()
1180 m.StatIndex = buf.DecodeUint32()
1184 // IpsecSadEntryAddDelV3 defines message 'ipsec_sad_entry_add_del_v3'.
1185 type IpsecSadEntryAddDelV3 struct {
1186 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1187 Entry ipsec_types.IpsecSadEntryV3 `binapi:"ipsec_sad_entry_v3,name=entry" json:"entry,omitempty"`
1190 func (m *IpsecSadEntryAddDelV3) Reset() { *m = IpsecSadEntryAddDelV3{} }
1191 func (*IpsecSadEntryAddDelV3) GetMessageName() string { return "ipsec_sad_entry_add_del_v3" }
1192 func (*IpsecSadEntryAddDelV3) GetCrcString() string { return "c77ebd92" }
1193 func (*IpsecSadEntryAddDelV3) GetMessageType() api.MessageType {
1194 return api.RequestMessage
1197 func (m *IpsecSadEntryAddDelV3) Size() (size int) {
1201 size += 1 // m.IsAdd
1202 size += 4 // m.Entry.SadID
1203 size += 4 // m.Entry.Spi
1204 size += 4 // m.Entry.Protocol
1205 size += 4 // m.Entry.CryptoAlgorithm
1206 size += 1 // m.Entry.CryptoKey.Length
1207 size += 1 * 128 // m.Entry.CryptoKey.Data
1208 size += 4 // m.Entry.IntegrityAlgorithm
1209 size += 1 // m.Entry.IntegrityKey.Length
1210 size += 1 * 128 // m.Entry.IntegrityKey.Data
1211 size += 4 // m.Entry.Flags
1212 size += 4 // m.Entry.Tunnel.Instance
1213 size += 1 // m.Entry.Tunnel.Src.Af
1214 size += 1 * 16 // m.Entry.Tunnel.Src.Un
1215 size += 1 // m.Entry.Tunnel.Dst.Af
1216 size += 1 * 16 // m.Entry.Tunnel.Dst.Un
1217 size += 4 // m.Entry.Tunnel.SwIfIndex
1218 size += 4 // m.Entry.Tunnel.TableID
1219 size += 1 // m.Entry.Tunnel.EncapDecapFlags
1220 size += 1 // m.Entry.Tunnel.Mode
1221 size += 1 // m.Entry.Tunnel.Flags
1222 size += 1 // m.Entry.Tunnel.Dscp
1223 size += 1 // m.Entry.Tunnel.HopLimit
1224 size += 4 // m.Entry.Salt
1225 size += 2 // m.Entry.UDPSrcPort
1226 size += 2 // m.Entry.UDPDstPort
1229 func (m *IpsecSadEntryAddDelV3) Marshal(b []byte) ([]byte, error) {
1231 b = make([]byte, m.Size())
1233 buf := codec.NewBuffer(b)
1234 buf.EncodeBool(m.IsAdd)
1235 buf.EncodeUint32(m.Entry.SadID)
1236 buf.EncodeUint32(m.Entry.Spi)
1237 buf.EncodeUint32(uint32(m.Entry.Protocol))
1238 buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm))
1239 buf.EncodeUint8(m.Entry.CryptoKey.Length)
1240 buf.EncodeBytes(m.Entry.CryptoKey.Data, 128)
1241 buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm))
1242 buf.EncodeUint8(m.Entry.IntegrityKey.Length)
1243 buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128)
1244 buf.EncodeUint32(uint32(m.Entry.Flags))
1245 buf.EncodeUint32(m.Entry.Tunnel.Instance)
1246 buf.EncodeUint8(uint8(m.Entry.Tunnel.Src.Af))
1247 buf.EncodeBytes(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], 16)
1248 buf.EncodeUint8(uint8(m.Entry.Tunnel.Dst.Af))
1249 buf.EncodeBytes(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], 16)
1250 buf.EncodeUint32(uint32(m.Entry.Tunnel.SwIfIndex))
1251 buf.EncodeUint32(m.Entry.Tunnel.TableID)
1252 buf.EncodeUint8(uint8(m.Entry.Tunnel.EncapDecapFlags))
1253 buf.EncodeUint8(uint8(m.Entry.Tunnel.Mode))
1254 buf.EncodeUint8(uint8(m.Entry.Tunnel.Flags))
1255 buf.EncodeUint8(uint8(m.Entry.Tunnel.Dscp))
1256 buf.EncodeUint8(m.Entry.Tunnel.HopLimit)
1257 buf.EncodeUint32(m.Entry.Salt)
1258 buf.EncodeUint16(m.Entry.UDPSrcPort)
1259 buf.EncodeUint16(m.Entry.UDPDstPort)
1260 return buf.Bytes(), nil
1262 func (m *IpsecSadEntryAddDelV3) Unmarshal(b []byte) error {
1263 buf := codec.NewBuffer(b)
1264 m.IsAdd = buf.DecodeBool()
1265 m.Entry.SadID = buf.DecodeUint32()
1266 m.Entry.Spi = buf.DecodeUint32()
1267 m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
1268 m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32())
1269 m.Entry.CryptoKey.Length = buf.DecodeUint8()
1270 m.Entry.CryptoKey.Data = make([]byte, 128)
1271 copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data)))
1272 m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32())
1273 m.Entry.IntegrityKey.Length = buf.DecodeUint8()
1274 m.Entry.IntegrityKey.Data = make([]byte, 128)
1275 copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data)))
1276 m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32())
1277 m.Entry.Tunnel.Instance = buf.DecodeUint32()
1278 m.Entry.Tunnel.Src.Af = ip_types.AddressFamily(buf.DecodeUint8())
1279 copy(m.Entry.Tunnel.Src.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1280 m.Entry.Tunnel.Dst.Af = ip_types.AddressFamily(buf.DecodeUint8())
1281 copy(m.Entry.Tunnel.Dst.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1282 m.Entry.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1283 m.Entry.Tunnel.TableID = buf.DecodeUint32()
1284 m.Entry.Tunnel.EncapDecapFlags = tunnel_types.TunnelEncapDecapFlags(buf.DecodeUint8())
1285 m.Entry.Tunnel.Mode = tunnel_types.TunnelMode(buf.DecodeUint8())
1286 m.Entry.Tunnel.Flags = tunnel_types.TunnelFlags(buf.DecodeUint8())
1287 m.Entry.Tunnel.Dscp = ip_types.IPDscp(buf.DecodeUint8())
1288 m.Entry.Tunnel.HopLimit = buf.DecodeUint8()
1289 m.Entry.Salt = buf.DecodeUint32()
1290 m.Entry.UDPSrcPort = buf.DecodeUint16()
1291 m.Entry.UDPDstPort = buf.DecodeUint16()
1295 // IpsecSadEntryAddDelV3Reply defines message 'ipsec_sad_entry_add_del_v3_reply'.
1296 type IpsecSadEntryAddDelV3Reply struct {
1297 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1298 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1301 func (m *IpsecSadEntryAddDelV3Reply) Reset() { *m = IpsecSadEntryAddDelV3Reply{} }
1302 func (*IpsecSadEntryAddDelV3Reply) GetMessageName() string { return "ipsec_sad_entry_add_del_v3_reply" }
1303 func (*IpsecSadEntryAddDelV3Reply) GetCrcString() string { return "9ffac24b" }
1304 func (*IpsecSadEntryAddDelV3Reply) GetMessageType() api.MessageType {
1305 return api.ReplyMessage
1308 func (m *IpsecSadEntryAddDelV3Reply) Size() (size int) {
1312 size += 4 // m.Retval
1313 size += 4 // m.StatIndex
1316 func (m *IpsecSadEntryAddDelV3Reply) Marshal(b []byte) ([]byte, error) {
1318 b = make([]byte, m.Size())
1320 buf := codec.NewBuffer(b)
1321 buf.EncodeInt32(m.Retval)
1322 buf.EncodeUint32(m.StatIndex)
1323 return buf.Bytes(), nil
1325 func (m *IpsecSadEntryAddDelV3Reply) Unmarshal(b []byte) error {
1326 buf := codec.NewBuffer(b)
1327 m.Retval = buf.DecodeInt32()
1328 m.StatIndex = buf.DecodeUint32()
1332 // IpsecSelectBackend defines message 'ipsec_select_backend'.
1333 type IpsecSelectBackend struct {
1334 Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"`
1335 Index uint8 `binapi:"u8,name=index" json:"index,omitempty"`
1338 func (m *IpsecSelectBackend) Reset() { *m = IpsecSelectBackend{} }
1339 func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" }
1340 func (*IpsecSelectBackend) GetCrcString() string { return "5bcfd3b7" }
1341 func (*IpsecSelectBackend) GetMessageType() api.MessageType {
1342 return api.RequestMessage
1345 func (m *IpsecSelectBackend) Size() (size int) {
1349 size += 4 // m.Protocol
1350 size += 1 // m.Index
1353 func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) {
1355 b = make([]byte, m.Size())
1357 buf := codec.NewBuffer(b)
1358 buf.EncodeUint32(uint32(m.Protocol))
1359 buf.EncodeUint8(m.Index)
1360 return buf.Bytes(), nil
1362 func (m *IpsecSelectBackend) Unmarshal(b []byte) error {
1363 buf := codec.NewBuffer(b)
1364 m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32())
1365 m.Index = buf.DecodeUint8()
1369 // IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'.
1370 type IpsecSelectBackendReply struct {
1371 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1374 func (m *IpsecSelectBackendReply) Reset() { *m = IpsecSelectBackendReply{} }
1375 func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" }
1376 func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" }
1377 func (*IpsecSelectBackendReply) GetMessageType() api.MessageType {
1378 return api.ReplyMessage
1381 func (m *IpsecSelectBackendReply) Size() (size int) {
1385 size += 4 // m.Retval
1388 func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) {
1390 b = make([]byte, m.Size())
1392 buf := codec.NewBuffer(b)
1393 buf.EncodeInt32(m.Retval)
1394 return buf.Bytes(), nil
1396 func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error {
1397 buf := codec.NewBuffer(b)
1398 m.Retval = buf.DecodeInt32()
1402 // IpsecSetAsyncMode defines message 'ipsec_set_async_mode'.
1403 type IpsecSetAsyncMode struct {
1404 AsyncEnable bool `binapi:"bool,name=async_enable" json:"async_enable,omitempty"`
1407 func (m *IpsecSetAsyncMode) Reset() { *m = IpsecSetAsyncMode{} }
1408 func (*IpsecSetAsyncMode) GetMessageName() string { return "ipsec_set_async_mode" }
1409 func (*IpsecSetAsyncMode) GetCrcString() string { return "a6465f7c" }
1410 func (*IpsecSetAsyncMode) GetMessageType() api.MessageType {
1411 return api.RequestMessage
1414 func (m *IpsecSetAsyncMode) Size() (size int) {
1418 size += 1 // m.AsyncEnable
1421 func (m *IpsecSetAsyncMode) Marshal(b []byte) ([]byte, error) {
1423 b = make([]byte, m.Size())
1425 buf := codec.NewBuffer(b)
1426 buf.EncodeBool(m.AsyncEnable)
1427 return buf.Bytes(), nil
1429 func (m *IpsecSetAsyncMode) Unmarshal(b []byte) error {
1430 buf := codec.NewBuffer(b)
1431 m.AsyncEnable = buf.DecodeBool()
1435 // IpsecSetAsyncModeReply defines message 'ipsec_set_async_mode_reply'.
1436 type IpsecSetAsyncModeReply struct {
1437 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1440 func (m *IpsecSetAsyncModeReply) Reset() { *m = IpsecSetAsyncModeReply{} }
1441 func (*IpsecSetAsyncModeReply) GetMessageName() string { return "ipsec_set_async_mode_reply" }
1442 func (*IpsecSetAsyncModeReply) GetCrcString() string { return "e8d4e804" }
1443 func (*IpsecSetAsyncModeReply) GetMessageType() api.MessageType {
1444 return api.ReplyMessage
1447 func (m *IpsecSetAsyncModeReply) Size() (size int) {
1451 size += 4 // m.Retval
1454 func (m *IpsecSetAsyncModeReply) Marshal(b []byte) ([]byte, error) {
1456 b = make([]byte, m.Size())
1458 buf := codec.NewBuffer(b)
1459 buf.EncodeInt32(m.Retval)
1460 return buf.Bytes(), nil
1462 func (m *IpsecSetAsyncModeReply) Unmarshal(b []byte) error {
1463 buf := codec.NewBuffer(b)
1464 m.Retval = buf.DecodeInt32()
1468 // IpsecSpdAddDel defines message 'ipsec_spd_add_del'.
1469 type IpsecSpdAddDel struct {
1470 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1471 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1474 func (m *IpsecSpdAddDel) Reset() { *m = IpsecSpdAddDel{} }
1475 func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" }
1476 func (*IpsecSpdAddDel) GetCrcString() string { return "20e89a95" }
1477 func (*IpsecSpdAddDel) GetMessageType() api.MessageType {
1478 return api.RequestMessage
1481 func (m *IpsecSpdAddDel) Size() (size int) {
1485 size += 1 // m.IsAdd
1486 size += 4 // m.SpdID
1489 func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) {
1491 b = make([]byte, m.Size())
1493 buf := codec.NewBuffer(b)
1494 buf.EncodeBool(m.IsAdd)
1495 buf.EncodeUint32(m.SpdID)
1496 return buf.Bytes(), nil
1498 func (m *IpsecSpdAddDel) Unmarshal(b []byte) error {
1499 buf := codec.NewBuffer(b)
1500 m.IsAdd = buf.DecodeBool()
1501 m.SpdID = buf.DecodeUint32()
1505 // IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'.
1506 type IpsecSpdAddDelReply struct {
1507 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1510 func (m *IpsecSpdAddDelReply) Reset() { *m = IpsecSpdAddDelReply{} }
1511 func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" }
1512 func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" }
1513 func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType {
1514 return api.ReplyMessage
1517 func (m *IpsecSpdAddDelReply) Size() (size int) {
1521 size += 4 // m.Retval
1524 func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) {
1526 b = make([]byte, m.Size())
1528 buf := codec.NewBuffer(b)
1529 buf.EncodeInt32(m.Retval)
1530 return buf.Bytes(), nil
1532 func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error {
1533 buf := codec.NewBuffer(b)
1534 m.Retval = buf.DecodeInt32()
1538 // IpsecSpdDetails defines message 'ipsec_spd_details'.
1539 type IpsecSpdDetails struct {
1540 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1543 func (m *IpsecSpdDetails) Reset() { *m = IpsecSpdDetails{} }
1544 func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" }
1545 func (*IpsecSpdDetails) GetCrcString() string { return "5813d7a2" }
1546 func (*IpsecSpdDetails) GetMessageType() api.MessageType {
1547 return api.ReplyMessage
1550 func (m *IpsecSpdDetails) Size() (size int) {
1554 size += 4 // m.Entry.SpdID
1555 size += 4 // m.Entry.Priority
1556 size += 1 // m.Entry.IsOutbound
1557 size += 4 // m.Entry.SaID
1558 size += 4 // m.Entry.Policy
1559 size += 1 // m.Entry.Protocol
1560 size += 1 // m.Entry.RemoteAddressStart.Af
1561 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1562 size += 1 // m.Entry.RemoteAddressStop.Af
1563 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1564 size += 1 // m.Entry.LocalAddressStart.Af
1565 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1566 size += 1 // m.Entry.LocalAddressStop.Af
1567 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1568 size += 2 // m.Entry.RemotePortStart
1569 size += 2 // m.Entry.RemotePortStop
1570 size += 2 // m.Entry.LocalPortStart
1571 size += 2 // m.Entry.LocalPortStop
1574 func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) {
1576 b = make([]byte, m.Size())
1578 buf := codec.NewBuffer(b)
1579 buf.EncodeUint32(m.Entry.SpdID)
1580 buf.EncodeInt32(m.Entry.Priority)
1581 buf.EncodeBool(m.Entry.IsOutbound)
1582 buf.EncodeUint32(m.Entry.SaID)
1583 buf.EncodeUint32(uint32(m.Entry.Policy))
1584 buf.EncodeUint8(m.Entry.Protocol)
1585 buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af))
1586 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1587 buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af))
1588 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1589 buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af))
1590 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1591 buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af))
1592 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1593 buf.EncodeUint16(m.Entry.RemotePortStart)
1594 buf.EncodeUint16(m.Entry.RemotePortStop)
1595 buf.EncodeUint16(m.Entry.LocalPortStart)
1596 buf.EncodeUint16(m.Entry.LocalPortStop)
1597 return buf.Bytes(), nil
1599 func (m *IpsecSpdDetails) Unmarshal(b []byte) error {
1600 buf := codec.NewBuffer(b)
1601 m.Entry.SpdID = buf.DecodeUint32()
1602 m.Entry.Priority = buf.DecodeInt32()
1603 m.Entry.IsOutbound = buf.DecodeBool()
1604 m.Entry.SaID = buf.DecodeUint32()
1605 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1606 m.Entry.Protocol = buf.DecodeUint8()
1607 m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
1608 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1609 m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
1610 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1611 m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
1612 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1613 m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
1614 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1615 m.Entry.RemotePortStart = buf.DecodeUint16()
1616 m.Entry.RemotePortStop = buf.DecodeUint16()
1617 m.Entry.LocalPortStart = buf.DecodeUint16()
1618 m.Entry.LocalPortStop = buf.DecodeUint16()
1622 // IpsecSpdDump defines message 'ipsec_spd_dump'.
1623 type IpsecSpdDump struct {
1624 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1625 SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"`
1628 func (m *IpsecSpdDump) Reset() { *m = IpsecSpdDump{} }
1629 func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" }
1630 func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" }
1631 func (*IpsecSpdDump) GetMessageType() api.MessageType {
1632 return api.RequestMessage
1635 func (m *IpsecSpdDump) Size() (size int) {
1639 size += 4 // m.SpdID
1643 func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) {
1645 b = make([]byte, m.Size())
1647 buf := codec.NewBuffer(b)
1648 buf.EncodeUint32(m.SpdID)
1649 buf.EncodeUint32(m.SaID)
1650 return buf.Bytes(), nil
1652 func (m *IpsecSpdDump) Unmarshal(b []byte) error {
1653 buf := codec.NewBuffer(b)
1654 m.SpdID = buf.DecodeUint32()
1655 m.SaID = buf.DecodeUint32()
1659 // IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'.
1660 type IpsecSpdEntryAddDel struct {
1661 IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"`
1662 Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"`
1665 func (m *IpsecSpdEntryAddDel) Reset() { *m = IpsecSpdEntryAddDel{} }
1666 func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" }
1667 func (*IpsecSpdEntryAddDel) GetCrcString() string { return "338b7411" }
1668 func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType {
1669 return api.RequestMessage
1672 func (m *IpsecSpdEntryAddDel) Size() (size int) {
1676 size += 1 // m.IsAdd
1677 size += 4 // m.Entry.SpdID
1678 size += 4 // m.Entry.Priority
1679 size += 1 // m.Entry.IsOutbound
1680 size += 4 // m.Entry.SaID
1681 size += 4 // m.Entry.Policy
1682 size += 1 // m.Entry.Protocol
1683 size += 1 // m.Entry.RemoteAddressStart.Af
1684 size += 1 * 16 // m.Entry.RemoteAddressStart.Un
1685 size += 1 // m.Entry.RemoteAddressStop.Af
1686 size += 1 * 16 // m.Entry.RemoteAddressStop.Un
1687 size += 1 // m.Entry.LocalAddressStart.Af
1688 size += 1 * 16 // m.Entry.LocalAddressStart.Un
1689 size += 1 // m.Entry.LocalAddressStop.Af
1690 size += 1 * 16 // m.Entry.LocalAddressStop.Un
1691 size += 2 // m.Entry.RemotePortStart
1692 size += 2 // m.Entry.RemotePortStop
1693 size += 2 // m.Entry.LocalPortStart
1694 size += 2 // m.Entry.LocalPortStop
1697 func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) {
1699 b = make([]byte, m.Size())
1701 buf := codec.NewBuffer(b)
1702 buf.EncodeBool(m.IsAdd)
1703 buf.EncodeUint32(m.Entry.SpdID)
1704 buf.EncodeInt32(m.Entry.Priority)
1705 buf.EncodeBool(m.Entry.IsOutbound)
1706 buf.EncodeUint32(m.Entry.SaID)
1707 buf.EncodeUint32(uint32(m.Entry.Policy))
1708 buf.EncodeUint8(m.Entry.Protocol)
1709 buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af))
1710 buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16)
1711 buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af))
1712 buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16)
1713 buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af))
1714 buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16)
1715 buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af))
1716 buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16)
1717 buf.EncodeUint16(m.Entry.RemotePortStart)
1718 buf.EncodeUint16(m.Entry.RemotePortStop)
1719 buf.EncodeUint16(m.Entry.LocalPortStart)
1720 buf.EncodeUint16(m.Entry.LocalPortStop)
1721 return buf.Bytes(), nil
1723 func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error {
1724 buf := codec.NewBuffer(b)
1725 m.IsAdd = buf.DecodeBool()
1726 m.Entry.SpdID = buf.DecodeUint32()
1727 m.Entry.Priority = buf.DecodeInt32()
1728 m.Entry.IsOutbound = buf.DecodeBool()
1729 m.Entry.SaID = buf.DecodeUint32()
1730 m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32())
1731 m.Entry.Protocol = buf.DecodeUint8()
1732 m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
1733 copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1734 m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
1735 copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1736 m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8())
1737 copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1738 m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8())
1739 copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1740 m.Entry.RemotePortStart = buf.DecodeUint16()
1741 m.Entry.RemotePortStop = buf.DecodeUint16()
1742 m.Entry.LocalPortStart = buf.DecodeUint16()
1743 m.Entry.LocalPortStop = buf.DecodeUint16()
1747 // IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'.
1748 type IpsecSpdEntryAddDelReply struct {
1749 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1750 StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"`
1753 func (m *IpsecSpdEntryAddDelReply) Reset() { *m = IpsecSpdEntryAddDelReply{} }
1754 func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" }
1755 func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" }
1756 func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType {
1757 return api.ReplyMessage
1760 func (m *IpsecSpdEntryAddDelReply) Size() (size int) {
1764 size += 4 // m.Retval
1765 size += 4 // m.StatIndex
1768 func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) {
1770 b = make([]byte, m.Size())
1772 buf := codec.NewBuffer(b)
1773 buf.EncodeInt32(m.Retval)
1774 buf.EncodeUint32(m.StatIndex)
1775 return buf.Bytes(), nil
1777 func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error {
1778 buf := codec.NewBuffer(b)
1779 m.Retval = buf.DecodeInt32()
1780 m.StatIndex = buf.DecodeUint32()
1784 // IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'.
1785 type IpsecSpdInterfaceDetails struct {
1786 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1787 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1790 func (m *IpsecSpdInterfaceDetails) Reset() { *m = IpsecSpdInterfaceDetails{} }
1791 func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" }
1792 func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "7a0bcf3e" }
1793 func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType {
1794 return api.ReplyMessage
1797 func (m *IpsecSpdInterfaceDetails) Size() (size int) {
1801 size += 4 // m.SpdIndex
1802 size += 4 // m.SwIfIndex
1805 func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) {
1807 b = make([]byte, m.Size())
1809 buf := codec.NewBuffer(b)
1810 buf.EncodeUint32(m.SpdIndex)
1811 buf.EncodeUint32(uint32(m.SwIfIndex))
1812 return buf.Bytes(), nil
1814 func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error {
1815 buf := codec.NewBuffer(b)
1816 m.SpdIndex = buf.DecodeUint32()
1817 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1821 // IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'.
1822 type IpsecSpdInterfaceDump struct {
1823 SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"`
1824 SpdIndexValid uint8 `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"`
1827 func (m *IpsecSpdInterfaceDump) Reset() { *m = IpsecSpdInterfaceDump{} }
1828 func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" }
1829 func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" }
1830 func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType {
1831 return api.RequestMessage
1834 func (m *IpsecSpdInterfaceDump) Size() (size int) {
1838 size += 4 // m.SpdIndex
1839 size += 1 // m.SpdIndexValid
1842 func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) {
1844 b = make([]byte, m.Size())
1846 buf := codec.NewBuffer(b)
1847 buf.EncodeUint32(m.SpdIndex)
1848 buf.EncodeUint8(m.SpdIndexValid)
1849 return buf.Bytes(), nil
1851 func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error {
1852 buf := codec.NewBuffer(b)
1853 m.SpdIndex = buf.DecodeUint32()
1854 m.SpdIndexValid = buf.DecodeUint8()
1858 // IpsecSpdsDetails defines message 'ipsec_spds_details'.
1859 type IpsecSpdsDetails struct {
1860 SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"`
1861 Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"`
1864 func (m *IpsecSpdsDetails) Reset() { *m = IpsecSpdsDetails{} }
1865 func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" }
1866 func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" }
1867 func (*IpsecSpdsDetails) GetMessageType() api.MessageType {
1868 return api.ReplyMessage
1871 func (m *IpsecSpdsDetails) Size() (size int) {
1875 size += 4 // m.SpdID
1876 size += 4 // m.Npolicies
1879 func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) {
1881 b = make([]byte, m.Size())
1883 buf := codec.NewBuffer(b)
1884 buf.EncodeUint32(m.SpdID)
1885 buf.EncodeUint32(m.Npolicies)
1886 return buf.Bytes(), nil
1888 func (m *IpsecSpdsDetails) Unmarshal(b []byte) error {
1889 buf := codec.NewBuffer(b)
1890 m.SpdID = buf.DecodeUint32()
1891 m.Npolicies = buf.DecodeUint32()
1895 // IpsecSpdsDump defines message 'ipsec_spds_dump'.
1896 type IpsecSpdsDump struct{}
1898 func (m *IpsecSpdsDump) Reset() { *m = IpsecSpdsDump{} }
1899 func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" }
1900 func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" }
1901 func (*IpsecSpdsDump) GetMessageType() api.MessageType {
1902 return api.RequestMessage
1905 func (m *IpsecSpdsDump) Size() (size int) {
1911 func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) {
1913 b = make([]byte, m.Size())
1915 buf := codec.NewBuffer(b)
1916 return buf.Bytes(), nil
1918 func (m *IpsecSpdsDump) Unmarshal(b []byte) error {
1922 // IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'.
1923 type IpsecTunnelProtectDel struct {
1924 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
1925 Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"`
1928 func (m *IpsecTunnelProtectDel) Reset() { *m = IpsecTunnelProtectDel{} }
1929 func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" }
1930 func (*IpsecTunnelProtectDel) GetCrcString() string { return "cd239930" }
1931 func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType {
1932 return api.RequestMessage
1935 func (m *IpsecTunnelProtectDel) Size() (size int) {
1939 size += 4 // m.SwIfIndex
1940 size += 1 // m.Nh.Af
1941 size += 1 * 16 // m.Nh.Un
1944 func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) {
1946 b = make([]byte, m.Size())
1948 buf := codec.NewBuffer(b)
1949 buf.EncodeUint32(uint32(m.SwIfIndex))
1950 buf.EncodeUint8(uint8(m.Nh.Af))
1951 buf.EncodeBytes(m.Nh.Un.XXX_UnionData[:], 16)
1952 return buf.Bytes(), nil
1954 func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error {
1955 buf := codec.NewBuffer(b)
1956 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
1957 m.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
1958 copy(m.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
1962 // IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'.
1963 type IpsecTunnelProtectDelReply struct {
1964 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
1967 func (m *IpsecTunnelProtectDelReply) Reset() { *m = IpsecTunnelProtectDelReply{} }
1968 func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" }
1969 func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" }
1970 func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType {
1971 return api.ReplyMessage
1974 func (m *IpsecTunnelProtectDelReply) Size() (size int) {
1978 size += 4 // m.Retval
1981 func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) {
1983 b = make([]byte, m.Size())
1985 buf := codec.NewBuffer(b)
1986 buf.EncodeInt32(m.Retval)
1987 return buf.Bytes(), nil
1989 func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error {
1990 buf := codec.NewBuffer(b)
1991 m.Retval = buf.DecodeInt32()
1995 // IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'.
1996 type IpsecTunnelProtectDetails struct {
1997 Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"`
2000 func (m *IpsecTunnelProtectDetails) Reset() { *m = IpsecTunnelProtectDetails{} }
2001 func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" }
2002 func (*IpsecTunnelProtectDetails) GetCrcString() string { return "21663a50" }
2003 func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType {
2004 return api.ReplyMessage
2007 func (m *IpsecTunnelProtectDetails) Size() (size int) {
2011 size += 4 // m.Tun.SwIfIndex
2012 size += 1 // m.Tun.Nh.Af
2013 size += 1 * 16 // m.Tun.Nh.Un
2014 size += 4 // m.Tun.SaOut
2015 size += 1 // m.Tun.NSaIn
2016 size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn
2019 func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) {
2021 b = make([]byte, m.Size())
2023 buf := codec.NewBuffer(b)
2024 buf.EncodeUint32(uint32(m.Tun.SwIfIndex))
2025 buf.EncodeUint8(uint8(m.Tun.Nh.Af))
2026 buf.EncodeBytes(m.Tun.Nh.Un.XXX_UnionData[:], 16)
2027 buf.EncodeUint32(m.Tun.SaOut)
2028 buf.EncodeUint8(uint8(len(m.Tun.SaIn)))
2029 for i := 0; i < len(m.Tun.SaIn); i++ {
2031 if i < len(m.Tun.SaIn) {
2032 x = uint32(m.Tun.SaIn[i])
2036 return buf.Bytes(), nil
2038 func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error {
2039 buf := codec.NewBuffer(b)
2040 m.Tun.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2041 m.Tun.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
2042 copy(m.Tun.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2043 m.Tun.SaOut = buf.DecodeUint32()
2044 m.Tun.NSaIn = buf.DecodeUint8()
2045 m.Tun.SaIn = make([]uint32, m.Tun.NSaIn)
2046 for i := 0; i < len(m.Tun.SaIn); i++ {
2047 m.Tun.SaIn[i] = buf.DecodeUint32()
2052 // IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'.
2053 type IpsecTunnelProtectDump struct {
2054 SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"`
2057 func (m *IpsecTunnelProtectDump) Reset() { *m = IpsecTunnelProtectDump{} }
2058 func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" }
2059 func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" }
2060 func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType {
2061 return api.RequestMessage
2064 func (m *IpsecTunnelProtectDump) Size() (size int) {
2068 size += 4 // m.SwIfIndex
2071 func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) {
2073 b = make([]byte, m.Size())
2075 buf := codec.NewBuffer(b)
2076 buf.EncodeUint32(uint32(m.SwIfIndex))
2077 return buf.Bytes(), nil
2079 func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error {
2080 buf := codec.NewBuffer(b)
2081 m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2085 // IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'.
2086 type IpsecTunnelProtectUpdate struct {
2087 Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"`
2090 func (m *IpsecTunnelProtectUpdate) Reset() { *m = IpsecTunnelProtectUpdate{} }
2091 func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" }
2092 func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "30d5f133" }
2093 func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType {
2094 return api.RequestMessage
2097 func (m *IpsecTunnelProtectUpdate) Size() (size int) {
2101 size += 4 // m.Tunnel.SwIfIndex
2102 size += 1 // m.Tunnel.Nh.Af
2103 size += 1 * 16 // m.Tunnel.Nh.Un
2104 size += 4 // m.Tunnel.SaOut
2105 size += 1 // m.Tunnel.NSaIn
2106 size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn
2109 func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) {
2111 b = make([]byte, m.Size())
2113 buf := codec.NewBuffer(b)
2114 buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex))
2115 buf.EncodeUint8(uint8(m.Tunnel.Nh.Af))
2116 buf.EncodeBytes(m.Tunnel.Nh.Un.XXX_UnionData[:], 16)
2117 buf.EncodeUint32(m.Tunnel.SaOut)
2118 buf.EncodeUint8(uint8(len(m.Tunnel.SaIn)))
2119 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2121 if i < len(m.Tunnel.SaIn) {
2122 x = uint32(m.Tunnel.SaIn[i])
2126 return buf.Bytes(), nil
2128 func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error {
2129 buf := codec.NewBuffer(b)
2130 m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32())
2131 m.Tunnel.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8())
2132 copy(m.Tunnel.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16))
2133 m.Tunnel.SaOut = buf.DecodeUint32()
2134 m.Tunnel.NSaIn = buf.DecodeUint8()
2135 m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn)
2136 for i := 0; i < len(m.Tunnel.SaIn); i++ {
2137 m.Tunnel.SaIn[i] = buf.DecodeUint32()
2142 // IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'.
2143 type IpsecTunnelProtectUpdateReply struct {
2144 Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"`
2147 func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} }
2148 func (*IpsecTunnelProtectUpdateReply) GetMessageName() string {
2149 return "ipsec_tunnel_protect_update_reply"
2151 func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" }
2152 func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType {
2153 return api.ReplyMessage
2156 func (m *IpsecTunnelProtectUpdateReply) Size() (size int) {
2160 size += 4 // m.Retval
2163 func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) {
2165 b = make([]byte, m.Size())
2167 buf := codec.NewBuffer(b)
2168 buf.EncodeInt32(m.Retval)
2169 return buf.Bytes(), nil
2171 func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error {
2172 buf := codec.NewBuffer(b)
2173 m.Retval = buf.DecodeInt32()
2177 func init() { file_ipsec_binapi_init() }
2178 func file_ipsec_binapi_init() {
2179 api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_ee601c29")
2180 api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14")
2181 api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_80f80cbb")
2182 api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804")
2183 api.RegisterMessage((*IpsecItfCreate)(nil), "ipsec_itf_create_6f50b3bc")
2184 api.RegisterMessage((*IpsecItfCreateReply)(nil), "ipsec_itf_create_reply_5383d31f")
2185 api.RegisterMessage((*IpsecItfDelete)(nil), "ipsec_itf_delete_f9e6675e")
2186 api.RegisterMessage((*IpsecItfDeleteReply)(nil), "ipsec_itf_delete_reply_e8d4e804")
2187 api.RegisterMessage((*IpsecItfDetails)(nil), "ipsec_itf_details_548a73b8")
2188 api.RegisterMessage((*IpsecItfDump)(nil), "ipsec_itf_dump_f9e6675e")
2189 api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_345d14a7")
2190 api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4")
2191 api.RegisterMessage((*IpsecSaV2Details)(nil), "ipsec_sa_v2_details_e2130051")
2192 api.RegisterMessage((*IpsecSaV2Dump)(nil), "ipsec_sa_v2_dump_2076c2f4")
2193 api.RegisterMessage((*IpsecSaV3Details)(nil), "ipsec_sa_v3_details_2fc991ee")
2194 api.RegisterMessage((*IpsecSaV3Dump)(nil), "ipsec_sa_v3_dump_2076c2f4")
2195 api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_ab64b5c6")
2196 api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b")
2197 api.RegisterMessage((*IpsecSadEntryAddDelV2)(nil), "ipsec_sad_entry_add_del_v2_aca78b27")
2198 api.RegisterMessage((*IpsecSadEntryAddDelV2Reply)(nil), "ipsec_sad_entry_add_del_v2_reply_9ffac24b")
2199 api.RegisterMessage((*IpsecSadEntryAddDelV3)(nil), "ipsec_sad_entry_add_del_v3_c77ebd92")
2200 api.RegisterMessage((*IpsecSadEntryAddDelV3Reply)(nil), "ipsec_sad_entry_add_del_v3_reply_9ffac24b")
2201 api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_5bcfd3b7")
2202 api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804")
2203 api.RegisterMessage((*IpsecSetAsyncMode)(nil), "ipsec_set_async_mode_a6465f7c")
2204 api.RegisterMessage((*IpsecSetAsyncModeReply)(nil), "ipsec_set_async_mode_reply_e8d4e804")
2205 api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_20e89a95")
2206 api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804")
2207 api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_5813d7a2")
2208 api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d")
2209 api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_338b7411")
2210 api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b")
2211 api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_7a0bcf3e")
2212 api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19")
2213 api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254")
2214 api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14")
2215 api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_cd239930")
2216 api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804")
2217 api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_21663a50")
2218 api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e")
2219 api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_30d5f133")
2220 api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804")
2223 // Messages returns list of all messages in this module.
2224 func AllMessages() []api.Message {
2225 return []api.Message{
2226 (*IpsecBackendDetails)(nil),
2227 (*IpsecBackendDump)(nil),
2228 (*IpsecInterfaceAddDelSpd)(nil),
2229 (*IpsecInterfaceAddDelSpdReply)(nil),
2230 (*IpsecItfCreate)(nil),
2231 (*IpsecItfCreateReply)(nil),
2232 (*IpsecItfDelete)(nil),
2233 (*IpsecItfDeleteReply)(nil),
2234 (*IpsecItfDetails)(nil),
2235 (*IpsecItfDump)(nil),
2236 (*IpsecSaDetails)(nil),
2237 (*IpsecSaDump)(nil),
2238 (*IpsecSaV2Details)(nil),
2239 (*IpsecSaV2Dump)(nil),
2240 (*IpsecSaV3Details)(nil),
2241 (*IpsecSaV3Dump)(nil),
2242 (*IpsecSadEntryAddDel)(nil),
2243 (*IpsecSadEntryAddDelReply)(nil),
2244 (*IpsecSadEntryAddDelV2)(nil),
2245 (*IpsecSadEntryAddDelV2Reply)(nil),
2246 (*IpsecSadEntryAddDelV3)(nil),
2247 (*IpsecSadEntryAddDelV3Reply)(nil),
2248 (*IpsecSelectBackend)(nil),
2249 (*IpsecSelectBackendReply)(nil),
2250 (*IpsecSetAsyncMode)(nil),
2251 (*IpsecSetAsyncModeReply)(nil),
2252 (*IpsecSpdAddDel)(nil),
2253 (*IpsecSpdAddDelReply)(nil),
2254 (*IpsecSpdDetails)(nil),
2255 (*IpsecSpdDump)(nil),
2256 (*IpsecSpdEntryAddDel)(nil),
2257 (*IpsecSpdEntryAddDelReply)(nil),
2258 (*IpsecSpdInterfaceDetails)(nil),
2259 (*IpsecSpdInterfaceDump)(nil),
2260 (*IpsecSpdsDetails)(nil),
2261 (*IpsecSpdsDump)(nil),
2262 (*IpsecTunnelProtectDel)(nil),
2263 (*IpsecTunnelProtectDelReply)(nil),
2264 (*IpsecTunnelProtectDetails)(nil),
2265 (*IpsecTunnelProtectDump)(nil),
2266 (*IpsecTunnelProtectUpdate)(nil),
2267 (*IpsecTunnelProtectUpdateReply)(nil),