summaryrefslogtreecommitdiff
path: root/print-esp.c
Commit message (Collapse)AuthorAgeFilesLines
* Squelch some unsigned vs. signed warnings.guy2005-04-211-7/+7
|
* The first argument to "ascii_print_with_offset()", "ascii_print()",guy2004-07-211-2/+1
| | | | | | | | | | | | "hex_print_with_offset()", and "hex_print()" is a string used as a tag; make it a "const char *", not a "const u_char *". Copy the declaration of "strsep()" from "interface.h" to "netdissect.h", and get rid of the include of "interface.h" from "print-esp.c", as it includes "netdissect.h". Update the "ND_TTEST2()" macro to do the same overflow checks that "TTEST2()" now does.
* Move the include of "interface.h" to where it was in 3.8[.x].guy2004-07-211-6/+2
| | | | | | | Get rid of the declaration of "strsep()" - we include "interface.h", which should declare it if we don't define HAVE_STRSEP, and if HAVE_STRSEP is defined on a platform that doesn't have "strsep()", that's a bug that should be fixed by arranging not to define it.
* From Rick Jones: include "interface.h" so that "strsep()" is declared ifguy2004-07-211-1/+2
| | | | | we're supplying our own "strsep()" due to it not being supplied by the OS or the compiler.
* print the packet length for ESP packetshannes2004-07-161-2/+3
|
* From Francis Dupont: ESP decryption should not be performed on theguy2004-04-101-2/+2
| | | | authentication trailer.
* print-esp has been "NDO"-ized.mcr2004-04-051-48/+52
| | | | | replace error() and warning() with ndo-ized version. moved snaplen/snapend to ndo structure.
* cleaned up warning.mcr2004-03-251-2/+2
|
* Fix a keyboardo.guy2003-11-191-2/+2
|
* Have various routines for printing non-final headers for IPv4/IPv6guy2003-11-191-6/+9
| | | | | | | return -1 if they run out of data. Have the IPv4 and IPv6 dissectors check for non-positive return values from those routines and quit if they see one.
* Have the configure script arrange that the Makefile define _U_guy2003-11-161-4/+4
| | | | | | | | | | appropriately, and that GNUmakefile and the MSVC++ project file define it apppriately, as we do with libpcap, rather than defining it in "interface.h". Undo the rcsid-shuffling and addition of extra #includes, as we no longer need to arrange that "interface.h" be included before using _U_ in an RCS ID or copyright.
* From Neil Spring:guy2003-11-151-4/+4
| | | | | | | | | | | use "_U_" in the definitions of "rcsid[]", to eliminate complaints about those variables being unused; move the definitions after the include of "interface.h", or add an include of "interface.h", so that "_U_" is defined. Include "config.h" before including "tcpdump-stdinc.h" in "missing/datalinks.c".
* unsigned/signed mixupitojun2003-10-281-2/+3
|
* #ifdef out a bunch of variables unused if HAVE_LIBCRYPTO isn't defined,guy2003-08-061-4/+14
| | | | | | | | | and make the initialization of some that are otherwise unused if HAVE_LIBCRYPTO isn't defined conditional on it being defined and #ifdef them out, too. #ifndef in some _U_'s for parameters not used if HAVE_LIBCRYPTO isn't defined.
* fix build without libcryptoitojun2003-07-171-1/+7
|
* lookup algorithm by EVP_xx in openssl. no need for algorithm tableitojun2003-07-171-248/+78
|
* KNFitojun2003-07-171-251/+219
|
* Don't bother printing the amount of memory we tried to allocate if theguy2003-05-021-6/+3
| | | | | | | attempt fails - it's not interesting to most if not all users, and you have to worry about the right format (%d is right for size_t on some platforms, %ld is right on others). Use "error()" to report the error while we're at it.
* Don't include addinfo.h in Win32 since it's not neededrisso2003-04-211-2/+1
|
* Eliminate a GCC warning about a "char" array subscript - and, by doingguy2003-03-251-2/+2
| | | | | | so, fix the code to correctly handle bytes with the 8th bit set (well, to handle them correctly if the string is made up solely of single-byte characters...).
* From an anonymous SourceForge user: use "u_int32_t", not "uint32_t", toguy2003-03-191-2/+2
| | | | | allow it to compile on Darwin (and there may be other platforms where that's necessary as well).
* From Kazushi Sugyo: various IPv6 fixes and core dump fixes.guy2003-03-131-34/+74
|
* From Gisle Vanem: make print-esp.c work with more (maybe all?) OpenSSLguy2003-03-021-4/+29
| | | | | versions, and changes to make it work on DOS/Windows with various compilers and C support libraries.
* changed format of -E argument so that multiple SAs could be describedmcr2003-02-261-88/+252
|
* From Kazushi Sugyo: make "-E alog:0x[0-9a-fA-F]" work.guy2003-02-051-4/+19
|
* The "__attribute__((packed))" tag on structures causes some files not toguy2002-12-111-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | compile with Sun C, as "interface.h" isn't being included before the structures are being declared. Furthermore, in the files that Sun C *can* compile, it doesn't cause Sun C to generate code that's safe with unaligned accesses, as "__attribute__" is defined as a do-nothing macro with compilers that don't support it. Therefore, we get rid of that tag on the structures to which it was added, and instead use "EXTRACT_16BIT()" and "EXTRACT_32BIT()" to fetch 16-bit and 32-bit big-endian quantities from packets. We also fix some other references to multi-byte quantities to get rid of code that tries to do unaligned loads on platforms that don't support them. We also throw in a hack that makes those macros use "__attribute__((packed))" on structures containing only one 16-bit or 32-bit integer to get the compiler to generate unaligned-safe code rather than doing it by hand. (GCC on SPARC produces the same code that doing it by hand does; I don't know if GCC on any other big-endian strict-alignment processor generates better code for that case. On little-endian processors, as "ntohs()" and "ntohl()" might be functions, that might actually produce worse code.) Fix some places to use "%u" rather than "%d" to print unsigned quantities.
* From Kazushi Sugyo: use the length from the IPv4 or IPv6 header to limitguy2002-11-131-1/+5
| | | | | how far into the packet we parse, so that we don't dissect trailers or, if it's part of the packet data, an FCS.
* Add a few more GCC warnings on GCC >= 2 for ".devel" builds.guy2002-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From Neil T. Spring: fixes for many of those warnings: addrtoname.c, configure.in: Linux needs netinet/ether.h for ether_ntohost print-*.c: change char *foo = "bar" to const char *foo = "bar" to appease -Wwrite-strings; should affect no run-time behavior. print-*.c: make some variables unsigned. print-bgp.c: plen ('prefix len') is unsigned, no reason to validate by comparing to zero. print-cnfp.c, print-rx.c: use intoa, provided by addrtoname, instead of inet_ntoa. print-domain.c: unsigned int l; (l=foo()) < 0 is guaranteed to be false, so check for (u_int)-1, which represents failure, explicitly. print-isakmp.c: complete initialization of attrmap objects. print-lwres.c: "if(x); print foo;" seemed much more likely to be intended to be "if(x) { print foo; }". print-smb.c: complete initialization of some structures. In addition, add some fixes for the signed vs. unsigned comparison warnings: extract.h: cast the result of the byte-extraction-and-combining, as, at least for the 16-bit version, C's integral promotions will turn "u_int16_t" into "int" if there are other "int"s nearby. print-*.c: make some more variables unsigned, or add casts to an unsigned type of signed values known not to be negative, or add casts to "int" of unsigned values known to fit in an "int", and make other changes needed to handle the aforementioned variables now being unsigned. print-isakmp.c: clean up the handling of error/status indicators in notify messages. print-ppp.c: get rid of a check that an unsigned quantity is >= 0. print-radius.c: clean up some of the bounds checking. print-smb.c: extract the word count into a "u_int" to avoid the aforementioned problems with C's integral promotions. print-snmp.c: change a check that an unsigned variable is >= 0 to a check that it's != 0. Also, fix some formats to use "%u" rather than "%d" for unsigned quantities.
* Added support for Win32, based on WinPcap.risso2002-08-011-7/+4
|
* Initial support for OpenSSL version 0.9.7 and higher.fenner2002-07-281-2/+37
| | | | configure doesn't know how to handle this yet.
* From Kazushi Sugyo <sugyo@pb.jp.nec.com>: patch for newesp and fix forguy2002-07-271-16/+19
| | | | "none" algorithm decode.
* whitespace cleanupitojun2002-06-111-2/+2
|
* From Maciej W. Rozycki <macro@ds2.pg.gda.pl>:guy2002-04-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Here is a patch that addresses a few SSL-related issues noticed: 1. The "/usr" directory is not the best choice to start looking for SSL libraries when cross-compiling. The patch adds "/usr/${host_alias}" at the front. Actually the test is quite bogus anyway -- there might be no libcrypto.a library at all (but e.g. libcrypto.so), so a better approach would be trying to link against -lcrypto and seeing if that works. First with no additional options (it might be in the default compiler/linker's search patch, like on sane systems), then with the -L<dir> option. 2. The "cast.h" and "rc5.h" headers should include the "openssl/" path as that is what is used throughout the code. Right now they are simply not found by configure. 3. The buggy CAST128 test should use a cache variable to permit overriding by an educated user. I think I may actually rewrite the test as described in #1 above one day, but my time is quite limited and tcpdump is not my priority task, so it might not happen soon. I won't mind if someone does it earlier.
* void void * arithitojun2002-02-181-3/+3
|
* Get rid of a warning if libcrypto isn't present.guy2002-01-251-1/+3
|
* need stdlib.h for malloc(3). strict prototypeitojun2002-01-231-2/+3
|
* print-esp understands various algorithms and RFC2406 encoding.tcpdump_3_7rel1tcpdump-3.7.1mcr2002-01-211-58/+157
|
* Don't try decrypting a fragmented ESP packet; the IP proto number andfenner2001-08-201-2/+8
| | | | | | | | padding info are in the last fragment but the header is in the first fragment. Pass padding length back to IP to allow trimming the padding. Update in_cksum() prototype to allow using it for checksums including the pseudo-header.
* correct openssl include pathname management. <openssl/foo.h> should beitojun2001-04-131-5/+5
| | | | used (see openssl docs).
* print SPI in hex.itojun2000-12-121-2/+2
|
* put stripped-down version of ip6.h and icmp6.h into tcpdump tree.itojun2000-10-071-5/+4
| | | | | | | | ip6.h is almost normal RFC2292 header. icmp6.h has couple of extensions (not covered by RFC2292), like MLD, ICMPv6 nodeinfo, and router renumber. XXX how to synchronize with future kame changes?
* move ah/esp struct declratiaon into separate header (ah.h and esp.h).itojun2000-10-061-24/+2
| | | | | | they are from KAME. use ah.h and esp.h where necessary.
* Get rid of some includes of <net/route.h>, and empty declarations ofguy2000-10-061-3/+1
| | | | | | "struct mbuf" and "struct rtentry" - they shouldn't be necessary (and weren't on the platforms on which I tested, both with GCC and the native compiler if it isn't GCC).
* always use u_intXX_t for protocol format declaration. char/short/int may notitojun2000-10-031-2/+2
| | | | | | come with exact size. while at it, correct signedness of ip/udp header field. nuke most of the use of bitfield. TODO: bitfield in namser.h
* typo in comment. from jinmei@kame.netitojun2000-10-031-2/+2
|
* Get rid of includes of <netinet/in_systm.h>, and replace "n_short",guy2000-09-291-2/+1
| | | | "n_long", and "n_time", defined in that file, with other types.
* Get rid of unneeded includes of <net/if.h>.guy2000-09-281-2/+1
|
* Add an "ip.h" header, to declare the IP stuff needed by dissectors, andguy2000-09-231-4/+3
| | | | | | | | | | | have dissectors include them rather than <netinet/ip.h> or <netinet/ip_var.h>, if they actually need that stuff. Put the declarations of the ICMP stuff directly into "print-icmp.c". Remove all unnecessary includes of <netinet/ip*.h> files. Copy the byte-order stuff from "nameser.h" into "tcp.h".
* Add "tcp.h" and "udp.h" headers, to declare the TCP and UDP stuff neededguy2000-09-231-4/+1
| | | | | | | | | by dissectors, and have dissectors include them rather than <netinet/udp.h>, <netinet/udp_var.h>, or <netinet/tcp.h>, if they actually need that stuff. Remove all unnecessary includes of <netinet/udp*.h> or <netinet/tcp*.h> files.
* Add definitions of Ethernet types fromguy2000-09-231-2/+1
| | | | | | | | | | | | | | | | "linux-includes/netinet/if_ether.h" to "ethertype.h". Move other stuff used by dissectors from <netinet/if_ether.h> to "ether.h", along the lines of "fddi.h" and "token.h". Move ARP declarations from BSD include files to "print-arp.c". Remove from dissectors includes of <netinet/if_ether.h>, and add includes of "ethertype.h" and/or "ether.h" as necessary. Get rid of configuration options that test declarations now made in "ether.h" or "print-arp.c", as those declarations are now under our control, not the OS's control.