summaryrefslogtreecommitdiff
path: root/wiretap/wtap.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2007-06-13 22:36:58 +0000
committerGerald Combs <gerald@wireshark.org>2007-06-13 22:36:58 +0000
commitd1a745f27b47ab4c7247c984eff543284012bba2 (patch)
tree8a506e8fa478ef9fae7313d51ba808a22c59180a /wiretap/wtap.c
parente3fc848842ac6868cda63cae40ca41ee31e94bce (diff)
downloadwireshark-d1a745f27b47ab4c7247c984eff543284012bba2.tar.gz
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/wtap.c')
-rw-r--r--wiretap/wtap.c17
1 files changed, 10 insertions, 7 deletions
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;