// Code generated by GoVPP's binapi-generator. DO NOT EDIT. // versions: // binapi-generator: v0.4.0-dev // VPP: 20.05-release // Package ipsec contains generated bindings for API file ipsec.api. // // Contents: // 1 enum // 2 structs // 30 messages // package ipsec import ( "strconv" api "git.fd.io/govpp.git/api" interface_types "git.fd.io/govpp.git/binapi/interface_types" ip_types "git.fd.io/govpp.git/binapi/ip_types" ipsec_types "git.fd.io/govpp.git/binapi/ipsec_types" codec "git.fd.io/govpp.git/codec" ) // This is a compile-time assertion to ensure that this generated file // is compatible with the GoVPP api package it is being compiled against. // A compilation error at this line likely means your copy of the // GoVPP api package needs to be updated. const _ = api.GoVppAPIPackageIsVersion2 const ( APIFile = "ipsec" APIVersion = "3.0.2" VersionCrc = 0x6a839805 ) // IpsecSpdAction defines enum 'ipsec_spd_action'. type IpsecSpdAction uint32 const ( IPSEC_API_SPD_ACTION_BYPASS IpsecSpdAction = 0 IPSEC_API_SPD_ACTION_DISCARD IpsecSpdAction = 1 IPSEC_API_SPD_ACTION_RESOLVE IpsecSpdAction = 2 IPSEC_API_SPD_ACTION_PROTECT IpsecSpdAction = 3 ) var ( IpsecSpdAction_name = map[uint32]string{ 0: "IPSEC_API_SPD_ACTION_BYPASS", 1: "IPSEC_API_SPD_ACTION_DISCARD", 2: "IPSEC_API_SPD_ACTION_RESOLVE", 3: "IPSEC_API_SPD_ACTION_PROTECT", } IpsecSpdAction_value = map[string]uint32{ "IPSEC_API_SPD_ACTION_BYPASS": 0, "IPSEC_API_SPD_ACTION_DISCARD": 1, "IPSEC_API_SPD_ACTION_RESOLVE": 2, "IPSEC_API_SPD_ACTION_PROTECT": 3, } ) func (x IpsecSpdAction) String() string { s, ok := IpsecSpdAction_name[uint32(x)] if ok { return s } return "IpsecSpdAction(" + strconv.Itoa(int(x)) + ")" } // IpsecSpdEntry defines type 'ipsec_spd_entry'. type IpsecSpdEntry struct { SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` Priority int32 `binapi:"i32,name=priority" json:"priority,omitempty"` IsOutbound bool `binapi:"bool,name=is_outbound" json:"is_outbound,omitempty"` SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` Policy IpsecSpdAction `binapi:"ipsec_spd_action,name=policy" json:"policy,omitempty"` Protocol uint8 `binapi:"u8,name=protocol" json:"protocol,omitempty"` RemoteAddressStart ip_types.Address `binapi:"address,name=remote_address_start" json:"remote_address_start,omitempty"` RemoteAddressStop ip_types.Address `binapi:"address,name=remote_address_stop" json:"remote_address_stop,omitempty"` LocalAddressStart ip_types.Address `binapi:"address,name=local_address_start" json:"local_address_start,omitempty"` LocalAddressStop ip_types.Address `binapi:"address,name=local_address_stop" json:"local_address_stop,omitempty"` RemotePortStart uint16 `binapi:"u16,name=remote_port_start" json:"remote_port_start,omitempty"` RemotePortStop uint16 `binapi:"u16,name=remote_port_stop" json:"remote_port_stop,omitempty"` LocalPortStart uint16 `binapi:"u16,name=local_port_start" json:"local_port_start,omitempty"` LocalPortStop uint16 `binapi:"u16,name=local_port_stop" json:"local_port_stop,omitempty"` } // IpsecTunnelProtect defines type 'ipsec_tunnel_protect'. type IpsecTunnelProtect struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"` SaOut uint32 `binapi:"u32,name=sa_out" json:"sa_out,omitempty"` NSaIn uint8 `binapi:"u8,name=n_sa_in" json:"-"` SaIn []uint32 `binapi:"u32[n_sa_in],name=sa_in" json:"sa_in,omitempty"` } // IpsecBackendDetails defines message 'ipsec_backend_details'. type IpsecBackendDetails struct { Name string `binapi:"string[128],name=name" json:"name,omitempty"` Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` Index uint8 `binapi:"u8,name=index" json:"index,omitempty"` Active bool `binapi:"bool,name=active" json:"active,omitempty"` } func (m *IpsecBackendDetails) Reset() { *m = IpsecBackendDetails{} } func (*IpsecBackendDetails) GetMessageName() string { return "ipsec_backend_details" } func (*IpsecBackendDetails) GetCrcString() string { return "ee601c29" } func (*IpsecBackendDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecBackendDetails) Size() (size int) { if m == nil { return 0 } size += 128 // m.Name size += 4 // m.Protocol size += 1 // m.Index size += 1 // m.Active return size } func (m *IpsecBackendDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeString(m.Name, 128) buf.EncodeUint32(uint32(m.Protocol)) buf.EncodeUint8(m.Index) buf.EncodeBool(m.Active) return buf.Bytes(), nil } func (m *IpsecBackendDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Name = buf.DecodeString(128) m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Index = buf.DecodeUint8() m.Active = buf.DecodeBool() return nil } // IpsecBackendDump defines message 'ipsec_backend_dump'. type IpsecBackendDump struct{} func (m *IpsecBackendDump) Reset() { *m = IpsecBackendDump{} } func (*IpsecBackendDump) GetMessageName() string { return "ipsec_backend_dump" } func (*IpsecBackendDump) GetCrcString() string { return "51077d14" } func (*IpsecBackendDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecBackendDump) Size() (size int) { if m == nil { return 0 } return size } func (m *IpsecBackendDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpsecBackendDump) Unmarshal(b []byte) error { return nil } // IpsecInterfaceAddDelSpd defines message 'ipsec_interface_add_del_spd'. type IpsecInterfaceAddDelSpd struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` } func (m *IpsecInterfaceAddDelSpd) Reset() { *m = IpsecInterfaceAddDelSpd{} } func (*IpsecInterfaceAddDelSpd) GetMessageName() string { return "ipsec_interface_add_del_spd" } func (*IpsecInterfaceAddDelSpd) GetCrcString() string { return "80f80cbb" } func (*IpsecInterfaceAddDelSpd) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecInterfaceAddDelSpd) Size() (size int) { if m == nil { return 0 } size += 1 // m.IsAdd size += 4 // m.SwIfIndex size += 4 // m.SpdID return size } func (m *IpsecInterfaceAddDelSpd) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(m.SpdID) return buf.Bytes(), nil } func (m *IpsecInterfaceAddDelSpd) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.SpdID = buf.DecodeUint32() return nil } // IpsecInterfaceAddDelSpdReply defines message 'ipsec_interface_add_del_spd_reply'. type IpsecInterfaceAddDelSpdReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecInterfaceAddDelSpdReply) Reset() { *m = IpsecInterfaceAddDelSpdReply{} } func (*IpsecInterfaceAddDelSpdReply) GetMessageName() string { return "ipsec_interface_add_del_spd_reply" } func (*IpsecInterfaceAddDelSpdReply) GetCrcString() string { return "e8d4e804" } func (*IpsecInterfaceAddDelSpdReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecInterfaceAddDelSpdReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecInterfaceAddDelSpdReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecInterfaceAddDelSpdReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } // IpsecSaDetails defines message 'ipsec_sa_details'. type IpsecSaDetails struct { Entry ipsec_types.IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` SeqOutbound uint64 `binapi:"u64,name=seq_outbound" json:"seq_outbound,omitempty"` LastSeqInbound uint64 `binapi:"u64,name=last_seq_inbound" json:"last_seq_inbound,omitempty"` ReplayWindow uint64 `binapi:"u64,name=replay_window" json:"replay_window,omitempty"` StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` } func (m *IpsecSaDetails) Reset() { *m = IpsecSaDetails{} } func (*IpsecSaDetails) GetMessageName() string { return "ipsec_sa_details" } func (*IpsecSaDetails) GetCrcString() string { return "b30c7f41" } func (*IpsecSaDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSaDetails) Size() (size int) { if m == nil { return 0 } size += 4 // m.Entry.SadID size += 4 // m.Entry.Spi size += 4 // m.Entry.Protocol size += 4 // m.Entry.CryptoAlgorithm size += 1 // m.Entry.CryptoKey.Length size += 1 * 128 // m.Entry.CryptoKey.Data size += 4 // m.Entry.IntegrityAlgorithm size += 1 // m.Entry.IntegrityKey.Length size += 1 * 128 // m.Entry.IntegrityKey.Data size += 4 // m.Entry.Flags size += 1 // m.Entry.TunnelSrc.Af size += 1 * 16 // m.Entry.TunnelSrc.Un size += 1 // m.Entry.TunnelDst.Af size += 1 * 16 // m.Entry.TunnelDst.Un size += 4 // m.Entry.TxTableID size += 4 // m.Entry.Salt size += 2 // m.Entry.UDPSrcPort size += 2 // m.Entry.UDPDstPort size += 4 // m.SwIfIndex size += 4 // m.Salt size += 8 // m.SeqOutbound size += 8 // m.LastSeqInbound size += 8 // m.ReplayWindow size += 4 // m.StatIndex return size } func (m *IpsecSaDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.Entry.SadID) buf.EncodeUint32(m.Entry.Spi) buf.EncodeUint32(uint32(m.Entry.Protocol)) buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) buf.EncodeUint8(m.Entry.CryptoKey.Length) buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) buf.EncodeUint8(m.Entry.IntegrityKey.Length) buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.Flags)) buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af)) buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af)) buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(m.Entry.TxTableID) buf.EncodeUint32(m.Entry.Salt) buf.EncodeUint16(m.Entry.UDPSrcPort) buf.EncodeUint16(m.Entry.UDPDstPort) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(m.Salt) buf.EncodeUint64(m.SeqOutbound) buf.EncodeUint64(m.LastSeqInbound) buf.EncodeUint64(m.ReplayWindow) buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSaDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Entry.SadID = buf.DecodeUint32() m.Entry.Spi = buf.DecodeUint32() m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) m.Entry.CryptoKey.Length = buf.DecodeUint8() m.Entry.CryptoKey.Data = make([]byte, 128) copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) m.Entry.IntegrityKey.Length = buf.DecodeUint8() m.Entry.IntegrityKey.Data = make([]byte, 128) copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.TxTableID = buf.DecodeUint32() m.Entry.Salt = buf.DecodeUint32() m.Entry.UDPSrcPort = buf.DecodeUint16() m.Entry.UDPDstPort = buf.DecodeUint16() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Salt = buf.DecodeUint32() m.SeqOutbound = buf.DecodeUint64() m.LastSeqInbound = buf.DecodeUint64() m.ReplayWindow = buf.DecodeUint64() m.StatIndex = buf.DecodeUint32() return nil } // IpsecSaDump defines message 'ipsec_sa_dump'. type IpsecSaDump struct { SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` } func (m *IpsecSaDump) Reset() { *m = IpsecSaDump{} } func (*IpsecSaDump) GetMessageName() string { return "ipsec_sa_dump" } func (*IpsecSaDump) GetCrcString() string { return "2076c2f4" } func (*IpsecSaDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSaDump) Size() (size int) { if m == nil { return 0 } size += 4 // m.SaID return size } func (m *IpsecSaDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.SaID) return buf.Bytes(), nil } func (m *IpsecSaDump) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SaID = buf.DecodeUint32() return nil } // IpsecSadEntryAddDel defines message 'ipsec_sad_entry_add_del'. type IpsecSadEntryAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Entry ipsec_types.IpsecSadEntry `binapi:"ipsec_sad_entry,name=entry" json:"entry,omitempty"` } func (m *IpsecSadEntryAddDel) Reset() { *m = IpsecSadEntryAddDel{} } func (*IpsecSadEntryAddDel) GetMessageName() string { return "ipsec_sad_entry_add_del" } func (*IpsecSadEntryAddDel) GetCrcString() string { return "b8def364" } func (*IpsecSadEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSadEntryAddDel) Size() (size int) { if m == nil { return 0 } size += 1 // m.IsAdd size += 4 // m.Entry.SadID size += 4 // m.Entry.Spi size += 4 // m.Entry.Protocol size += 4 // m.Entry.CryptoAlgorithm size += 1 // m.Entry.CryptoKey.Length size += 1 * 128 // m.Entry.CryptoKey.Data size += 4 // m.Entry.IntegrityAlgorithm size += 1 // m.Entry.IntegrityKey.Length size += 1 * 128 // m.Entry.IntegrityKey.Data size += 4 // m.Entry.Flags size += 1 // m.Entry.TunnelSrc.Af size += 1 * 16 // m.Entry.TunnelSrc.Un size += 1 // m.Entry.TunnelDst.Af size += 1 * 16 // m.Entry.TunnelDst.Un size += 4 // m.Entry.TxTableID size += 4 // m.Entry.Salt size += 2 // m.Entry.UDPSrcPort size += 2 // m.Entry.UDPDstPort return size } func (m *IpsecSadEntryAddDel) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(m.Entry.SadID) buf.EncodeUint32(m.Entry.Spi) buf.EncodeUint32(uint32(m.Entry.Protocol)) buf.EncodeUint32(uint32(m.Entry.CryptoAlgorithm)) buf.EncodeUint8(m.Entry.CryptoKey.Length) buf.EncodeBytes(m.Entry.CryptoKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.IntegrityAlgorithm)) buf.EncodeUint8(m.Entry.IntegrityKey.Length) buf.EncodeBytes(m.Entry.IntegrityKey.Data, 128) buf.EncodeUint32(uint32(m.Entry.Flags)) buf.EncodeUint8(uint8(m.Entry.TunnelSrc.Af)) buf.EncodeBytes(m.Entry.TunnelSrc.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.TunnelDst.Af)) buf.EncodeBytes(m.Entry.TunnelDst.Un.XXX_UnionData[:], 16) buf.EncodeUint32(m.Entry.TxTableID) buf.EncodeUint32(m.Entry.Salt) buf.EncodeUint16(m.Entry.UDPSrcPort) buf.EncodeUint16(m.Entry.UDPDstPort) return buf.Bytes(), nil } func (m *IpsecSadEntryAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.Entry.SadID = buf.DecodeUint32() m.Entry.Spi = buf.DecodeUint32() m.Entry.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Entry.CryptoAlgorithm = ipsec_types.IpsecCryptoAlg(buf.DecodeUint32()) m.Entry.CryptoKey.Length = buf.DecodeUint8() m.Entry.CryptoKey.Data = make([]byte, 128) copy(m.Entry.CryptoKey.Data, buf.DecodeBytes(len(m.Entry.CryptoKey.Data))) m.Entry.IntegrityAlgorithm = ipsec_types.IpsecIntegAlg(buf.DecodeUint32()) m.Entry.IntegrityKey.Length = buf.DecodeUint8() m.Entry.IntegrityKey.Data = make([]byte, 128) copy(m.Entry.IntegrityKey.Data, buf.DecodeBytes(len(m.Entry.IntegrityKey.Data))) m.Entry.Flags = ipsec_types.IpsecSadFlags(buf.DecodeUint32()) m.Entry.TunnelSrc.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelSrc.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.TunnelDst.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.TunnelDst.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.TxTableID = buf.DecodeUint32() m.Entry.Salt = buf.DecodeUint32() m.Entry.UDPSrcPort = buf.DecodeUint16() m.Entry.UDPDstPort = buf.DecodeUint16() return nil } // IpsecSadEntryAddDelReply defines message 'ipsec_sad_entry_add_del_reply'. type IpsecSadEntryAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` } func (m *IpsecSadEntryAddDelReply) Reset() { *m = IpsecSadEntryAddDelReply{} } func (*IpsecSadEntryAddDelReply) GetMessageName() string { return "ipsec_sad_entry_add_del_reply" } func (*IpsecSadEntryAddDelReply) GetCrcString() string { return "9ffac24b" } func (*IpsecSadEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSadEntryAddDelReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval size += 4 // m.StatIndex return size } func (m *IpsecSadEntryAddDelReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSadEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() m.StatIndex = buf.DecodeUint32() return nil } // IpsecSelectBackend defines message 'ipsec_select_backend'. type IpsecSelectBackend struct { Protocol ipsec_types.IpsecProto `binapi:"ipsec_proto,name=protocol" json:"protocol,omitempty"` Index uint8 `binapi:"u8,name=index" json:"index,omitempty"` } func (m *IpsecSelectBackend) Reset() { *m = IpsecSelectBackend{} } func (*IpsecSelectBackend) GetMessageName() string { return "ipsec_select_backend" } func (*IpsecSelectBackend) GetCrcString() string { return "5bcfd3b7" } func (*IpsecSelectBackend) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSelectBackend) Size() (size int) { if m == nil { return 0 } size += 4 // m.Protocol size += 1 // m.Index return size } func (m *IpsecSelectBackend) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Protocol)) buf.EncodeUint8(m.Index) return buf.Bytes(), nil } func (m *IpsecSelectBackend) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Protocol = ipsec_types.IpsecProto(buf.DecodeUint32()) m.Index = buf.DecodeUint8() return nil } // IpsecSelectBackendReply defines message 'ipsec_select_backend_reply'. type IpsecSelectBackendReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecSelectBackendReply) Reset() { *m = IpsecSelectBackendReply{} } func (*IpsecSelectBackendReply) GetMessageName() string { return "ipsec_select_backend_reply" } func (*IpsecSelectBackendReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSelectBackendReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSelectBackendReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecSelectBackendReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecSelectBackendReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } // IpsecSpdAddDel defines message 'ipsec_spd_add_del'. type IpsecSpdAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` } func (m *IpsecSpdAddDel) Reset() { *m = IpsecSpdAddDel{} } func (*IpsecSpdAddDel) GetMessageName() string { return "ipsec_spd_add_del" } func (*IpsecSpdAddDel) GetCrcString() string { return "20e89a95" } func (*IpsecSpdAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSpdAddDel) Size() (size int) { if m == nil { return 0 } size += 1 // m.IsAdd size += 4 // m.SpdID return size } func (m *IpsecSpdAddDel) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(m.SpdID) return buf.Bytes(), nil } func (m *IpsecSpdAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.SpdID = buf.DecodeUint32() return nil } // IpsecSpdAddDelReply defines message 'ipsec_spd_add_del_reply'. type IpsecSpdAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecSpdAddDelReply) Reset() { *m = IpsecSpdAddDelReply{} } func (*IpsecSpdAddDelReply) GetMessageName() string { return "ipsec_spd_add_del_reply" } func (*IpsecSpdAddDelReply) GetCrcString() string { return "e8d4e804" } func (*IpsecSpdAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdAddDelReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecSpdAddDelReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecSpdAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } // IpsecSpdDetails defines message 'ipsec_spd_details'. type IpsecSpdDetails struct { Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"` } func (m *IpsecSpdDetails) Reset() { *m = IpsecSpdDetails{} } func (*IpsecSpdDetails) GetMessageName() string { return "ipsec_spd_details" } func (*IpsecSpdDetails) GetCrcString() string { return "f2222790" } func (*IpsecSpdDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdDetails) Size() (size int) { if m == nil { return 0 } size += 4 // m.Entry.SpdID size += 4 // m.Entry.Priority size += 1 // m.Entry.IsOutbound size += 4 // m.Entry.SaID size += 4 // m.Entry.Policy size += 1 // m.Entry.Protocol size += 1 // m.Entry.RemoteAddressStart.Af size += 1 * 16 // m.Entry.RemoteAddressStart.Un size += 1 // m.Entry.RemoteAddressStop.Af size += 1 * 16 // m.Entry.RemoteAddressStop.Un size += 1 // m.Entry.LocalAddressStart.Af size += 1 * 16 // m.Entry.LocalAddressStart.Un size += 1 // m.Entry.LocalAddressStop.Af size += 1 * 16 // m.Entry.LocalAddressStop.Un size += 2 // m.Entry.RemotePortStart size += 2 // m.Entry.RemotePortStop size += 2 // m.Entry.LocalPortStart size += 2 // m.Entry.LocalPortStop return size } func (m *IpsecSpdDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.Entry.SpdID) buf.EncodeInt32(m.Entry.Priority) buf.EncodeBool(m.Entry.IsOutbound) buf.EncodeUint32(m.Entry.SaID) buf.EncodeUint32(uint32(m.Entry.Policy)) buf.EncodeUint8(m.Entry.Protocol) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af)) buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af)) buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af)) buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af)) buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint16(m.Entry.RemotePortStart) buf.EncodeUint16(m.Entry.RemotePortStop) buf.EncodeUint16(m.Entry.LocalPortStart) buf.EncodeUint16(m.Entry.LocalPortStop) return buf.Bytes(), nil } func (m *IpsecSpdDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Entry.SpdID = buf.DecodeUint32() m.Entry.Priority = buf.DecodeInt32() m.Entry.IsOutbound = buf.DecodeBool() m.Entry.SaID = buf.DecodeUint32() m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32()) m.Entry.Protocol = buf.DecodeUint8() m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.RemotePortStart = buf.DecodeUint16() m.Entry.RemotePortStop = buf.DecodeUint16() m.Entry.LocalPortStart = buf.DecodeUint16() m.Entry.LocalPortStop = buf.DecodeUint16() return nil } // IpsecSpdDump defines message 'ipsec_spd_dump'. type IpsecSpdDump struct { SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` } func (m *IpsecSpdDump) Reset() { *m = IpsecSpdDump{} } func (*IpsecSpdDump) GetMessageName() string { return "ipsec_spd_dump" } func (*IpsecSpdDump) GetCrcString() string { return "afefbf7d" } func (*IpsecSpdDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSpdDump) Size() (size int) { if m == nil { return 0 } size += 4 // m.SpdID size += 4 // m.SaID return size } func (m *IpsecSpdDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.SpdID) buf.EncodeUint32(m.SaID) return buf.Bytes(), nil } func (m *IpsecSpdDump) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SpdID = buf.DecodeUint32() m.SaID = buf.DecodeUint32() return nil } // IpsecSpdEntryAddDel defines message 'ipsec_spd_entry_add_del'. type IpsecSpdEntryAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Entry IpsecSpdEntry `binapi:"ipsec_spd_entry,name=entry" json:"entry,omitempty"` } func (m *IpsecSpdEntryAddDel) Reset() { *m = IpsecSpdEntryAddDel{} } func (*IpsecSpdEntryAddDel) GetMessageName() string { return "ipsec_spd_entry_add_del" } func (*IpsecSpdEntryAddDel) GetCrcString() string { return "9f384b8d" } func (*IpsecSpdEntryAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSpdEntryAddDel) Size() (size int) { if m == nil { return 0 } size += 1 // m.IsAdd size += 4 // m.Entry.SpdID size += 4 // m.Entry.Priority size += 1 // m.Entry.IsOutbound size += 4 // m.Entry.SaID size += 4 // m.Entry.Policy size += 1 // m.Entry.Protocol size += 1 // m.Entry.RemoteAddressStart.Af size += 1 * 16 // m.Entry.RemoteAddressStart.Un size += 1 // m.Entry.RemoteAddressStop.Af size += 1 * 16 // m.Entry.RemoteAddressStop.Un size += 1 // m.Entry.LocalAddressStart.Af size += 1 * 16 // m.Entry.LocalAddressStart.Un size += 1 // m.Entry.LocalAddressStop.Af size += 1 * 16 // m.Entry.LocalAddressStop.Un size += 2 // m.Entry.RemotePortStart size += 2 // m.Entry.RemotePortStop size += 2 // m.Entry.LocalPortStart size += 2 // m.Entry.LocalPortStop return size } func (m *IpsecSpdEntryAddDel) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeUint32(m.Entry.SpdID) buf.EncodeInt32(m.Entry.Priority) buf.EncodeBool(m.Entry.IsOutbound) buf.EncodeUint32(m.Entry.SaID) buf.EncodeUint32(uint32(m.Entry.Policy)) buf.EncodeUint8(m.Entry.Protocol) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStart.Af)) buf.EncodeBytes(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.RemoteAddressStop.Af)) buf.EncodeBytes(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStart.Af)) buf.EncodeBytes(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.Entry.LocalAddressStop.Af)) buf.EncodeBytes(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], 16) buf.EncodeUint16(m.Entry.RemotePortStart) buf.EncodeUint16(m.Entry.RemotePortStop) buf.EncodeUint16(m.Entry.LocalPortStart) buf.EncodeUint16(m.Entry.LocalPortStop) return buf.Bytes(), nil } func (m *IpsecSpdEntryAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.Entry.SpdID = buf.DecodeUint32() m.Entry.Priority = buf.DecodeInt32() m.Entry.IsOutbound = buf.DecodeBool() m.Entry.SaID = buf.DecodeUint32() m.Entry.Policy = IpsecSpdAction(buf.DecodeUint32()) m.Entry.Protocol = buf.DecodeUint8() m.Entry.RemoteAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.RemoteAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.RemoteAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.RemoteAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.LocalAddressStart.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.LocalAddressStart.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.LocalAddressStop.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Entry.LocalAddressStop.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Entry.RemotePortStart = buf.DecodeUint16() m.Entry.RemotePortStop = buf.DecodeUint16() m.Entry.LocalPortStart = buf.DecodeUint16() m.Entry.LocalPortStop = buf.DecodeUint16() return nil } // IpsecSpdEntryAddDelReply defines message 'ipsec_spd_entry_add_del_reply'. type IpsecSpdEntryAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` StatIndex uint32 `binapi:"u32,name=stat_index" json:"stat_index,omitempty"` } func (m *IpsecSpdEntryAddDelReply) Reset() { *m = IpsecSpdEntryAddDelReply{} } func (*IpsecSpdEntryAddDelReply) GetMessageName() string { return "ipsec_spd_entry_add_del_reply" } func (*IpsecSpdEntryAddDelReply) GetCrcString() string { return "9ffac24b" } func (*IpsecSpdEntryAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdEntryAddDelReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval size += 4 // m.StatIndex return size } func (m *IpsecSpdEntryAddDelReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) buf.EncodeUint32(m.StatIndex) return buf.Bytes(), nil } func (m *IpsecSpdEntryAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() m.StatIndex = buf.DecodeUint32() return nil } // IpsecSpdInterfaceDetails defines message 'ipsec_spd_interface_details'. type IpsecSpdInterfaceDetails struct { SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` } func (m *IpsecSpdInterfaceDetails) Reset() { *m = IpsecSpdInterfaceDetails{} } func (*IpsecSpdInterfaceDetails) GetMessageName() string { return "ipsec_spd_interface_details" } func (*IpsecSpdInterfaceDetails) GetCrcString() string { return "7a0bcf3e" } func (*IpsecSpdInterfaceDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdInterfaceDetails) Size() (size int) { if m == nil { return 0 } size += 4 // m.SpdIndex size += 4 // m.SwIfIndex return size } func (m *IpsecSpdInterfaceDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.SpdIndex) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *IpsecSpdInterfaceDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SpdIndex = buf.DecodeUint32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } // IpsecSpdInterfaceDump defines message 'ipsec_spd_interface_dump'. type IpsecSpdInterfaceDump struct { SpdIndex uint32 `binapi:"u32,name=spd_index" json:"spd_index,omitempty"` SpdIndexValid uint8 `binapi:"u8,name=spd_index_valid" json:"spd_index_valid,omitempty"` } func (m *IpsecSpdInterfaceDump) Reset() { *m = IpsecSpdInterfaceDump{} } func (*IpsecSpdInterfaceDump) GetMessageName() string { return "ipsec_spd_interface_dump" } func (*IpsecSpdInterfaceDump) GetCrcString() string { return "8971de19" } func (*IpsecSpdInterfaceDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSpdInterfaceDump) Size() (size int) { if m == nil { return 0 } size += 4 // m.SpdIndex size += 1 // m.SpdIndexValid return size } func (m *IpsecSpdInterfaceDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.SpdIndex) buf.EncodeUint8(m.SpdIndexValid) return buf.Bytes(), nil } func (m *IpsecSpdInterfaceDump) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SpdIndex = buf.DecodeUint32() m.SpdIndexValid = buf.DecodeUint8() return nil } // IpsecSpdsDetails defines message 'ipsec_spds_details'. type IpsecSpdsDetails struct { SpdID uint32 `binapi:"u32,name=spd_id" json:"spd_id,omitempty"` Npolicies uint32 `binapi:"u32,name=npolicies" json:"npolicies,omitempty"` } func (m *IpsecSpdsDetails) Reset() { *m = IpsecSpdsDetails{} } func (*IpsecSpdsDetails) GetMessageName() string { return "ipsec_spds_details" } func (*IpsecSpdsDetails) GetCrcString() string { return "a04bb254" } func (*IpsecSpdsDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecSpdsDetails) Size() (size int) { if m == nil { return 0 } size += 4 // m.SpdID size += 4 // m.Npolicies return size } func (m *IpsecSpdsDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(m.SpdID) buf.EncodeUint32(m.Npolicies) return buf.Bytes(), nil } func (m *IpsecSpdsDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SpdID = buf.DecodeUint32() m.Npolicies = buf.DecodeUint32() return nil } // IpsecSpdsDump defines message 'ipsec_spds_dump'. type IpsecSpdsDump struct{} func (m *IpsecSpdsDump) Reset() { *m = IpsecSpdsDump{} } func (*IpsecSpdsDump) GetMessageName() string { return "ipsec_spds_dump" } func (*IpsecSpdsDump) GetCrcString() string { return "51077d14" } func (*IpsecSpdsDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecSpdsDump) Size() (size int) { if m == nil { return 0 } return size } func (m *IpsecSpdsDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) return buf.Bytes(), nil } func (m *IpsecSpdsDump) Unmarshal(b []byte) error { return nil } // IpsecTunnelIfAddDel defines message 'ipsec_tunnel_if_add_del'. type IpsecTunnelIfAddDel struct { IsAdd bool `binapi:"bool,name=is_add" json:"is_add,omitempty"` Esn bool `binapi:"bool,name=esn" json:"esn,omitempty"` AntiReplay bool `binapi:"bool,name=anti_replay" json:"anti_replay,omitempty"` LocalIP ip_types.Address `binapi:"address,name=local_ip" json:"local_ip,omitempty"` RemoteIP ip_types.Address `binapi:"address,name=remote_ip" json:"remote_ip,omitempty"` LocalSpi uint32 `binapi:"u32,name=local_spi" json:"local_spi,omitempty"` RemoteSpi uint32 `binapi:"u32,name=remote_spi" json:"remote_spi,omitempty"` CryptoAlg uint8 `binapi:"u8,name=crypto_alg" json:"crypto_alg,omitempty"` LocalCryptoKeyLen uint8 `binapi:"u8,name=local_crypto_key_len" json:"local_crypto_key_len,omitempty"` LocalCryptoKey []byte `binapi:"u8[128],name=local_crypto_key" json:"local_crypto_key,omitempty"` RemoteCryptoKeyLen uint8 `binapi:"u8,name=remote_crypto_key_len" json:"remote_crypto_key_len,omitempty"` RemoteCryptoKey []byte `binapi:"u8[128],name=remote_crypto_key" json:"remote_crypto_key,omitempty"` IntegAlg uint8 `binapi:"u8,name=integ_alg" json:"integ_alg,omitempty"` LocalIntegKeyLen uint8 `binapi:"u8,name=local_integ_key_len" json:"local_integ_key_len,omitempty"` LocalIntegKey []byte `binapi:"u8[128],name=local_integ_key" json:"local_integ_key,omitempty"` RemoteIntegKeyLen uint8 `binapi:"u8,name=remote_integ_key_len" json:"remote_integ_key_len,omitempty"` RemoteIntegKey []byte `binapi:"u8[128],name=remote_integ_key" json:"remote_integ_key,omitempty"` Renumber bool `binapi:"bool,name=renumber" json:"renumber,omitempty"` ShowInstance uint32 `binapi:"u32,name=show_instance" json:"show_instance,omitempty"` UDPEncap bool `binapi:"bool,name=udp_encap" json:"udp_encap,omitempty"` TxTableID uint32 `binapi:"u32,name=tx_table_id" json:"tx_table_id,omitempty"` Salt uint32 `binapi:"u32,name=salt" json:"salt,omitempty"` } func (m *IpsecTunnelIfAddDel) Reset() { *m = IpsecTunnelIfAddDel{} } func (*IpsecTunnelIfAddDel) GetMessageName() string { return "ipsec_tunnel_if_add_del" } func (*IpsecTunnelIfAddDel) GetCrcString() string { return "2b135e68" } func (*IpsecTunnelIfAddDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecTunnelIfAddDel) Size() (size int) { if m == nil { return 0 } size += 1 // m.IsAdd size += 1 // m.Esn size += 1 // m.AntiReplay size += 1 // m.LocalIP.Af size += 1 * 16 // m.LocalIP.Un size += 1 // m.RemoteIP.Af size += 1 * 16 // m.RemoteIP.Un size += 4 // m.LocalSpi size += 4 // m.RemoteSpi size += 1 // m.CryptoAlg size += 1 // m.LocalCryptoKeyLen size += 1 * 128 // m.LocalCryptoKey size += 1 // m.RemoteCryptoKeyLen size += 1 * 128 // m.RemoteCryptoKey size += 1 // m.IntegAlg size += 1 // m.LocalIntegKeyLen size += 1 * 128 // m.LocalIntegKey size += 1 // m.RemoteIntegKeyLen size += 1 * 128 // m.RemoteIntegKey size += 1 // m.Renumber size += 4 // m.ShowInstance size += 1 // m.UDPEncap size += 4 // m.TxTableID size += 4 // m.Salt return size } func (m *IpsecTunnelIfAddDel) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeBool(m.IsAdd) buf.EncodeBool(m.Esn) buf.EncodeBool(m.AntiReplay) buf.EncodeUint8(uint8(m.LocalIP.Af)) buf.EncodeBytes(m.LocalIP.Un.XXX_UnionData[:], 16) buf.EncodeUint8(uint8(m.RemoteIP.Af)) buf.EncodeBytes(m.RemoteIP.Un.XXX_UnionData[:], 16) buf.EncodeUint32(m.LocalSpi) buf.EncodeUint32(m.RemoteSpi) buf.EncodeUint8(m.CryptoAlg) buf.EncodeUint8(m.LocalCryptoKeyLen) buf.EncodeBytes(m.LocalCryptoKey, 128) buf.EncodeUint8(m.RemoteCryptoKeyLen) buf.EncodeBytes(m.RemoteCryptoKey, 128) buf.EncodeUint8(m.IntegAlg) buf.EncodeUint8(m.LocalIntegKeyLen) buf.EncodeBytes(m.LocalIntegKey, 128) buf.EncodeUint8(m.RemoteIntegKeyLen) buf.EncodeBytes(m.RemoteIntegKey, 128) buf.EncodeBool(m.Renumber) buf.EncodeUint32(m.ShowInstance) buf.EncodeBool(m.UDPEncap) buf.EncodeUint32(m.TxTableID) buf.EncodeUint32(m.Salt) return buf.Bytes(), nil } func (m *IpsecTunnelIfAddDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.IsAdd = buf.DecodeBool() m.Esn = buf.DecodeBool() m.AntiReplay = buf.DecodeBool() m.LocalIP.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.LocalIP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.RemoteIP.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.RemoteIP.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.LocalSpi = buf.DecodeUint32() m.RemoteSpi = buf.DecodeUint32() m.CryptoAlg = buf.DecodeUint8() m.LocalCryptoKeyLen = buf.DecodeUint8() m.LocalCryptoKey = make([]byte, 128) copy(m.LocalCryptoKey, buf.DecodeBytes(len(m.LocalCryptoKey))) m.RemoteCryptoKeyLen = buf.DecodeUint8() m.RemoteCryptoKey = make([]byte, 128) copy(m.RemoteCryptoKey, buf.DecodeBytes(len(m.RemoteCryptoKey))) m.IntegAlg = buf.DecodeUint8() m.LocalIntegKeyLen = buf.DecodeUint8() m.LocalIntegKey = make([]byte, 128) copy(m.LocalIntegKey, buf.DecodeBytes(len(m.LocalIntegKey))) m.RemoteIntegKeyLen = buf.DecodeUint8() m.RemoteIntegKey = make([]byte, 128) copy(m.RemoteIntegKey, buf.DecodeBytes(len(m.RemoteIntegKey))) m.Renumber = buf.DecodeBool() m.ShowInstance = buf.DecodeUint32() m.UDPEncap = buf.DecodeBool() m.TxTableID = buf.DecodeUint32() m.Salt = buf.DecodeUint32() return nil } // IpsecTunnelIfAddDelReply defines message 'ipsec_tunnel_if_add_del_reply'. type IpsecTunnelIfAddDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` } func (m *IpsecTunnelIfAddDelReply) Reset() { *m = IpsecTunnelIfAddDelReply{} } func (*IpsecTunnelIfAddDelReply) GetMessageName() string { return "ipsec_tunnel_if_add_del_reply" } func (*IpsecTunnelIfAddDelReply) GetCrcString() string { return "5383d31f" } func (*IpsecTunnelIfAddDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelIfAddDelReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval size += 4 // m.SwIfIndex return size } func (m *IpsecTunnelIfAddDelReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *IpsecTunnelIfAddDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } // IpsecTunnelIfSetSa defines message 'ipsec_tunnel_if_set_sa'. type IpsecTunnelIfSetSa struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` SaID uint32 `binapi:"u32,name=sa_id" json:"sa_id,omitempty"` IsOutbound uint8 `binapi:"u8,name=is_outbound" json:"is_outbound,omitempty"` } func (m *IpsecTunnelIfSetSa) Reset() { *m = IpsecTunnelIfSetSa{} } func (*IpsecTunnelIfSetSa) GetMessageName() string { return "ipsec_tunnel_if_set_sa" } func (*IpsecTunnelIfSetSa) GetCrcString() string { return "f2f87112" } func (*IpsecTunnelIfSetSa) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecTunnelIfSetSa) Size() (size int) { if m == nil { return 0 } size += 4 // m.SwIfIndex size += 4 // m.SaID size += 1 // m.IsOutbound return size } func (m *IpsecTunnelIfSetSa) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint32(m.SaID) buf.EncodeUint8(m.IsOutbound) return buf.Bytes(), nil } func (m *IpsecTunnelIfSetSa) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.SaID = buf.DecodeUint32() m.IsOutbound = buf.DecodeUint8() return nil } // IpsecTunnelIfSetSaReply defines message 'ipsec_tunnel_if_set_sa_reply'. type IpsecTunnelIfSetSaReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecTunnelIfSetSaReply) Reset() { *m = IpsecTunnelIfSetSaReply{} } func (*IpsecTunnelIfSetSaReply) GetMessageName() string { return "ipsec_tunnel_if_set_sa_reply" } func (*IpsecTunnelIfSetSaReply) GetCrcString() string { return "e8d4e804" } func (*IpsecTunnelIfSetSaReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelIfSetSaReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecTunnelIfSetSaReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelIfSetSaReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } // IpsecTunnelProtectDel defines message 'ipsec_tunnel_protect_del'. type IpsecTunnelProtectDel struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` Nh ip_types.Address `binapi:"address,name=nh" json:"nh,omitempty"` } func (m *IpsecTunnelProtectDel) Reset() { *m = IpsecTunnelProtectDel{} } func (*IpsecTunnelProtectDel) GetMessageName() string { return "ipsec_tunnel_protect_del" } func (*IpsecTunnelProtectDel) GetCrcString() string { return "ddd2ba36" } func (*IpsecTunnelProtectDel) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecTunnelProtectDel) Size() (size int) { if m == nil { return 0 } size += 4 // m.SwIfIndex size += 1 // m.Nh.Af size += 1 * 16 // m.Nh.Un return size } func (m *IpsecTunnelProtectDel) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) buf.EncodeUint8(uint8(m.Nh.Af)) buf.EncodeBytes(m.Nh.Un.XXX_UnionData[:], 16) return buf.Bytes(), nil } func (m *IpsecTunnelProtectDel) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) return nil } // IpsecTunnelProtectDelReply defines message 'ipsec_tunnel_protect_del_reply'. type IpsecTunnelProtectDelReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecTunnelProtectDelReply) Reset() { *m = IpsecTunnelProtectDelReply{} } func (*IpsecTunnelProtectDelReply) GetMessageName() string { return "ipsec_tunnel_protect_del_reply" } func (*IpsecTunnelProtectDelReply) GetCrcString() string { return "e8d4e804" } func (*IpsecTunnelProtectDelReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelProtectDelReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecTunnelProtectDelReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelProtectDelReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } // IpsecTunnelProtectDetails defines message 'ipsec_tunnel_protect_details'. type IpsecTunnelProtectDetails struct { Tun IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tun" json:"tun,omitempty"` } func (m *IpsecTunnelProtectDetails) Reset() { *m = IpsecTunnelProtectDetails{} } func (*IpsecTunnelProtectDetails) GetMessageName() string { return "ipsec_tunnel_protect_details" } func (*IpsecTunnelProtectDetails) GetCrcString() string { return "ac6c823b" } func (*IpsecTunnelProtectDetails) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelProtectDetails) Size() (size int) { if m == nil { return 0 } size += 4 // m.Tun.SwIfIndex size += 1 // m.Tun.Nh.Af size += 1 * 16 // m.Tun.Nh.Un size += 4 // m.Tun.SaOut size += 1 // m.Tun.NSaIn size += 4 * len(m.Tun.SaIn) // m.Tun.SaIn return size } func (m *IpsecTunnelProtectDetails) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Tun.SwIfIndex)) buf.EncodeUint8(uint8(m.Tun.Nh.Af)) buf.EncodeBytes(m.Tun.Nh.Un.XXX_UnionData[:], 16) buf.EncodeUint32(m.Tun.SaOut) buf.EncodeUint8(uint8(len(m.Tun.SaIn))) for i := 0; i < len(m.Tun.SaIn); i++ { var x uint32 if i < len(m.Tun.SaIn) { x = uint32(m.Tun.SaIn[i]) } buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *IpsecTunnelProtectDetails) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Tun.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Tun.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Tun.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Tun.SaOut = buf.DecodeUint32() m.Tun.NSaIn = buf.DecodeUint8() m.Tun.SaIn = make([]uint32, m.Tun.NSaIn) for i := 0; i < len(m.Tun.SaIn); i++ { m.Tun.SaIn[i] = buf.DecodeUint32() } return nil } // IpsecTunnelProtectDump defines message 'ipsec_tunnel_protect_dump'. type IpsecTunnelProtectDump struct { SwIfIndex interface_types.InterfaceIndex `binapi:"interface_index,name=sw_if_index" json:"sw_if_index,omitempty"` } func (m *IpsecTunnelProtectDump) Reset() { *m = IpsecTunnelProtectDump{} } func (*IpsecTunnelProtectDump) GetMessageName() string { return "ipsec_tunnel_protect_dump" } func (*IpsecTunnelProtectDump) GetCrcString() string { return "f9e6675e" } func (*IpsecTunnelProtectDump) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecTunnelProtectDump) Size() (size int) { if m == nil { return 0 } size += 4 // m.SwIfIndex return size } func (m *IpsecTunnelProtectDump) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.SwIfIndex)) return buf.Bytes(), nil } func (m *IpsecTunnelProtectDump) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) return nil } // IpsecTunnelProtectUpdate defines message 'ipsec_tunnel_protect_update'. type IpsecTunnelProtectUpdate struct { Tunnel IpsecTunnelProtect `binapi:"ipsec_tunnel_protect,name=tunnel" json:"tunnel,omitempty"` } func (m *IpsecTunnelProtectUpdate) Reset() { *m = IpsecTunnelProtectUpdate{} } func (*IpsecTunnelProtectUpdate) GetMessageName() string { return "ipsec_tunnel_protect_update" } func (*IpsecTunnelProtectUpdate) GetCrcString() string { return "143f155d" } func (*IpsecTunnelProtectUpdate) GetMessageType() api.MessageType { return api.RequestMessage } func (m *IpsecTunnelProtectUpdate) Size() (size int) { if m == nil { return 0 } size += 4 // m.Tunnel.SwIfIndex size += 1 // m.Tunnel.Nh.Af size += 1 * 16 // m.Tunnel.Nh.Un size += 4 // m.Tunnel.SaOut size += 1 // m.Tunnel.NSaIn size += 4 * len(m.Tunnel.SaIn) // m.Tunnel.SaIn return size } func (m *IpsecTunnelProtectUpdate) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeUint32(uint32(m.Tunnel.SwIfIndex)) buf.EncodeUint8(uint8(m.Tunnel.Nh.Af)) buf.EncodeBytes(m.Tunnel.Nh.Un.XXX_UnionData[:], 16) buf.EncodeUint32(m.Tunnel.SaOut) buf.EncodeUint8(uint8(len(m.Tunnel.SaIn))) for i := 0; i < len(m.Tunnel.SaIn); i++ { var x uint32 if i < len(m.Tunnel.SaIn) { x = uint32(m.Tunnel.SaIn[i]) } buf.EncodeUint32(x) } return buf.Bytes(), nil } func (m *IpsecTunnelProtectUpdate) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Tunnel.SwIfIndex = interface_types.InterfaceIndex(buf.DecodeUint32()) m.Tunnel.Nh.Af = ip_types.AddressFamily(buf.DecodeUint8()) copy(m.Tunnel.Nh.Un.XXX_UnionData[:], buf.DecodeBytes(16)) m.Tunnel.SaOut = buf.DecodeUint32() m.Tunnel.NSaIn = buf.DecodeUint8() m.Tunnel.SaIn = make([]uint32, m.Tunnel.NSaIn) for i := 0; i < len(m.Tunnel.SaIn); i++ { m.Tunnel.SaIn[i] = buf.DecodeUint32() } return nil } // IpsecTunnelProtectUpdateReply defines message 'ipsec_tunnel_protect_update_reply'. type IpsecTunnelProtectUpdateReply struct { Retval int32 `binapi:"i32,name=retval" json:"retval,omitempty"` } func (m *IpsecTunnelProtectUpdateReply) Reset() { *m = IpsecTunnelProtectUpdateReply{} } func (*IpsecTunnelProtectUpdateReply) GetMessageName() string { return "ipsec_tunnel_protect_update_reply" } func (*IpsecTunnelProtectUpdateReply) GetCrcString() string { return "e8d4e804" } func (*IpsecTunnelProtectUpdateReply) GetMessageType() api.MessageType { return api.ReplyMessage } func (m *IpsecTunnelProtectUpdateReply) Size() (size int) { if m == nil { return 0 } size += 4 // m.Retval return size } func (m *IpsecTunnelProtectUpdateReply) Marshal(b []byte) ([]byte, error) { if b == nil { b = make([]byte, m.Size()) } buf := codec.NewBuffer(b) buf.EncodeInt32(m.Retval) return buf.Bytes(), nil } func (m *IpsecTunnelProtectUpdateReply) Unmarshal(b []byte) error { buf := codec.NewBuffer(b) m.Retval = buf.DecodeInt32() return nil } func init() { file_ipsec_binapi_init() } func file_ipsec_binapi_init() { api.RegisterMessage((*IpsecBackendDetails)(nil), "ipsec_backend_details_ee601c29") api.RegisterMessage((*IpsecBackendDump)(nil), "ipsec_backend_dump_51077d14") api.RegisterMessage((*IpsecInterfaceAddDelSpd)(nil), "ipsec_interface_add_del_spd_80f80cbb") api.RegisterMessage((*IpsecInterfaceAddDelSpdReply)(nil), "ipsec_interface_add_del_spd_reply_e8d4e804") api.RegisterMessage((*IpsecSaDetails)(nil), "ipsec_sa_details_b30c7f41") api.RegisterMessage((*IpsecSaDump)(nil), "ipsec_sa_dump_2076c2f4") api.RegisterMessage((*IpsecSadEntryAddDel)(nil), "ipsec_sad_entry_add_del_b8def364") api.RegisterMessage((*IpsecSadEntryAddDelReply)(nil), "ipsec_sad_entry_add_del_reply_9ffac24b") api.RegisterMessage((*IpsecSelectBackend)(nil), "ipsec_select_backend_5bcfd3b7") api.RegisterMessage((*IpsecSelectBackendReply)(nil), "ipsec_select_backend_reply_e8d4e804") api.RegisterMessage((*IpsecSpdAddDel)(nil), "ipsec_spd_add_del_20e89a95") api.RegisterMessage((*IpsecSpdAddDelReply)(nil), "ipsec_spd_add_del_reply_e8d4e804") api.RegisterMessage((*IpsecSpdDetails)(nil), "ipsec_spd_details_f2222790") api.RegisterMessage((*IpsecSpdDump)(nil), "ipsec_spd_dump_afefbf7d") api.RegisterMessage((*IpsecSpdEntryAddDel)(nil), "ipsec_spd_entry_add_del_9f384b8d") api.RegisterMessage((*IpsecSpdEntryAddDelReply)(nil), "ipsec_spd_entry_add_del_reply_9ffac24b") api.RegisterMessage((*IpsecSpdInterfaceDetails)(nil), "ipsec_spd_interface_details_7a0bcf3e") api.RegisterMessage((*IpsecSpdInterfaceDump)(nil), "ipsec_spd_interface_dump_8971de19") api.RegisterMessage((*IpsecSpdsDetails)(nil), "ipsec_spds_details_a04bb254") api.RegisterMessage((*IpsecSpdsDump)(nil), "ipsec_spds_dump_51077d14") api.RegisterMessage((*IpsecTunnelIfAddDel)(nil), "ipsec_tunnel_if_add_del_2b135e68") api.RegisterMessage((*IpsecTunnelIfAddDelReply)(nil), "ipsec_tunnel_if_add_del_reply_5383d31f") api.RegisterMessage((*IpsecTunnelIfSetSa)(nil), "ipsec_tunnel_if_set_sa_f2f87112") api.RegisterMessage((*IpsecTunnelIfSetSaReply)(nil), "ipsec_tunnel_if_set_sa_reply_e8d4e804") api.RegisterMessage((*IpsecTunnelProtectDel)(nil), "ipsec_tunnel_protect_del_ddd2ba36") api.RegisterMessage((*IpsecTunnelProtectDelReply)(nil), "ipsec_tunnel_protect_del_reply_e8d4e804") api.RegisterMessage((*IpsecTunnelProtectDetails)(nil), "ipsec_tunnel_protect_details_ac6c823b") api.RegisterMessage((*IpsecTunnelProtectDump)(nil), "ipsec_tunnel_protect_dump_f9e6675e") api.RegisterMessage((*IpsecTunnelProtectUpdate)(nil), "ipsec_tunnel_protect_update_143f155d") api.RegisterMessage((*IpsecTunnelProtectUpdateReply)(nil), "ipsec_tunnel_protect_update_reply_e8d4e804") } // Messages returns list of all messages in this module. func AllMessages() []api.Message { return []api.Message{ (*IpsecBackendDetails)(nil), (*IpsecBackendDump)(nil), (*IpsecInterfaceAddDelSpd)(nil), (*IpsecInterfaceAddDelSpdReply)(nil), (*IpsecSaDetails)(nil), (*IpsecSaDump)(nil), (*IpsecSadEntryAddDel)(nil), (*IpsecSadEntryAddDelReply)(nil), (*IpsecSelectBackend)(nil), (*IpsecSelectBackendReply)(nil), (*IpsecSpdAddDel)(nil), (*IpsecSpdAddDelReply)(nil), (*IpsecSpdDetails)(nil), (*IpsecSpdDump)(nil), (*IpsecSpdEntryAddDel)(nil), (*IpsecSpdEntryAddDelReply)(nil), (*IpsecSpdInterfaceDetails)(nil), (*IpsecSpdInterfaceDump)(nil), (*IpsecSpdsDetails)(nil), (*IpsecSpdsDump)(nil), (*IpsecTunnelIfAddDel)(nil), (*IpsecTunnelIfAddDelReply)(nil), (*IpsecTunnelIfSetSa)(nil), (*IpsecTunnelIfSetSaReply)(nil), (*IpsecTunnelProtectDel)(nil), (*IpsecTunnelProtectDelReply)(nil), (*IpsecTunnelProtectDetails)(nil), (*IpsecTunnelProtectDump)(nil), (*IpsecTunnelProtectUpdate)(nil), (*IpsecTunnelProtectUpdateReply)(nil), } }