udp destination entries configured properly

This commit is contained in:
maliakal_d 2021-08-20 17:02:05 +02:00
parent 0c6911e469
commit 2afe7112b2
4 changed files with 26 additions and 22 deletions

View File

@ -137,8 +137,10 @@ void basictests() {
// update default udpdstip and udpdstmac (1g is hardware ip and hardware // update default udpdstip and udpdstmac (1g is hardware ip and hardware
// mac) // mac)
udpDetails[0].srcip = ipadd; for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) {
udpDetails[0].srcmac = macadd; udpDetails[iRxEntry].srcip = ipadd;
udpDetails[iRxEntry].srcmac = macadd;
}
#ifdef VIRTUAL #ifdef VIRTUAL
return; return;
@ -1524,13 +1526,13 @@ int configureMAC() {
LOG(logINFOBLUE, ("Configuring MAC\n")); LOG(logINFOBLUE, ("Configuring MAC\n"));
for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) { for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) {
uint32_t srcip = udpDetails[0].srcip; uint32_t srcip = udpDetails[iRxEntry].srcip;
uint32_t dstip = udpDetails[0].dstip; uint32_t dstip = udpDetails[iRxEntry].dstip;
uint64_t srcmac = udpDetails[0].srcmac; uint64_t srcmac = udpDetails[iRxEntry].srcmac;
uint64_t dstmac = udpDetails[0].dstmac; uint64_t dstmac = udpDetails[iRxEntry].dstmac;
int srcport = udpDetails[0].srcport; int srcport = udpDetails[iRxEntry].srcport;
int dstport = udpDetails[0].dstport; int dstport = udpDetails[iRxEntry].dstport;
int dstport2 = udpDetails[0].dstport2; int dstport2 = udpDetails[iRxEntry].dstport2;
char src_mac[50], src_ip[INET_ADDRSTRLEN], dst_mac[50], char src_mac[50], src_ip[INET_ADDRSTRLEN], dst_mac[50],
dst_ip[INET_ADDRSTRLEN]; dst_ip[INET_ADDRSTRLEN];
@ -1539,6 +1541,7 @@ int configureMAC() {
getIpAddressinString(src_ip, srcip); getIpAddressinString(src_ip, srcip);
getIpAddressinString(dst_ip, dstip); getIpAddressinString(dst_ip, dstip);
LOG(logINFOBLUE, ("\tEntry %d\n", iRxEntry));
LOG(logINFO, LOG(logINFO,
("\tSource IP : %s\n" ("\tSource IP : %s\n"
"\tSource MAC : %s\n" "\tSource MAC : %s\n"

View File

@ -1436,18 +1436,18 @@ int configureMAC() {
(selInterface ? "Inner" : "Outer"))); (selInterface ? "Inner" : "Outer")));
for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) { for (int iRxEntry = 0; iRxEntry != numUdpDestinations; ++iRxEntry) {
uint32_t srcip = udpDetails[0].srcip; uint32_t srcip = udpDetails[iRxEntry].srcip;
uint32_t srcip2 = udpDetails[0].srcip2; uint32_t srcip2 = udpDetails[iRxEntry].srcip2;
uint32_t dstip = udpDetails[0].dstip; uint32_t dstip = udpDetails[iRxEntry].dstip;
uint32_t dstip2 = udpDetails[0].dstip2; uint32_t dstip2 = udpDetails[iRxEntry].dstip2;
uint64_t srcmac = udpDetails[0].srcmac; uint64_t srcmac = udpDetails[iRxEntry].srcmac;
uint64_t srcmac2 = udpDetails[0].srcmac2; uint64_t srcmac2 = udpDetails[iRxEntry].srcmac2;
uint64_t dstmac = udpDetails[0].dstmac; uint64_t dstmac = udpDetails[iRxEntry].dstmac;
uint64_t dstmac2 = udpDetails[0].dstmac2; uint64_t dstmac2 = udpDetails[iRxEntry].dstmac2;
int srcport = udpDetails[0].srcport; int srcport = udpDetails[iRxEntry].srcport;
int srcport2 = udpDetails[0].srcport2; int srcport2 = udpDetails[iRxEntry].srcport2;
int dstport = udpDetails[0].dstport; int dstport = udpDetails[iRxEntry].dstport;
int dstport2 = udpDetails[0].dstport2; int dstport2 = udpDetails[iRxEntry].dstport2;
char src_mac[50], src_ip[INET_ADDRSTRLEN], dst_mac[50], char src_mac[50], src_ip[INET_ADDRSTRLEN], dst_mac[50],
dst_ip[INET_ADDRSTRLEN]; dst_ip[INET_ADDRSTRLEN];
@ -1461,6 +1461,7 @@ int configureMAC() {
getMacAddressinString(dst_mac2, 50, dstmac2); getMacAddressinString(dst_mac2, 50, dstmac2);
getIpAddressinString(src_ip2, srcip2); getIpAddressinString(src_ip2, srcip2);
getIpAddressinString(dst_ip2, dstip2); getIpAddressinString(dst_ip2, dstip2);
LOG(logINFOBLUE, ("\tEntry %d\n", iRxEntry));
LOG(logINFO, ("\tOuter %s\n", (numInterfaces == 2) LOG(logINFO, ("\tOuter %s\n", (numInterfaces == 2)
? "(Bottom)" ? "(Bottom)"