On Sunday 8 January 2006 04:09, Guy Harris wrote:
>
> Yes - there are other cases in pcap-linux.c where it does
>
>       #ifndef ARPHRD_xxx
>       #define ARPHRD_xxx yyy
>       #endif

Thank you Guy, attached you find the patch to complete the support for vISDN. 
The ARPHRD_ constant is randomly chosen to reduce the chance of a collision.

The patch is based on the recent CVS version of libpcap.

Thank you,

Bye,

-- 
  Daniele Orlandi
diff -ur libpcap/pcap.3 libpcap-vihai/pcap.3
--- libpcap/pcap.3	2005-09-07 10:28:56.000000000 +0200
+++ libpcap-vihai/pcap.3	2006-01-09 00:39:16.000000000 +0100
@@ -1079,6 +1079,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()
Only in libpcap-vihai: pcap.3.orig
diff -ur libpcap/pcap.c libpcap-vihai/pcap.c
--- libpcap/pcap.c	2005-12-13 14:41:39.000000000 +0100
+++ libpcap-vihai/pcap.c	2006-01-09 00:39:16.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/pcap-linux.c libpcap-vihai/pcap-linux.c
--- libpcap/pcap-linux.c	2005-11-24 20:27:42.000000000 +0100
+++ libpcap-vihai/pcap-linux.c	2006-01-09 02:26:21.000000000 +0100
@@ -1340,6 +1340,16 @@
 		//handle->md.cooked = 1;
 		break;
 
+	/* ARPHRD_LAPD is unofficial and randomly allocated, if reallocation
+	 * is needed, please report it to <[EMAIL PROTECTED]> */
+#ifndef ARPHRD_LAPD
+#define ARPHRD_LAPD	8445
+#endif
+	case ARPHRD_LAPD:
+		/* Don't expect IP packet out of this interfaces... */
+		handle->linktype = DLT_LINUX_LAPD;
+	break;
+
 	default:
 		handle->linktype = -1;
 		break;
@@ -1421,6 +1431,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))) {
@@ -1474,7 +1485,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;
 			}
 
Only in libpcap-vihai: pcap-linux.c.orig
-
This is the tcpdump-workers list.
Visit https://lists.sandelman.ca/ to unsubscribe.

Reply via email to