Home
last modified time | relevance | path

Searched refs:nlh (Results 1 – 25 of 67) sorted by relevance

123

/linux-2.6.39/include/net/
Dnetlink.h216 struct nlmsghdr *nlh; member
295 static inline void *nlmsg_data(const struct nlmsghdr *nlh) in nlmsg_data() argument
297 return (unsigned char *) nlh + NLMSG_HDRLEN; in nlmsg_data()
304 static inline int nlmsg_len(const struct nlmsghdr *nlh) in nlmsg_len() argument
306 return nlh->nlmsg_len - NLMSG_HDRLEN; in nlmsg_len()
314 static inline struct nlattr *nlmsg_attrdata(const struct nlmsghdr *nlh, in nlmsg_attrdata() argument
317 unsigned char *data = nlmsg_data(nlh); in nlmsg_attrdata()
326 static inline int nlmsg_attrlen(const struct nlmsghdr *nlh, int hdrlen) in nlmsg_attrlen() argument
328 return nlmsg_len(nlh) - NLMSG_ALIGN(hdrlen); in nlmsg_attrlen()
336 static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining) in nlmsg_ok() argument
[all …]
Dgenetlink.h146 struct nlmsghdr *nlh; in genlmsg_put() local
149 nlh = nlmsg_put(skb, pid, seq, family->id, GENL_HDRLEN + in genlmsg_put()
151 if (nlh == NULL) in genlmsg_put()
154 hdr = nlmsg_data(nlh); in genlmsg_put()
276 struct nlmsghdr *nlh = (struct nlmsghdr *)((unsigned char *)gnlh - in genlmsg_len() local
278 return (nlh->nlmsg_len - GENL_HDRLEN - NLMSG_HDRLEN); in genlmsg_len()
/linux-2.6.39/include/linux/
Dnetlink.h78 #define NLMSG_DATA(nlh) ((void*)(((char*)nlh) + NLMSG_LENGTH(0))) argument
79 #define NLMSG_NEXT(nlh,len) ((len) -= NLMSG_ALIGN((nlh)->nlmsg_len), \ argument
80 (struct nlmsghdr*)(((char*)(nlh)) + NLMSG_ALIGN((nlh)->nlmsg_len)))
81 #define NLMSG_OK(nlh,len) ((len) >= (int)sizeof(struct nlmsghdr) && \ argument
82 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \
83 (nlh)->nlmsg_len <= (len))
84 #define NLMSG_PAYLOAD(nlh,len) ((nlh)->nlmsg_len - NLMSG_SPACE((len))) argument
182 extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err);
219 const struct nlmsghdr *nlh; member
236 struct nlmsghdr *nlh; in __nlmsg_put() local
[all …]
/linux-2.6.39/net/phonet/
Dpn_netlink.c64 static int addr_doit(struct sk_buff *skb, struct nlmsghdr *nlh, void *attr) in addr_doit() argument
78 err = nlmsg_parse(nlh, sizeof(*ifm), tb, IFA_MAX, ifa_phonet_policy); in addr_doit()
82 ifm = nlmsg_data(nlh); in addr_doit()
94 if (nlh->nlmsg_type == RTM_NEWADDR) in addr_doit()
99 phonet_address_notify(nlh->nlmsg_type, dev, pnaddr); in addr_doit()
107 struct nlmsghdr *nlh; in fill_addr() local
109 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*ifm), 0); in fill_addr()
110 if (nlh == NULL) in fill_addr()
113 ifm = nlmsg_data(nlh); in fill_addr()
120 return nlmsg_end(skb, nlh); in fill_addr()
[all …]
/linux-2.6.39/net/dcb/
Ddcbnl.c203 struct nlmsghdr *nlh; in dcbnl_reply() local
210 nlh = NLMSG_NEW(dcbnl_skb, pid, seq, event, sizeof(*dcb), flags); in dcbnl_reply()
212 dcb = NLMSG_DATA(nlh); in dcbnl_reply()
222 nlmsg_end(dcbnl_skb, nlh); in dcbnl_reply()
253 struct nlmsghdr *nlh; in dcbnl_getpfccfg() local
274 nlh = NLMSG_NEW(dcbnl_skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags); in dcbnl_getpfccfg()
276 dcb = NLMSG_DATA(nlh); in dcbnl_getpfccfg()
302 nlmsg_end(dcbnl_skb, nlh); in dcbnl_getpfccfg()
320 struct nlmsghdr *nlh; in dcbnl_getperm_hwaddr() local
332 nlh = NLMSG_NEW(dcbnl_skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags); in dcbnl_getperm_hwaddr()
[all …]
/linux-2.6.39/drivers/scsi/
Dscsi_netlink.c81 struct nlmsghdr *nlh; in scsi_nl_rcv_msg() local
90 nlh = nlmsg_hdr(skb); in scsi_nl_rcv_msg()
91 if ((nlh->nlmsg_len < (sizeof(*nlh) + sizeof(*hdr))) || in scsi_nl_rcv_msg()
92 (skb->len < nlh->nlmsg_len)) { in scsi_nl_rcv_msg()
98 rlen = NLMSG_ALIGN(nlh->nlmsg_len); in scsi_nl_rcv_msg()
102 if (nlh->nlmsg_type != SCSI_TRANSPORT_MSG) { in scsi_nl_rcv_msg()
107 hdr = NLMSG_DATA(nlh); in scsi_nl_rcv_msg()
119 if (nlh->nlmsg_len < (sizeof(*nlh) + hdr->msglen)) { in scsi_nl_rcv_msg()
145 if ((err) || (nlh->nlmsg_flags & NLM_F_ACK)) in scsi_nl_rcv_msg()
146 netlink_ack(skb, nlh, err); in scsi_nl_rcv_msg()
[all …]
Dscsi_transport_iscsi.c1043 struct nlmsghdr *nlh; in iscsi_recv_pdu() local
1063 nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); in iscsi_recv_pdu()
1064 ev = NLMSG_DATA(nlh); in iscsi_recv_pdu()
1082 struct nlmsghdr *nlh; in iscsi_offload_mesg() local
1093 nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); in iscsi_offload_mesg()
1094 ev = NLMSG_DATA(nlh); in iscsi_offload_mesg()
1115 struct nlmsghdr *nlh; in iscsi_conn_error_event() local
1132 nlh = __nlmsg_put(skb, 0, 0, 0, (len - sizeof(*nlh)), 0); in iscsi_conn_error_event()
1133 ev = NLMSG_DATA(nlh); in iscsi_conn_error_event()
1152 struct nlmsghdr *nlh; in iscsi_if_send_reply() local
[all …]
/linux-2.6.39/net/xfrm/
Dxfrm_user.c570 static int xfrm_add_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_add_sa() argument
574 struct xfrm_usersa_info *p = nlmsg_data(nlh); in xfrm_add_sa()
591 if (nlh->nlmsg_type == XFRM_MSG_NEWSA) in xfrm_add_sa()
605 c.seq = nlh->nlmsg_seq; in xfrm_add_sa()
606 c.pid = nlh->nlmsg_pid; in xfrm_add_sa()
607 c.event = nlh->nlmsg_type; in xfrm_add_sa()
649 static int xfrm_del_sa(struct sk_buff *skb, struct nlmsghdr *nlh, in xfrm_del_sa() argument
656 struct xfrm_usersa_id *p = nlmsg_data(nlh); in xfrm_del_sa()
678 c.seq = nlh->nlmsg_seq; in xfrm_del_sa()
679 c.pid = nlh->nlmsg_pid; in xfrm_del_sa()
[all …]
/linux-2.6.39/net/decnet/netfilter/
Ddn_rtmsg.c38 struct nlmsghdr *nlh; in dnrmg_build_message() local
48 nlh = NLMSG_PUT(skb, 0, 0, 0, size - sizeof(*nlh)); in dnrmg_build_message()
49 rtm = (struct nf_dn_rtmsg *)NLMSG_DATA(nlh); in dnrmg_build_message()
53 nlh->nlmsg_len = skb->tail - old_tail; in dnrmg_build_message()
102 #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
106 struct nlmsghdr *nlh = nlmsg_hdr(skb); in dnrmg_receive_user_skb() local
108 if (nlh->nlmsg_len < sizeof(*nlh) || skb->len < nlh->nlmsg_len) in dnrmg_receive_user_skb()
/linux-2.6.39/net/ipv4/
Dinet_diag.c82 struct nlmsghdr *nlh; in inet_csk_diag_fill() local
91 nlh = NLMSG_PUT(skb, pid, seq, unlh->nlmsg_type, sizeof(*r)); in inet_csk_diag_fill()
92 nlh->nlmsg_flags = nlmsg_flags; in inet_csk_diag_fill()
94 r = NLMSG_DATA(nlh); in inet_csk_diag_fill()
172 nlh->nlmsg_len = skb_tail_pointer(skb) - b; in inet_csk_diag_fill()
189 struct nlmsghdr *nlh = NLMSG_PUT(skb, pid, seq, in inet_twsk_diag_fill() local
192 r = NLMSG_DATA(nlh); in inet_twsk_diag_fill()
195 nlh->nlmsg_flags = nlmsg_flags; in inet_twsk_diag_fill()
228 nlh->nlmsg_len = skb_tail_pointer(skb) - previous_tail; in inet_twsk_diag_fill()
247 const struct nlmsghdr *nlh) in inet_diag_get_exact() argument
[all …]
/linux-2.6.39/Documentation/connector/
Ducon.c62 struct nlmsghdr *nlh; in netlink_send() local
70 nlh = (struct nlmsghdr *)buf; in netlink_send()
71 nlh->nlmsg_seq = seq++; in netlink_send()
72 nlh->nlmsg_pid = getpid(); in netlink_send()
73 nlh->nlmsg_type = NLMSG_DONE; in netlink_send()
74 nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh)); in netlink_send()
75 nlh->nlmsg_flags = 0; in netlink_send()
77 m = NLMSG_DATA(nlh); in netlink_send()
84 err = send(s, nlh, size, 0); in netlink_send()
/linux-2.6.39/net/bridge/
Dbr_netlink.c42 struct nlmsghdr *nlh; in br_fill_ifinfo() local
48 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*hdr), flags); in br_fill_ifinfo()
49 if (nlh == NULL) in br_fill_ifinfo()
52 hdr = nlmsg_data(nlh); in br_fill_ifinfo()
74 return nlmsg_end(skb, nlh); in br_fill_ifinfo()
77 nlmsg_cancel(skb, nlh); in br_fill_ifinfo()
130 cb->nlh->nlmsg_seq, RTM_NEWLINK, in br_dump_ifinfo()
146 static int br_rtm_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) in br_rtm_setlink() argument
155 if (nlmsg_len(nlh) < sizeof(*ifm)) in br_rtm_setlink()
158 ifm = nlmsg_data(nlh); in br_rtm_setlink()
[all …]
/linux-2.6.39/security/selinux/
Dnetlink.c43 static void selnl_add_payload(struct nlmsghdr *nlh, int len, int msgtype, void *data) in selnl_add_payload() argument
47 struct selnl_msg_setenforce *msg = NLMSG_DATA(nlh); in selnl_add_payload()
55 struct selnl_msg_policyload *msg = NLMSG_DATA(nlh); in selnl_add_payload()
72 struct nlmsghdr *nlh; in selnl_notify() local
81 nlh = NLMSG_PUT(skb, 0, 0, msgtype, len); in selnl_notify()
82 selnl_add_payload(nlh, len, msgtype, data); in selnl_notify()
83 nlh->nlmsg_len = skb->tail - tmp; in selnl_notify()
/linux-2.6.39/net/wimax/
Dop-msg.c185 struct nlmsghdr *nlh = (void *) msg->head; in wimax_msg_data_len() local
188 nla = nlmsg_find_attr(nlh, sizeof(struct genlmsghdr), in wimax_msg_data_len()
207 struct nlmsghdr *nlh = (void *) msg->head; in wimax_msg_data() local
210 nla = nlmsg_find_attr(nlh, sizeof(struct genlmsghdr), in wimax_msg_data()
228 struct nlmsghdr *nlh = (void *) msg->head; in wimax_msg_len() local
231 nla = nlmsg_find_attr(nlh, sizeof(struct genlmsghdr), in wimax_msg_len()
348 struct nlmsghdr *nlh = info->nlhdr; in wimax_gnl_doit_msg_from_user() local
401 nlh->nlmsg_len, nlh->nlmsg_type, nlh->nlmsg_flags, in wimax_gnl_doit_msg_from_user()
402 nlh->nlmsg_seq, nlh->nlmsg_pid); in wimax_gnl_doit_msg_from_user()
/linux-2.6.39/net/netfilter/ipset/
Dip_set_core.c538 flag_exist(const struct nlmsghdr *nlh) in flag_exist() argument
540 return nlh->nlmsg_flags & NLM_F_EXCL ? 0 : IPSET_FLAG_EXIST; in flag_exist()
547 struct nlmsghdr *nlh; in start_msg() local
550 nlh = nlmsg_put(skb, pid, seq, cmd | (NFNL_SUBSYS_IPSET << 8), in start_msg()
552 if (nlh == NULL) in start_msg()
555 nfmsg = nlmsg_data(nlh); in start_msg()
560 return nlh; in start_msg()
622 const struct nlmsghdr *nlh, in ip_set_create() argument
630 u32 flags = flag_exist(nlh); in ip_set_create()
747 const struct nlmsghdr *nlh, in ip_set_destroy() argument
[all …]
/linux-2.6.39/net/netfilter/
Dnf_conntrack_netlink.c399 struct nlmsghdr *nlh; in ctnetlink_fill_info() local
405 nlh = nlmsg_put(skb, pid, seq, event, sizeof(*nfmsg), flags); in ctnetlink_fill_info()
406 if (nlh == NULL) in ctnetlink_fill_info()
409 nfmsg = nlmsg_data(nlh); in ctnetlink_fill_info()
446 nlmsg_end(skb, nlh); in ctnetlink_fill_info()
451 nlmsg_cancel(skb, nlh); in ctnetlink_fill_info()
546 struct nlmsghdr *nlh; in ctnetlink_conntrack_event() local
581 nlh = nlmsg_put(skb, item->pid, 0, type, sizeof(*nfmsg), flags); in ctnetlink_conntrack_event()
582 if (nlh == NULL) in ctnetlink_conntrack_event()
585 nfmsg = nlmsg_data(nlh); in ctnetlink_conntrack_event()
[all …]
Dnfnetlink.c126 static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) in nfnetlink_rcv_msg() argument
137 if (nlh->nlmsg_len < NLMSG_LENGTH(sizeof(struct nfgenmsg))) in nfnetlink_rcv_msg()
140 type = nlh->nlmsg_type; in nfnetlink_rcv_msg()
160 u_int8_t cb_id = NFNL_MSG_TYPE(nlh->nlmsg_type); in nfnetlink_rcv_msg()
162 struct nlattr *attr = (void *)nlh + min_len; in nfnetlink_rcv_msg()
163 int attrlen = nlh->nlmsg_len - min_len; in nfnetlink_rcv_msg()
170 err = nc->call(net->nfnl, skb, nlh, (const struct nlattr **)cda); in nfnetlink_rcv_msg()
/linux-2.6.39/drivers/connector/
Dconnector.c71 struct nlmsghdr *nlh; in cn_netlink_send() local
104 nlh = NLMSG_PUT(skb, 0, msg->seq, NLMSG_DONE, size - sizeof(*nlh)); in cn_netlink_send()
106 data = NLMSG_DATA(nlh); in cn_netlink_send()
158 struct nlmsghdr *nlh; in cn_rx_skb() local
165 nlh = nlmsg_hdr(skb); in cn_rx_skb()
167 if (nlh->nlmsg_len < sizeof(struct cn_msg) || in cn_rx_skb()
168 skb->len < nlh->nlmsg_len || in cn_rx_skb()
169 nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) { in cn_rx_skb()
/linux-2.6.39/kernel/
Daudit.c169 struct nlmsghdr *nlh = nlmsg_hdr(ab->skb); in audit_set_pid() local
170 nlh->nlmsg_pid = pid; in audit_set_pid()
383 struct nlmsghdr *nlh = nlmsg_hdr(skb); in audit_printk_skb() local
384 char *data = NLMSG_DATA(nlh); in audit_printk_skb()
386 if (nlh->nlmsg_type != AUDIT_EOE) { in audit_printk_skb()
388 printk(KERN_NOTICE "type=%d %s\n", nlh->nlmsg_type, data); in audit_printk_skb()
507 struct nlmsghdr *nlh; in audit_make_reply() local
516 nlh = NLMSG_NEW(skb, pid, seq, t, size, flags); in audit_make_reply()
517 data = NLMSG_DATA(nlh); in audit_make_reply()
646 static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh) in audit_receive_msg() argument
[all …]
/linux-2.6.39/net/ipv6/
Daddrlabel.c406 static int ip6addrlbl_newdel(struct sk_buff *skb, struct nlmsghdr *nlh, in ip6addrlbl_newdel() argument
416 err = nlmsg_parse(nlh, sizeof(*ifal), tb, IFAL_MAX, ifal_policy); in ip6addrlbl_newdel()
420 ifal = nlmsg_data(nlh); in ip6addrlbl_newdel()
439 switch(nlh->nlmsg_type) { in ip6addrlbl_newdel()
447 nlh->nlmsg_flags & NLM_F_REPLACE); in ip6addrlbl_newdel()
459 static inline void ip6addrlbl_putmsg(struct nlmsghdr *nlh, in ip6addrlbl_putmsg() argument
462 struct ifaddrlblmsg *ifal = nlmsg_data(nlh); in ip6addrlbl_putmsg()
476 struct nlmsghdr *nlh = nlmsg_put(skb, pid, seq, event, in ip6addrlbl_fill() local
478 if (!nlh) in ip6addrlbl_fill()
481 ip6addrlbl_putmsg(nlh, p->prefixlen, p->ifindex, lseq); in ip6addrlbl_fill()
[all …]
/linux-2.6.39/net/ipv6/netfilter/
Dip6_queue.c153 struct nlmsghdr *nlh; in ipq_build_packet_message() local
184 nlh = NLMSG_PUT(skb, 0, 0, IPQM_PACKET, size - sizeof(*nlh)); in ipq_build_packet_message()
185 pmsg = NLMSG_DATA(nlh); in ipq_build_packet_message()
216 nlh->nlmsg_len = skb->tail - old_tail; in ipq_build_packet_message()
401 #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
407 struct nlmsghdr *nlh; in __ipq_rcv_skb() local
410 if (skblen < sizeof(*nlh)) in __ipq_rcv_skb()
413 nlh = nlmsg_hdr(skb); in __ipq_rcv_skb()
414 nlmsglen = nlh->nlmsg_len; in __ipq_rcv_skb()
415 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen) in __ipq_rcv_skb()
[all …]
/linux-2.6.39/net/ipv4/netfilter/
Dip_queue.c152 struct nlmsghdr *nlh; in ipq_build_packet_message() local
183 nlh = NLMSG_PUT(skb, 0, 0, IPQM_PACKET, size - sizeof(*nlh)); in ipq_build_packet_message()
184 pmsg = NLMSG_DATA(nlh); in ipq_build_packet_message()
216 nlh->nlmsg_len = skb->tail - old_tail; in ipq_build_packet_message()
400 #define RCV_SKB_FAIL(err) do { netlink_ack(skb, nlh, (err)); return; } while (0)
406 struct nlmsghdr *nlh; in __ipq_rcv_skb() local
409 if (skblen < sizeof(*nlh)) in __ipq_rcv_skb()
412 nlh = nlmsg_hdr(skb); in __ipq_rcv_skb()
413 nlmsglen = nlh->nlmsg_len; in __ipq_rcv_skb()
414 if (nlmsglen < sizeof(*nlh) || skblen < nlmsglen) in __ipq_rcv_skb()
[all …]
/linux-2.6.39/net/core/
Dfib_rules.c61 struct fib_rules_ops *ops, struct nlmsghdr *nlh,
266 static int fib_nl_newrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) in fib_nl_newrule() argument
269 struct fib_rule_hdr *frh = nlmsg_data(nlh); in fib_nl_newrule()
275 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*frh))) in fib_nl_newrule()
284 err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy); in fib_nl_newrule()
402 notify_rule_change(RTM_NEWRULE, rule, ops, nlh, NETLINK_CB(skb).pid); in fib_nl_newrule()
415 static int fib_nl_delrule(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg) in fib_nl_delrule() argument
418 struct fib_rule_hdr *frh = nlmsg_data(nlh); in fib_nl_delrule()
424 if (nlh->nlmsg_len < nlmsg_msg_size(sizeof(*frh))) in fib_nl_delrule()
433 err = nlmsg_parse(nlh, sizeof(*frh), tb, FRA_MAX, ops->policy); in fib_nl_delrule()
[all …]
Drtnetlink.c554 struct nlmsghdr *nlh, gfp_t flags) in rtnl_notify() argument
559 if (nlh) in rtnl_notify()
560 report = nlmsg_report(nlh); in rtnl_notify()
847 struct nlmsghdr *nlh; in rtnl_fill_ifinfo() local
853 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags); in rtnl_fill_ifinfo()
854 if (nlh == NULL) in rtnl_fill_ifinfo()
857 ifm = nlmsg_data(nlh); in rtnl_fill_ifinfo()
991 return nlmsg_end(skb, nlh); in rtnl_fill_ifinfo()
994 nlmsg_cancel(skb, nlh); in rtnl_fill_ifinfo()
1018 cb->nlh->nlmsg_seq, 0, in rtnl_dump_ifinfo()
[all …]
/linux-2.6.39/drivers/staging/hv/tools/
Dhv_kvp_daemon.c291 struct nlmsghdr *nlh; in netlink_send() local
299 nlh = (struct nlmsghdr *)buffer; in netlink_send()
300 nlh->nlmsg_seq = 0; in netlink_send()
301 nlh->nlmsg_pid = getpid(); in netlink_send()
302 nlh->nlmsg_type = NLMSG_DONE; in netlink_send()
303 nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh)); in netlink_send()
304 nlh->nlmsg_flags = 0; in netlink_send()
306 iov[0].iov_base = nlh; in netlink_send()
307 iov[0].iov_len = sizeof(*nlh); in netlink_send()

123