Commit Graph

101 Commits

Author SHA1 Message Date
hannes
50b4920bc5 move AF specific stuff to dedicated files 2006-02-21 10:27:40 +00:00
hannes
d198f14d38 add support for BGP signaled VPLS 2006-02-02 12:36:09 +00:00
hannes
a11596df2c add cisco prop. eigrp related, extd. communities 2005-10-19 09:24:08 +00:00
guy
9e349e88a7 Before subtracting a value from a prefix length, make sure the prefix
length is >= the value.  (In theory, if that check isn't done, the
prefix length will overflow, and, as it's unsigned, that'd make it very
large, and rejected by the other sanity check - but it's cleaner to
check explicitly.)

In decode_rt_routing_info(), fix the checks for the prefix length -
according to draft-marques-ppvpn-rt-constrain-01, the default route
target has a 0-length prefix, and all others have a length between 32
and 96.
2005-10-16 18:14:55 +00:00
hannes
8bf0956a98 bugfix: we truncate the iso nsap strings by one byte, print next-hop length in the MP_REACH attribute 2005-06-03 07:28:24 +00:00
hannes
7a063a52a4 copy&paste error: decode_labeled_clnp_ was intended to be decode_clnp_ 2005-05-18 19:58:36 +00:00
guy
9bd9227c32 Add bounds checking and other sanity checking.
If "decode_prefix4()" returns -1, quit any loop using it to return the
length of an item.
2005-05-05 22:49:17 +00:00
guy
2fd4391eb9 Check for a negative "advance" value, which indicates an error.
Don't make the last statement in a loop a break statement, as that means
the body of the loop will be executed at most once.

When looping over the data in a TCP segment containing BGP packets, loop
until we reach the first of the end of the captured data or the end of
the segment, not just the end of the captured data.
2005-04-20 20:45:34 +00:00
guy
000d739130 Get rid of an unused variable (the length from the BGP header is passed
as the "length" argument).
2005-04-20 20:22:11 +00:00
guy
fa08b40c1a Move some statements before the case's "break;" statement, so that
they're executed; if they shouldn't be executed, they shouldn't be in
the code.
2005-04-20 10:29:39 +00:00
guy
2340cefe2e Protect some IPv6 code with #ifdef INET6/#endif. 2005-03-27 01:31:25 +00:00
hannes
28a778829d extra printing for IPv6 transcoded CLNP next-hops in the MP-REACH printer 2005-03-23 09:22:58 +00:00
hannes
973c5c75be -add support for CLNP and CLNP-VPN NLRIs
-treat the AFI/SAFI field as a composite 24-Bit entity
 and not as seperate 8/16-Bit entity
2005-03-22 19:30:59 +00:00
hannes
65ff785f67 add support for graceful-restart end-of-rib marker 2004-06-22 15:04:51 +00:00
hannes
9974f43f2f import latest definition for Pseudowires from draft-ietf-pwe3-iana-allocation-04
and put it to its new home l2vpn.{c|h}
rework bgp, ldp, lsp-ping to use the common l2vpn_encaps tokenlist
update FILES list to acommodate the recent file additions
2004-06-15 09:42:40 +00:00
hannes
d44d003db5 expose bgp_l2vpn_encaps_values[] to the outside world 2004-06-12 08:52:21 +00:00
hannes
3b17aa68d1 expose bgp_vpn_rd_print() to the outside world 2004-06-12 08:17:50 +00:00
guy
f5ad5cff18 From Steiner Haug: handle LDP-over-TCP, and do more complete LDP
decoding.
2004-05-27 21:20:49 +00:00
hannes
bc84c5c5ec print the capcode when dissecting capabilities 2004-05-17 12:10:05 +00:00
mcr
0d208ebd8b use new tok2strbuf() API. 2004-04-29 02:16:01 +00:00
guy
5c2f39fbdd Add bounds checking. 2004-03-24 00:01:00 +00:00
hannes
35f23d144c add recent IANA SAFI and CAP codepoints - FIXME: add decoder 2004-03-18 11:14:45 +00:00
hannes
5947e8f138 print type 2 route distinguishers in IP adress format 2004-03-16 11:39:59 +00:00
hannes
b285a49d96 add support for the cisco proprietary MDT Group Extended Community 2004-03-14 21:10:37 +00:00
hannes
c519841be2 - bugfix: rework the AS_PATH decoder per draft-ietf-idr-rfc3065bis:
CONFED_AS_SET and CONFED_AS_SEQUENCE codepoints have changed;
- rework the SEQ and SET display output in accordance with contemporary
    routing software
     ( AS )  indicates an CONFED AS SEQUENCE segment
     { AS }  indicates an AS SET segment
    ({ AS }) indicates an CONFED AS SET segment
