unicast udp_srcmac (#642)

* udp_srcmac can only be a unicast address (LSB of first octet must be 0)

* renamed binaries
This commit is contained in:
Dhanya Thattil 2023-02-03 10:56:19 +01:00 committed by GitHub
parent c62ce0ce6b
commit 55bf73f3b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 64 additions and 54 deletions

View File

@ -1 +0,0 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc1

View File

@ -0,0 +1 @@
../slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServerv7.0.0.rc3

View File

@ -1 +0,0 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc1

View File

@ -0,0 +1 @@
../slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServerv7.0.0.rc3

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc1

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServerv7.0.0.rc3

View File

@ -1 +0,0 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv7.0.0.rc2

View File

@ -0,0 +1 @@
../slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServerv7.0.0.rc3

View File

@ -1 +0,0 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc1

View File

@ -0,0 +1 @@
../slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServerv7.0.0.rc3

View File

@ -1 +0,0 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc1

View File

@ -0,0 +1 @@
../slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServerv7.0.0.rc3

View File

@ -1916,55 +1916,57 @@ int acquire(int blocking, int file_des) {
#ifdef EIGERD
// check for hardware mac and hardware ip
if (udpDetails[0].srcmac != getDetectorMAC()) {
ret = FAIL;
uint64_t sourcemac = getDetectorMAC();
char src_mac[MAC_ADDRESS_SIZE];
getMacAddressinString(src_mac, MAC_ADDRESS_SIZE, sourcemac);
sprintf(mess,
ret = FAIL;
uint64_t sourcemac = getDetectorMAC();
char src_mac[MAC_ADDRESS_SIZE];
getMacAddressinString(src_mac, MAC_ADDRESS_SIZE, sourcemac);
sprintf(
mess,
"Invalid udp source mac address for this detector. Must be "
"same as hardware detector mac address %s\n",
src_mac);
LOG(logERROR, (mess));
} else if (!enableTenGigabitEthernet(GET_FLAG) &&
(udpDetails[0].srcip != getDetectorIP())) {
ret = FAIL;
uint32_t sourceip = getDetectorIP();
char src_ip[INET_ADDRSTRLEN];
getIpAddressinString(src_ip, sourceip);
sprintf(mess,
LOG(logERROR, (mess));
} else if (!enableTenGigabitEthernet(GET_FLAG) &&
(udpDetails[0].srcip != getDetectorIP())) {
ret = FAIL;
uint32_t sourceip = getDetectorIP();
char src_ip[INET_ADDRSTRLEN];
getIpAddressinString(src_ip, sourceip);
sprintf(
mess,
"Invalid udp source ip address for this detector. Must be "
"same as hardware detector ip address %s in 1G readout "
"mode \n",
src_ip);
LOG(logERROR, (mess));
} else
LOG(logERROR, (mess));
} else
#endif
if (configured == FAIL) {
ret = FAIL;
strcpy(mess, "Could not start acquisition because ");
strcat(mess, configureMessage);
LOG(logERROR, (mess));
} else if (sharedMemory_getScanStatus() == RUNNING) {
ret = FAIL;
strcpy(mess, "Could not start acquisition because a scan is "
"already running!\n");
LOG(logERROR, (mess));
} else {
memset(scanErrMessage, 0, MAX_STR_LENGTH);
sharedMemory_setScanStop(0);
sharedMemory_setScanStatus(IDLE); // if it was error
if (pthread_create(&pthread_tid, NULL, &start_state_machine,
&blocking)) {
if (configured == FAIL) {
ret = FAIL;
strcpy(mess, "Could not start acquisition thread!\n");
strcpy(mess, "Could not start acquisition because ");
strcat(mess, configureMessage);
LOG(logERROR, (mess));
} else if (sharedMemory_getScanStatus() == RUNNING) {
ret = FAIL;
strcpy(mess, "Could not start acquisition because a scan is "
"already running!\n");
LOG(logERROR, (mess));
} else {
// only does not wait for non blocking and scan
if (blocking || !scan) {
pthread_join(pthread_tid, NULL);
memset(scanErrMessage, 0, MAX_STR_LENGTH);
sharedMemory_setScanStop(0);
sharedMemory_setScanStatus(IDLE); // if it was error
if (pthread_create(&pthread_tid, NULL, &start_state_machine,
&blocking)) {
ret = FAIL;
strcpy(mess, "Could not start acquisition thread!\n");
LOG(logERROR, (mess));
} else {
// only does not wait for non blocking and scan
if (blocking || !scan) {
pthread_join(pthread_tid, NULL);
}
}
}
}
}
return Server_SendResult(file_des, INT32, NULL, 0);
}
@ -5139,11 +5141,20 @@ int set_source_udp_mac(int file_des) {
if (Server_VerifyLock() == OK) {
if (check_detector_idle("configure mac") == OK) {
if (udpDetails[0].srcmac != arg) {
for (int iRxEntry = 0; iRxEntry != MAX_UDP_DESTINATION;
++iRxEntry) {
udpDetails[iRxEntry].srcmac = arg;
// multicast (LSB of first octet = 1)
if ((arg >> 40) & 0x1) {
ret = FAIL;
sprintf(mess,
"Cannot set source mac address. Must be a unicast "
"address (LSB of first octet should be 0).");
LOG(logERROR, (mess));
} else {
for (int iRxEntry = 0; iRxEntry != MAX_UDP_DESTINATION;
++iRxEntry) {
udpDetails[iRxEntry].srcmac = arg;
}
configure_mac();
}
configure_mac();
}
}
}

View File

@ -4,11 +4,10 @@
#define RELEASE "7.0.0.rc1"
#define APILIB "7.0.0.rc1 0x221208"
#define APIRECEIVER "7.0.0.rc1 0x221208"
#define APICTB "7.0.0.rc1 0x221212"
#define APIGOTTHARD2 "7.0.0.rc1 0x221212"
#define APIJUNGFRAU "7.0.0.rc1 0x221212"
#define APIMOENCH "7.0.0.rc1 0x221212"
#define APIEIGER "7.0.0.rc1 0x221212"
#define APIGOTTHARD "7.0.0.rc2 0x221220"
#define APIMYTHEN3 "7.0.0.rc3 0x230130"
#define APICTB "7.0.0.rc3 0x230130"
#define APIGOTTHARD "7.0.0.rc3 0x230130"
#define APIGOTTHARD2 "7.0.0.rc3 0x230130"
#define APIJUNGFRAU "7.0.0.rc3 0x230130"
#define APIMYTHEN3 "7.0.0.rc3 0x230130"
#define APIMOENCH "7.0.0.rc3 0x230130"
#define APIEIGER "7.0.0.rc3 0x230130"