Commit Graph

65 Commits

Author SHA1 Message Date
hannes
7430187e17 change IPv6 prefix formatting and remove IS_REACH alike TLV code redundancy 2003-04-09 12:16:50 +00:00
hannes
ffd3876b19 loop through the stack of IP Reach admin tags rather than just printing one 2003-03-30 01:21:13 +00:00
hannes
5e10e84341 - bugfix: forgot to increment processed byte counter by 1
in the IP Reach subTLV dissector
- make the IP Reach subTLV decoder show the tag value in
  decimal notation like popular router OSes do
2003-02-24 09:36:56 +00:00
guy
bcd506b0a6 From Peter Fales: don't assume "sprintf()" returns the number of
characters printed - on older platforms with a V7/BSD-style API, it
doesn't.
2003-01-25 23:23:57 +00:00
hannes
584c65b1cd remove private version of mask2plen() 2002-12-23 14:40:46 +00:00
hannes
6eeb0a811b - fix display cosmetics
- more use of bittok2str() and Flags: [xyz]
- fixed buffer allocation for ipv6 (14-> should be 16)
- old-style ip_reach output looks now similar
  to new_style ip_reach
2002-12-21 18:41:34 +00:00
guy
fcc82f451d The "__attribute__((packed))" tag on structures causes some files not to
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.
2002-12-11 07:13:49 +00:00
guy
4081766c05 "isis_print_is_reach_subtlv()" takes a "char *" as its last argument;
don't cast a "char *" to "u_int8_t *" when passing it to that function.
2002-12-11 06:00:41 +00:00
hannes
7466655db7 remove 4 duplicates for ext_ip_reach_ processing;
create a common extended IP reach decoder
which is called from TLVs (135,235,236,237)
 we process the TLV and optional subTLVs and return
 he amount of processed bytes
2002-12-10 23:51:46 +00:00
hannes
76984f8c58 fix ported from guy harris' recent RSVP fix;
The floating-point numbers in IS-IS packets are stored in big-endian
  format; extract them as such, so that when we process them as numbers
  they're in native byte order, not network byte order.

removed bittok2str() lookalike;
2002-12-10 17:17:14 +00:00
hannes
4deb8f315d only hexdump SNP PDUs when vflag > 1 2002-12-05 23:40:10 +00:00
itojun
10afb02ac8 put __attribute__((packed)) to packet headers. s/u_short/u_int16_t/ and so
forth while i'm here
2002-11-09 17:19:16 +00:00
hannes
ca5286580a support for the Vendor Proprietary TLV #250 plus rfc/draft references 2002-10-09 14:04:07 +00:00
hannes
117f0765e0 support for Alias ID TLV #24 described in draft-ietf-isis-ext-lsp-frags 2002-10-06 08:15:21 +00:00
hannes
dbabb66dba modularize the ext_is_reach, mt_id decoder & misc cleanups 2002-10-05 19:37:28 +00:00
hannes
7183dee63b simplify initial OSI processing 2002-10-05 11:10:56 +00:00
hannes
f60a1bd8cb hide multiline output using vflag plus enhanced, ES-IS decoder 2002-10-03 16:00:32 +00:00
hannes
41aacf911e more verbose handling for unknown data 2002-09-15 00:58:43 +00:00
guy
edb0e92cdc Add a few more GCC warnings on GCC >= 2 for ".devel" builds.
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.
2002-09-05 00:00:07 +00:00
hannes
6165e4584c from Said Ouissal:
support for Hello PDU Sequence Numbers
  described in draft-shen-isis-iih-sequence-00.txt
2002-09-03 14:21:42 +00:00
hannes
92f6294b49 boundary checking for print_nsap() 2002-09-01 21:08:02 +00:00
hannes
973a00103a more consistent use of the length: indicator; 2002-08-20 00:17:23 +00:00
hannes
40e6f9e754 make the number in the bracket after the area address unambigous
by prepending a length: string;
2002-08-09 22:57:22 +00:00
risso
3d932490b8 Added support for Win32, based on WinPcap. 2002-08-01 08:52:55 +00:00
hannes
4f0215cae3 use print_nsap() rather than isonsap_string() for decoding ISHs 2002-07-25 09:00:42 +00:00
hannes
e004864648 better idendation and dedicated line for the common header; 2002-07-19 10:10:34 +00:00
hannes
c77ebe87ea use the new public print_unknown_data{} rather then the private
isis_print_unknown_data{}
2002-07-19 09:34:05 +00:00
guy
3ef80863b4 Fix indentation. 2002-06-29 04:33:31 +00:00
itojun
111ff8a61d whitespace cleanup 2002-06-11 17:08:37 +00:00
hannes
a7b3e9ec87 support for
ES Neighbor(s)     TLV #3
Partition DIS      TLV #4
Prefix Neighbors   TLV #5
Prefix Neighbor(s)
 (variable length) TLV #7

