[v3,1/2] batctl: netlink: Make netlink_query_common non-static
Commit Message
With a view to the introduction of a JSON debug support the
netlink_query_common can be used for simple query of batman-adv
atttirubtes without any filters.
Signed-off-by: Alexander Sarmanow <asarmanow@gmail.com>
---
netlink.c | 12 ++++--------
netlink.h | 8 ++++++++
2 files changed, 12 insertions(+), 8 deletions(-)
@@ -29,10 +29,6 @@
#include "functions.h"
#include "main.h"
-struct nlquery_opts {
- int err;
-};
-
struct nla_policy batadv_netlink_policy[NUM_BATADV_ATTR] = {
[BATADV_ATTR_VERSION] = {
.type = NLA_STRING,
@@ -623,10 +619,10 @@ static int nlquery_stop_cb(struct nl_msg *msg, void *arg)
return NL_STOP;
}
-static int netlink_query_common(struct state *state,
- unsigned int mesh_ifindex, uint8_t nl_cmd,
- nl_recvmsg_msg_cb_t callback, int flags,
- struct nlquery_opts *query_opts)
+int netlink_query_common(struct state *state,
+ unsigned int mesh_ifindex, uint8_t nl_cmd,
+ nl_recvmsg_msg_cb_t callback, int flags,
+ struct nlquery_opts *query_opts)
{
struct nl_msg *msg;
struct nl_cb *cb;
@@ -25,6 +25,10 @@ struct print_opts {
uint8_t nl_cmd;
};
+struct nlquery_opts {
+ int err;
+};
+
struct ether_addr;
int netlink_create(struct state *state);
@@ -54,6 +58,10 @@ int netlink_print_error(struct sockaddr_nl *nla, struct nlmsgerr *nlerr,
void *arg);
void netlink_print_remaining_header(struct print_opts *opts);
+int netlink_query_common(struct state *state, unsigned int mesh_ifindex,
+ uint8_t nl_cmd, nl_recvmsg_msg_cb_t callback, int flags,
+ struct nlquery_opts *query_opts);
+
extern char algo_name_buf[256];
extern int last_err;
extern int64_t mcast_flags;