aboutsummaryrefslogtreecommitdiffstats
path: root/testing/ssldump/0060-link_layer.patch
blob: 0b4df7cd667285f6c1a3f49437eb51322d9280d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Patch by Robert Scheck <robert@fedoraproject.org> for ssldump >= 0.9b3 which adds
some further link layer offsets; inspirated from the original DLT_LINUX_SLL patch
by PeBek at http://sourceforge.net/p/ssldump/patches/6/.

--- ssldump-0.9b3/base/pcap-snoop.c		2014-05-04 02:02:58.000000000 +0200
+++ ssldump-0.9b3/base/pcap-snoop.c.link_layer	2014-05-04 02:20:21.000000000 +0200
@@ -136,6 +136,10 @@
     len=hdr->len;
     
     switch(pcap_if_type){
+      case DLT_RAW:
+#ifdef DLT_LOOP
+      case DLT_LOOP:
+#endif
       case DLT_NULL:
         data+=4;
         len-=4;
@@ -158,6 +162,73 @@
           return;
         
         break;
+      case DLT_IEEE802:
+        data+=22;
+        len-=22;
+        break;
+      case DLT_FDDI:
+        data+=21;
+        len-=21;
+        break;
+#ifdef __amigaos__
+      case DLT_MIAMI:
+        data+=16;
+        len-=16;
+        break;
+#endif
+      case DLT_SLIP:
+#ifdef DLT_SLIP_BSDOS
+      case DLT_SLIP_BSDOS:
+#endif
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__APPLE__)
+        data+=16;
+        len-=16;
+#else
+        data+=24;
+        len-=24;
+#endif
+        break;
+      case DLT_PPP:
+#ifdef DLT_PPP_BSDOS
+      case DLT_PPP_BSDOS:
+#endif
+#ifdef DLT_PPP_SERIAL
+      case DLT_PPP_SERIAL:
+#endif
+#ifdef DLT_PPP_ETHER
+      case DLT_PPP_ETHER:
+#endif
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__APPLE__)
+        data+=4;
+        len-=4;
+#else
+#if defined(sun) || defined(__sun)
+        data+=8;
+        len-=8;
+#else
+        data+=24;
+        len-=24;
+#endif
+#endif
+        break;
+#ifdef DLT_ENC
+      case DLT_ENC:
+        data+=12;
+        len-=12;
+        break;
+#endif
+#ifdef DLT_LINUX_SLL
+      case DLT_LINUX_SLL:
+        data+=16;
+        len-=16;
+        break;
+#endif
+#ifdef DLT_IPNET
+      case DLT_IPNET:
+        data+=24;
+        len-=24;
+        break;
+#endif
     }
     network_process_packet(n,&hdr->ts,data,len);
   }