]> The Tcpdump Group git mirrors - libpcap/commitdiff
Added basic support for BACnet MS/TP
authorNiko Delarich <[email protected]>
Fri, 3 Aug 2012 12:30:33 +0000 (14:30 +0200)
committerMichael Richardson <[email protected]>
Sun, 14 Apr 2013 22:32:04 +0000 (18:32 -0400)
Added DLT_CHOICE, dummy offsets & basic matching

gencode.c
pcap.c

index 4151519f52b5bc4b54bd4142848ee2911303cef1..1cbaeebdd36c76c166e729c6847e85d4ab2762c7 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -1343,6 +1343,13 @@ init_linktype(p)
                off_nl_nosnap = -1;     /* no 802.2 LLC */
                return;
 
+       case DLT_BACNET_MS_TP:
+               off_linktype = -1;
+               off_macpl = -1;
+               off_nl = -1;
+               off_nl_nosnap = -1;
+               return;
+
        case DLT_JUNIPER_SERVICES:
                off_linktype = 12;
                off_macpl = -1;         /* L3 proto location dep. on cookie type */
@@ -3354,6 +3361,9 @@ gen_linktype(proto)
                 */
                return gen_mcmp(OR_LINK, 0, BPF_W, 0x4d474300, 0xffffff00); /* compare the magic number */
 
+       case DLT_BACNET_MS_TP:
+               return gen_mcmp(OR_LINK, 0, BPF_W, 0x55FF0000, 0xffff0000);
+
        case DLT_IPNET:
                return gen_ipnet_linktype(proto);
 
diff --git a/pcap.c b/pcap.c
index bd72767db8140a61b0dae4370e7787414e980b87..0bf845db89b9925fcfc8704358b8aa339bd80541 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -1010,6 +1010,7 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(DLT_LINUX_IRDA, "Linux IrDA"),
        DLT_CHOICE(DLT_IEEE802_11_RADIO_AVS, "802.11 plus AVS radio information header"),
         DLT_CHOICE(DLT_JUNIPER_MONITOR, "Juniper Passive Monitor PIC"),
+       DLT_CHOICE(DLT_BACNET_MS_TP, "BACnet MS/TP"),
        DLT_CHOICE(DLT_PPP_PPPD, "PPP for pppd, with direction flag"),
        DLT_CHOICE(DLT_JUNIPER_PPPOE, "Juniper PPPoE"),
        DLT_CHOICE(DLT_JUNIPER_PPPOE_ATM, "Juniper PPPoE/ATM"),