dect
/
libpcap
Archived
13
0
Fork 0
Commit Graph

156 Commits

Author SHA1 Message Date
guy a0a4852137 From Gilbert Hoyek <gil_hoyek@hotmail.com>: support for capturing SS7
traffic on Intel Septel cards, and for filtering on SS7 MTP3 fields.

Clean up indentation.
2005-06-20 21:27:07 +00:00
hannes c8df74b581 bugreport from Paolo Lucente <paolo.lucente@ic.cnr.it>:
the mpls stack processing is broken:
for example "mpls 10000 && mpls 20000" does produce

reading from file ppp.pcap, link-type PPP (PPP)
(000) ldh      [2]
(001) jeq      #0x00000281      jt 2    jf 11
(002) ld       [4]
(003) and      #0xfffff000
(004) jeq      #0x02710000      jt 5    jf 11
(005) ldh      [6]
(006) jeq      #0x00000281      jt 7    jf 11
(007) ld       [8]
(008) and      #0xfffff000
(009) jeq      #0x04e20000      jt 10   jf 11
(010) ret      #1514
(011) ret      #0

the extra match for 0x281 at instruction #6 is broken and
a copy&paste artifact from the vlan code generator, which
in contrast does require the VLAN tag 0x8100 at every instance
inside a VLAN stack;

correct code should be:

