Home
last modified time | relevance | path

Searched refs:nl (Results 1 – 25 of 42) sorted by relevance

12

/systemd-251/src/libsystemd/sd-netlink/
Dsd-netlink.c23 _cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL; in netlink_new()
27 nl = new(sd_netlink, 1); in netlink_new()
28 if (!nl) in netlink_new()
31 *nl = (sd_netlink) { in netlink_new()
34 .sockaddr.nl.nl_family = AF_NETLINK, in netlink_new()
64 if (!greedy_realloc((void**) &nl->rbuffer, sizeof(struct nlmsghdr), sizeof(uint8_t))) in netlink_new()
67 *ret = TAKE_PTR(nl); in netlink_new()
72 _cleanup_(sd_netlink_unrefp) sd_netlink *nl = NULL; in sd_netlink_new_from_fd()
78 r = netlink_new(&nl); in sd_netlink_new_from_fd()
82 addrlen = sizeof(nl->sockaddr); in sd_netlink_new_from_fd()
[all …]
Dnetlink-socket.c30 static int broadcast_groups_get(sd_netlink *nl) { in broadcast_groups_get() argument
35 assert(nl); in broadcast_groups_get()
36 assert(nl->fd >= 0); in broadcast_groups_get()
38 if (getsockopt(nl->fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, NULL, &len) < 0) { in broadcast_groups_get()
42 nl->broadcast_group_dont_leave = true; in broadcast_groups_get()
55 if (getsockopt(nl->fd, SOL_NETLINK, NETLINK_LIST_MEMBERSHIPS, groups, &len) < 0) in broadcast_groups_get()
66 … r = hashmap_ensure_put(&nl->broadcast_group_refs, NULL, UINT_TO_PTR(group), UINT_TO_PTR(1)); in broadcast_groups_get()
74 int socket_bind(sd_netlink *nl) { in socket_bind() argument
78 r = setsockopt_int(nl->fd, SOL_NETLINK, NETLINK_PKTINFO, true); in socket_bind()
82 addrlen = sizeof(nl->sockaddr); in socket_bind()
[all …]
Dnetlink-genl.c49 void genl_clear_family(sd_netlink *nl) { in genl_clear_family() argument
50 assert(nl); in genl_clear_family()
52nl->genl_family_by_name = hashmap_free_with_destructor(nl->genl_family_by_name, genl_family_free); in genl_clear_family()
53nl->genl_family_by_id = hashmap_free_with_destructor(nl->genl_family_by_id, genl_family_free); in genl_clear_family()
57 sd_netlink *nl, in genl_family_new_unsupported() argument
64 assert(nl); in genl_family_new_unsupported()
83 r = hashmap_ensure_put(&nl->genl_family_by_name, &string_hash_ops, f->name, f); in genl_family_new_unsupported()
87 f->genl = nl; in genl_family_new_unsupported()
93 sd_netlink *nl, in genl_family_new() argument
104 assert(nl); in genl_family_new()
[all …]
Dnetlink-internal.h67 struct sockaddr_nl nl; member
132 int message_new_empty(sd_netlink *nl, sd_netlink_message **ret);
134 sd_netlink *nl,
139 int message_new(sd_netlink *nl, sd_netlink_message **ret, uint16_t type);
140 int message_new_synthetic_error(sd_netlink *nl, int error, uint32_t serial, sd_netlink_message **re…
145 bool netlink_pid_changed(sd_netlink *nl);
146 int netlink_rqueue_make_room(sd_netlink *nl);
147 int netlink_rqueue_partial_make_room(sd_netlink *nl);
150 int socket_bind(sd_netlink *nl);
151 int socket_broadcast_group_ref(sd_netlink *nl, unsigned group);
[all …]
Dnetlink-slot.c13 sd_netlink *nl, in netlink_slot_allocate() argument
23 assert(nl); in netlink_slot_allocate()
31 slot->netlink = nl; in netlink_slot_allocate()
43 sd_netlink_ref(nl); in netlink_slot_allocate()
45 LIST_PREPEND(slots, nl->slots, slot); in netlink_slot_allocate()
53 sd_netlink *nl; in netlink_slot_disconnect() local
57 nl = slot->netlink; in netlink_slot_disconnect()
58 if (!nl) in netlink_slot_disconnect()
64 (void) hashmap_remove(nl->reply_callbacks, &slot->reply_callback.serial); in netlink_slot_disconnect()
67 … prioq_remove(nl->reply_callbacks_prioq, &slot->reply_callback, &slot->reply_callback.prioq_idx); in netlink_slot_disconnect()
[all …]
Dnetlink-util.h104 #define netlink_call_async(nl, ret_slot, message, callback, destroy_callback, userdata) \ argument
108 sd_netlink_call_async(nl, ret_slot, message, \
114 #define netlink_add_match(nl, ret_slot, match, callback, destroy_callback, userdata, description) \ argument
118 sd_netlink_add_match(nl, ret_slot, match, \
124 #define genl_add_match(nl, ret_slot, family, group, cmd, callback, destroy_callback, userdata, desc… argument
128 sd_genl_add_match(nl, ret_slot, family, group, cmd, \
Dnetlink-types.c54 sd_netlink *nl, in type_system_root_get_type_system_and_header_size() argument
61 assert(nl); in type_system_root_get_type_system_and_header_size()
66 switch (nl->protocol) { in type_system_root_get_type_system_and_header_size()
74 … return genl_get_type_system_and_header_size(nl, type, ret_type_system, ret_header_size); in type_system_root_get_type_system_and_header_size()
Dnetlink-message.c23 int message_new_empty(sd_netlink *nl, sd_netlink_message **ret) { in message_new_empty() argument
26 assert(nl); in message_new_empty()
38 .protocol = nl->protocol, in message_new_empty()
47 sd_netlink *nl, in message_new_full() argument
57 assert(nl); in message_new_full()
64 r = message_new_empty(nl, &m); in message_new_full()
82 int message_new(sd_netlink *nl, sd_netlink_message **ret, uint16_t type) { in message_new() argument
87 assert_return(nl, -EINVAL); in message_new()
90 r = type_system_root_get_type_system_and_header_size(nl, type, &type_system, &size); in message_new()
94 return message_new_full(nl, type, type_system, size, ret); in message_new()
[all …]
Dnetlink-types.h42 sd_netlink *nl,
53 sd_netlink *nl,
Dnetlink-genl.h8 void genl_clear_family(sd_netlink *nl);
Dnetlink-slot.h7 sd_netlink *nl,
/systemd-251/src/systemd/
Dsd-netlink.h39 typedef int (*sd_netlink_message_handler_t)(sd_netlink *nl, sd_netlink_message *m, void *userdata);
43 int sd_netlink_new_from_fd(sd_netlink **nl, int fd);
44 int sd_netlink_open(sd_netlink **nl);
45 int sd_netlink_open_fd(sd_netlink **nl, int fd);
46 int sd_netlink_inc_rcvbuf(sd_netlink *nl, const size_t size);
48 sd_netlink *sd_netlink_ref(sd_netlink *nl);
49 sd_netlink *sd_netlink_unref(sd_netlink *nl);
51 int sd_netlink_send(sd_netlink *nl, sd_netlink_message *message, uint32_t *serial);
52 int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcnt, uint32_t **ret_s…
53 int sd_netlink_call_async(sd_netlink *nl, sd_netlink_slot **ret_slot, sd_netlink_message *message,
[all …]
/systemd-251/src/journal/
Djournald-audit.c421 const struct nlmsghdr *nl = buffer; in server_process_audit_message() local
433 sa->nl.nl_family != AF_NETLINK || in server_process_audit_message()
434 sa->nl.nl_pid != 0) { in server_process_audit_message()
444 if (!NLMSG_OK(nl, buffer_size)) { in server_process_audit_message()
450 if (IN_SET(nl->nlmsg_type, NLMSG_NOOP, NLMSG_ERROR)) in server_process_audit_message()
454 if (nl->nlmsg_type < AUDIT_FIRST_USER_MSG && nl->nlmsg_type != AUDIT_USER) in server_process_audit_message()
457 …process_audit_string(s, nl->nlmsg_type, NLMSG_DATA(nl), nl->nlmsg_len - ALIGN(sizeof(struct nlmsgh… in server_process_audit_message()
477 .nl.nl_family = AF_NETLINK, in enable_audit()
478 .nl.nl_pid = 0, in enable_audit()
488 .msg_namelen = sizeof(sa.nl), in enable_audit()
[all …]
/systemd-251/src/libsystemd/sd-device/
Ddevice-monitor.c86 m->snl.nl.nl_pid = snl.nl.nl_pid; in monitor_set_nl_address()
94 m->snl_trusted_sender.nl.nl_pid = sender->snl.nl.nl_pid; in device_monitor_allow_unicast_sender()
160 .snl.nl.nl_family = AF_NETLINK, in device_monitor_new_full()
161 .snl.nl.nl_groups = group, in device_monitor_new_full()
458 if (snl.nl.nl_groups == MONITOR_GROUP_NONE) { in device_monitor_receive_device()
460 if (m->snl_trusted_sender.nl.nl_pid == 0 || in device_monitor_receive_device()
461 snl.nl.nl_pid != m->snl_trusted_sender.nl.nl_pid) in device_monitor_receive_device()
465 } else if (snl.nl.nl_groups == MONITOR_GROUP_KERNEL) { in device_monitor_receive_device()
466 if (snl.nl.nl_pid > 0) in device_monitor_receive_device()
468 … "sd-device-monitor: Multicast kernel netlink message from PID %"PRIu32" ignored.", snl.nl.nl_pid); in device_monitor_receive_device()
[all …]
/systemd-251/src/basic/
Dreplace-var.c58 size_t skip, d, nl; in replace_var() local
75 nl = l - skip + strlen(n); in replace_var()
76 a = realloc(r, nl + 1); in replace_var()
80 l = nl; in replace_var()
Dstrv.c850 char **nl; in strv_extend_n() local
865 nl = reallocarray(*l, GREEDY_ALLOC_ROUND_UP(k + n + 1), sizeof(char *)); in strv_extend_n()
866 if (!nl) in strv_extend_n()
869 *l = nl; in strv_extend_n()
872 nl[i] = strdup(value); in strv_extend_n()
873 if (!nl[i]) in strv_extend_n()
876 nl[i] = NULL; in strv_extend_n()
882 free(nl[j]); in strv_extend_n()
883 nl[k] = NULL; in strv_extend_n()
/systemd-251/src/test/
Dtest-socket-netlink.c108 assert_se(a.sockaddr.nl.nl_family == AF_NETLINK); in TEST()
109 assert_se(a.sockaddr.nl.nl_groups == 0); in TEST()
113 assert_se(a.sockaddr.nl.nl_family == AF_NETLINK); in TEST()
114 assert_se(a.sockaddr.nl.nl_groups == 10); in TEST()
119 assert_se(a.sockaddr.nl.nl_family == AF_NETLINK); in TEST()
120 assert_se(a.sockaddr.nl.nl_groups == 0); in TEST()
123 assert_se(a.sockaddr.nl.nl_family == AF_NETLINK); in TEST()
124 assert_se(a.sockaddr.nl.nl_groups == 10); in TEST()
127 assert_se(a.sockaddr.nl.nl_family == AF_NETLINK); in TEST()
128 assert_se(a.sockaddr.nl.nl_groups == 10); in TEST()
/systemd-251/src/network/
Dnetworkd-queue.c236 static int request_netlink_handler(sd_netlink *nl, sd_netlink_message *m, Request *req) { in request_netlink_handler() argument
249 return req->netlink_handler(nl, m, req, req->link, req->userdata); in request_netlink_handler()
254 int request_call_netlink_async(sd_netlink *nl, sd_netlink_message *m, Request *req) { in request_call_netlink_async() argument
257 assert(nl); in request_call_netlink_async()
261 r = netlink_call_async(nl, NULL, m, request_netlink_handler, request_destroy_callback, req); in request_call_netlink_async()
Dnetworkd-queue.h16 typedef int (*request_netlink_handler_t)(sd_netlink *nl, sd_netlink_message *m, Request *req, Link …
137 int request_call_netlink_async(sd_netlink *nl, sd_netlink_message *m, Request *req);
/systemd-251/src/libsystemd/sd-journal/
Djournal-send.c254 char *c, *nl; in sd_journal_sendv() local
267 nl = memchr(iov[i].iov_base, '\n', iov[i].iov_len); in sd_journal_sendv()
268 if (nl) { in sd_journal_sendv()
269 if (_unlikely_(nl < c)) in sd_journal_sendv()
/systemd-251/src/shared/
Dcgroup-show.c213 _cleanup_free_ char *nl = NULL; in show_cgroup_name() local
216 r = flistxattr_malloc(fd, &nl); in show_cgroup_name()
220 NULSTR_FOREACH(xa, nl) { in show_cgroup_name()
/systemd-251/src/portable/
Dportablectl.c305 bool nl = false, header = false; in inspect_image() local
341 nl = true; in inspect_image()
390 if (nl) in inspect_image()
396 nl = true; in inspect_image()
465 if (nl) in inspect_image()
471 nl = true; in inspect_image()
/systemd-251/src/locale/
Dkbd-model-map4 nl nl pc105 - terminate:ctrl_alt_bksp
/systemd-251/test/test-keymap-util/
Dkbd-model-map4 nl nl pc105 - terminate:ctrl_alt_bksp
/systemd-251/po/
DLINGUAS21 nl

12