2 * Netgrind -- Link Layer Analyser
4 * (c) 2003 Martin Mares <mj@ucw.cz>
6 * This software may be freely distributed and used according to the terms
7 * of the GNU General Public License.
11 #include "netgrind/pkt.h"
12 #include "netgrind/netgrind.h"
15 #include <netinet/in.h>
16 #include <net/ethernet.h>
18 struct pkt_stats stat_link_dwarf, stat_link_in, stat_link_unknown, stat_link_arp;
20 void link_eth_got_packet(struct pkt *p)
22 struct ether_header *eth;
25 pkt_account(&stat_link_in, p);
26 if (!(eth = pkt_pop(p, sizeof(*eth))))
28 pkt_account(&stat_link_dwarf, p);
31 etype = ntohs(eth->ether_type);
38 pkt_account(&stat_link_arp, p);
42 // printf("Unknown ethertype: %04x\n", etype);
43 pkt_account(&stat_link_unknown, p);