mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
eiger, jungfrau, ctb, moench, gotthard virtual servers checked
This commit is contained in:
@ -616,7 +616,12 @@ void getMacAddressinString(char* cmac, int size, uint64_t mac) {
|
||||
|
||||
void getIpAddressinString(char* cip, uint32_t ip) {
|
||||
memset(cip, 0, INET_ADDRSTRLEN);
|
||||
#if defined(EIGERD) && !defined(VIRTUAL)
|
||||
inet_ntop(AF_INET, &ip, cip, INET_ADDRSTRLEN);
|
||||
#else
|
||||
sprintf(cip, "%d.%d.%d.%d",
|
||||
(ip>>24)&0xff,(ip>>16)&0xff,(ip>>8)&0xff,(ip)&0xff);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
int udpSockfd[2] = {-1, -1};
|
||||
struct addrinfo* udpServerAddrInfo[2] = {0, 0};
|
||||
unsigned short int udpDestinationPort[2] = {0, 0};
|
||||
char udpDestinationIp[2][MAX_STR_LENGTH] = {"", ""};
|
||||
char udpDestinationIp[2][INET_ADDRSTRLEN] = {"", ""};
|
||||
|
||||
//DEFAULT_TX_UDP_PORT;// src port
|
||||
int getUdPSocketDescriptor(int index) {
|
||||
@ -26,8 +26,8 @@ int getUdPSocketDescriptor(int index) {
|
||||
int setUDPDestinationDetails(int index, const char* ip, unsigned short int port) {
|
||||
udpDestinationPort[index] = port;
|
||||
size_t len = strlen(ip);
|
||||
memset(udpDestinationIp[index], 0, MAX_STR_LENGTH);
|
||||
strncpy(udpDestinationIp[index], ip, len > MAX_STR_LENGTH ? MAX_STR_LENGTH : len );
|
||||
memset(udpDestinationIp[index], 0, INET_ADDRSTRLEN);
|
||||
strncpy(udpDestinationIp[index], ip, len > INET_ADDRSTRLEN ? INET_ADDRSTRLEN : len );
|
||||
|
||||
if (udpServerAddrInfo[index]) {
|
||||
freeaddrinfo(udpServerAddrInfo[index]);
|
||||
|
Reference in New Issue
Block a user