diff --git a/Makefile b/Makefile
index 60795f7..3fa21f4 100755
--- a/Makefile
+++ b/Makefile
@@ -24,7 +24,20 @@ export CONFIG_BATCTL_BISECT=n
 
 # batctl build
 BINARY_NAME = batctl
-OBJ = main.o bat-hosts.o functions.o sys.o debug.o ping.o traceroute.o tcpdump.o  hash.o debugfs.o ioctl.o list-batman.o translate.o netlink.o
+OBJ += bat-hosts.o
+OBJ += debugfs.o
+OBJ += debug.o
+OBJ += functions.o
+OBJ += hash.o
+OBJ += ioctl.o
+OBJ += list-batman.o
+OBJ += main.o
+OBJ += netlink.o
+OBJ += ping.o
+OBJ += sys.o
+OBJ += tcpdump.o
+OBJ += traceroute.o
+OBJ += translate.o
 OBJ_BISECT = bisect_iv.o
 MANPAGE = man/batctl.8
 
diff --git a/batman_adv.h b/batman_adv.h
index 6a97a2c..4c8e526 100644
--- a/batman_adv.h
+++ b/batman_adv.h
@@ -56,7 +56,44 @@ enum batadv_tt_client_flags {
 	BATADV_TT_CLIENT_TEMP	 = (1 << 11),
 };
 
