On Thu, 10 Sep 1998, you wrote:
>This is intended for Sergio in Italy, but if there's anyone else on this list
>that uses the Olicom TR card and Linux, then this is meant for you.
>
>I have two patches at http://verdict.uthscsa.edu/gram/ethereal/
>
>tcpdump-3.4a6-oltr.patch.gz
>---------------------------
>Please apply this patch to a non-patched tcpdump-3.4a6. This patch includes
>Paul Norton's linux tr patch, as well as some changes I made to compensate
>for oltr. I have a perfectly-working tcpdump at work with Linux 2.0.35 and
>oltr (OC-3137). I *think* this is patch is the only modification I made to
>tcpdump. :-)
>
The problem for me don't is formatting the token ring frame, but selecting only
the interesting frames. This is the job of the filter used by the pcap
library. But if I use a filter as "tcp port 23 and host 10.10.224.133" the
internal compiler of libpcap generate a progam with wrongs offsets, because the
token ring use a variable RIF. With the IBM tr driver, the RIF is 'expanded'
to a fixed length, and the patch is trivial: change the offset of the next
field. With the olicom driver the code generated must test if this is a source
routed frame and add to the offset this length.
The code is roughly this:
ldb [8]
and #0x80 is this a source routed?
jeq #0 L1;L2
L1: ldx #0 no
jmp L3
L2: ldb [14] yes; load the RIF length
and #0x1f
tax
L3: ldb [x+offset]
The problem is who I don't have any idea how to insert this in the gencode.c
Specifically I have problems to understand how the compiler link the jumps, and
in the source there are few comments. I understand who the best comment is the
source code, but sometimes a little comment is a very big help for someone with
an intelligence below the mean :-).