From 20a5e15443bfbbb7e6624a754832cdce19d462a0 Mon Sep 17 00:00:00 2001 From: Vadim Kochan Date: Thu, 4 Aug 2016 19:30:19 +0300 Subject: netsniff-ng: Allow to compile without libnl One might not want to install libnl just for sniffing packets, for example if netsniff-ng will be compiled on embedded or switch system. Hide libnl dependend code if CONFIG_LIBNL=0. In case the `--rfraw' option is used, the user will get a panic message. In case of netlink messages being sniffed, they will not be dissected. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- dissector_netlink.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'dissector_netlink.h') diff --git a/dissector_netlink.h b/dissector_netlink.h index 9d30e56..240ff1c 100644 --- a/dissector_netlink.h +++ b/dissector_netlink.h @@ -7,6 +7,7 @@ #ifndef DISSECTOR_NETLINK_H #define DISSECTOR_NETLINK_H +#include "config.h" #include "protos.h" extern void dissector_init_netlink(int fnttype); @@ -14,7 +15,11 @@ extern void dissector_cleanup_netlink(void); static inline struct protocol *dissector_get_netlink_entry_point(void) { +#ifdef HAVE_LIBNL return &nlmsg_ops; +#else + return &none_ops; +#endif } static inline struct protocol *dissector_get_netlink_exit_point(void) -- cgit v1.2.3-54-g00ecf