msm: ipa: Add NAT and IPv6 CT suppression tests

Add kernel tests to validate NAT and IPv6 CT suppression
tests.

Change-Id: If69b651330846b92c85184c5afdeba73bafa1592
Signed-off-by: Chaitanya Pratapa <quic_cpratapa@quicinc.com>
This commit is contained in:
Chaitanya Pratapa
2021-09-08 17:07:01 -07:00
committed by Gerrit - the friendly Code Review server
parent 47c0ae3849
commit 1fb4520d43
4 changed files with 1554 additions and 7 deletions

View File

@@ -189,3 +189,25 @@ bool RoutingDriverWrapper::PutRoutingTable(uint32_t routingTableHandle)
return true;
}
bool RoutingDriverWrapper::SetNatConntrackExcRoutingTable(uint32_t routingTableHandle, bool nat_or_conntrack)
{
int retval = 0;
if (!DeviceNodeIsOpened())
return false;
if (nat_or_conntrack)
retval = ioctl(m_fd, IPA_IOC_SET_NAT_EXC_RT_TBL_IDX, routingTableHandle);
else
retval = ioctl(m_fd, IPA_IOC_SET_CONN_TRACK_EXC_RT_TBL_IDX, routingTableHandle);
if (retval) {
printf("%s(), IPA_IOC_SET_CONN_TRACK_EXC_RT_TBL_IDX ioctl failed.\n", __FUNCTION__);
return false;
}
printf("%s(), %s ioctl issued to IPA routing block.\n", __FUNCTION__,(nat_or_conntrack) ?
"IPA_IOC_SET_NAT_EXC_RT_TBL_IDX" : "IPA_IOC_SET_CONN_TRACK_EXC_RT_TBL_IDX");
return true;
}