|
|
|
@ -1100,8 +1100,9 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
|
if (DEBUG_IED_SERVER) printf("IED_SERVER: reporting.c: set owner to %s\n", clientAddressString);
|
|
|
|
|
|
|
|
|
|
if (strchr(clientAddressString, '.') != NULL) {
|
|
|
|
|
if (DEBUG_IED_SERVER) printf("IED_SERVER: reporting.c: client address is IPv4 address\n");
|
|
|
|
|
{
|
|
|
|
|
if (DEBUG_IED_SERVER)
|
|
|
|
|
printf("IED_SERVER: reporting.c: client address is IPv4 address\n");
|
|
|
|
|
|
|
|
|
|
uint8_t ipV4Addr[4];
|
|
|
|
|
|
|
|
|
|
int addrElementCount = 0;
|
|
|
|
@ -1111,9 +1112,12 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
|
while (separator != NULL && addrElementCount < 4) {
|
|
|
|
|
int intVal = atoi(separator);
|
|
|
|
|
|
|
|
|
|
ipV4Addr[addrElementCount] = intVal;
|
|
|
|
|
|
|
|
|
|
separator = strchr(separator, '.');
|
|
|
|
|
|
|
|
|
|
ipV4Addr[addrElementCount] = intVal;
|
|
|
|
|
if (separator != NULL)
|
|
|
|
|
separator++; // skip '.' character
|
|
|
|
|
|
|
|
|
|
addrElementCount ++;
|
|
|
|
|
}
|
|
|
|
@ -1122,7 +1126,7 @@ updateOwner(ReportControl* rc, MmsServerConnection connection)
|
|
|
|
|
MmsValue_setOctetString(owner, ipV4Addr, 4);
|
|
|
|
|
else
|
|
|
|
|
MmsValue_setOctetString(owner, ipV4Addr, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
uint8_t ipV6Addr[16];
|
|
|
|
@ -1227,7 +1231,7 @@ Reporting_RCBWriteAccessHandler(MmsMapping* self, ReportControl* rc, char* eleme
|
|
|
|
|
goto exit_function;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
retVal = DATA_ACCESS_ERROR_OBJECT_ATTRIBUTE_INCONSISTENT;
|
|
|
|
|
retVal = DATA_ACCESS_ERROR_TEMPORARILY_UNAVAILABLE;
|
|
|
|
|
goto exit_function;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|