]> The Tcpdump Group git mirrors - libpcap/commitdiff
Support the "inbound" and "outbound" qualifiers on Linux cooked
authorguy <guy>
Tue, 6 Aug 2002 07:35:46 +0000 (07:35 +0000)
committerguy <guy>
Tue, 6 Aug 2002 07:35:46 +0000 (07:35 +0000)
captures.

gencode.c

index 39aa416dfd55a5ab25450cac2a36bdb1d7fb1b2d..83734a7b66635aa385f31d1cc8e81d542feabfde 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -21,7 +21,7 @@
  */
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.174 2002-08-06 06:13:20 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/gencode.c,v 1.175 2002-08-06 07:35:46 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -4074,6 +4074,27 @@ gen_inbound(dir)
                          dir);
                break;
 
+       case DLT_LINUX_SLL:
+               if (dir) {
+                       /*
+                        * Match packets sent by this machine.
+                        */
+                       b0 = gen_cmp(0, BPF_H, LINUX_SLL_OUTGOING);
+               } else {
+                       /*
+                        * Match packets sent to this machine.
+                        * (No broadcast or multicast packets, or
+                        * packets sent to some other machine and
+                        * received promiscuously.)
+                        *
+                        * XXX - packets sent to other machines probably
+                        * shouldn't be matched, but what about broadcast
+                        * or multicast packets we received?
+                        */
+                       b0 = gen_cmp(0, BPF_H, LINUX_SLL_HOST);
+               }
+               break;
+
        default:
                bpf_error("inbound/outbound not supported on linktype %d\n",
                    linktype);