MV_VOID mvNfpSecSaPrint(MV_NFP_SEC_SA_ENTRY *pSAEntry) { mvDebugPrintIpAddr(MV_32BIT_BE(pSAEntry->tunnelHdr.sIp)); mvOsPrintf("->"); mvDebugPrintIpAddr(MV_32BIT_BE(pSAEntry->tunnelHdr.dIp)); mvOsPrintf(" out_if=%d da=", pSAEntry->tunnelHdr.outIfIndex); mvDebugPrintMacAddr(pSAEntry->tunnelHdr.dstMac); mvOsPrintf(" spi=0x%x", MV_32BIT_BE(pSAEntry->spi)); if (pSAEntry) mvOsPrintf("\tstats: encrypt:%d decrypt:%d reject:%d drop:%d bytes:%d", pSAEntry->stats.encrypt, pSAEntry->stats.decrypt, pSAEntry->stats.rejected, pSAEntry->stats.dropped, pSAEntry->stats.bytes); mvOsPrintf("\n"); }
/* Print a NFP NAT Rule */ void mvFpNatRulePrint(const MV_FP_NAT_RULE *rule) { /* Note: some of the fields in the NAT rule may contain invalid values */ mvOsPrintf("Original packet: "); mvOsPrintf("SIP="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->srcIp)), mvOsPrintf(", DIP="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->dstIp)), mvOsPrintf(", SPort=%d", MV_16BIT_BE(rule->srcPort)); mvOsPrintf(", DPort=%d", MV_16BIT_BE(rule->dstPort)); mvOsPrintf("\nNAT Info: "); mvOsPrintf("count=%u, flags=0x%x", rule->new_count, rule->flags); mvOsPrintf(", newIP="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->newIp)); mvOsPrintf(", newPort=%d", MV_16BIT_BE(rule->newPort)); mvOsPrintf("\n"); }
/* Print a NFP Rule */ void mvFpRulePrint(const MV_FP_RULE *rule) { mvFpActionTypePrint(rule); mvFpRuleTypePrint(rule); mvOsPrintf(", SIP="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->routingInfo.srcIp)); mvOsPrintf(", DIP="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->routingInfo.dstIp)); mvOsPrintf(", GTW="); mvDebugPrintIpAddr(MV_32BIT_BE(rule->routingInfo.defGtwIp)); mvOsPrintf(", DA="); mvDebugPrintMacAddr(rule->routingInfo.dstMac); mvOsPrintf(", SA="); mvDebugPrintMacAddr(rule->routingInfo.srcMac); mvOsPrintf(", inIf=%d", rule->routingInfo.inIfIndex); mvOsPrintf(", outIf=%d", rule->routingInfo.outIfIndex); mvOsPrintf(", count=%d, aware_flags=0x%X", rule->mgmtInfo.new_count, rule->routingInfo.aware_flags); mvOsPrintf("\n"); }
MV_VOID mvNfpSecDbPrint(MV_VOID) { MV_U32 i; mvOsPrintf("NFP IPSec:\n"); for (i = 0; i < spdInRuleCount; i++) { mvOsPrintf("inbound[%d] ", i); mvDebugPrintIpAddr(MV_32BIT_BE(spdInDb[i].sIp)); mvOsPrintf("->"); mvDebugPrintIpAddr(MV_32BIT_BE(spdInDb[i].dIp)); mvOsPrintf(" "); mvNfpSecSaPrint(spdInDb[i].pSAEntry); } for (i = 0; i < spdOutRuleCount; i++) { mvOsPrintf("outbound[%d] ", i); mvDebugPrintIpAddr(MV_32BIT_BE(spdOutDb[i].sIp)); mvOsPrintf("->"); mvDebugPrintIpAddr(MV_32BIT_BE(spdOutDb[i].dIp)); mvOsPrintf(" "); mvNfpSecSaPrint(spdOutDb[i].pSAEntry); } }