values for an HDLC link (MTP2 is what's usually run on those links, with
MTP3 atop it); remove them. Also, boost dlt_count to match the number
of DLT_ values.
if we have a MPLS label stack deeper > 1 then generate a match
for a cleared bottom-of-stack-bit of the previous MPLS shim header
rather than just incrementing the offset;
if there is a compined expression of MPLS and IP like e.g.
"mpls && ip" | "mpls && ip host" | "mpls && ip src net"
then poison the linkoffset to make sure that other code generators
do not try to match link-layer protos like Q_ARP, Q_RARP etc.
introduce a new function gen_null() that matches against the first nibble
of the IP header and matches if the bottom-of-stack bit is set;
TODO: IPv6 stuff i.e. gen_host6() etc.
the size of the buffer we handed to it is insufficient to determine
whether we have the entire list of interfaces or not - if the amount of
space left in the buffer after adding an entry is non-zero but less
than the amount of space required by the next entry, the ioctl will stop
before adding the next entry, and not necessarily return an error.
The only way to ensure that we got all the data is to pass a buffer
large enough that the amount of space in the buffer *not* filled in
is greater than the largest possible entry.
We assume that's "sizeof(ifreq.ifr_name)" plus 255, under the assumption
that no address is more than 255 bytes (on systems where the "sa_len"
field in a "struct sockaddr" is 1 byte, e.g. newer BSDs, that's the
case, and addresses are unlikely to be bigger than that in any case).
"septel_set_datalink()".
It's also always the same, so get rid of "septel_get_datalink()".
Add an inject routine that just returns an error.
Get rid of a malloc() whose result was neither used nor freed.
Clean up indentation.
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
pcap_dumper_t. (Just doing an "ftell()" on the result of
"pcap_dump_file()" won't necessarily work on Windows, as Microsoft, in
their infinite wisdom, have multiple different versions of the C library
runtime, and if a DLL is built using one version, and another DLL or an
executable is built with another version, file descriptors and FILE *'s
opened in one of them cannot be used in the other.)
packets, only sent packets, or all packets be accepted, with an
implementation for Linux.
Add an implementation for BPF platforms that support BIOCSSEESENT.
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.
encapsulation with an "MTP2 plus pseudo-header" encapsulation. Get rid
of "rawss7.h", as the LINKTYPE_RAWSS7 it's mainly dedicated to explain
was never implemented. Update savefile.c for the changes.
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()".
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()".
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.
whether it succeeds or fails, so you can't erase a "no" result and try
again with a different header. Use AC_CHECK_DECL, which doesn't define
HAVE_DECL_xxx, and then explicitly define it based on whether we found a
declaration or not.
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.