clarified use of SYSTEM_ID_LEN, ETHER_ADDR_LEN, LSP_ID_LEN

plus some cleanups, boundary checks and modularization
 (isis_print_metric_block)
2002-05-31 23:23:35 +00:00
guy
fc258e549c Make static routines, and string buffers, not used outside
"print-isoclns.c".
2002-05-29 09:48:16 +00:00
hannes
ccf20e1448 cosmetic cleanup for the print_nsap routine 2002-05-25 15:11:37 +00:00
guy
946131ffb1 From Hannes Gredler: support the IS-IS buffersize TLV #14, and clean up
some names.

Fix a misspelling.
2002-05-16 10:19:23 +00:00
guy
1bc4de7dd5 From Hannes Gredler: support for the IP-Reach-subTLV #2 and
IDRP-info-TLV #131.
2002-04-30 09:04:35 +00:00
guy
4c51c6177b Make some "u_char *"s "char *"s, to eliminate signed vs. unsigned
complaints from some compilers.
2002-04-25 04:47:42 +00:00
guy
4bc49330dd From Hannes Gredler:
there was a bug in the way i calculated the checksum over LSPs;
	additionally the TLV parser recognizes [decoder is still left]
	the IS Alias TLV #24
2002-04-12 07:56:49 +00:00
guy
1a2af7c290 From Hannes Gredler:
i have cleaned up most of the print-isoclns.c code
	and made heavy use of tok2str to display ascii
	strings - i also cleaned up the TLV parsing
	routines to use consitently while(tmp>0) loops
	when decoding a TLV;
2002-04-09 08:27:25 +00:00
guy
2358785108 From Hannes Gredler: much of the subTLVs of the IS-reach and IP-reach
decoders can be re-used in several parts of the code;

- the subTLV decoder can now be called from various places
- plus added support for checking the checksum in the LSP PDU
- plus misc cleanups [use tok2str() for displaying
  strings rather than switch/case chains]
2002-03-23 22:51:56 +00:00
guy
378fa9511c From Hannes Gredler: update to the previous patch, plus miscellaneous
cleanups and a bug fix for a nasty bug in the EXT_IS_REACH subTLV
decoder.
2002-03-20 07:00:03 +00:00
guy
f804943916 From Hannes Gredler: dump unknown TLV and subTLV data in hex. 2002-03-19 10:49:44 +00:00
itojun
5b9612e643 make sure of evaluation ordering. (gcc3 spotted this)
From: Simon Burge <simonb@wasabisystems.com>
2002-03-14 07:19:00 +00:00
guy
41b6c4a34e From Hannes Gredler: support for decoding of GMPLS related TLVs and
subTLVs for IS-IS.
2002-03-14 05:59:53 +00:00
guy
1493567efb Make the bitmasks unsigned "int"s, so that Sun's C compiler doesn't
complain.
2002-02-25 09:36:07 +00:00
guy
ef1927a7bb Fixes to IS_REACH TLV #2 dissection, from Hannes Gredler
<hannes@juniper.net>.
2002-01-10 09:33:23 +00:00
guy
02102a4397 From Hannes Gredler: properly assert the checksum TLV #12 for
artifically long, and hence stripped frames.
2001-12-18 09:00:14 +00:00
guy
dda62b4b55 From Hannes Gredler: stop TLV processing at the boundary indicated in
the pdu_len field in the IS-IS header; this stops tcpdump from printing
a lot of bogus TLVs when the interface driver does not correctly report
the frame-length.
2001-12-13 09:31:21 +00:00
guy
4289270cdb Support for the IS-IS restart signaling TLV #211, from Hannes Gredler
<hannes@juniper.net>.
2001-12-09 03:43:22 +00:00
guy
ff83f3d261 IPv6 TLV support and some bug fixes and cleanups, from Hannes Gredler
<hannes@juniper.net>.
2001-12-03 09:17:07 +00:00
guy
e3dfdbd574 Bug fix from Hannes Gredler. 2001-11-10 21:35:04 +00:00
guy
49237ba3be Bug fix from Hannes Gredler. 2001-10-29 09:06:48 +00:00