]> The Tcpdump Group git mirrors - libpcap/commitdiff
Updating Endace DAG ERF support.
authorStephen Donnelly <[email protected]>
Mon, 4 May 2009 04:32:52 +0000 (16:32 +1200)
committerStephen Donnelly <[email protected]>
Mon, 4 May 2009 04:32:52 +0000 (16:32 +1200)
- 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.

pcap-dag.c
pcap-dag.h

index 59882e64f581d325e0829c487d324f8d684dbf5f..c8d5f0f47f9042cc372f5ff1fff5ae4abe33add5 100644 (file)
@@ -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 */
index 635eee4a21791cb4da6498d26155336e7906806a..fcdef7bda856cbb35242d884332dda00889155c9 100644 (file)
@@ -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