-enum {
+/**
+ * enum batadv_nl_attrs - batman-adv netlink attributes
+ *
+ * @BATADV_ATTR_UNSPEC: unspecified attribute to catch errors
+ * @BATADV_ATTR_VERSION: batman-adv version string
+ * @BATADV_ATTR_ALGO_NAME: name of routing algorithm
+ * @BATADV_ATTR_MESH_IFINDEX: index of the batman-adv interface
+ * @BATADV_ATTR_MESH_IFNAME: name of the batman-adv interface
+ * @BATADV_ATTR_MESH_ADDRESS: mac address of the batman-adv interface
+ * @BATADV_ATTR_HARD_IFINDEX: index of the non-batman-adv interface
+ * @BATADV_ATTR_HARD_IFNAME: name of the non-batman-adv interface
+ * @BATADV_ATTR_HARD_ADDRESS: mac address of the non-batman-adv interface
+ * @BATADV_ATTR_ACTIVE: TODO
+ * @BATADV_ATTR_ORIG_ADDRESS: TODO
+ * @BATADV_ATTR_TT_ADDRESS: TODO
+ * @BATADV_ATTR_TT_TTVN: TODO
+ * @BATADV_ATTR_TT_LAST_TTVN: TODO
+ * @BATADV_ATTR_TT_CRC32: TODO
+ * @BATADV_ATTR_TT_VID: TODO
+ * @BATADV_ATTR_TT_FLAGS: TODO
+ * @BATADV_ATTR_FLAG_BEST: TODO
+ * @BATADV_ATTR_LAST_SEEN_MSECS: TODO
+ * @BATADV_ATTR_NEIGH_ADDRESS: TODO
+ * @BATADV_ATTR_TQ: TODO
+ * @BATADV_ATTR_THROUGHPUT: TODO
+ * @BATADV_ATTR_BANDWIDTH_UP: TODO
+ * @BATADV_ATTR_BANDWIDTH_DOWN: TODO
+ * @BATADV_ATTR_ROUTER: TODO
+ * @BATADV_ATTR_BLA_OWN: TODO
+ * @BATADV_ATTR_BLA_ADDRESS: TODO
+ * @BATADV_ATTR_BLA_VID: TODO
+ * @BATADV_ATTR_BLA_BACKBONE: TODO
+ * @BATADV_ATTR_BLA_CRC: TODO
+ * @__BATADV_ATTR_AFTER_LAST: internal use
+ * @NUM_BATADV_ATTR: total number of batadv_nl_attrs available
+ * @BATADV_ATTR_MAX: highest attribute number currently defined
+ */
+enum batadv_nl_attrs {
 	BATADV_ATTR_UNSPEC,
 	BATADV_ATTR_VERSION,
 	BATADV_ATTR_ALGO_NAME,
@@ -87,15 +124,32 @@ enum {
 	BATADV_ATTR_BLA_VID,
 	BATADV_ATTR_BLA_BACKBONE,
 	BATADV_ATTR_BLA_CRC,
-	__BATADV_ATTR_MAX,
+	/* add attributes above here, update the policy in netlink.c */
+	__BATADV_ATTR_AFTER_LAST,
+	NUM_BATADV_ATTR = __BATADV_ATTR_AFTER_LAST,
+	BATADV_ATTR_MAX = __BATADV_ATTR_AFTER_LAST - 1
 };
 
-#define BATADV_ATTR_MAX (__BATADV_ATTR_MAX - 1)
-
-enum {
+/**
+ * enum batadv_nl_commands - supported batman-adv netlink commands
+ *
+ * @BATADV_CMD_UNSPEC: unspecified command to catch errors
+ * @BATADV_CMD_GET_MESH_INFO: Query basic information about batman-adv device
+ * @BATADV_CMD_GET_ROUTING_ALGOS: TODO
+ * @BATADV_CMD_GET_HARDIFS: TODO
+ * @BATADV_CMD_GET_TRANSTABLE_LOCAL: TODO
+ * @BATADV_CMD_GET_TRANSTABLE_GLOBAL: TODO
+ * @BATADV_CMD_GET_ORIGINATORS: TODO
+ * @BATADV_CMD_GET_NEIGHBORS: TODO
+ * @BATADV_CMD_GET_GATEWAYS: TODO
+ * @BATADV_CMD_GET_BLA_CLAIM: TODO
+ * @__BATADV_CMD_AFTER_LAST: internal use
+ * @BATADV_CMD_MAX: highest used command number
+ */
+enum batadv_nl_commands {
 	BATADV_CMD_UNSPEC,
-	BATADV_CMD_GET_ROUTING_ALGOS,
 	BATADV_CMD_GET_MESH_INFO,
+	BATADV_CMD_GET_ROUTING_ALGOS,
 	BATADV_CMD_GET_HARDIFS,
 	BATADV_CMD_GET_TRANSTABLE_LOCAL,
 	BATADV_CMD_GET_TRANSTABLE_GLOBAL,
@@ -103,9 +157,9 @@ enum {
 	BATADV_CMD_GET_NEIGHBORS,
 	BATADV_CMD_GET_GATEWAYS,
 	BATADV_CMD_GET_BLA_CLAIM,
-	__BATADV_CMD_MAX,
+	/* add new commands above here */
+	__BATADV_CMD_AFTER_LAST,
+	BATADV_CMD_MAX = __BATADV_CMD_AFTER_LAST - 1
 };
 
-#define BATADV_CMD_MAX (__BATADV_CMD_MAX - 1)
-
 #endif /* _UAPI_LINUX_BATMAN_ADV_H_ */
diff --git a/netlink.c b/netlink.c
index e09166c..de2fd8a 100644
--- a/netlink.c
+++ b/netlink.c
@@ -1,3 +1,27 @@
+/*
+ * Copyright (C) 2009-2016  B.A.T.M.A.N. contributors:
+ *
+ * Andrew Lunn <andrew@lunn.ch>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA
+ *
+ */
+
+#include "netlink.h"
+#include "main.h"
+
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
@@ -23,7 +47,7 @@ struct print_opts {
 	float watch_interval;
 };
 
-static struct nla_policy policy[BATADV_ATTR_MAX+1] = {
+static struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
 	[BATADV_ATTR_VERSION]		= { .type = NLA_STRING },
 	[BATADV_ATTR_ALGO_NAME]		= { .type = NLA_STRING },
 	[BATADV_ATTR_MESH_IFINDEX]	= { .type = NLA_U32 },
@@ -145,7 +169,7 @@ static int info_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -247,7 +271,7 @@ static int routing_algos_callback(struct nl_msg *msg, void *arg __unused)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -336,7 +360,7 @@ static int originators_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -470,7 +494,7 @@ static int neighbors_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -561,7 +585,7 @@ static int transglobal_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -657,7 +681,7 @@ static int translocal_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -757,7 +781,7 @@ static int gateways_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
@@ -836,7 +860,7 @@ static int bla_claim_callback(struct nl_msg *msg, void *arg)
 		return NL_OK;
 
 	if (nla_parse(attrs, BATADV_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
-		      genlmsg_len(ghdr), policy)) {
+		      genlmsg_len(ghdr), batadv_netlink_policy)) {
 		fputs("Received invalid data from kernel.\n", stderr);
 		exit(1);
 	}
