Hello,

Some time ago I requested the allocation of a DLT_ constant for SLL 
encapsulated LAPD frames coming from vISDN interfaces.

I have a small patch which would complete support for vISDN capturing, 
however, netdev's people doesn't want to allocate an ARPHRD_ constant unless 
vISDN is integrated into mainline kernel (to avoid pollution) and I don't 
plan to propose vISDN for integration in the short.

Would you accept a patch using a temporary, self-allocated, ARPHRD_ constant? 

The patch would be like the one I'm attaching.

Bye,

-- 
  Daniele Orlandi
diff -ur libpcap-0.9.3/pcap.3 libpcap-0.9.3-vihai/pcap.3
--- libpcap-0.9.3/pcap.3	2005-07-07 04:04:35.000000000 +0200
+++ libpcap-0.9.3-vihai/pcap.3	2005-12-28 13:59:39.000000000 +0100
@@ -1075,6 +1075,10 @@
 Linux-IrDA packets, with a
 .B DLT_LINUX_SLL
 header followed by the IrLAP header.
+.TP 5
+.B DLT_LINUX_LAPD
+LAPD (q.921) frames, with a
+.B DLT_LINUX_SLL header captured via vISDN.
 .RE
 .PP
 .B pcap_list_datalinks()
diff -ur libpcap-0.9.3/pcap.c libpcap-0.9.3-vihai/pcap.c
--- libpcap-0.9.3/pcap.c	2005-07-07 04:04:35.000000000 +0200
+++ libpcap-0.9.3-vihai/pcap.c	2005-12-28 13:57:58.000000000 +0100
@@ -354,6 +354,7 @@
 	DLT_CHOICE(DLT_ARCNET_LINUX, "Linux ARCNET"),
 	DLT_CHOICE(DLT_DOCSIS, "DOCSIS"),
 	DLT_CHOICE(DLT_LINUX_IRDA, "Linux IrDA"),
+	DLT_CHOICE(DLT_LINUX_LAPD, "Linux vISDN LAPD"),
 	DLT_CHOICE(DLT_IEEE802_11_RADIO_AVS, "802.11 plus AVS radio information header"),
         DLT_CHOICE(DLT_SYMANTEC_FIREWALL, "Symantec Firewall"),
         DLT_CHOICE(DLT_JUNIPER_ATM1, "Juniper ATM1 PIC"),
diff -ur libpcap-0.9.3/pcap-linux.c libpcap-0.9.3-vihai/pcap-linux.c
--- libpcap-0.9.3/pcap-linux.c	2005-07-07 04:04:34.000000000 +0200
+++ libpcap-0.9.3-vihai/pcap-linux.c	2005-12-28 00:09:27.000000000 +0100
@@ -1308,6 +1308,14 @@
 		//handle->md.cooked = 1;
 		break;
 
+#ifndef ARPHRD_LAPD
+#define ARPHRD_LAPD	1000
+#endif
+	case ARPHRD_LAPD:
+		/* Don't expect IP packet out of this interfaces... */
+		handle->linktype = DLT_LINUX_LAPD;
+	break;
+
 	default:
 		handle->linktype = -1;
 		break;
@@ -1389,6 +1397,7 @@
 			if (handle->linktype == -1 ||
 			    handle->linktype == DLT_LINUX_SLL ||
 			    handle->linktype == DLT_LINUX_IRDA ||
+			    handle->linktype == DLT_LINUX_LAPD ||
 			    (handle->linktype == DLT_EN10MB &&
 			     (strncmp("isdn", device, 4) == 0 ||
 			      strncmp("isdY", device, 4) == 0))) {
@@ -1442,7 +1451,8 @@
 				}
 				/* IrDA capture is not a real "cooked" capture,
 				 * it's IrLAP frames, not IP packets. */
-				if (handle->linktype != DLT_LINUX_IRDA)
+				if (handle->linktype != DLT_LINUX_IRDA &&
+			    		handle->linktype != DLT_LINUX_LAPD)
 					handle->linktype = DLT_LINUX_SLL;
 			}
 
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.

Reply via email to