udp virtual of gotthard2

This commit is contained in:
2019-08-26 10:54:01 +02:00
parent 3b2feba3b2
commit 298e1dd1fe
4 changed files with 21 additions and 4 deletions

View File

@ -273,6 +273,23 @@ int64_t getTimeLeft(enum timerIndex ind){
return -1;
}
int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t sourceip, uint32_t udpport) {
#ifdef VIRTUAL
char cDestIp[MAX_STR_LENGTH];
memset(cDestIp, 0, MAX_STR_LENGTH);
sprintf(cDestIp, "%d.%d.%d.%d", (destip>>24)&0xff,(destip>>16)&0xff,(destip>>8)&0xff,(destip)&0xff);
FILE_LOG(logINFO, ("1G UDP: Destination (IP: %s, port:%d)\n", cDestIp, udpport));
if (setUDPDestinationDetails(0, cDestIp, udpport) == FAIL) {
FILE_LOG(logERROR, ("could not set udp destination IP and port\n"));
return FAIL;
}
return OK;
#endif
return OK;
}
int startStateMachine(){
#ifdef VIRTUAL
// create udp socket