diff options
author | Guy Harris <guy@alum.mit.edu> | 2003-10-25 07:17:28 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2003-10-25 07:17:28 +0000 |
commit | b624dce63ba6fd7c4d700864c5eaa936a470e99c (patch) | |
tree | 779267db694464aabf71de57a78ed5695901f578 /wiretap | |
parent | aed6852d6bc1bae4972d8eaa56ed98d96f7fa27a (diff) |
Add a new WTAP_ENCAP_CHDLC_WITH_PHDR type, to distinguish Cisco HDLC
captures with packet direction information from captures without it.
Use them appropriately.
svn path=/trunk/; revision=8780
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/ngsniffer.c | 6 | ||||
-rw-r--r-- | wiretap/visual.c | 16 | ||||
-rw-r--r-- | wiretap/wtap.c | 5 | ||||
-rw-r--r-- | wiretap/wtap.h | 5 |
4 files changed, 18 insertions, 14 deletions
diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 798f0cde01..b0994cfcda 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -1,6 +1,6 @@ /* ngsniffer.c * - * $Id: ngsniffer.c,v 1.111 2003/10/01 07:11:48 guy Exp $ + * $Id: ngsniffer.c,v 1.112 2003/10/25 07:17:27 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -1667,7 +1667,7 @@ static int infer_pkt_encap(const guint8 *pd, int len) /* * Cisco HDLC. */ - return WTAP_ENCAP_CHDLC; + return WTAP_ENCAP_CHDLC_WITH_PHDR; } } @@ -1701,7 +1701,7 @@ static int fix_pseudo_header(int encap, const guint8 *pd, int len, switch (encap) { case WTAP_ENCAP_WFLEET_HDLC: - case WTAP_ENCAP_CHDLC: + case WTAP_ENCAP_CHDLC_WITH_PHDR: case WTAP_ENCAP_PPP_WITH_PHDR: if (pseudo_header->x25.flags == 0) pseudo_header->p2p.sent = TRUE; diff --git a/wiretap/visual.c b/wiretap/visual.c index c023cd5e16..013634a47c 100644 --- a/wiretap/visual.c +++ b/wiretap/visual.c @@ -2,7 +2,7 @@ * File read and write routines for Visual Networks cap files. * Copyright (c) 2001, Tom Nisbet tnisbet@visualnetworks.com * - * $Id: visual.c,v 1.13 2003/10/01 07:11:48 guy Exp $ + * $Id: visual.c,v 1.14 2003/10/25 07:17:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -187,7 +187,7 @@ int visual_open(wtap *wth, int *err) break; case 22: - encap = WTAP_ENCAP_CHDLC; + encap = WTAP_ENCAP_CHDLC_WITH_PHDR; break; case 32: @@ -307,7 +307,7 @@ static gboolean visual_read(wtap *wth, int *err, long *data_offset) /* Fill in the encapsulation. Visual files have a media type in the file header and an encapsulation type in each packet header. Files with a media type of HDLC can be either Cisco EtherType or PPP. */ - if ((wth->file_encap == WTAP_ENCAP_CHDLC) && (vpkt_hdr.encap_hint == 14)) + if ((wth->file_encap == WTAP_ENCAP_CHDLC_WITH_PHDR) && (vpkt_hdr.encap_hint == 14)) wth->phdr.pkt_encap = WTAP_ENCAP_PPP_WITH_PHDR; else wth->phdr.pkt_encap = wth->file_encap; @@ -383,7 +383,7 @@ static void visual_set_pseudo_header(int encap, struct visual_pkt_hdr *vpkt_hdr, pseudo_header->eth.fcs_len = -1; break; - case WTAP_ENCAP_CHDLC: + case WTAP_ENCAP_CHDLC_WITH_PHDR: case WTAP_ENCAP_PPP_WITH_PHDR: pseudo_header->p2p.sent = (packet_status & PS_SENT) ? TRUE : FALSE; break; @@ -411,7 +411,7 @@ int visual_dump_can_write_encap(int encap) case WTAP_ENCAP_ETHERNET: case WTAP_ENCAP_TOKEN_RING: case WTAP_ENCAP_LAPB: - case WTAP_ENCAP_CHDLC: + case WTAP_ENCAP_CHDLC_WITH_PHDR: case WTAP_ENCAP_FRELAY_WITH_PHDR: case WTAP_ENCAP_PPP: case WTAP_ENCAP_PPP_WITH_PHDR: @@ -517,7 +517,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, case WTAP_ENCAP_PPP_WITH_PHDR: vpkt_hdr.encap_hint = 14; break; - case WTAP_ENCAP_CHDLC: /* HDLC Router */ + case WTAP_ENCAP_CHDLC_WITH_PHDR: /* HDLC Router */ vpkt_hdr.encap_hint = 13; break; case WTAP_ENCAP_FRELAY_WITH_PHDR: /* Frame Relay Auto-detect */ @@ -536,7 +536,7 @@ static gboolean visual_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr, packet_status = 0; switch (wdh->encap) { - case WTAP_ENCAP_CHDLC: + case WTAP_ENCAP_CHDLC_WITH_PHDR: packet_status |= (pseudo_header->p2p.sent ? PS_SENT : 0x00); break; @@ -668,7 +668,7 @@ static gboolean visual_dump_close(wtap_dumper *wdh, int *err) case WTAP_ENCAP_PPP: /* PPP is differentiated from CHDLC in PktHdr */ case WTAP_ENCAP_PPP_WITH_PHDR: - case WTAP_ENCAP_CHDLC: + case WTAP_ENCAP_CHDLC_WITH_PHDR: vfile_hdr.media_type = htoles(22); break; diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 03120cd9b6..7e508d31fc 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1,6 +1,6 @@ /* wtap.c * - * $Id: wtap.c,v 1.83 2003/05/16 00:34:33 guy Exp $ + * $Id: wtap.c,v 1.84 2003/10/25 07:17:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -175,6 +175,9 @@ static const struct encap_type_info { /* WTAP_ENCAP_PFLOG */ { "OpenBSD PF Firewall logs", "pflog" }, + + /* WTAP_ENCAP_CHDLC_WITH_PHDR */ + { "Cisco HDLC with Directional Info", "chdlc-with-direction" }, }; /* Name that should be somewhat descriptive. */ diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 54be05aea6..5671803c7f 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1,6 +1,6 @@ /* wtap.h * - * $Id: wtap.h,v 1.141 2003/10/01 07:11:49 guy Exp $ + * $Id: wtap.h,v 1.142 2003/10/25 07:17:28 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez <gram@alumni.rice.edu> @@ -128,9 +128,10 @@ #define WTAP_ENCAP_TZSP 36 #define WTAP_ENCAP_ENC 37 #define WTAP_ENCAP_PFLOG 38 +#define WTAP_ENCAP_CHDLC_WITH_PHDR 39 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 39 +#define WTAP_NUM_ENCAP_TYPES 40 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we |