Add data payload to this frame from an ARP packet.
315 bool alternate =
true;
316 bool endOfPkt =
false;
324 if (this->getLen() != 14) {
325 printError(this->myName,
"Frame is expected to be of length 14 bytes (was found to be %d bytes).\n", this->getLen());
333 if (arpChunk.getLE_TKeep() & 0x01) {
334 this->frmQ[ethChunkCnt].setLE_TData(arpChunk.getLE_TData().range( 7, 0), 55, 48);
335 this->frmQ[ethChunkCnt].setLE_TKeep(this->frmQ[ethChunkCnt].getLE_TKeep() | (0x40));
336 this->setLen(this->getLen() + 1);
338 if (arpChunk.getLE_TKeep() & 0x02) {
339 this->frmQ[ethChunkCnt].setLE_TData(arpChunk.getLE_TData().range(15, 8), 63, 56);
340 this->frmQ[ethChunkCnt].setLE_TKeep(this->frmQ[ethChunkCnt].getLE_TKeep() | (0x80));
341 this->setLen(this->getLen() + 1);
343 if ((arpChunk.getLE_TLast()) && (arpChunk.getLE_TKeep() <= 0x03)) {
344 this->frmQ[ethChunkCnt].setLE_TLast(
TLAST);
348 this->frmQ[ethChunkCnt].setLE_TLast(0);
350 alternate = !alternate;
355 if (arpChunk.getLE_TKeep() & 0x04) {
356 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(23, 16), 7, 0);
357 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x01));
359 if (arpChunk.getLE_TKeep() & 0x08) {
360 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(31, 24), 15, 8);
361 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x02));
363 if (arpChunk.getLE_TKeep() & 0x10) {
364 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(39, 32), 23,16);
365 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x04));
367 if (arpChunk.getLE_TKeep() & 0x20) {
368 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(47, 40), 31,24);
369 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x08));
371 if (arpChunk.getLE_TKeep() & 0x40) {
372 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(55, 48), 39,32);
373 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x10));
375 if (arpChunk.getLE_TKeep() & 0x80) {
376 newEthChunk.setLE_TData(arpChunk.getLE_TData().range(63, 56), 47,40);
377 newEthChunk.setLE_TKeep(newEthChunk.getLE_TKeep() | (0x20));
381 if (arpChunk.getLE_TLast()) {
382 newEthChunk.setLE_TLast(
TLAST);
387 newEthChunk.setLE_TLast(0);
393 alternate = !alternate;
#define printError(callerName, format,...)
A macro to print an error message.