Commit 4f21671e authored by 's avatar

Default link_type for PacketDescriptorType2_t (Ethnernet).

Detection of link_type for PacketExtDescriptorType05_t.


git-svn-id: file:///home/svn/mapi/trunk@1485 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 01608a97
......@@ -210,6 +210,19 @@ process_pkts(BufferInformationSectionType1_t* bufferInformation, napatech_instan
mhdr.caplen = descriptor->StoredLength;
mhdr.wlen = descriptor->WireLength;
// Layer 2 type. (0:EtherII, 1:LLC, 2:SNAP, 3:Novell RAW)
switch(pExtDescr->l2Type) {
case 0:
i->hwinfo.link_type = DLT_EN10MB;
break;
case 1:
case 2:
case 3:
default:
DEBUG_CMD(Debug_Message("WARNING: Unexpected Layer 2 type (%d) in Extended Packet Descriptor\n", pExtDescr->l2Type));
break;
}
// ? TODO - modify third argument to pass test_packet_read
mapid_process_pkt(&i->mapidlib, (unsigned char*)frame, frame + (descriptor->StoredLength - descriptor->WireLength), &mhdr);
......@@ -373,6 +386,7 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
inst->hwinfo.offline=1;
inst->hwinfo.cap_length=1500;
inst->hwinfo.link_type=DLT_EN10MB;
inst->hwinfo.devtype=MAPI_DEVICE_NAPATECH;
inst->hwinfo.devid=inst->id;
inst->hwinfo.pkts=0;
......@@ -415,6 +429,7 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
DEBUG_CMD(Debug_Message("WARNING: Could not get info hardware-info, using default = 1500"));
i->hwinfo.cap_length=1500;
}
i->hwinfo.link_type=DLT_EN10MB; // TODO
DEBUG_CMD(Debug_Message("mapinapatechdrv: mapidrv_create_flow; NTCI_CardIdentification() = %d", NTCI_CardIdentification(i->napatechhandle)));
......
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