pcap: Use SLL2 linktype for captures
This means we can use wireshark on our pcaps.
Signed-off-by: Rashmica Gupta <rashmica@linux.ibm.com>
Change-Id: I215af00e064d352e41d0a8eb87d5a30582998676
diff --git a/utils/mctp-capture.h b/utils/mctp-capture.h
index 8babf2e..e432df9 100644
--- a/utils/mctp-capture.h
+++ b/utils/mctp-capture.h
@@ -12,17 +12,16 @@
#if HAVE_PCAP
#include <pcap/pcap.h>
+
#else
typedef void pcap_t;
typedef void pcap_dumper_t;
#endif
-#define CAPTURE_LINKTYPE_FIRST 147
-#define CAPTURE_LINKTYPE_LAST 162
+#define CAPTURE_LINKTYPE_LINUX_SLL2 276
struct capture {
const char *path;
- int linktype;
pcap_t *pcap;
pcap_dumper_t *dumper;
};
@@ -31,8 +30,9 @@
int capture_init(void);
int capture_prepare(struct capture *cap);
void capture_close(struct capture *cap);
-void capture_binding(struct mctp_pktbuf *pkt, void *user);
-void capture_socket(pcap_dumper_t *dumper, const void *buf, size_t len);
+void capture_binding(struct mctp_pktbuf *pkt, bool outgoing, void *user);
+void capture_socket(pcap_dumper_t *dumper, const void *buf, size_t len,
+ bool outgoing, int eid);
#else
#include <stdio.h>
static inline int capture_init(void)
@@ -54,12 +54,13 @@
}
static inline void capture_binding(struct mctp_pktbuf *pkt __unused,
- void *user __unused)
+ bool outgoing __unused, void *user __unused)
{
}
static inline void capture_socket(pcap_dumper_t *dumper __unused,
- const void *buf __unused, size_t len __unused)
+ const void *buf __unused, size_t len __unused,
+ bool outgoing __unused, int eid __unused)
{
}
#endif