diff -Nuar darkstat-3.0.712.orig/decode.c darkstat-3.0.712/decode.c --- darkstat-3.0.712.orig/decode.c 2008-11-29 11:39:55.000000000 +0600 +++ darkstat-3.0.712/decode.c 2008-12-18 01:06:08.000000000 +0600 @@ -67,6 +67,8 @@ pktsummary *sm); static void decode_linux_sll(u_char *, const struct pcap_pkthdr *, const u_char *); +static void decode_raw(u_char *, const struct pcap_pkthdr *, + const u_char *); static void decode_ip(const u_char *pdata, const uint32_t len, pktsummary *sm); @@ -85,6 +87,7 @@ #ifdef DLT_LINUX_SLL { DLT_LINUX_SLL, SLL_HDR_LEN, decode_linux_sll }, #endif + { DLT_RAW, RAW_HDR_LEN, decode_raw }, { -1, -1, NULL } }; @@ -300,6 +303,19 @@ } static void +decode_raw(u_char *user _unused_, + const struct pcap_pkthdr *pheader, + const u_char *pdata) +{ + pktsummary sm; + memset(&sm, 0, sizeof(sm)); + + decode_ip(pdata, pheader->caplen, &sm); + sm.time = pheader->ts.tv_sec; + acct_for(&sm); +} + +static void decode_ip(const u_char *pdata, const uint32_t len, pktsummary *sm) { const struct ip *hdr = (const struct ip *)pdata; diff -Nuar darkstat-3.0.712.orig/decode.h darkstat-3.0.712/decode.h --- darkstat-3.0.712.orig/decode.h 2008-11-29 11:39:55.000000000 +0600 +++ darkstat-3.0.712/decode.h 2008-12-18 00:49:14.000000000 +0600 @@ -18,6 +18,7 @@ #define NULL_HDR_LEN 4 #define PPPOE_HDR_LEN 8 #define SLL_HDR_LEN 16 +#define RAW_HDR_LEN 0 #ifndef ETHER_ADDR_LEN #define ETHER_ADDR_LEN 6