Raw Ethernet: working in tests
This commit is contained in:
@@ -791,10 +791,13 @@ uint32_t DiffractionExperiment::GetSrcIPv4Address(uint32_t data_stream, uint32_t
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Non existing data stream");
|
||||
if (half_module >= 2 * GetModulesNum())
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Non existing module");
|
||||
if ((data_stream+1) >= 256/32)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"Cannot handle more than 7 data stream in the current model");
|
||||
if (half_module >= 32)
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds,
|
||||
"Cannot handle more than 16 modules / data stream in the current model");
|
||||
uint32_t host = ((data_stream * 32) | half_module) << 24;
|
||||
uint32_t host = (((data_stream+1) * 32) | half_module) << 24;
|
||||
return internal.ipv4_subnet() | host;
|
||||
}
|
||||
|
||||
@@ -802,7 +805,7 @@ uint32_t DiffractionExperiment::GetDestIPv4Address(uint32_t data_stream) const {
|
||||
if (data_stream >= GetDataStreamsNum())
|
||||
throw JFJochException(JFJochExceptionCategory::ArrayOutOfBounds, "Non existing data stream");
|
||||
|
||||
uint32_t host = (0xFFlu - data_stream) << 24;
|
||||
uint32_t host = (data_stream + 1) << 24;
|
||||
return internal.ipv4_subnet() | host;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user