+struct pcap_pkthdr; /* from pcap.h */
+
+#define DECODER_ARGS const struct pcap_pkthdr *pheader, \
+ const u_char *pdata, \
+ struct pktsummary *sm
+
+/* Returns 0 on decode failure (meaning accounting should not be performed) */
+typedef int (decoder_fn)(DECODER_ARGS);
+
+struct linkhdr {
+ int linktype;
+ unsigned int hdrlen;
+ decoder_fn *decoder;
+};
+
+const struct linkhdr *getlinkhdr(const int linktype);
+int getsnaplen(const struct linkhdr *lh);
+