Commit 434fe9d4 authored by Andrey Ignatov's avatar Andrey Ignatov Committed by Daniel Borkmann
Browse files

libbpf: Move __dump_nlmsg_t from API to implementation



This typedef is used only by implementation in netlink.c. Nothing uses
it in public API. Move it to netlink.c.

Signed-off-by: default avatarAndrey Ignatov <rdna@fb.com>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent d71019b5
Loading
Loading
Loading
Loading
+0 −3
Original line number Original line Diff line number Diff line
@@ -304,11 +304,8 @@ int bpf_perf_event_read_simple(void *mem, unsigned long size,
			       void **buf, size_t *buf_len,
			       void **buf, size_t *buf_len,
			       bpf_perf_event_print_t fn, void *priv);
			       bpf_perf_event_print_t fn, void *priv);


struct nlmsghdr;
struct nlattr;
struct nlattr;
typedef int (*dump_nlmsg_t)(void *cookie, void *msg, struct nlattr **tb);
typedef int (*dump_nlmsg_t)(void *cookie, void *msg, struct nlattr **tb);
typedef int (*__dump_nlmsg_t)(struct nlmsghdr *nlmsg, dump_nlmsg_t,
			      void *cookie);
int bpf_netlink_open(unsigned int *nl_pid);
int bpf_netlink_open(unsigned int *nl_pid);
int nl_get_link(int sock, unsigned int nl_pid, dump_nlmsg_t dump_link_nlmsg,
int nl_get_link(int sock, unsigned int nl_pid, dump_nlmsg_t dump_link_nlmsg,
		void *cookie);
		void *cookie);
+3 −0
Original line number Original line Diff line number Diff line
@@ -18,6 +18,9 @@
#define SOL_NETLINK 270
#define SOL_NETLINK 270
#endif
#endif


typedef int (*__dump_nlmsg_t)(struct nlmsghdr *nlmsg, dump_nlmsg_t,
			      void *cookie);

int bpf_netlink_open(__u32 *nl_pid)
int bpf_netlink_open(__u32 *nl_pid)
{
{
	struct sockaddr_nl sa;
	struct sockaddr_nl sa;