Home
last modified time | relevance | path

Searched refs:nlmsghdr (Results 1 – 25 of 142) sorted by relevance

123456

/linux/tools/testing/selftests/bpf/
H A Dnetlink_helpers.h27 const struct nlmsghdr *inner_nlh);
32 int rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n,
33 struct nlmsghdr **answer)
36 int addattr(struct nlmsghdr *n, int maxlen, int type);
37 int addattr8(struct nlmsghdr *n, int maxlen, int type, __u8 data);
38 int addattr16(struct nlmsghdr *n, int maxlen, int type, __u16 data);
39 int addattr32(struct nlmsghdr *n, int maxlen, int type, __u32 data);
40 int addattr64(struct nlmsghdr *n, int maxlen, int type, __u64 data);
41 int addattrstrz(struct nlmsghdr *n, int maxlen, int type, const char *data);
42 int addattr_l(struct nlmsghdr *n, int maxlen, int type, const void *data, int alen);
[all …]
H A Dnetlink_helpers.c141 static void rtnl_talk_error(struct nlmsghdr *h, struct nlmsgerr *err, in rtnl_talk_error()
149 size_t iovlen, struct nlmsghdr **answer, in __rtnl_talk_iov()
161 struct nlmsghdr *h; in __rtnl_talk_iov()
192 for (h = (struct nlmsghdr *)buf; status >= sizeof(*h); ) { in __rtnl_talk_iov()
212 h = (struct nlmsghdr *)((char *)h + NLMSG_ALIGN(len)); in __rtnl_talk_iov()
239 *answer = (struct nlmsghdr *)buf; in __rtnl_talk_iov()
245 *answer = (struct nlmsghdr *)buf; in __rtnl_talk_iov()
250 h = (struct nlmsghdr *)((char *)h + NLMSG_ALIGN(len)); in __rtnl_talk_iov()
264 static int __rtnl_talk(struct rtnl_handle *rtnl, struct nlmsghdr *n, in __rtnl_talk()
265 struct nlmsghdr **answer, bool show_rtnl_err, in __rtnl_talk()
[all …]
/linux/tools/net/ynl/lib/
H A Dynl-priv.h42 typedef int (*ynl_parse_cb_t)(const struct nlmsghdr *nlh,
101 struct nlmsghdr *ynl_msg_start_req(struct ynl_sock *ys, __u32 id, __u16 flags);
102 struct nlmsghdr *ynl_msg_start_dump(struct ynl_sock *ys, __u32 id);
104 struct nlmsghdr *
106 struct nlmsghdr *
136 int ynl_exec(struct ynl_sock *ys, struct nlmsghdr *req_nlh,
138 int ynl_exec_dump(struct ynl_sock *ys, struct nlmsghdr *req_nlh,
148 static inline struct nlmsghdr *ynl_nlmsg_put_header(void *buf) in ynl_nlmsg_put_header()
150 struct nlmsghdr *nlh = (struct nlmsghdr *)buf; in ynl_nlmsg_put_header()
158 static inline unsigned int ynl_nlmsg_data_len(const struct nlmsghdr *nlh) in ynl_nlmsg_data_len()
[all …]
H A Dynl.c206 ynl_ext_ack_check(struct ynl_sock *ys, const struct nlmsghdr *nlh, in ynl_ext_ack_check()
264 off -= sizeof(struct nlmsghdr); in ynl_ext_ack_check()
291 off -= sizeof(struct nlmsghdr); in ynl_ext_ack_check()
326 ynl_cb_error(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) in ynl_cb_error()
345 static int ynl_cb_done(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) in ynl_cb_done()
471 struct nlmsghdr *ynl_msg_start(struct ynl_sock *ys, __u32 id, __u16 flags) in ynl_msg_start()
473 struct nlmsghdr *nlh; in ynl_msg_start()
491 static int ynl_msg_end(struct ynl_sock *ys, struct nlmsghdr *nlh) in ynl_msg_end()
509 struct nlmsghdr *
514 struct nlmsghdr *nl in ynl_gemsg_start()
[all...]
/linux/tools/include/uapi/linux/
H A Dnetlink.h44 struct nlmsghdr { struct
91 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
96 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
97 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
98 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
111 struct nlmsghdr msg;
/linux/tools/testing/selftests/net/
H A Dnetlink-dumps.c46 const struct nlmsghdr *nlh; in nl_get_extack()
51 nlh = (struct nlmsghdr *)&buf[n - rem]; in nl_get_extack()
91 struct nlmsghdr nlhdr;
155 ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr)); in TEST()
167 sizeof(struct nlmsghdr) + sizeof(struct ndmsg)); in TEST()
174 struct nlmsghdr nlhdr;
212 ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr)); in TEST()
215 ASSERT_GE(n, (ssize_t)sizeof(struct nlmsghdr)); in TEST()
H A Dtap.c33 static struct rtattr *rtattr_add(struct nlmsghdr *nh, unsigned short type, in rtattr_add()
44 static struct rtattr *rtattr_begin(struct nlmsghdr *nh, unsigned short type) in rtattr_begin()
49 static void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr) in rtattr_end()
56 static struct rtattr *rtattr_add_str(struct nlmsghdr *nh, unsigned short type, in rtattr_add_str()
68 static struct rtattr *rtattr_add_any(struct nlmsghdr *nh, unsigned short type, in rtattr_add_any()
78 int (*fill_rtattr)(struct nlmsghdr *nh), in dev_create()
79 int (*fill_info_data)(struct nlmsghdr *nh)) in dev_create()
82 struct nlmsghdr nh; in dev_create()
140 struct nlmsghdr nh; in dev_delete()
171 static int macvtap_fill_rtattr(struct nlmsghdr *nh) in macvtap_fill_rtattr()
/linux/tools/testing/selftests/net/tcp_ao/lib/
H A Dnetlink.c37 struct nlmsghdr hdr; in netlink_check_answer()
39 struct nlmsghdr orig_msg; in netlink_check_answer()
60 static inline struct rtattr *rtattr_hdr(struct nlmsghdr *nh) in rtattr_hdr()
65 static int rtattr_pack(struct nlmsghdr *nh, size_t req_sz, in rtattr_pack()
85 static struct rtattr *_rtattr_begin(struct nlmsghdr *nh, size_t req_sz, in _rtattr_begin()
96 static inline struct rtattr *rtattr_begin(struct nlmsghdr *nh, size_t req_sz, in rtattr_begin()
102 static inline void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr) in rtattr_end()
109 static int veth_pack_peerb(struct nlmsghdr *nh, size_t req_sz, in veth_pack_peerb()
139 struct nlmsghdr nh; in __add_veth()
202 struct nlmsghdr nh; in __ip_addr_add()
[all …]
/linux/include/uapi/linux/
H A Dnetlink.h52 struct nlmsghdr { struct
100 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr)))
105 (struct nlmsghdr *)(((char *)(nlh)) + \
107 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
108 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
121 struct nlmsghdr msg;
/linux/tools/testing/selftests/net/netfilter/
H A Dnf_queue.c77 static int queue_cb(const struct nlmsghdr *nlh, void *data) in queue_cb()
120 static struct nlmsghdr *
123 struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); in nfq_build_cfg_request()
144 static struct nlmsghdr *
147 struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); in nfq_build_cfg_params()
167 static struct nlmsghdr *
174 struct nlmsghdr *nlh; in nfq_build_verdict()
212 struct nlmsghdr *nlh; in open_queue()
274 struct nlmsghdr *nlh; in mainloop()
H A Dconntrack_dump_flush.c20 static int build_cta_tuple_v4(struct nlmsghdr *nlh, int type, in build_cta_tuple_v4()
50 static int build_cta_tuple_v6(struct nlmsghdr *nlh, int type, in build_cta_tuple_v6()
80 static int build_cta_proto(struct nlmsghdr *nlh) in build_cta_proto()
101 static int conntrack_data_insert(struct mnl_socket *sock, struct nlmsghdr *nlh, in conntrack_data_insert()
105 struct nlmsghdr *rplnlh; in conntrack_data_insert()
149 struct nlmsghdr *nlh; in conntrack_data_generate_v4()
183 struct nlmsghdr *nlh; in conntrack_data_generate_v6()
213 static int count_entries(const struct nlmsghdr *nlh, void *data) in count_entries()
222 struct nlmsghdr *nlh, *rplnlh; in conntracK_count_zone()
269 struct nlmsghdr *nlh, *rplnlh; in conntrack_flush_zone()
/linux/include/net/
H A Dnetlink.h494 struct nlmsghdr *nlh;
536 int (*cb)(struct sk_buff *, struct nlmsghdr *,
608 static inline void *nlmsg_data(const struct nlmsghdr *nlh) in nlmsg_data()
617 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len()
630 static inline void *nlmsg_payload(const struct nlmsghdr *nlh, size_t len) in nlmsg_payload()
643 static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh, in nlmsg_attrdata()
655 static inline int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) in nlmsg_attrlen()
665 static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) in nlmsg_ok()
667 return (remaining >= (int) sizeof(struct nlmsghdr) && in nlmsg_ok()
668 nlh->nlmsg_len >= sizeof(struct nlmsghdr) && in nlmsg_ok()
[all …]
H A Drtnetlink.h9 typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *,
64 static inline int rtnl_msg_family(const struct nlmsghdr *nlh) in rtnl_msg_family()
252 int rtnl_delete_link(struct net_device *dev, u32 portid, const struct nlmsghdr *nlh);
254 u32 portid, const struct nlmsghdr *nlh);
/linux/include/linux/
H A Dsock_diag.h12 struct nlmsghdr;
18 int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
20 int (*destroy)(struct sk_buff *skb, struct nlmsghdr *nlh);
28 int (*fn)(struct sk_buff *skb, struct nlmsghdr *nlh);
H A Drtnetlink.h22 u32 group, const struct nlmsghdr *nlh, gfp_t flags);
29 u32 portid, const struct nlmsghdr *nlh);
36 const struct nlmsghdr *nlh);
38 gfp_t flags, u32 portid, const struct nlmsghdr *nlh);
/linux/tools/testing/selftests/net/mptcp/
H A Dpm_nl_ctl.c50 struct nlmsghdr *nh = (void *)data; in init_genl_req()
66 static int nl_error(struct nlmsghdr *nh) in nl_error()
104 u_int8_t buffer[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + in capture_events()
108 struct nlmsghdr *nh; in capture_events()
123 res_len = NLMSG_ALIGN(sizeof(struct nlmsghdr)) + in capture_events()
135 nh = (struct nlmsghdr *)buffer; in capture_events()
218 static int do_nl_req(int fd, struct nlmsghdr *nh, int len, int max) in do_nl_req()
255 static int genl_parse_getfamily(struct nlmsghdr *nlh, int *pm_family, in genl_parse_getfamily()
326 char data[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + in resolve_mptcp_pm_netlink()
329 struct nlmsghdr *nh; in resolve_mptcp_pm_netlink()
[all …]
/linux/include/linux/netfilter/
H A Dnfnetlink.h13 const struct nlmsghdr *nlh;
67 static inline void nfnl_fill_hdr(struct nlmsghdr *nlh, u8 family, u8 version, in nfnl_fill_hdr()
78 static inline struct nlmsghdr *nfnl_msg_put(struct sk_buff *skb, u32 portid, in nfnl_msg_put()
83 struct nlmsghdr *nlh; in nfnl_msg_put()
/linux/samples/bpf/
H A Dxdp_router_ipv4_user.c63 struct nlmsghdr *nh; in recv_msg()
73 nh = (struct nlmsghdr *)buf_ptr; in recv_msg()
91 static void read_route(struct nlmsghdr *nh, int nll) in read_route()
254 struct nlmsghdr *nh; in get_route_table()
262 struct nlmsghdr nl; in get_route_table()
306 nh = (struct nlmsghdr *)buf; in get_route_table()
316 static void read_arp(struct nlmsghdr *nh, int nll) in read_arp()
391 struct nlmsghdr *nh; in get_arp_table()
398 struct nlmsghdr nl; in get_arp_table()
441 nh = (struct nlmsghdr *)buf; in get_arp_table()
[all …]
/linux/include/rdma/
H A Drdma_netlink.h18 int (*doit)(struct sk_buff *skb, struct nlmsghdr *nlh,
65 void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq,
76 int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
/linux/tools/testing/selftests/bpf/prog_tests/
H A Dxfrm_info.c171 static struct rtattr *rtattr_add(struct nlmsghdr *nh, unsigned short type, in rtattr_add()
182 static struct rtattr *rtattr_add_str(struct nlmsghdr *nh, unsigned short type, in rtattr_add_str()
191 static struct rtattr *rtattr_begin(struct nlmsghdr *nh, unsigned short type) in rtattr_begin()
196 static void rtattr_end(struct nlmsghdr *nh, struct rtattr *attr) in rtattr_end()
206 struct nlmsghdr nh; in setup_xfrmi_external_dev()
213 struct nlmsghdr *nh; in setup_xfrmi_external_dev()
/linux/tools/testing/selftests/connector/
H A Dproc_filter.c21 #define NL_MESSAGE_SIZE (sizeof(struct nlmsghdr) + sizeof(struct cn_msg) + \
23 #define NL_MESSAGE_SIZE_NF (sizeof(struct nlmsghdr) + sizeof(struct cn_msg) + \
43 struct nlmsghdr *hdr; in send_message()
46 hdr = (struct nlmsghdr *)buff; in send_message()
136 struct nlmsghdr *hdr; in handle_packet()
138 hdr = (struct nlmsghdr *)buff; in handle_packet()
/linux/samples/connector/
H A Ducon.c48 struct nlmsghdr *nlh; in netlink_send()
56 nlh = (struct nlmsghdr *)buf; in netlink_send()
102 struct nlmsghdr *reply; in main()
214 reply = (struct nlmsghdr *)buf; in main()
/linux/Documentation/userspace-api/netlink/
H A Dintro.rst104 A Netlink message always starts with struct nlmsghdr, which is followed
112 struct nlmsghdr {
126 In Classic Netlink :c:member:`nlmsghdr.nlmsg_type` used to identify
149 are initiated by the user. :c:member:`nlmsghdr.nlmsg_flags` should
155 :c:member:`nlmsghdr.nlmsg_seq` should be a set to a monotonically
160 :c:member:`nlmsghdr.nlmsg_seq` of ``0``.
162 :c:member:`nlmsghdr.nlmsg_pid` is the Netlink equivalent of an address.
176 As previously mentioned :c:member:`nlmsghdr.nlmsg_type` carries
197 | struct nlmsghdr - response header |
201 | struct nlmsghdr - original request header |
[all …]
/linux/drivers/infiniband/core/
H A Dnetlink.c131 void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, in ibnl_put_msg()
141 int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, in ibnl_put_attr()
152 static int rdma_nl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, in rdma_nl_rcv_msg()
208 struct nlmsghdr *, in rdma_nl_rcv_skb() argument
212 struct nlmsghdr *nlh; in rdma_nl_rcv_skb()
/linux/tools/bpf/bpftool/
H A Dnet.c107 typedef int (*__dump_nlmsg_t)(struct nlmsghdr *nlmsg, dump_nlmsg_t, void *cookie);
158 struct nlmsghdr *nh; in netlink_recv()
173 for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, (unsigned int)len); in netlink_recv()
210 static int __dump_class_nlmsg(struct nlmsghdr *nlh, in __dump_class_nlmsg()
230 struct nlmsghdr nlh; in netlink_get_class()
249 static int __dump_qdisc_nlmsg(struct nlmsghdr *nlh, in __dump_qdisc_nlmsg()
269 struct nlmsghdr nlh; in netlink_get_qdisc()
288 static int __dump_filter_nlmsg(struct nlmsghdr *nlh, in __dump_filter_nlmsg()
308 struct nlmsghdr nlh; in netlink_get_filter()
328 static int __dump_link_nlmsg(struct nlmsghdr *nlh, in __dump_link_nlmsg()
[all …]

123456