dect
/
libpcap
Archived
1
0
Fork 0

Updating Endace DAG ERF support.

- Ensure all 'MC' ERF types are handled correctly by DLT_ERF.

- Allow capture of ERF 'TYPE_IPV6' records as DLT_RAW.

- Add new ERF types

- Explicitly list known ERF types with no matching native DLT.
master
Stephen Donnelly 14 years ago
parent 45d78ae906
commit 0ca4ea9a38
  1. 19
      pcap-dag.c
  2. 8
      pcap-dag.h

@ -368,6 +368,10 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
case TYPE_MC_AAL5:
case TYPE_MC_ATM:
case TYPE_MC_HDLC:
case TYPE_MC_RAW_CHANNEL:
case TYPE_MC_RAW:
case TYPE_MC_AAL2:
case TYPE_COLOR_MC_HDLC_POS:
packet_len += 4; /* MC header */
break;
@ -487,6 +491,7 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
break;
case TYPE_IPV4:
case TYPE_IPV6:
packet_len = ntohs(header->wlen);
caplen = rlen - dag_record_size;
if (caplen > packet_len) {
@ -494,6 +499,14 @@ dag_read(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
}
break;
/* These types have no matching 'native' DLT, but can be used with DLT_ERF above */
case TYPE_MC_RAW:
case TYPE_MC_RAW_CHANNEL:
case TYPE_IP_COUNTER:
case TYPE_TCP_FLOW_COUNTER:
case TYPE_INFINIBAND:
case TYPE_RAW_LINK:
case TYPE_INFINIBAND_LINK:
default:
/* Unhandled ERF type.
* Ignore rather than generating error
@ -1089,6 +1102,7 @@ dag_get_datalink(pcap_t *p)
break;
case TYPE_IPV4:
case TYPE_IPV6:
if(!p->linktype)
p->linktype = DLT_RAW;
break;
@ -1099,10 +1113,11 @@ dag_get_datalink(pcap_t *p)
case TYPE_IP_COUNTER:
case TYPE_TCP_FLOW_COUNTER:
case TYPE_INFINIBAND:
case TYPE_IPV6:
case TYPE_RAW_LINK:
case TYPE_INFINIBAND_LINK:
default:
/* Libpcap cannot deal with these types yet */
/* Add no DLTs, but still covered by DLT_ERF */
/* Add no 'native' DLTs, but still covered by DLT_ERF */
break;
} /* switch */

@ -93,6 +93,14 @@ int dag_platform_finddevs(pcap_if_t **devlistp, char *errbuf);
#define TYPE_IPV6 23
#endif
#ifndef TYPE_RAW_LINK
#define TYPE_RAW_LINK 24
#endif
#ifndef TYPE_INFINIBAND_LINK
#define TYPE_INFINIBAND_LINK 25
#endif
#ifndef TYPE_PAD