Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik committed Nov 23, 2024
1 parent d0d83cc commit 83559fb
Show file tree
Hide file tree
Showing 11 changed files with 1,395 additions and 14 deletions.
8 changes: 8 additions & 0 deletions vslib/HostInterfaceInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#include <linux/if_packet.h>
#include <linux/if_ether.h>

extern bool g_vpp;

using namespace saivs;

HostInterfaceInfo::HostInterfaceInfo(
Expand All @@ -42,6 +44,12 @@ HostInterfaceInfo::HostInterfaceInfo(

m_run_thread = true;

if (g_vpp) // VPP
{
// threads are disabled for vpp
return;
}

m_e2t = std::make_shared<std::thread>(&HostInterfaceInfo::veth2tap_fun, this);
m_t2e = std::make_shared<std::thread>(&HostInterfaceInfo::tap2veth_fun, this);
}
Expand Down
5 changes: 4 additions & 1 deletion vslib/MACsecAttr.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@

namespace saivs
{
using macsec_sci_t = std::string;
using macsec_an_t = std::uint16_t;
using macsec_pn_t = std::uint64_t;
using macsec_ssci_t = std::uint32_t;

struct MACsecAttr
{
Expand Down Expand Up @@ -50,11 +52,12 @@ namespace saivs
std::string m_authKey;
std::string m_sak;
std::string m_sci;
std::string m_ssci;
std::string m_ssciStr;
std::string m_salt;

macsec_an_t m_an;
macsec_pn_t m_pn;
macsec_ssci_t m_ssci;

bool m_sendSci;
bool m_encryptionEnable;
Expand Down
4 changes: 2 additions & 2 deletions vslib/MACsecManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ bool MACsecManager::create_macsec_egress_sa(
<< ( attr.is_xpn() ? " xpn " : " pn ")
<< attr.m_pn
<< ( attr.is_xpn() ? " ssci " : "" )
<< ( attr.is_xpn() ? attr.m_ssci : "" )
<< ( attr.is_xpn() ? attr.m_ssciStr : "" )
<< ( attr.is_xpn() ? " salt " : "" )
<< ( attr.is_xpn() ? attr.m_salt : "" )
<< " on key "
Expand Down Expand Up @@ -487,7 +487,7 @@ bool MACsecManager::create_macsec_ingress_sa(
<< ( attr.is_xpn() ? " xpn " : " pn " )
<< attr.m_pn
<< ( attr.is_xpn() ? " ssci " : "" )
<< ( attr.is_xpn() ? attr.m_ssci : "" )
<< ( attr.is_xpn() ? attr.m_ssciStr : "" )
<< ( attr.is_xpn() ? " salt " : "" )
<< ( attr.is_xpn() ? attr.m_salt : "" )
<< " on key "
Expand Down
15 changes: 15 additions & 0 deletions vslib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ lib_LTLIBRARIES = libsaivs.la
noinst_LIBRARIES = libSaiVS.a

libSaiVS_a_SOURCES = \
vppxlate/SaiAclStats.c \
vppxlate/SaiIntfStats.c \
vppxlate/SaiVppStats.c \
vppxlate/SaiVppXlate.c \
Buffer.cpp \
ContextConfigContainer.cpp \
ContextConfig.cpp \
Expand Down Expand Up @@ -54,10 +58,21 @@ libSaiVS_a_SOURCES = \
SwitchStateBaseFdb.cpp \
SwitchStateBaseHostif.cpp \
SwitchStateBaseMACsec.cpp \
SaiObjectDB.cpp \
SwitchStateBaseFdbVpp.cpp \
SwitchStateBaseAcl.cpp \
SwitchStateBaseBfd.cpp \
SwitchStateBaseNbr.cpp \
SwitchStateBaseNexthop.cpp \
SwitchStateBaseRif.cpp \
SwitchStateBaseRoute.cpp \
SwitchStateBaseUtils.cpp \
TunnelManager.cpp \
SwitchState.cpp \
TrafficFilterPipes.cpp \
TrafficForwarder.cpp \
VirtualSwitchSaiInterface.cpp \
VirtualSwitchSaiInterfaceVpp.cpp \
VirtualSwitchSaiInterfaceFdb.cpp \
VirtualSwitchSaiInterfacePort.cpp

Expand Down
Loading

0 comments on commit 83559fb

Please sign in to comment.