From 3f756801910b8b34c5e3da2a6ba541ab742a1af5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 8 Jan 2001 22:18:22 +0000 Subject: Code to handle Frame Relay Sniffer captures, from Jeff Foster. Code to register the Frame Relay dissector to handle Frame Relay captures, from Paul Ionescu. svn path=/trunk/; revision=2845 --- wiretap/ngsniffer.c | 9 +++++++-- wiretap/wtap.c | 5 ++++- wiretap/wtap.h | 5 +++-- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'wiretap') diff --git a/wiretap/ngsniffer.c b/wiretap/ngsniffer.c index 2d46090507..0e0738edf4 100644 --- a/wiretap/ngsniffer.c +++ b/wiretap/ngsniffer.c @@ -1,6 +1,6 @@ /* ngsniffer.c * - * $Id: ngsniffer.c,v 1.56 2000/11/29 08:24:14 guy Exp $ + * $Id: ngsniffer.c,v 1.57 2001/01/08 22:18:22 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -733,13 +733,18 @@ found: /* * OK, this is from an "Internetwork analyzer"; let's * look at the first byte of the packet, and figure - * out whether it's LAPB, LAPD or PPP. + * out whether it's LAPB, LAPD, PPP, or Frame Relay. */ if (pd[0] == 0xFF) { /* * PPP. */ wth->file_encap = WTAP_ENCAP_PPP; + } else if (pd[0] == 0x34 || pd[0] == 0x28) { + /* + * Frame Relay. + */ + wth->file_encap = WTAP_ENCAP_FRELAY; } else if (pd[0] & 1) { /* * LAPB. diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 89ad680747..8ea3ed0916 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -1,6 +1,6 @@ /* wtap.c * - * $Id: wtap.c,v 1.50 2000/12/23 08:06:16 guy Exp $ + * $Id: wtap.c,v 1.51 2001/01/08 22:18:22 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -124,6 +124,9 @@ const static struct encap_type_info { /* WTAP_ENCAP_SLL */ { "Linux cooked-mode capture", "linux-sll" }, + + /* WTAP_ENCAP_FRELAY */ + { "Frame Relay", "frelay" }, }; /* Name that should be somewhat descriptive. */ diff --git a/wiretap/wtap.h b/wiretap/wtap.h index cb496342d6..8875d1ddbe 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -1,6 +1,6 @@ /* wtap.h * - * $Id: wtap.h,v 1.83 2000/12/23 08:06:16 guy Exp $ + * $Id: wtap.h,v 1.84 2001/01/08 22:18:22 guy Exp $ * * Wiretap Library * Copyright (c) 1998 by Gilbert Ramirez @@ -96,9 +96,10 @@ #define WTAP_ENCAP_PPP_WITH_PHDR 17 #define WTAP_ENCAP_IEEE_802_11 18 #define WTAP_ENCAP_SLL 19 +#define WTAP_ENCAP_FRELAY 20 /* last WTAP_ENCAP_ value + 1 */ -#define WTAP_NUM_ENCAP_TYPES 20 +#define WTAP_NUM_ENCAP_TYPES 21 /* File types that can be read by wiretap. We support writing some many of these file types, too, so we -- cgit v1.2.1