2004-01-15 18:59:15 +00:00
hannes
bd4ee43fba forgot to break 2003-12-23 22:18:35 +00:00
hannes
28146cdebd add support for the ATTR SET attribute per draft-marques-ppvpn-ibgp
TODO boundary and recursion check
add reference (draft-marques-ppvpn-rt-constrain)
  to the Route Target Information SAFI
2003-12-23 22:07:56 +00:00
guy
bbc1cfa669 Have the configure script arrange that the Makefile define _U_
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.
2003-11-16 09:36:07 +00:00
guy
3824a6c041 From Neil Spring:
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".
2003-11-15 00:39:12 +00:00
hannes
5534ed4ad1 fix for last commit: pass the correct pointer for the route target buffer 2003-10-27 08:18:57 +00:00
hannes
859d3eb8b9 - support for the route target information SAFI #132 defined in draft-marques-ppvpn-rt-constrain-01.txt
- support for 32-bit AS number route-target (type 2) format
2003-10-27 08:04:52 +00:00
itojun
58b83f6ad4 use snprintf 2003-08-13 02:26:52 +00:00
guy
e75b0eb764 Get rid of a bogus printf argument. 2003-07-01 08:33:43 +00:00
hannes
5f3c628f70 - update the extd community decoder as per draft-ietf-idr-bgp-ext-communities-05
- additional support for 4-byte AS number format #2
  - get rid of lots of copy&paste code ans usage of bittok2str() for flag parsing
  - misc cleanups
- replace datap with tptr in the bgp_cap decoder
-
2003-06-17 13:12:59 +00:00
guy
13137dd548 Based on a patch from Michele "mydecay" Marchetto <smarchetto1@tin.it>:
check the header length to make sure it's at least the minimum length,
so we don't, for example, go into an infinite loop if the header length
is 0.

Get rid of some blank lines at the end of the file.
2003-06-03 23:23:50 +00:00
guy
f4d9457518 Get rid of the zero-length array in "struct bgp_notification" - not all
C compilers support zero-length arrays.

Add in TCHECK calls when dissecting stuff in a BGP notification.
2003-06-03 22:15:58 +00:00
hannes
aad4c8a555 misc. display corrections, spit out the notification number 2003-05-30 11:09:39 +00:00
hannes
1358e2de53 support for capability notification messages 2003-05-27 14:34:04 +00:00
hannes
6111d166dc add support for optional AFI, SAFI and MAXPREFL values that
may be optionally present in the data portion of a BGP
Notification CEASE message as described per
draft-ietf-idr-cease-subcode-02
2003-05-27 13:09:02 +00:00
hannes
f5bce589b5 support BGP cease subcodes as per draft-ietf-idr-cease-subcode-02 2003-05-27 12:43:37 +00:00
guy
7baf2c4382 Fix up a format string to match what's supplied to it. 2003-02-11 06:28:39 +00:00
hannes
7c790c6565 - added backwards compatible extd community IDs
as defined in draft-rosen-vpns-ospf-bgp-mpls-06.xt
- bugfix for reading out the correct router-type field
- better handling (more verbose) display for unknown community formats
2003-02-10 16:59:30 +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
4f16f87939 newline the truncated indicator - its's a little friendlier to scripts 2003-01-17 11:07:49 +00:00
hannes
21a071eb36 patch from George Bakos gbakos[AT]ists.dartmouth.edu:
A denial of service vulnerability exists in the print-bgp
module in the way IPv4 Withdrawal prefix lengths are validated. If IPv6 is
not enabled, the function decode_prefix4() is called to breakout the
prefix length and network prefix fields of the UPDATE message. In
bgp_update_print, a pointer (i) is incremented with the returned length
and thus traverses all withdrawn routes in the UPDATE message. However, if
the prefix length is > 32, decode_prefix4() returns -1. As the pointer "i"
then decrements, instead of incrementing, an infinite loop is created,
halting any further packet analysis and creating a very nice cpu sponge.

The patch addresses the loop problem, and also intervenes
whenever the length exceeds 32 bits (in IPv4) regardless
of message type:
2002-12-15 08:33:23 +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
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
2e141b872c labeled(rfc3107) and VPN(draft2547bis) BGP support for v6 2002-10-19 12:31:47 +00:00
hannes
e7ca243260 correct masking of flags in BGP_CAPCODE_RESTART 2002-10-11 13:09:51 +00:00
hannes
d6dc3a1240 support for BGP graceful restart draft-ietf-idr-restart-05 2002-10-11 10:33:09 +00:00