diff options
author | Gerald Combs <gerald@wireshark.org> | 2007-06-13 22:36:58 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2007-06-13 22:36:58 +0000 |
commit | d1a745f27b47ab4c7247c984eff543284012bba2 (patch) | |
tree | 8a506e8fa478ef9fae7313d51ba808a22c59180a /wiretap | |
parent | e3fc848842ac6868cda63cae40ca41ee31e94bce (diff) |
Add support for PPI (the Per-Packet Information header), described at
http://www.cacetech.com/documents/PPI_Header_format_1.0.pdf .
svn path=/trunk/; revision=22094
Diffstat (limited to 'wiretap')
-rw-r--r-- | wiretap/libpcap.c | 4 | ||||
-rw-r--r-- | wiretap/wtap.c | 17 | ||||
-rw-r--r-- | wiretap/wtap.h | 19 |
3 files changed, 23 insertions, 17 deletions
diff --git a/wiretap/libpcap.c b/wiretap/libpcap.c index c56f1d0d83..eced02cf8d 100644 --- a/wiretap/libpcap.c +++ b/wiretap/libpcap.c @@ -310,7 +310,7 @@ static const struct { /* * Linux "cooked mode" captures, used by the current CVS version - * of libpcap + * of libpcap * OR * it could be a packet in Cisco's ERSPAN encapsulation which uses * this number as well (why can't people stick to protocols when it @@ -427,6 +427,8 @@ static const struct { { 188, WTAP_ENCAP_IEEE802_16_MAC_CPS }, /* USB packets with Linux-specified header */ { 189, WTAP_ENCAP_USB_LINUX }, + /* Per-Packet Information header */ + { 192, WTAP_ENCAP_PPI }, /* * To repeat: diff --git a/wiretap/wtap.c b/wiretap/wtap.c index 4f686d7ee1..ce606b02f6 100644 --- a/wiretap/wtap.c +++ b/wiretap/wtap.c @@ -350,7 +350,7 @@ static struct encap_type_info encap_table_base[] = { /* WTAP_ENCAP_JUNIPER_CHDLC */ { "Juniper C-HDLC", "juniper-chdlc" }, - + /* WTAP_ENCAP_JUNIPER_GGSN */ { "Juniper GGSN", "juniper-ggsn" }, @@ -377,6 +377,9 @@ static struct encap_type_info encap_table_base[] = { /* WTAP_ENCAP_MPEG */ { "MPEG", "mpeg" }, + + /* WTAP_ENCAP_PPI */ + { "Per-Packet Information header", "ppi" }, }; gint wtap_num_encap_types = sizeof(encap_table_base) / sizeof(struct encap_type_info); @@ -384,13 +387,13 @@ static GArray* encap_table_arr = NULL; static const struct encap_type_info* encap_table = NULL; static void wtap_init_encap_types(void) { - + if (encap_table_arr) return; - + encap_table_arr = g_array_new(FALSE,TRUE,sizeof(struct encap_type_info)); - + g_array_append_vals(encap_table_arr,encap_table_base,wtap_num_encap_types); - + encap_table = (void*)encap_table_arr->data; } @@ -403,10 +406,10 @@ int wtap_get_num_encap_types(void) { int wtap_register_encap_type(char* name, char* short_name) { struct encap_type_info* e = g_malloc(sizeof(struct encap_type_info)); wtap_init_encap_types(); - + e->name = g_strdup(name); e->short_name = g_strdup(short_name); - + g_array_append_val(encap_table_arr,e); encap_table = (void*)encap_table_arr->data; diff --git a/wiretap/wtap.h b/wiretap/wtap.h index 8922e461e4..d3fde5fe6e 100644 --- a/wiretap/wtap.h +++ b/wiretap/wtap.h @@ -191,6 +191,7 @@ extern "C" { #define WTAP_ENCAP_NETTL_RAW_TELNET 94 #define WTAP_ENCAP_USB_LINUX 95 #define WTAP_ENCAP_MPEG 96 +#define WTAP_ENCAP_PPI 97 #define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types() @@ -516,7 +517,7 @@ typedef union { guint16 vc; guint16 cid; } atm; - + guint32 ds0mask; } k12_input_info_t; @@ -571,7 +572,7 @@ struct catapult_dct2000_phdr #define URB_TRANSFER_IN 0x80 /* to host */ /* - * USB setup header as defined in USB specification + * USB setup header as defined in USB specification */ struct usb_request_hdr { gint8 bmRequestType; @@ -604,7 +605,7 @@ struct linux_usb_phdr { guint32 urb_len; /* whole len of urb this event refers to */ guint32 data_len; /* amount of urb data really present in this event*/ }; - + union wtap_pseudo_header { struct eth_phdr eth; struct x25_phdr x25; @@ -646,26 +647,26 @@ struct file_type_info { /* the file type name */ /* should be NULL for all "pseudo" types that are only internally used and not read/writeable */ const char *name; - + /* the file type short name, used as a shortcut for the command line tools */ /* should be NULL for all "pseudo" types that are are only internally used and not read/writeable */ const char *short_name; - + /* the common file extensions for this type (seperated by semicolon) */ /* should be *.* if no common extension is applicable */ const char *file_extensions; - + /* the default file extension, used to save this type */ /* should be NULL if no default extension is known */ const char *file_extension_default; - + /* can this type be compressed with gzip? */ gboolean can_compress; - + /* can this type write this encapsulation format? */ /* should be NULL is this file type don't have write support */ int (*can_write_encap)(int); - + /* the function to open the capture file for writing */ /* should be NULL is this file type don't have write support */ int (*dump_open)(wtap_dumper *, gboolean, int *); |