From: Hannes Gredler Date: Wed, 9 Feb 2011 08:09:27 +0000 (+0100) Subject: add some more Juniper proprietary DLTs and LINKTYPEs, X-Git-Tag: libpcap-1.2.1~85^2 X-Git-Url: https://git.tcpdump.org/libpcap/commitdiff_plain/7a2e714e11c90b88725a7a1324b1aa059e147133?hp=-c add some more Juniper proprietary DLTs and LINKTYPEs, in order to prevent clashes with the public. --- 7a2e714e11c90b88725a7a1324b1aa059e147133 diff --git a/gencode.c b/gencode.c index b94ea729..9cef425d 100644 --- a/gencode.c +++ b/gencode.c @@ -1366,6 +1366,15 @@ init_linktype(p) off_nl_nosnap = -1; return; + case DLT_JUNIPER_VS: + case DLT_JUNIPER_SRX_E2E: + case DLT_JUNIPER_FIBRECHANNEL: + off_linktype = 8; + off_macpl = -1; + off_nl = -1; + off_nl_nosnap = -1; + return; + case DLT_MTP2: off_li = 2; off_sio = 3; @@ -3472,6 +3481,10 @@ gen_linktype(proto) case DLT_JUNIPER_VP: case DLT_JUNIPER_ST: case DLT_JUNIPER_ISM: + case DLT_JUNIPER_VS: + case DLT_JUNIPER_SRX_E2E: + case DLT_JUNIPER_FIBRECHANNEL: + /* just lets verify the magic number for now - * on ATM we may have up to 6 different encapsulations on the wire * and need a lot of heuristics to figure out that the payload @@ -7674,6 +7687,10 @@ gen_inbound(dir) case DLT_JUNIPER_VP: case DLT_JUNIPER_ST: case DLT_JUNIPER_ISM: + case DLT_JUNIPER_VS: + case DLT_JUNIPER_SRX_E2E: + case DLT_JUNIPER_FIBRECHANNEL: + /* juniper flags (including direction) are stored * the byte after the 3-byte magic number */ if (dir) { diff --git a/pcap-common.c b/pcap-common.c index 3989dfc4..0833653f 100644 --- a/pcap-common.c +++ b/pcap-common.c @@ -753,6 +753,13 @@ static const char rcsid[] _U_ = */ #define LINKTYPE_DBUS 231 +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + */ +#define LINKTYPE_JUNIPER_VS 232 +#define LINKTYPE_JUNIPER_SRX_E2E 233 +#define LINKTYPE_JUNIPER_FIBRECHANNEL 234 static struct linktype_map { int dlt; @@ -1105,6 +1112,15 @@ static struct linktype_map { /* D-Bus messages */ { DLT_DBUS, LINKTYPE_DBUS }, + /* Juniper Virtual Server */ + { DLT_JUNIPER_VS, LINKTYPE_JUNIPER_VS }, + + /* Juniper SRX E2E debugging */ + { DLT_JUNIPER_SRX_E2E, LINKTYPE_JUNIPER_SRX_E2E }, + + /* Juniper Fibrechannel */ + { DLT_JUNIPER_FIBRECHANNEL, LINKTYPE_JUNIPER_FIBRECHANNEL }, + { -1, -1 } }; diff --git a/pcap.c b/pcap.c index 146c09c6..d26bf212 100644 --- a/pcap.c +++ b/pcap.c @@ -847,6 +847,9 @@ static struct dlt_choice dlt_choices[] = { DLT_CHOICE(DLT_IPV4, "Raw IPv4"), DLT_CHOICE(DLT_IPV6, "Raw IPv6"), DLT_CHOICE(DLT_IEEE802_15_4_NOFCS, "IEEE 802.15.4 without FCS"), + DLT_CHOICE(DLT_JUNIPER_VS, "Juniper Virtual Server"), + DLT_CHOICE(DLT_JUNIPER_SRX_E2E, "Juniper SRX E2E"), + DLT_CHOICE(DLT_JUNIPER_FIBRECHANNEL, "Juniper Fibrechannel"), DLT_CHOICE_SENTINEL }; diff --git a/pcap/bpf.h b/pcap/bpf.h index 3fa2bf28..67140ce7 100644 --- a/pcap/bpf.h +++ b/pcap/bpf.h @@ -987,6 +987,14 @@ struct bpf_program { */ #define DLT_DBUS 231 +/* + * Juniper-private data link type, as per request from + * Hannes Gredler . + */ +#define DLT_JUNIPER_VS 232 +#define DLT_JUNIPER_SRX_E2E 233 +#define DLT_JUNIPER_FIBRECHANNEL 234 + /* * DLT and savefile link type values are split into a class and * a member of that class. A class value of 0 indicates a regular