diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 1999-07-28 20:41:38 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 1999-07-28 20:41:38 +0000 |
commit | 207a20307369cdeb5c18bd0f84798b92b748f229 (patch) | |
tree | 38a5a6c87b0e56ceaef70163824415c852397108 /usr.sbin/tcpdump/print-tcp.c | |
parent | a3e88823e044692f45ac5d63023e60d2e605452b (diff) |
- Merge some changes from tcpdump 3.4
-a flag; attempt to convert network and broadcast addresses to names
Improved signal handling
Miscellaneous fixes and typos
OSPF MD5 authentication support
- -X flag; emacs-hexl print (including ascii)
- Add ECN bits to TCP and IP headers
- IKE & IPsec (ESP & AH) support
OK deraadt@
Diffstat (limited to 'usr.sbin/tcpdump/print-tcp.c')
-rw-r--r-- | usr.sbin/tcpdump/print-tcp.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/usr.sbin/tcpdump/print-tcp.c b/usr.sbin/tcpdump/print-tcp.c index 55aade745f4..37a9dbbd959 100644 --- a/usr.sbin/tcpdump/print-tcp.c +++ b/usr.sbin/tcpdump/print-tcp.c @@ -21,7 +21,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-tcp.c,v 1.6 1998/09/22 22:03:01 provos Exp $ (LBL)"; + "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/print-tcp.c,v 1.7 1999/07/28 20:41:36 jakob Exp $ (LBL)"; #endif #include <sys/param.h> @@ -75,6 +75,15 @@ static const char rcsid[] = #define TCPOPT_CCECHO 13 /* T/TCP CC options (rfc1644) */ #endif +/* Definitions required for ECN + for use if the OS running tcpdump does not have ECN */ +#ifndef TH_ECNECHO +#define TH_ECNECHO 0x40 /* ECN Echo in tcp header */ +#endif +#ifndef TH_CWR +#define TH_CWR 0x80 /* ECN Cwnd Reduced in tcp header*/ +#endif + struct tha { struct in_addr src; struct in_addr dst; @@ -95,6 +104,7 @@ struct tcp_seq_hash { static struct tcp_seq_hash tcp_seq_hash[TSEQ_HASHSIZE]; +#define NETBIOS_SSN_PORT 139 void tcp_print(register const u_char *bp, register u_int length, @@ -134,7 +144,8 @@ tcp_print(register const u_char *bp, register u_int length, (void)printf("tcp %d", length - tp->th_off * 4); return; } - if ((flags = tp->th_flags) & (TH_SYN|TH_FIN|TH_RST|TH_PUSH)) { + if ((flags = tp->th_flags) & (TH_SYN|TH_FIN|TH_RST|TH_PUSH| + TH_ECNECHO|TH_CWR)) { if (flags & TH_SYN) putchar('S'); if (flags & TH_FIN) @@ -143,6 +154,10 @@ tcp_print(register const u_char *bp, register u_int length, putchar('R'); if (flags & TH_PUSH) putchar('P'); + if (flags & TH_CWR) + putchar('W'); /* congestion _W_indow reduced (ECN) */ + if (flags & TH_ECNECHO) + putchar('E'); /* ecn _E_cho sent (ECN) */ } else putchar('.'); |