Commit 3a25fa5d authored by kfox's avatar kfox

Force mtu size (mainly for Linux) so that large packets fail as expected.

parent 946588e5
......@@ -113,8 +113,6 @@ _nameToLibrary(const char *name)
return result;
}
typedef AthenaEthernetFragmenter *(*ModuleInit)(AthenaEthernetFragmenter *);
static void
_destroy(AthenaEthernetFragmenter **athenaEthernetFragmenter)
{
......@@ -144,7 +142,7 @@ athenaEthernetFragmenter_Create(const char *fragmenterName)
}
const char *initEntry = _nameToInitMethod(fragmenterName);
ModuleInit _init = dlsym(athenaEthernetFragmenter->module, initEntry);
AthenaEthernetFragmenter_Init *_init = dlsym(athenaEthernetFragmenter->module, initEntry);
parcMemory_Deallocate(&initEntry);
if (_init == NULL) {
......
......@@ -72,9 +72,6 @@ typedef void (AthenaEthernetFragmenter_Fini)(AthenaEthernetFragmenter *athenaEth
//
struct AthenaEthernetFragmenter {
void *module; // so library can be unloaded
//uint32_t sendSequenceNumber;
//uint32_t receiveSequenceNumber;
//PARCDeque *fragments;
AthenaEthernetFragmenter_Send *send;
AthenaEthernetFragmenter_Receive *receive;
AthenaEthernetFragmenter_Fini *fini;
......
......@@ -239,9 +239,10 @@ LONGBOW_TEST_CASE(Global, athenaTransportLinkModuleETH_SendReceive)
assertTrue(result != NULL, "athenaTransportLinkAdapter_Open failed (%s)", strerror(errno));
parcURI_Release(&connectionURI);
size_t mtu = 1500; // forced MTU size to detect large messages
// Open a link we can send messages on
//sprintf(linkSpecificationURI, "eth://%s:%s/name=ETH_1", device, deviceMAC);
sprintf(linkSpecificationURI, "eth://%s/name=ETH_1", device);
sprintf(linkSpecificationURI, "eth://%s/name=ETH_1/mtu=%d", device, mtu);
connectionURI = parcURI_Parse(linkSpecificationURI);
result = athenaTransportLinkAdapter_Open(athenaTransportLinkAdapter, connectionURI);
assertTrue(result != NULL, "athenaTransportLinkAdapter_Open failed (%s)", strerror(errno));
......@@ -307,7 +308,7 @@ LONGBOW_TEST_CASE(Global, athenaTransportLinkModuleETH_SendReceive)
ccnxMetaMessage = ccnxInterest_CreateSimple(name);
ccnxName_Release(&name);
size_t largePayloadSize = 8192 * 7;
size_t largePayloadSize = mtu * 2;
char largePayload[largePayloadSize];
PARCBuffer *payload = parcBuffer_Wrap((void *)largePayload, largePayloadSize, 0, largePayloadSize);
ccnxInterest_SetPayload(ccnxMetaMessage, payload);
......@@ -351,7 +352,8 @@ LONGBOW_TEST_CASE(Global, athenaTransportLinkModuleETH_SendReceiveFragments)
myAddress.ether_addr_octet[2], myAddress.ether_addr_octet[3],
myAddress.ether_addr_octet[4], myAddress.ether_addr_octet[5]);
sprintf(linkSpecificationURI, "eth://%s/Listener/name=ETHListener/fragmenter=BEFS", device);
size_t mtu = 1500; // forced MTU size for fragmentation
sprintf(linkSpecificationURI, "eth://%s/Listener/name=ETHListener/fragmenter=BEFS/mtu=%d", device, mtu);
connectionURI = parcURI_Parse(linkSpecificationURI);
result = athenaTransportLinkAdapter_Open(athenaTransportLinkAdapter, connectionURI);
......@@ -390,7 +392,6 @@ LONGBOW_TEST_CASE(Global, athenaTransportLinkModuleETH_SendReceiveFragments)
// Try to send a large (>mtu) message
size_t numberOfFragments = 4; // four is the maximum that MacOS will queue without a reader
size_t mtu = 1500;
size_t largePayloadSize = mtu * numberOfFragments;
char largePayload[largePayloadSize];
PARCBuffer *payload = parcBuffer_Wrap((void *)largePayload, largePayloadSize, 0, largePayloadSize);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment