tcpdump mailing list archives
Re: a problem with some code
From: Guy Harris <guy () alum mit edu>
Date: Thu, 5 Feb 2009 11:18:55 -0800
On Feb 5, 2009, at 9:03 AM, Tyler Littlefield wrote:
I'm in a college course, which is using a program that is not working with my screen reader. I am blind, and am using a reader that takes the text on the screen and reads it in synthasized speech. There are some programs that don't work with this however, and this is one of them.
When you say "There are some programs that don't work with this however, and this is one of them.", do you mean that tcpdump doesn't work with the screen reader?
If so, what doesn't work? Is the problem that the output has a lot of abbreviations and other "non-words" and the screen reader doesn't translate them well? Or is the problem that command-line programs such as tcpdump/WinDump don't work with the screen reader?
The problem is in getting the size of the IP header, I believe.
You are correct. Your code is doing int ipsize=sizeof(*recv);where "recv" is a pointer to a structure that defines the fixed-length portion of the IP header. As you might infer from my saying "fixed- length portion", the IP header is variable in length; it can include options.
RFC 791 describes how that works; you'll need to look at the "header length" field from the IP header, and use that as the length of the IP header (as RFC 791 indicates, that field is in units of 4-byte words, so you'll need to multiply it by 4 to get the length in bytes).
- This is the tcpdump-workers list. Visit https://cod.sandelman.ca/ to unsubscribe.
Current thread:
- a problem with some code Tyler Littlefield (Feb 05)
- Re: a problem with some code Guy Harris (Feb 05)
- Re: a problem with some code Tyler Littlefield (Feb 06)
- Re: a problem with some code Guy Harris (Feb 05)