Searched refs:nlh (Results 1 - 25 of 201) sorted by relevance

123456789

/linux-master/tools/testing/selftests/netfilter/
H A Dconntrack_dump_flush.c20 static int build_cta_tuple_v4(struct nlmsghdr *nlh, int type, argument
26 nest = mnl_attr_nest_start(nlh, type);
30 nest_ip = mnl_attr_nest_start(nlh, CTA_TUPLE_IP);
33 mnl_attr_put_u32(nlh, CTA_IP_V4_SRC, src_ip);
34 mnl_attr_put_u32(nlh, CTA_IP_V4_DST, dst_ip);
35 mnl_attr_nest_end(nlh, nest_ip);
37 nest_proto = mnl_attr_nest_start(nlh, CTA_TUPLE_PROTO);
40 mnl_attr_put_u8(nlh, CTA_PROTO_NUM, 6);
41 mnl_attr_put_u16(nlh, CTA_PROTO_SRC_PORT, htons(src_port));
42 mnl_attr_put_u16(nlh, CTA_PROTO_DST_POR
48 build_cta_tuple_v6(struct nlmsghdr *nlh, int type, struct in6_addr src_ip, struct in6_addr dst_ip, uint16_t src_port, uint16_t dst_port) argument
76 build_cta_proto(struct nlmsghdr *nlh) argument
95 conntrack_data_insert(struct mnl_socket *sock, struct nlmsghdr *nlh, uint16_t zone) argument
143 struct nlmsghdr *nlh; local
177 struct nlmsghdr *nlh; local
207 count_entries(const struct nlmsghdr *nlh, void *data) argument
215 struct nlmsghdr *nlh, *rplnlh; local
262 struct nlmsghdr *nlh, *rplnlh; local
[all...]
H A Dnf-queue.c77 static int queue_cb(const struct nlmsghdr *nlh, void *data) argument
85 mnl_attr_parse(nlh, sizeof(struct nfgenmsg), parse_attr_cb, tb);
123 struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); local
130 nlh->nlmsg_type = (NFNL_SUBSYS_QUEUE << 8) | NFQNL_MSG_CONFIG;
131 nlh->nlmsg_flags = NLM_F_REQUEST;
133 nfg = mnl_nlmsg_put_extra_header(nlh, sizeof(*nfg));
139 mnl_attr_put(nlh, NFQA_CFG_CMD, sizeof(cmd), &cmd);
141 return nlh;
147 struct nlmsghdr *nlh = mnl_nlmsg_put_header(buf); local
154 nlh
174 struct nlmsghdr *nlh; local
212 struct nlmsghdr *nlh; local
274 struct nlmsghdr *nlh; local
[all...]
/linux-master/drivers/staging/gdm724x/
H A Dnetlink_k.c20 #define ND_NLMSG_DATA(nlh) ((void *)((char *)NLMSG_DATA(nlh) + \
23 #define ND_NLMSG_R_LEN(nlh) ((nlh)->nlmsg_len - ND_IFINDEX_LEN)
24 #define ND_NLMSG_IFIDX(nlh) NLMSG_DATA(nlh)
31 struct nlmsghdr *nlh; local
47 nlh = (struct nlmsghdr *)skb->data;
49 if (skb->len < nlh->nlmsg_len || nlh
97 struct nlmsghdr *nlh; local
[all...]
/linux-master/drivers/scsi/
H A Dscsi_netlink.c34 struct nlmsghdr *nlh; local
42 nlh = nlmsg_hdr(skb);
43 if ((nlh->nlmsg_len < (sizeof(*nlh) + sizeof(*hdr))) ||
44 (skb->len < nlh->nlmsg_len)) {
50 rlen = NLMSG_ALIGN(nlh->nlmsg_len);
54 if (nlh->nlmsg_type != SCSI_TRANSPORT_MSG) {
59 hdr = nlmsg_data(nlh);
71 if (nlh->nlmsg_len < (sizeof(*nlh)
[all...]
/linux-master/tools/net/ynl/lib/
H A Dynl-priv.h41 typedef int (*ynl_parse_cb_t)(const struct nlmsghdr *nlh,
142 struct nlmsghdr *nlh = buf; local
144 memset(nlh, 0, sizeof(*nlh));
145 nlh->nlmsg_len = NLMSG_HDRLEN;
147 return nlh;
150 static inline unsigned int ynl_nlmsg_data_len(const struct nlmsghdr *nlh) argument
152 return nlh->nlmsg_len - NLMSG_HDRLEN;
155 static inline void *ynl_nlmsg_data(const struct nlmsghdr *nlh) argument
157 return (unsigned char *)nlh
161 ynl_nlmsg_data_offset(const struct nlmsghdr *nlh, unsigned int offset) argument
166 ynl_nlmsg_end_addr(const struct nlmsghdr *nlh) argument
172 ynl_nlmsg_put_extra_header(struct nlmsghdr *nlh, unsigned int size) argument
245 __ynl_attr_put_overflow(struct nlmsghdr *nlh, size_t size) argument
260 ynl_attr_nest_start(struct nlmsghdr *nlh, unsigned int attr_type) argument
275 ynl_attr_nest_end(struct nlmsghdr *nlh, struct nlattr *attr) argument
281 ynl_attr_put(struct nlmsghdr *nlh, unsigned int attr_type, const void *value, size_t size) argument
299 ynl_attr_put_str(struct nlmsghdr *nlh, unsigned int attr_type, const char *str) argument
369 ynl_attr_put_s8(struct nlmsghdr *nlh, unsigned int attr_type, __s8 value) argument
375 ynl_attr_put_s16(struct nlmsghdr *nlh, unsigned int attr_type, __s16 value) argument
381 ynl_attr_put_s32(struct nlmsghdr *nlh, unsigned int attr_type, __s32 value) argument
387 ynl_attr_put_s64(struct nlmsghdr *nlh, unsigned int attr_type, __s64 value) argument
393 ynl_attr_put_u8(struct nlmsghdr *nlh, unsigned int attr_type, __u8 value) argument
399 ynl_attr_put_u16(struct nlmsghdr *nlh, unsigned int attr_type, __u16 value) argument
405 ynl_attr_put_u32(struct nlmsghdr *nlh, unsigned int attr_type, __u32 value) argument
411 ynl_attr_put_u64(struct nlmsghdr *nlh, unsigned int attr_type, __u64 value) argument
441 ynl_attr_put_uint(struct nlmsghdr *nlh, __u16 type, __u64 data) argument
450 ynl_attr_put_sint(struct nlmsghdr *nlh, __u16 type, __s64 data) argument
[all...]
H A Dynl.c140 ynl_ext_ack_check(struct ynl_sock *ys, const struct nlmsghdr *nlh, argument
149 if (!(nlh->nlmsg_flags & NLM_F_ACK_TLVS)) {
154 ynl_attr_for_each(attr, nlh, hlen) {
194 start = ynl_nlmsg_data_offset(ys->nlh, ys->family->hdr_len);
195 end = ynl_nlmsg_end_addr(ys->nlh);
219 start = ynl_nlmsg_data_offset(ys->nlh, ys->family->hdr_len);
220 end = ynl_nlmsg_end_addr(ys->nlh);
260 ynl_cb_error(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
262 const struct nlmsgerr *err = ynl_nlmsg_data(nlh);
271 if (!(nlh
279 ynl_cb_done(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
398 struct nlmsghdr *nlh; local
416 ynl_msg_end(struct ynl_sock *ys, struct nlmsghdr *nlh) argument
439 struct nlmsghdr *nlh; local
477 ynl_cb_null(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
489 const struct nlmsghdr *nlh; local
595 ynl_get_family_info_cb(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
628 struct nlmsghdr *nlh; local
789 ynl_ntf_parse(struct ynl_sock *ys, const struct nlmsghdr *nlh) argument
827 ynl_ntf_trampoline(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
864 ynl_check_alien(struct ynl_sock *ys, const struct nlmsghdr *nlh, __u32 rsp_cmd) argument
882 ynl_req_trampoline(const struct nlmsghdr *nlh, struct ynl_parse_arg *yarg) argument
915 ynl_dump_trampoline(const struct nlmsghdr *nlh, struct ynl_parse_arg *data) argument
[all...]
/linux-master/security/selinux/
H A Dnetlink.c43 static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data) argument
47 struct selnl_msg_setenforce *msg = nlmsg_data(nlh);
55 struct selnl_msg_policyload *msg = nlmsg_data(nlh);
72 struct nlmsghdr *nlh; local
81 nlh = nlmsg_put(skb, 0, 0, msgtype, len, 0);
82 if (!nlh)
84 selnl_add_payload(nlh, len, msgtype, data);
85 nlh->nlmsg_len = skb->tail - tmp;
/linux-master/drivers/infiniband/core/
H A Dnetlink.c131 void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq, argument
134 *nlh = nlmsg_put(skb, 0, seq, RDMA_NL_GET_TYPE(client, op), len, flags);
135 if (!*nlh)
137 return nlmsg_data(*nlh);
141 int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh, argument
145 nlmsg_cancel(skb, nlh);
152 static int rdma_nl_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, argument
155 int type = nlh->nlmsg_type;
181 err = cb_table[op].doit(skb, nlh, extack);
185 if ((nlh
212 struct nlmsghdr *nlh; local
[all...]
H A Diwpm_msg.c67 struct nlmsghdr *nlh; local
75 skb = iwpm_create_nlmsg(RDMA_NL_IWPM_REG_PID, &nlh, nl_client);
80 nlh->nlmsg_seq = iwpm_get_nlmsg_seq();
81 nlmsg_request = iwpm_get_nlmsg_request(nlh->nlmsg_seq, nl_client, GFP_KERNEL);
90 ret = ibnl_put_attr(skb, nlh, sizeof(u32), &msg_seq, IWPM_NLA_REG_PID_SEQ);
93 ret = ibnl_put_attr(skb, nlh, IFNAMSIZ,
97 ret = ibnl_put_attr(skb, nlh, IWPM_DEVNAME_SIZE,
101 ret = ibnl_put_attr(skb, nlh, IWPM_ULIBNAME_SIZE,
106 nlmsg_end(skb, nlh);
147 struct nlmsghdr *nlh; local
230 struct nlmsghdr *nlh; local
317 struct nlmsghdr *nlh; local
[all...]
/linux-master/net/tipc/
H A Ddiag.c53 struct tipc_sock_diag_req *req = nlmsg_data(cb->nlh);
54 struct nlmsghdr *nlh; local
57 nlh = nlmsg_put_answer(skb, cb, SOCK_DIAG_BY_FAMILY, 0,
59 if (!nlh)
67 nlmsg_end(skb, nlh);
/linux-master/net/netfilter/
H A Dnfnetlink.c216 static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, argument
225 if (nlmsg_len(nlh) < sizeof(struct nfgenmsg))
228 type = nlh->nlmsg_type;
256 u8 cb_id = NFNL_MSG_TYPE(nlh->nlmsg_type);
258 struct nlattr *attr = (void *)nlh + min_len;
259 int attrlen = nlh->nlmsg_len - min_len;
264 .nlh = nlh,
265 .nfmsg = nlmsg_data(nlh),
318 struct nlmsghdr *nlh; member in struct:nfnl_err
323 nfnl_err_add(struct list_head *list, struct nlmsghdr *nlh, int err, const struct netlink_ext_ack *extack) argument
371 nfnetlink_rcv_batch(struct sk_buff *skb, struct nlmsghdr *nlh, u16 subsys_id, u32 genid) argument
604 nfnetlink_rcv_skb_batch(struct sk_buff *skb, struct nlmsghdr *nlh) argument
644 struct nlmsghdr *nlh = nlmsg_hdr(skb); local
[all...]
/linux-master/net/phonet/
H A Dpn_netlink.c51 static int addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, argument
69 err = nlmsg_parse_deprecated(nlh, sizeof(*ifm), tb, IFA_MAX,
74 ifm = nlmsg_data(nlh);
86 if (nlh->nlmsg_type == RTM_NEWADDR)
91 phonet_address_notify(nlh->nlmsg_type, dev, pnaddr);
99 struct nlmsghdr *nlh; local
101 nlh = nlmsg_put(skb, portid, seq, event, sizeof(*ifm), 0);
102 if (nlh == NULL)
105 ifm = nlmsg_data(nlh);
113 nlmsg_end(skb, nlh);
164 struct nlmsghdr *nlh; local
218 route_doit(struct sk_buff *skb, struct nlmsghdr *nlh, struct netlink_ext_ack *extack) argument
[all...]
/linux-master/include/linux/netfilter/
H A Dnfnetlink.h13 const struct nlmsghdr *nlh; member in struct:nfnl_info
67 static inline void nfnl_fill_hdr(struct nlmsghdr *nlh, u8 family, u8 version, argument
72 nfmsg = nlmsg_data(nlh);
83 struct nlmsghdr *nlh; local
85 nlh = nlmsg_put(skb, portid, seq, type, sizeof(struct nfgenmsg), flags);
86 if (!nlh)
89 nfnl_fill_hdr(nlh, family, version, res_id);
91 return nlh;
/linux-master/tools/include/uapi/linux/
H A Dnetlink.h94 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0)))
95 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
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) && \
99 (nlh)->nlmsg_len <= (len))
100 #define NLMSG_PAYLOAD(nlh,le
[all...]
/linux-master/include/uapi/linux/
H A Dnetlink.h103 #define NLMSG_DATA(nlh) ((void *)(((char *)nlh) + NLMSG_HDRLEN))
104 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \
105 (struct nlmsghdr *)(((char *)(nlh)) + \
106 NLMSG_ALIGN((nlh)->nlmsg_len)))
107 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \
108 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
109 (nlh)->nlmsg_len <= (len))
110 #define NLMSG_PAYLOAD(nlh,le
[all...]
/linux-master/tools/testing/selftests/net/af_unix/
H A Ddiag_uid.c81 struct nlmsghdr nlh; member in struct:__anon219
84 .nlh = {
151 struct nlmsghdr *nlh; local
157 nlh = (struct nlmsghdr *)buf;
158 ASSERT_NE(NLMSG_OK(nlh, ret), 0);
159 ASSERT_EQ(nlh->nlmsg_type, SOCK_DIAG_BY_FAMILY);
161 render_response(_metadata, NLMSG_DATA(nlh), nlh->nlmsg_len);
163 nlh = NLMSG_NEXT(nlh, re
[all...]
/linux-master/net/batman-adv/
H A Dnetlink.h18 int batadv_netlink_get_ifindex(const struct nlmsghdr *nlh, int attrtype);
/linux-master/samples/connector/
H A Ducon.c48 struct nlmsghdr *nlh; local
56 nlh = (struct nlmsghdr *)buf;
57 nlh->nlmsg_seq = seq++;
58 nlh->nlmsg_pid = getpid();
59 nlh->nlmsg_type = NLMSG_DONE;
60 nlh->nlmsg_len = size;
61 nlh->nlmsg_flags = 0;
63 m = NLMSG_DATA(nlh);
70 err = send(s, nlh, size, 0);
/linux-master/tools/lib/bpf/
H A Dnlattr.c81 static inline int nlmsg_len(const struct nlmsghdr *nlh) argument
83 return nlh->nlmsg_len - NLMSG_HDRLEN;
158 int libbpf_nla_dump_errormsg(struct nlmsghdr *nlh) argument
170 if (!(nlh->nlmsg_flags & NLM_F_ACK_TLVS))
173 err = (struct nlmsgerr *)NLMSG_DATA(nlh);
177 if (!(nlh->nlmsg_flags & NLM_F_CAPPED))
181 alen = (void *)nlh + nlh->nlmsg_len - (void *)attr;
/linux-master/include/net/
H A Dnetlink.h22 * nlmsg_data(nlh)---^ ^
23 * nlmsg_next(nlh)-----------------------+
26 * <---------------------- nlmsg_len(nlh) --------------------->
27 * <------ hdrlen ------> <- nlmsg_attrlen(nlh, hdrlen) ->
31 * nlmsg_attrdata(nlh, hdrlen)---^
57 * nlmsg_data(nlh) head of message payload
58 * nlmsg_len(nlh) length of message payload
59 * nlmsg_attrdata(nlh, hdrlen) head of attributes data
60 * nlmsg_attrlen(nlh, hdrlen) length of attributes data
63 * nlmsg_ok(nlh, remainin
477 struct nlmsghdr *nlh; member in struct:nl_info
591 nlmsg_data(const struct nlmsghdr *nlh) argument
600 nlmsg_len(const struct nlmsghdr *nlh) argument
610 nlmsg_attrdata(const struct nlmsghdr *nlh, int hdrlen) argument
622 nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) argument
632 nlmsg_ok(const struct nlmsghdr *nlh, int remaining) argument
648 nlmsg_next(const struct nlmsghdr *nlh, int *remaining) argument
745 __nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy, unsigned int validate, struct netlink_ext_ack *extack) argument
772 nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy, struct netlink_ext_ack *extack) argument
792 nlmsg_parse_deprecated(const struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy, struct netlink_ext_ack *extack) argument
813 nlmsg_parse_deprecated_strict(const struct nlmsghdr *nlh, int hdrlen, struct nlattr *tb[], int maxtype, const struct nla_policy *policy, struct netlink_ext_ack *extack) argument
830 nlmsg_find_attr(const struct nlmsghdr *nlh, int hdrlen, int attrtype) argument
890 nlmsg_validate_deprecated(const struct nlmsghdr *nlh, int hdrlen, int maxtype, const struct nla_policy *policy, struct netlink_ext_ack *extack) argument
911 nlmsg_report(const struct nlmsghdr *nlh) argument
922 nlmsg_seq(const struct nlmsghdr *nlh) argument
1036 nlmsg_end(struct sk_buff *skb, struct nlmsghdr *nlh) argument
1075 nlmsg_cancel(struct sk_buff *skb, struct nlmsghdr *nlh) argument
1179 nl_dump_check_consistent(struct netlink_callback *cb, struct nlmsghdr *nlh) argument
[all...]
/linux-master/include/rdma/
H A Drdma_netlink.h16 int (*doit)(struct sk_buff *skb, struct nlmsghdr *nlh,
56 * @nlh: Pointer to put the header of the new netlink message.
63 void *ibnl_put_msg(struct sk_buff *skb, struct nlmsghdr **nlh, int seq,
68 * @nlh: Header of the netlink message to append the attribute to.
74 int ibnl_put_attr(struct sk_buff *skb, struct nlmsghdr *nlh,
/linux-master/tools/lib/thermal/
H A Dsampling.c13 struct nlmsghdr *nlh = nlmsg_hdr(n); local
14 struct genlmsghdr *genlhdr = genlmsg_hdr(nlh);
19 genlmsg_parse(nlh, 0, attrs, THERMAL_GENL_ATTR_MAX, NULL);
/linux-master/net/ipv6/
H A Daddrlabel.c384 static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh, argument
394 err = nlmsg_parse_deprecated(nlh, sizeof(*ifal), tb, IFAL_MAX,
399 ifal = nlmsg_data(nlh);
415 switch (nlh->nlmsg_type) {
423 nlh->nlmsg_flags & NLM_F_REPLACE);
435 static void ip6addrlbl_putmsg(struct nlmsghdr *nlh, argument
438 struct ifaddrlblmsg *ifal = nlmsg_data(nlh);
453 struct nlmsghdr *nlh = nlmsg_put(skb, portid, seq, event, local
455 if (!nlh)
458 ip6addrlbl_putmsg(nlh,
470 ip6addrlbl_valid_dump_req(const struct nlmsghdr *nlh, struct netlink_ext_ack *extack) argument
497 const struct nlmsghdr *nlh = cb->nlh; local
535 ip6addrlbl_valid_get_req(struct sk_buff *skb, const struct nlmsghdr *nlh, struct nlattr **tb, struct netlink_ext_ack *extack) argument
579 ip6addrlbl_get(struct sk_buff *in_skb, struct nlmsghdr *nlh, struct netlink_ext_ack *extack) argument
[all...]
/linux-master/crypto/
H A Dcrypto_user_base.c159 struct nlmsghdr *nlh; local
163 nlh = nlmsg_put(skb, NETLINK_CB(in_skb).portid, info->nlmsg_seq,
165 if (!nlh) {
170 ualg = nlmsg_data(nlh);
174 nlmsg_cancel(skb, nlh);
178 nlmsg_end(skb, nlh);
234 info.nlmsg_seq = cb->nlh->nlmsg_seq;
260 static int crypto_update_alg(struct sk_buff *skb, struct nlmsghdr *nlh, argument
264 struct crypto_user_alg *p = nlmsg_data(nlh);
296 static int crypto_del_alg(struct sk_buff *skb, struct nlmsghdr *nlh, argument
334 crypto_add_alg(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) argument
382 crypto_del_rng(struct sk_buff *skb, struct nlmsghdr *nlh, struct nlattr **attrs) argument
422 crypto_user_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh, struct netlink_ext_ack *extack) argument
[all...]
/linux-master/drivers/connector/
H A Dconnector.c68 struct nlmsghdr *nlh; local
101 nlh = nlmsg_put(skb, 0, msg->seq, NLMSG_DONE, size, 0);
102 if (!nlh) {
107 data = nlmsg_data(nlh);
136 struct nlmsghdr *nlh; local
144 nlh = nlmsg_hdr(skb);
145 if (nlh->nlmsg_len < NLMSG_HDRLEN + sizeof(struct cn_msg) + msg->len)
200 struct nlmsghdr *nlh; local
204 nlh = nlmsg_hdr(skb);
205 len = nlmsg_len(nlh);
[all...]

Completed in 209 milliseconds

123456789