(000) ldh      [2]
(001) jeq      #0x281           jt 2    jf 9
(002) ld       [4]
(003) and      #0xfffff000
(004) jeq      #0x2710000       jt 5    jf 9
(005) ld       [8]
(006) and      #0xfffff000
(007) jeq      #0x4e20000       jt 8    jf 9
(008) ret      #1514
(009) ret      #0
2005-06-06 14:10:58 +00:00
guy 3a1174ec74 Put in a note about ISO-over-LLC, PPPoA (which is "PPP-over-LLC using
the ISO NLPID for PPP"), and PPPoE.
2005-05-28 00:29:49 +00:00
hannes 18bb7676da add basic support for DLT_JUNIPER_{GGSN,ES,MONITOR,SERVICES} 2005-05-19 09:33:20 +00:00
hannes ddf0f5f8d9 add basic support for DLT_JUNIPER_PPPOE_ATM 2005-05-12 07:04:22 +00:00
hannes 94b22ceceb add minimalistic code support for DLT_JUNIPER_PPPOE 2005-05-03 20:31:35 +00:00
guy a27ec87482 Fix a bunch of places to support all the 802.11+radio header DLT_ values
where DLT_IEEE802_11 is supported.
2005-05-02 21:22:34 +00:00
guy 875df1a937 Make "link[N:M]" refer to the 802.11 header for all 802.11 DLT_ values,
including those with fixed-length radio headers (it already refers to
the 802.11 header for radiotap).

Add a new "radio" keyword, to allow access to the radio header.  In
theory, something to allow testing for specific signal strengths, etc.
might be useful, but radiotap makes that difficult as the code can't
loop through the header looking for the signal strength field, the loop
has to be unrolled, and some of the other headers might not have
standardized the meaning of some of the fields, so we require the user
to construct such a filter themselves, for now.
2005-05-02 21:13:08 +00:00
guy 574c8c863c Add support for most filter operations for captures with the radiotap
header.

Handle MAC broadcasts with the AVS and Prism header as well.
2005-05-01 19:32:38 +00:00
guy bd90260840 Use "gen_load_ipxhdrlen()" in more places. 2005-05-01 09:17:45 +00:00
guy 94f7e7a5ed Add a routine to load into the X register the length of the IPv4 header. 2005-05-01 09:05:01 +00:00
guy 6804103187 Make the value argument to "gen_ncmp()" a bpf_int32, the same as the
value arguments are to other routines.  Do the same with the value
argument to "gen_atmfield_code()".

"gen_load_a()" can return more than one statement; append to the list of
statements it returns with "sappend()", rather than manually appending
to the first statement.

Fix the argument list to one "gen_ncmp()" call, and get rid of the casts
in the other calls, as the arguments already have the right types.

Fix the casts in calls to "gen_atmfield_code()".
2005-05-01 08:37:04 +00:00
guy eeadab8760 Replace all the "gen_load_*rel()" routines with "gen_load_a()", which
takes an argument indicating what the offset is relative to.

Make the various comparison generators take an argument of that sort as
well.

Tweak the arguments to "gen_ncmp()" to match those of the other
comparison routines, and make all the other comparison routines just
call "gen_ncmp()".
2005-05-01 04:13:52 +00:00
guy 4a81b9fad7 Add a routine to generate code to load a value relative to the beginning
of the transport-layer header, where the network layer is an IPv6
header, and use that.
2005-05-01 00:55:42 +00:00
guy 9b461d662c Add routines to generate code to load values relative to the beginning
of the link-layer, network-layer, and transport-layer (assuming the
network layer is IPv4) headers.  This makes it a bit clearer what stuff
would be changed for variable-length link-layer headers or
variable-length pseudo-headers before the link-layer header.
2005-05-01 00:38:01 +00:00
guy 9f021f0abe "gen_portatom()" and "gen_portatom6()" are declared as static; define
them as static as well.
2005-04-25 18:58:05 +00:00
guy 022b629ab1 From Albert Chin: just define __attribute__ as an empty macro if we
don't have __attribute__ support in the compiler.

While we're at it, get rid of the declaration of bpf_error() in
gencode.c, as it's already declared in gencode.h.
2005-04-23 22:26:51 +00:00
guy 50ba231733 Get rid of an unused variable. 2005-04-20 18:23:09 +00:00
guy 97a8e5112d From Patrick Marie <mycroft@virgaria.org>: add support for port ranges
in tests - "portrange X-Y" matches all ports in the range [X,Y].

Support added for port ranges with IPv6.

Fix some comments.
2005-04-19 04:25:00 +00:00
guy 83f2e11be6 Declare "bpf_error()" as "__attribute__((noreturn))" to squelch some
compiler warnings with GCC 4.0.
2005-04-18 22:36:45 +00:00
guy 88917fcb87 Put in a comment explaining what "gen_proto()" does.
What it does includes checking whether the packet is of the type
specified by the <proto> argument, so there's no need to add such a
check when checking whether the ISO protocol type field has a particular
value; remove the extra check against the ISO protocol.

Fix a typo in a comment.
2005-04-15 04:39:09 +00:00
hannes b464d55402 as per guy's suggestion:
backout some of the ethernet specific isis plumbings
    (already done in 1.226)
  and rather make Q_ISIS to cmp right;
2005-04-10 17:48:38 +00:00
guy 1ed95a858a Rename "gen_llc()" to "gen_llc_linktype()", to match
"gen_ether_linktype()" and "gen_linux_sll_linktype()", as well as
"gen_linktype()".

Add comments for those routines to indicate how they handle the protocol
type argument.

In "gen_linux_sll_linktype()", merge together the handling of
LLCSAP_ISONS, LLCSAP_IP, and LLCSAP_NETBEUI, as was done in
"gen_ether_linktype()" and "gen_llc_linktype()".
2005-04-10 03:40:24 +00:00
guy 8dd4d1132c Fix off_nl_nosnap for Apple IP-over-IEEE 1394.
Merge the code to handle the LLCSAP_ISONS, LLCSAP_IP, and
LLCSAP_NETBEUI.

"gen_ether_linktype()" already handles SAPs as protocol IDs; just use it
for Ethernet, rather than using "gen_llc()" (which isn't prepared to
handle Ethernet, with off_linktype pointing to the type/length field
rather than the DSAP).

That also means that "gen_linktype(LLCSAP_ISONS)" can be used to test
for OSI packets on Ethernet.

Expand some comments.

Fix a typo ("off_nl = +4" should've been "off_nl += 4").
2005-04-09 23:38:36 +00:00
guy 9d7ed6809f As per Daniele Orlandi's request, use DLT_LINUX_LAPD rather than
DLT_LAPD (it includes more than just the LAPD header).
2005-04-09 21:15:13 +00:00
hannes 2bb9a4c5bd fix offset calculation for iso/isis/clnp/esis over DLT_EN10MB 2005-04-08 15:33:58 +00:00
hannes cba69f4084 -add support for llc based protocols (iso, etc..) for ethernet
by checking the proto against the ethermtu and bumping
 the link-layer offset by two.

-add support for vlan and mpls hierarchies by not absolute
  setting offsets but rather incrementing them;

  example(s):

  mpls 100000 && mpls 1024
    =filters for outerlabel 100000 and inner label 1024
  vlan 100 && vlan 200
    =filters for vlan 200 encapsulated withing vlan 100
  vlan 300 && mpls 17
    =filters for mpls label 17 encapsulated in vlan 300
2005-04-08 14:40:38 +00:00
guy be07cb1988 At the request of Daniele Orlandi, add DLT_LAPD and LINKTYPE_LAPD for
raw LAPD.
2005-04-07 20:42:45 +00:00
guy b3f8e4f640 Squelch some compiler warnings. 2005-03-27 22:10:23 +00:00
guy afe114b070 For "ether proto", allow LLC value names as well as Ethernet type value
names, so that, as the tcpdump man page claims to be the case, "ether
proto \{iso,stp,ipx,netbeui}" are equivalent to "{iso,stp,ipx,netbeui}".
2005-03-17 07:02:31 +00:00
guy c1401d4725 The DLT_LINUX_PPP_WITHDIRECTION is also used for pppd on some BSDs, so
rename it again to DLT_PPP_PPPD, and rename other #defines to match.

Add backwards-compatibility #defines of DLT_PPP_WITH_DIRECTION and
DLT_LINUX_PPP_WITHDIRECTION for software that used them.
2005-02-08 19:52:18 +00:00
guy d9e0597103 Rename DLT_PPP_WITHDIRECTION to DLT_LINUX_PPP_WITHDIRECTION, as it's a
Linux-specific mechanism, and rename other #defines accordingly.  Give
more details about it in comments.
2005-01-31 01:47:27 +00:00
hannes b82f83587c add support for DLT_JUNIPER_{MLFR,MLPPP) 2005-01-25 22:38:23 +00:00
hannes 6e18a333d2 add gencode support for Juniper ML/LS PIC DLT_ 2005-01-12 09:02:55 +00:00
guy f8a76d1d76 From Gisle Vanem: MS-DOS support. 2004-12-18 08:52:08 +00:00
guy 8ab85b3b53 From Gisle Vanem: there's no need to include <sys/time.h> in
"gencode.c", as "pcap.h" includes it.
2004-12-17 20:16:44 +00:00
guy 3573dfdacc Put the FDDI padding (if any) into the pcap_t structure on platforms
that require it, and make pcap_fddipad private to the code generator, as
that's the only place that needs it (ideally, all *its* state should be
local as well).  This makes opening an FDDI device, on platforms where
the padding is supplied as part of the packet, and opening other types
of devices or opening savefiles in the same program work better, as you
don't have to be sure you compile the filter for a given pcap_t before
opening the next pcap_t.
2004-12-15 00:25:08 +00:00
guy 1ab36e08d7 Fix a comment.
Clean up white space.
2004-11-06 22:57:28 +00:00
guy a1e08cec1e Move the code to generate code to check for a particular linktype in the
Linux cooked header into a routine of its own.
2004-11-06 22:45:17 +00:00
hannes 3bcf07168c add support for DLT_JUNIPER_ATM1 (137) and DLT_JUNIPER_ATM2 (135) 2004-10-19 15:55:28 +00:00
guy 2ae5a9fc8c From Nicolas Dade <ndade@nsd.dyndns.org>: the VLAN tag is in the lower
12 bits of the VLAN field - check only those bits, not the priority or
CFI flag.
2004-08-27 07:37:10 +00:00
hannes 4017783b36 add support for another PPP variant as per request from Karsten Keil <kkeil@suse.de>
the first byte (0xff) of the PPP header (0xff03) is tweaked to accomodate
the direction 0x00 = IN, 0x01 = OUT

the DLT_ supports the libpcap tokens "inbound" and "outbound"
2004-08-18 14:25:01 +00:00
guy fa90431b10 Catch the case in "gen_mpls()" where "orig_nl" isn't -1, meaning
somebody's already used "vlan" or "mpls".
2004-07-15 00:08:06 +00:00
hannes 4ce3baf349 bugfix: MPLS compare all (masked)32bits instead of just 16 2004-06-16 08:29:33 +00:00
hannes 405ab1a931 add baseline support for MPLS protocol and per-label filtering 2004-06-16 08:20:28 +00:00
guy 1cd8c13e62 From Brian Ginsbach: squelch some compiler warnings. 2004-04-07 18:43:29 +00:00
guy 0a56a3721a Get rid of long-vs-int problem in a printf format (sometimes sizeof is
an int, sometime's it's a long).
2004-03-29 21:04:31 +00:00
fenner 8177eec7d9 Handle the new OpenBSD pf format (DLT 117), which is now being used
by other systems as they adopt pf.
Don't bother trying to be backwards compatible with DLT 17.
2004-03-28 20:27:12 +00:00
guy 1bd06dd0d5 Add support for Apple's IP-over-IEEE 1394 encapsulation.
Fix a comment.
2004-03-17 19:03:28 +00:00
guy 8842b61d2f Add support for DLT_ value 99, as used by the Axent Raptor
firewall/Symantec Enterprise Firewall.  Thanks, Axent/Symantec, for not
asking us for a DLT_ value and not telling us about the link-layer type.
2004-03-11 09:13:11 +00:00