| /freebsd/sys/compat/linux/ |
| H A D | linux_netlink.c | 76 rtnl_neigh_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_neigh_from_linux() 81 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct ndmsg)) in rtnl_neigh_from_linux() 92 rtnl_ifaddr_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_ifaddr_from_linux() 97 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + in rtnl_ifaddr_from_linux() 112 rtnl_route_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_route_from_linux() 120 if (hdr->nlmsg_len < sizeof(struct nlmsghdr) + sizeof(struct rtmsg)) in rtnl_route_from_linux() 129 attrs_len = hdr->nlmsg_len - sizeof(struct nlmsghdr); in rtnl_route_from_linux() 158 rtnl_from_linux(struct nlmsghdr *hdr, struct nl_pstate *npt) in rtnl_from_linux() 185 nlmsg_from_linux(int netlink_family, struct nlmsghdr **hdr, in nlmsg_from_linux() 202 handle_default_out(struct nlmsghdr *hdr, struct nl_writer *nw) in handle_default_out() [all …]
|
| /freebsd/lib/libsysdecode/ |
| H A D | netlink.c | 26 const struct nlmsghdr *nl = buf; in sysdecode_netlink() 31 if (remaining < sizeof(struct nlmsghdr)) in sysdecode_netlink() 38 if (nl->nlmsg_len < sizeof(struct nlmsghdr) || nl->nlmsg_len > remaining) in sysdecode_netlink() 43 while (remaining >= sizeof(struct nlmsghdr)) { in sysdecode_netlink() 48 if (nl->nlmsg_len < sizeof(struct nlmsghdr) || in sysdecode_netlink() 88 nl = (const struct nlmsghdr *)(const void *)((const char *)nl + aligned_len); in sysdecode_netlink()
|
| /freebsd/contrib/wpa/src/drivers/ |
| H A D | priv_netlink.h | 50 #define NLMSG_HDRLEN ((int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) 51 #define NLMSG_LENGTH(len) ((len) + NLMSG_ALIGN(sizeof(struct nlmsghdr))) 55 (struct nlmsghdr *) \ 57 #define NLMSG_OK(nlh,len) ((len) >= (int) sizeof(struct nlmsghdr) && \ 58 (nlh)->nlmsg_len >= sizeof(struct nlmsghdr) && \ 84 struct nlmsghdr struct
|
| H A D | netlink.c | 26 struct nlmsghdr *h) in netlink_receive_link() 43 struct nlmsghdr *h; in netlink_receive() 57 h = (struct nlmsghdr *) buf; in netlink_receive() 175 struct nlmsghdr hdr; in netlink_send_oper_ifla()
|
| /freebsd/tests/sys/netlink/ |
| H A D | test_snl.c | 74 struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); in ATF_TC_BODY() 82 struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); in ATF_TC_BODY() 87 ATF_CHECK(rx_hdr->nlmsg_len == sizeof(struct nlmsghdr) + sizeof(struct nlmsgerr)); in ATF_TC_BODY() 90 ATF_CHECK(!memcmp(hdr, e.orig_hdr, sizeof(struct nlmsghdr))); in ATF_TC_BODY() 115 struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); in ATF_TC_BODY() 123 struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); in ATF_TC_BODY() 130 ATF_CHECK(!memcmp(hdr, e.orig_hdr, sizeof(struct nlmsghdr))); in ATF_TC_BODY() 154 struct nlmsghdr *hdr = snl_create_msg_request(&nw, 255); in ATF_TC_BODY() 162 struct nlmsghdr *rx_hdr = snl_read_reply(&ss, hdr->nlmsg_seq); in ATF_TC_BODY() 211 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); in ATF_TC_BODY()
|
| /freebsd/sys/netlink/ |
| H A D | netlink_snl.h | 309 snl_send_message(struct snl_state *ss, struct nlmsghdr *hdr) in snl_send_message() 332 static inline struct nlmsghdr * 365 struct nlmsghdr *hdr = (struct nlmsghdr *)(void *)&ss->buf[ss->off]; in snl_read_message_dbg() 371 static inline struct nlmsghdr * 397 struct nlmsghdr *hdr = (struct nlmsghdr *)(void *)&ss->buf[ss->off]; in snl_read_message() 402 static inline struct nlmsghdr * 405 struct nlmsghdr *hdr; in snl_read_reply() 477 snl_parse_attrs(struct snl_state *ss, struct nlmsghdr *hdr, int hdrlen, in snl_parse_attrs() 488 snl_parse_fields(struct snl_state *ss, struct nlmsghdr *hdr, int hdrlen __unused, in snl_parse_fields() 507 snl_parse_fields(ss, (struct nlmsghdr *)hdr, parser->in_hdr_size, in snl_parse_header() [all …]
|
| H A D | netlink_message_writer.c | 195 nw->hdr = (last_len > 0) ? (struct nlmsghdr *)new->data : NULL; in _nlmsg_refill_buffer() 207 struct nlmsghdr *hdr; in _nlmsg_add() 212 required_len = NETLINK_ALIGN(len + sizeof(struct nlmsghdr)); in _nlmsg_add() 219 hdr = (struct nlmsghdr *)(&nb->data[nb->datalen]); in _nlmsg_add() 228 nb->datalen += sizeof(struct nlmsghdr); in _nlmsg_add() 267 nlmsg_ack(struct nlpcb *nlp, int error, struct nlmsghdr *hdr, in nlmsg_ack() 285 payload_len += hdr->nlmsg_len - sizeof(struct nlmsghdr); in nlmsg_ack() 319 _nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr) in _nlmsg_end_dump()
|
| H A D | netlink.h | 97 struct nlmsghdr { struct 174 struct nlmsghdr msg; 214 #define NLMSG_HDRLEN (sizeof(struct nlmsghdr)) 225 #define NLMSG_HDRLEN (NLMSG_ALIGN(sizeof(struct nlmsghdr)))
|
| H A D | netlink_snl_generic.h | 35 static inline struct nlmsghdr * 39 struct nlmsghdr *hdr; in snl_create_genl_msg_request() 44 hdr = snl_reserve_msg_object(nw, struct nlmsghdr); in snl_create_genl_msg_request() 125 struct nlmsghdr *hdr; in _snl_get_genl_family_info()
|
| H A D | netlink_var.h | 87 #define ALIGNED_NL_SZ(_data) roundup2((((struct nlmsghdr *)(_data))->nlmsg_len), 16) 109 struct nlmsghdr; 131 void nlmsg_ack(struct nlpcb *nlp, int error, struct nlmsghdr *nlmsg, 170 bool (*nlmsg_end_dump)(struct nl_writer *nw, int error, struct nlmsghdr *hdr);
|
| H A D | netlink_message_parser.h | 70 struct nlmsghdr *hdr; /* Current parsed message header */ 225 struct nlmsghdr *nl_alloc_compat_hdr(struct nlmsghdr *hdr, uint32_t len, 303 nl_parse_nlmsg(struct nlmsghdr *hdr, const struct nlhdr_parser *parser, in nl_parse_nlmsg() 306 if (__predict_false(hdr->nlmsg_len - sizeof(struct nlmsghdr) < in nl_parse_nlmsg() 315 nl_get_attrs_bmask_nlmsg(struct nlmsghdr *hdr, in nl_get_attrs_bmask_nlmsg() 318 if (__predict_false(hdr->nlmsg_len - sizeof(struct nlmsghdr) < in nl_get_attrs_bmask_nlmsg()
|
| H A D | netlink_io.c | 212 struct nlmsghdr *hdr = (struct nlmsghdr *)nw->buf->data; in nl_send() 260 nl_receive_message(struct nlmsghdr *hdr, int remaining_length, in nl_receive_message() 327 struct nlmsghdr *hdr; in nl_process_nbuf() 347 for (; nb->offset + sizeof(struct nlmsghdr) <= nb->datalen;) { in nl_process_nbuf() 348 hdr = (struct nlmsghdr *)&nb->data[nb->offset]; in nl_process_nbuf()
|
| H A D | netlink_message_writer.h | 47 struct nlmsghdr *hdr; /* Pointer to the currently-filled msg */ 84 bool _nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr); 139 nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr) in nlmsg_end_dump() 159 bool nlmsg_end_dump(struct nl_writer *nw, int error, struct nlmsghdr *hdr); 164 nlmsg_reply(struct nl_writer *nw, const struct nlmsghdr *hdr, int payload_len) in nlmsg_reply()
|
| H A D | netlink_generic.c | 51 static int nlctrl_handle_getfamily(struct nlmsghdr *, struct nl_pstate *); 113 genl_handle_message(struct nlmsghdr *hdr, struct nl_pstate *npt) in genl_handle_message() 120 if (__predict_false(hdr->nlmsg_len < sizeof(struct nlmsghdr) + in genl_handle_message() 177 dump_family(struct nlmsghdr *hdr, struct genlmsghdr *ghdr, in dump_family() 260 nlctrl_handle_getfamily(struct nlmsghdr *hdr, struct nl_pstate *npt) in nlctrl_handle_getfamily() 313 struct nlmsghdr hdr = {.nlmsg_type = NETLINK_GENERIC }; in nlctrl_notify()
|
| /freebsd/sbin/route/ |
| H A D | route_netlink.c | 43 static void print_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, 45 static void print_nhop_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, 47 static void print_nlmsg(struct nl_helper *h, struct nlmsghdr *hdr, 181 struct nlmsghdr *hdr = snl_create_msg_request(&nw, nl_type); in rtmsg_nl_int() 330 struct nlmsghdr *hdr = snl_create_msg_request(&nw, NL_RTM_GETLINK); in get_ifdata() 355 print_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *dst) in print_getmsg() 405 print_nhop_getmsg(struct nl_helper *h, struct nlmsghdr *hdr, struct sockaddr *dst) in print_nhop_getmsg() 502 print_line_prefix(struct nlmsghdr *hdr, struct snl_msg_info *cinfo, in print_line_prefix() 520 get_action_name(struct nlmsghdr *hdr, int new_cmd) in get_action_name() 570 print_nlmsg_route(struct nl_helper *h, struct nlmsghdr *hdr, in print_nlmsg_route() [all …]
|
| /freebsd/lib/libc/rpc/ |
| H A D | svc_nl.c | 76 struct nlmsghdr *hdr; 179 struct nlmsghdr *hdr = sc->hdr; in svc_nl_recv() 183 if (recv(xprt->xp_fd, hdr, sizeof(struct nlmsghdr), in svc_nl_recv() 184 MSG_PEEK) != sizeof(struct nlmsghdr)) in svc_nl_recv() 351 recv(xprt->xp_fd, sc->hdr, sizeof(struct nlmsghdr), in svc_nl_stat() 352 MSG_PEEK | MSG_DONTWAIT) == sizeof(struct nlmsghdr)) in svc_nl_stat()
|
| /freebsd/usr.bin/netstat/ |
| H A D | route_netlink.c | 71 static void p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr); 81 struct nlmsghdr hdr; in prepare_ifmap_netlink() 95 struct nlmsghdr *hdr; in prepare_ifmap_netlink() 229 p_rtentry_netlink(struct snl_state *ss, const char *name, struct nlmsghdr *hdr) in p_rtentry_netlink() 279 struct nlmsghdr *hdr; in p_rtable_netlink() 293 struct nlmsghdr hdr; in p_rtable_netlink()
|
| /freebsd/sys/netpfil/pf/ |
| H A D | pf_nl.c | 172 dump_state(struct nlpcb *nlp, const struct nlmsghdr *hdr, in dump_state() 271 struct nlmsghdr *hdr, struct nl_pstate *npt) in handle_dumpstates() 328 struct nlmsghdr *hdr, struct nl_pstate *npt) in handle_getstate() 343 dump_creatorid(struct nlpcb *nlp, const struct nlmsghdr *hdr, uint32_t creator, in dump_creatorid() 365 pf_handle_getstates(struct nlmsghdr *hdr, struct nl_pstate *npt) in pf_handle_getstates() 383 pf_handle_getcreators(struct nlmsghdr *hdr, struct nl_pstate *npt) in pf_handle_getcreators() 433 pf_handle_start(struct nlmsghdr *hdr __unused, struct nl_pstate *npt __unused) in pf_handle_start() 439 pf_handle_stop(struct nlmsghdr *hdr __unused, struct nl_pstate *npt __unused) in pf_handle_stop() 841 pf_handle_addrule(struct nlmsghdr *hdr, struct nl_pstate *npt) in pf_handle_addrule() 870 pf_handle_getrules(struct nlmsghdr *hdr, struct nl_pstate *npt) in pf_handle_getrules() [all …]
|
| /freebsd/sys/tests/ |
| H A D | ktest.c | 82 create_reply(struct nl_writer *nw, struct nlmsghdr *hdr, int cmd) in create_reply() 96 dump_mod_test(struct nlmsghdr *hdr, struct nl_pstate *npt, in dump_mod_test() 116 dump_mod_tests(struct nlmsghdr *hdr, struct nl_pstate *npt, in dump_mod_tests() 132 dump_tests(struct nlmsghdr *hdr, struct nl_pstate *npt) in dump_tests() 163 run_test(struct nlmsghdr *hdr, struct nl_pstate *npt) in run_test()
|
| /freebsd/sys/netlink/route/ |
| H A D | iface.c | 64 struct nlmsghdr hdr; 292 dump_iface(struct nl_writer *nw, if_t ifp, const struct nlmsghdr *hdr, in dump_iface() 458 rtnl_handle_getlink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) in rtnl_handle_getlink() 539 rtnl_handle_dellink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) in rtnl_handle_dellink() 591 create_link(struct nlmsghdr *hdr, struct nl_parsed_link *lattrs, in create_link() 616 modify_link(struct nlmsghdr *hdr, struct nl_parsed_link *lattrs, in modify_link() 673 rtnl_handle_newlink(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) in rtnl_handle_newlink() 967 const struct nlmsghdr *hdr) in dump_iface_addr() 1071 rtnl_handle_getaddr(struct nlmsghdr *hdr, struct nlpcb *nlp, struct nl_pstate *npt) in rtnl_handle_getaddr() 1123 handle_newaddr_inet(struct nlmsghdr *hdr, struct nl_parsed_ifa *attrs, in handle_newaddr_inet() [all …]
|
| /freebsd/contrib/libpcap/ |
| H A D | pcap-netfilter-linux.c | 146 const struct nlmsghdr *nlh = (const struct nlmsghdr *) bp; in netfilter_read_linux() 187 if (nlh->nlmsg_len < sizeof(struct nlmsghdr) || (u_int)len < nlh->nlmsg_len) { in netfilter_read_linux() 252 pkth.caplen = pkth.len = nlh->nlmsg_len-NLMSG_ALIGN(sizeof(struct nlmsghdr)); in netfilter_read_linux() 345 struct nlmsghdr *nlh = (struct nlmsghdr *) buf; in netfilter_send_config_msg() 346 struct nfgenmsg *nfg = (struct nfgenmsg *) (buf + sizeof(struct nlmsghdr)); in netfilter_send_config_msg() 407 nlh = (struct nlmsghdr *) buf; in netfilter_send_config_msg()
|
| /freebsd/crypto/heimdal/lib/roken/ |
| H A D | getifaddrs.c | 141 struct nlmsghdr *nlh; 277 char reqbuf[NLMSG_ALIGN(sizeof(struct nlmsghdr)) + in nl_sendreq() 280 struct nlmsghdr *req_hdr; in nl_sendreq() 286 req_hdr = (struct nlmsghdr *)reqbuf; in nl_sendreq() 329 struct nlmsghdr **nlhp, in nl_getmsg() 332 struct nlmsghdr *nh; in nl_getmsg() 352 nh = (struct nlmsghdr *)buff; in nl_getmsg() 353 for (nh = (struct nlmsghdr *)buff; in nl_getmsg() 355 nh = (struct nlmsghdr *)NLMSG_NEXT(nh, read_size)){ in nl_getmsg() 381 *nlhp = (struct nlmsghdr *)buff; in nl_getmsg() [all …]
|
| /freebsd/usr.bin/genl/ |
| H A D | genl.c | 265 parser_nlctrl_notify(struct snl_state *ss, struct nlmsghdr *hdr) in parser_nlctrl_notify() 275 parser_nlsysevent(struct snl_state *ss, struct nlmsghdr *hdr) in parser_nlsysevent() 289 parser_fallback(struct snl_state *ss __unused, struct nlmsghdr *hdr) in parser_fallback() 312 struct nlmsghdr *hdr; in monitor_mcast() 392 struct nlmsghdr *hdr; in list_families()
|
| /freebsd/usr.sbin/arp/ |
| H A D | arp_netlink.c | 61 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); in get_link_info() 113 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETROUTE); in guess_ifindex() 289 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETNEIGH); in print_entries_nl() 360 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_DELNEIGH); in delete_nl() 405 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_NEWNEIGH); in set_nl()
|
| /freebsd/usr.sbin/ndp/ |
| H A D | ndp_netlink.c | 73 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETLINK); in get_link_info() 146 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_GETROUTE); in guess_ifindex() 317 struct nlmsghdr *hdr; in print_entries_nl() 426 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_DELNEIGH); in delete_nl() 490 struct nlmsghdr *hdr = snl_create_msg_request(&nw, RTM_NEWNEIGH); in set_nl()
|