On Thursday 28 April 2016 22:37:21 Andrew Lunn wrote:
From: Matthias Schiffer mschiffer@universe-factory.net
debugfs is currently severely broken virtually everywhere in the kernel where files are dynamically added and removed (see http://lkml.iu.edu/hypermail/linux/kernel/1506.1/02196.html for some details). In addition to that, debugfs is not namespace-aware.
Also, the debugfs interface will try to fix the whole list of originators/ TT entries into a single buffer. The situation has improved in recent kernels,as the seq_file infrastructure will fall back to vmalloc now when kmalloc fails. Still, converting all information to text and potentially retrying multiple times until the buffer is big enough is very inefficient.
This commit adds generic infrastructur for the netlink interface to batman-adv and implements the following command:
- BATADV_CMD_GET_ROUTING_ALGOS: will return the list of supported routing algorithms
- BATADV_CMD_GET_MESH_INFO: will return basic information about a batman-adv softif (name, index and MAC address for both the softif and the primary hardif; routing algorithm; batman-adv version)
- BATADV_CMD_GET_HARDIFS: will return the list of hardifs (including index, name and MAC address) of all hardifs for a given softif
Signed-off-by: Matthias Schiffer mschiffer@universe-factory.net
Makefile | 1 + include/uapi/linux/batman_adv.h | 49 ++++++++ net/batman-adv/Makefile | 1 + net/batman-adv/main.c | 48 ++++++++ net/batman-adv/main.h | 1 + net/batman-adv/netlink.c | 251 ++++++++++++++++++++++++++++++++++++++++ net/batman-adv/netlink.h | 36 ++++++ 7 files changed, 387 insertions(+) create mode 100644 include/uapi/linux/batman_adv.h create mode 100644 net/batman-adv/netlink.c create mode 100644 net/batman-adv/netlink.h
You can find the missing includes in the attached patch
Kind regards, Sven