diff options
author | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-21 04:41:37 +0000 |
---|---|---|
committer | Gilbert Ramirez <gram@alumni.rice.edu> | 2000-09-21 04:41:37 +0000 |
commit | c312f69abcbd44c8ca982f16d086c5bef05783f7 (patch) | |
tree | a96809a3c62e1475a013044d5a312bfc58622083 /wiretap | |
parent | 66752e74e9cd57d06556d6d2f093514e1102b634 (diff) | |
download | wireshark-c312f69abcbd44c8ca982f16d086c5bef05783f7.tar.gz wireshark-c312f69abcbd44c8ca982f16d086c5bef05783f7.tar.bz2 wireshark-c312f69abcbd44c8ca982f16d086c5bef05783f7.zip |
Make sure to pass the sent/received direction from pppdump.c in
pseudo_header.
Use generic "p2p_phdr" instead of "lapd_phdr". Modify toshiba.c and
packet-lapd.c to take that into account.
Add frame.p2p_dir, a filterable field, 0=sent, 1=recvd
Make p2p_dir available in packe_info, as I think it will be needed
in VJ COMP and UNCOMP dissection.
Rename WTAP_ENCAP_TR to WTAP_ENCAP_TOKEN_RING.
Mention pppd-log support in man page.
Mention atmsnoop in README.
svn path=/trunk/; revision=2455
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/iptrace.c | 4 | ||||
-rw-r--r-- | wiretap/lanalyzer.c | 4 | ||||
-rw-r--r-- | wiretap/libpcap.c | 4 | ||||
-rw-r--r-- | wiretap/netmon.c | 6 | ||||
-rw-r--r-- | wiretap/netxray.c | 6 | ||||
-rw-r--r-- | wiretap/ngsniffer.c | 6 | ||||
-rw-r--r-- | wiretap/pppdump.c | 10 | ||||
-rw-r--r-- | wiretap/snoop.c | 6 | ||||
-rw-r--r-- | wiretap/toshiba.c | 6 | ||||
-rw-r--r-- | wiretap/wtap.h | 16 |
10 files changed, 37 insertions, 31 deletions
diff --git a/wiretap/iptrace.c b/wiretap/iptrace.c index a2bf913b58..41a1da2213 100644 --- a/wiretap/iptrace.c +++ b/wiretap/iptrace.c @@ -1,6 +1,6 @@ /* iptrace.c * - * $Id: iptrace.c,v 1.31 2000/09/07 05:34:09 gram Exp $ + * $Id: iptrace.c,v 1.32 2000/09/21 04:41:30 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -408,7 +408,7 @@ wtap_encap_ift(unsigned int ift) /* 0x6 */ WTAP_ENCAP_ETHERNET, /* IFT_ETHER */ /* 0x7 */ WTAP_ENCAP_UNKNOWN, /* IFT_ISO88023 */ /* 0x8 */ WTAP_ENCAP_UNKNOWN, /* IFT_ISO88024 */ -/* 0x9 */ WTAP_ENCAP_TR, /* IFT_ISO88025 */ +/* 0x9 */ WTAP_ENCAP_TOKEN_RING, /* IFT_ISO88025 */ /* 0xa */ WTAP_ENCAP_UNKNOWN, /* IFT_ISO88026 */ /* 0xb */ WTAP_ENCAP_UNKNOWN, /* IFT_STARLAN */ /* 0xc */ WTAP_ENCAP_RAW_IP, /* IFT_P10, IBM SP switch */ diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c index 4df14843c9..e566c71866 100644 --- a/wiretap/lanalyzer.c +++ b/wiretap/lanalyzer.c @@ -1,6 +1,6 @@ /* lanalyzer.c * - * $Id: lanalyzer.c,v 1.25 2000/09/07 05:34:10 gram Exp $ + * $Id: lanalyzer.c,v 1.26 2000/09/21 04:41:30 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -167,7 +167,7 @@ int lanalyzer_open(wtap *wth, int *err) wth->file_encap = WTAP_ENCAP_ETHERNET; break; case BOARD_325TR: - wth->file_encap = WTAP_ENCAP_TR; + wth->file_encap = WTAP_ENCAP_TOKEN_RING; break; default: g_message("lanalyzer: board type %u unknown", diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index 173548fddf..6dcf93c9b6 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -1,6 +1,6 @@ /* libpcap.c * - * $Id: libpcap.c,v 1.42 2000/09/17 07:50:35 guy Exp $ + * $Id: libpcap.c,v 1.43 2000/09/21 04:41:31 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -95,7 +95,7 @@ static const struct { */ { 0, WTAP_ENCAP_NULL }, /* null encapsulation */ { 1, WTAP_ENCAP_ETHERNET }, - { 6, WTAP_ENCAP_TR }, /* IEEE 802 Networks - assume token ring */ + { 6, WTAP_ENCAP_TOKEN_RING }, /* IEEE 802 Networks - assume token ring */ { 7, WTAP_ENCAP_ARCNET }, { 8, WTAP_ENCAP_SLIP }, { 9, WTAP_ENCAP_PPP }, diff --git a/wiretap/netmon.c b/wiretap/netmon.c index 337c4a8c34..7a56d7b3a4 100644 --- a/wiretap/netmon.c +++ b/wiretap/netmon.c @@ -1,6 +1,6 @@ /* netmon.c * - * $Id: netmon.c,v 1.33 2000/09/07 05:34:12 gram Exp $ + * $Id: netmon.c,v 1.34 2000/09/21 04:41:32 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -108,7 +108,7 @@ int netmon_open(wtap *wth, int *err) static const int netmon_encap[] = { WTAP_ENCAP_UNKNOWN, WTAP_ENCAP_ETHERNET, - WTAP_ENCAP_TR, + WTAP_ENCAP_TOKEN_RING, WTAP_ENCAP_FDDI_BITSWAPPED, WTAP_ENCAP_UNKNOWN, /* WAN */ WTAP_ENCAP_UNKNOWN, /* LocalTalk */ @@ -412,7 +412,7 @@ netmon_close(wtap *wth) static const int wtap_encap[] = { -1, /* WTAP_ENCAP_UNKNOWN -> unsupported */ 1, /* WTAP_ENCAP_ETHERNET -> NDIS Ethernet */ - 2, /* WTAP_ENCAP_TR -> NDIS Token Ring */ + 2, /* WTAP_ENCAP_TOKEN_RING -> NDIS Token Ring */ -1, /* WTAP_ENCAP_SLIP -> unsupported */ -1, /* WTAP_ENCAP_PPP -> unsupported */ 3, /* WTAP_ENCAP_FDDI -> NDIS FDDI */ diff --git a/wiretap/netxray.c b/wiretap/netxray.c index 061387ff7e..c998a7bfa1 100644 --- a/wiretap/netxray.c +++ b/wiretap/netxray.c @@ -1,6 +1,6 @@ /* netxray.c * - * $Id: netxray.c,v 1.31 2000/09/07 05:34:14 gram Exp $ + * $Id: netxray.c,v 1.32 2000/09/21 04:41:32 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -110,7 +110,7 @@ int netxray_open(wtap *wth, int *err) double t; static const int netxray_encap[] = { WTAP_ENCAP_ETHERNET, - WTAP_ENCAP_TR, + WTAP_ENCAP_TOKEN_RING, WTAP_ENCAP_FDDI_BITSWAPPED, WTAP_ENCAP_ETHERNET, /* WAN(PPP), but shaped like ethernet */ WTAP_ENCAP_UNKNOWN, /* LocalTalk */ @@ -310,7 +310,7 @@ netxray_close(wtap *wth) static const int wtap_encap[] = { -1, /* WTAP_ENCAP_UNKNOWN -> unsupported */ 0, /* WTAP_ENCAP_ETHERNET -> NDIS Ethernet */ - 1, /* WTAP_ENCAP_TR -> NDIS Token Ring */ + 1, /* WTAP_ENCAP_TOKEN_RING -> NDIS Token Ring */ -1, /* WTAP_ENCAP_SLIP -> unsupported */ -1, /* WTAP_ENCAP_PPP -> unsupported */ 2, /* WTAP_ENCAP_FDDI -> NDIS FDDI */ diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 898806c5fc..807cda7dee 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -1,6 +1,6 @@ /* ngsniffer.c * - * $Id: ngsniffer.c,v 1.51 2000/09/07 05:34:16 gram Exp $ + * $Id: ngsniffer.c,v 1.52 2000/09/21 04:41:33 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -291,7 +291,7 @@ int ngsniffer_open(wtap *wth, int *err) guint16 start_date; guint16 start_time; static const int sniffer_encap[] = { - WTAP_ENCAP_TR, + WTAP_ENCAP_TOKEN_RING, WTAP_ENCAP_ETHERNET, WTAP_ENCAP_ARCNET, WTAP_ENCAP_UNKNOWN, /* StarLAN */ @@ -893,7 +893,7 @@ static void ngsniffer_close(wtap *wth) static const int wtap_encap[] = { -1, /* WTAP_ENCAP_UNKNOWN -> unsupported */ 1, /* WTAP_ENCAP_ETHERNET */ - 0, /* WTAP_ENCAP_TR */ + 0, /* WTAP_ENCAP_TOKEN_RING */ -1, /* WTAP_ENCAP_SLIP -> unsupported */ 7, /* WTAP_ENCAP_PPP -> Internetwork analyzer (synchronous) FIXME ! */ -1, /* WTAP_ENCAP_FDDI -> unsupported */ diff --git a/wiretap/pppdump.c b/wiretap/pppdump.c index 5a7c030198..5e1ba5e1cd 100644 --- a/wiretap/pppdump.c +++ b/wiretap/pppdump.c @@ -1,6 +1,6 @@ /* pppdump.c * - * $Id: pppdump.c,v 1.2 2000/09/19 17:35:08 gram Exp $ + * $Id: pppdump.c,v 1.3 2000/09/21 04:41:35 gram Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@xiexie.org> * @@ -197,7 +197,7 @@ pppdump_open(wtap *wth, int *err) state->offset = 5; file_seek(wth->fh, 5, SEEK_SET); - wth->file_encap = WTAP_ENCAP_PPP; + wth->file_encap = WTAP_ENCAP_PPP_WITH_PHDR; wth->file_type = WTAP_FILE_PPPDUMP; wth->snapshot_length = 8192; /* just guessing */ @@ -254,7 +254,9 @@ pppdump_read(wtap *wth, int *err, int *data_offset) wth->phdr.caplen = num_bytes; wth->phdr.ts.tv_sec = state->timestamp; wth->phdr.ts.tv_usec = state->tenths * 100000; - wth->phdr.pkt_encap = WTAP_ENCAP_PPP; + wth->phdr.pkt_encap = WTAP_ENCAP_PPP_WITH_PHDR; + + wth->pseudo_header.p2p.sent = (direction == DIRECTION_SENT ? TRUE : FALSE); return TRUE; } @@ -541,6 +543,8 @@ pppdump_seek_read (wtap *wth, return -1; } + pseudo_header->p2p.sent = (pid->dir == DIRECTION_SENT ? TRUE : FALSE); + return 0; } diff --git a/wiretap/snoop.c b/wiretap/snoop.c index 7d8e9302f4..9e23eb6fbb 100644 --- a/wiretap/snoop.c +++ b/wiretap/snoop.c @@ -1,6 +1,6 @@ /* snoop.c * - * $Id: snoop.c,v 1.31 2000/09/19 05:12:11 guy Exp $ + * $Id: snoop.c,v 1.32 2000/09/21 04:41:36 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -125,7 +125,7 @@ int snoop_open(wtap *wth, int *err) static const int snoop_encap[] = { WTAP_ENCAP_ETHERNET, /* IEEE 802.3 */ WTAP_ENCAP_UNKNOWN, /* IEEE 802.4 Token Bus */ - WTAP_ENCAP_TR, + WTAP_ENCAP_TOKEN_RING, WTAP_ENCAP_UNKNOWN, /* IEEE 802.6 Metro Net */ WTAP_ENCAP_ETHERNET, WTAP_ENCAP_UNKNOWN, /* HDLC */ @@ -405,7 +405,7 @@ snoop_read_rec_data(FILE_T fh, u_char *pd, int length, int *err) static const int wtap_encap[] = { -1, /* WTAP_ENCAP_UNKNOWN -> unsupported */ 0x04, /* WTAP_ENCAP_ETHERNET -> DL_ETHER */ - 0x02, /* WTAP_ENCAP_TR -> DL_TPR */ + 0x02, /* WTAP_ENCAP_TOKEN_RING -> DL_TPR */ -1, /* WTAP_ENCAP_SLIP -> unsupported */ -1, /* WTAP_ENCAP_PPP -> unsupported */ 0x08, /* WTAP_ENCAP_FDDI -> DL_FDDI */ diff --git a/wiretap/toshiba.c b/wiretap/toshiba.c index 407b52dab7..d0b6d37c3f 100644 --- a/wiretap/toshiba.c +++ b/wiretap/toshiba.c @@ -1,6 +1,6 @@ /* toshiba.c * - * $Id: toshiba.c,v 1.12 2000/09/07 05:34:20 gram Exp $ + * $Id: toshiba.c,v 1.13 2000/09/21 04:41:37 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -327,8 +327,8 @@ parse_toshiba_rec_hdr(wtap *wth, FILE_T fh, case 'D': if (wth) wth->phdr.pkt_encap = WTAP_ENCAP_LAPD; - pseudo_header->lapd.from_network_to_user = - (direction[0] == 'R' ? TRUE : FALSE ); + pseudo_header->p2p.sent = + (direction[0] == 'T' ? TRUE : FALSE ); break; default: diff --git a/wiretap/wtap.h b/wiretap/wtap.h index c3ccdc4ed5..43426a1993 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1,6 +1,6 @@ /* wtap.h * - * $Id: wtap.h,v 1.80 2000/09/19 17:22:11 gram Exp $ + * $Id: wtap.h,v 1.81 2000/09/21 04:41:37 gram Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org> @@ -78,7 +78,7 @@ #define WTAP_ENCAP_PER_PACKET -1 #define WTAP_ENCAP_UNKNOWN 0 #define WTAP_ENCAP_ETHERNET 1 -#define WTAP_ENCAP_TR 2 +#define WTAP_ENCAP_TOKEN_RING 2 #define WTAP_ENCAP_SLIP 3 #define WTAP_ENCAP_PPP 4 #define WTAP_ENCAP_FDDI 5 @@ -93,9 +93,10 @@ #define WTAP_ENCAP_ASCEND 14 #define WTAP_ENCAP_LAPD 15 #define WTAP_ENCAP_V120 16 +#define WTAP_ENCAP_PPP_WITH_PHDR 17 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 17 +#define WTAP_NUM_ENCAP_TYPES 18 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we @@ -185,11 +186,12 @@ struct ascend_phdr { guint32 task; /* Task number */ }; -/* Packet "pseudo-header" information for LAPD capture files. */ -struct lapd_phdr { - gboolean from_network_to_user; + +struct p2p_phdr { + gboolean sent; /* TRUE=sent, FALSE=received */ }; + /* * Bits in AppTrafType. * @@ -246,7 +248,7 @@ union wtap_pseudo_header { struct x25_phdr x25; struct ngsniffer_atm_phdr ngsniffer_atm; struct ascend_phdr ascend; - struct lapd_phdr lapd; + struct p2p_phdr p2p; }; struct wtap_pkthdr { |