Searched refs:cmsg (Results 1 - 22 of 22) sorted by relevance

/systemd/src/basic/
H A Dsocket-util.h136 #define CMSG_FOREACH(cmsg, mh) \
137 for ((cmsg) = CMSG_FIRSTHDR(mh); (cmsg); (cmsg) = CMSG_NXTHDR((mh), (cmsg)))
H A Dfd-util.c324 struct cmsghdr *cmsg; local
328 CMSG_FOREACH(cmsg, mh)
329 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS)
330 close_many((int*) CMSG_DATA(cmsg), (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int));
H A Dsocket-util.c880 struct cmsghdr *cmsg; local
885 cmsg = CMSG_FIRSTHDR(&mh);
886 cmsg->cmsg_level = SOL_SOCKET;
887 cmsg->cmsg_type = SCM_RIGHTS;
888 cmsg->cmsg_len = CMSG_LEN(sizeof(int));
889 memcpy(CMSG_DATA(cmsg), &fd, sizeof(int));
907 struct cmsghdr *cmsg, *found = NULL; local
922 CMSG_FOREACH(cmsg, &mh) {
923 if (cmsg->cmsg_level == SOL_SOCKET &&
924 cmsg
[all...]
/systemd/src/libsystemd/sd-daemon/
H A Dsd-daemon.c417 struct cmsghdr *cmsg = NULL; local
475 cmsg = CMSG_FIRSTHDR(&msghdr);
477 cmsg->cmsg_level = SOL_SOCKET;
478 cmsg->cmsg_type = SCM_RIGHTS;
479 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * n_fds);
481 memcpy(CMSG_DATA(cmsg), fds, sizeof(int) * n_fds);
484 assert_se(cmsg = CMSG_NXTHDR(&msghdr, cmsg));
490 cmsg->cmsg_level = SOL_SOCKET;
491 cmsg
[all...]
/systemd/src/libsystemd/sd-bus/
H A Dbus-container.c162 struct cmsghdr *cmsg; local
246 CMSG_FOREACH(cmsg, &mh) {
247 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
253 fds = (int*) CMSG_DATA(cmsg);
254 n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
H A Dbus-socket.c564 struct cmsghdr *cmsg; local
566 CMSG_FOREACH(cmsg, &mh)
567 if (cmsg->cmsg_level == SOL_SOCKET &&
568 cmsg->cmsg_type == SCM_RIGHTS) {
574 j = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
575 close_many((int*) CMSG_DATA(cmsg), j);
579 cmsg->cmsg_level, cmsg->cmsg_type);
977 struct cmsghdr *cmsg; local
979 CMSG_FOREACH(cmsg,
[all...]
/systemd/src/resolve/
H A Dresolved-dns-stream.c72 struct cmsghdr *cmsg; local
118 CMSG_FOREACH(cmsg, &mh) {
120 if (cmsg->cmsg_level == IPPROTO_IPV6) {
123 switch (cmsg->cmsg_type) {
126 struct in6_pktinfo *i = (struct in6_pktinfo*) CMSG_DATA(cmsg);
134 s->ttl = *(int *) CMSG_DATA(cmsg);
138 } else if (cmsg->cmsg_level == IPPROTO_IP) {
141 switch (cmsg->cmsg_type) {
144 struct in_pktinfo *i = (struct in_pktinfo*) CMSG_DATA(cmsg);
152 s->ttl = *(int *) CMSG_DATA(cmsg);
[all...]
H A Dresolved-manager.c618 struct cmsghdr *cmsg; local
675 CMSG_FOREACH(cmsg, &mh) {
677 if (cmsg->cmsg_level == IPPROTO_IPV6) {
680 switch (cmsg->cmsg_type) {
683 struct in6_pktinfo *i = (struct in6_pktinfo*) CMSG_DATA(cmsg);
693 p->ttl = *(int *) CMSG_DATA(cmsg);
697 } else if (cmsg->cmsg_level == IPPROTO_IP) {
700 switch (cmsg->cmsg_type) {
703 struct in_pktinfo *i = (struct in_pktinfo*) CMSG_DATA(cmsg);
713 p->ttl = *(int *) CMSG_DATA(cmsg);
828 struct cmsghdr *cmsg; local
878 struct cmsghdr *cmsg; local
[all...]
/systemd/src/libsystemd/sd-netlink/
H A Dnetlink-socket.c269 struct cmsghdr *cmsg; local
301 CMSG_FOREACH(cmsg, &msg) {
302 if (cmsg->cmsg_level == SOL_NETLINK &&
303 cmsg->cmsg_type == NETLINK_PKTINFO &&
304 cmsg->cmsg_len == CMSG_LEN(sizeof(struct nl_pktinfo))) {
305 struct nl_pktinfo *pktinfo = (void *)CMSG_DATA(cmsg);
/systemd/src/journal/
H A Djournald-syslog.c58 struct cmsghdr *cmsg; local
73 cmsg = CMSG_FIRSTHDR(&msghdr);
74 cmsg->cmsg_level = SOL_SOCKET;
75 cmsg->cmsg_type = SCM_CREDENTIALS;
76 cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred));
77 memcpy(CMSG_DATA(cmsg), ucred, sizeof(struct ucred));
78 msghdr.msg_controllen = cmsg->cmsg_len;
104 memcpy(CMSG_DATA(cmsg), &u, sizeof(struct ucred));
H A Djournald-server.c1156 struct cmsghdr *cmsg; local
1223 CMSG_FOREACH(cmsg, &msghdr) {
1225 if (cmsg->cmsg_level == SOL_SOCKET &&
1226 cmsg->cmsg_type == SCM_CREDENTIALS &&
1227 cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
1228 ucred = (struct ucred*) CMSG_DATA(cmsg);
1229 else if (cmsg->cmsg_level == SOL_SOCKET &&
1230 cmsg->cmsg_type == SCM_SECURITY) {
1231 label = (char*) CMSG_DATA(cmsg);
1232 label_len = cmsg
[all...]
H A Djournald-stream.c750 struct cmsghdr *cmsg; local
765 cmsg = CMSG_FIRSTHDR(&msghdr);
766 cmsg->cmsg_level = SOL_SOCKET;
767 cmsg->cmsg_type = SCM_RIGHTS;
768 cmsg->cmsg_len = CMSG_LEN(sizeof(int));
770 memcpy(CMSG_DATA(cmsg), &s->fd, sizeof(int));
/systemd/src/libsystemd-network/
H A Dsd-dhcp-server.c303 struct cmsghdr *cmsg; local
312 cmsg = CMSG_FIRSTHDR(&msg);
313 assert(cmsg);
315 cmsg->cmsg_level = IPPROTO_IP;
316 cmsg->cmsg_type = IP_PKTINFO;
317 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
323 pktinfo = (struct in_pktinfo*) CMSG_DATA(cmsg);
957 struct cmsghdr *cmsg; local
983 CMSG_FOREACH(cmsg, &msg) {
984 if (cmsg
[all...]
H A Dsd-ndisc.c491 struct cmsghdr *cmsg; local
536 CMSG_FOREACH(cmsg, &msg) {
537 if (cmsg->cmsg_level == SOL_IPV6 &&
538 cmsg->cmsg_type == IPV6_HOPLIMIT &&
539 cmsg->cmsg_len == CMSG_LEN(sizeof(int))) {
540 int hops = *(int*)CMSG_DATA(cmsg);
H A Dsd-dhcp-client.c1617 struct cmsghdr *cmsg; local
1649 CMSG_FOREACH(cmsg, &msg) {
1650 if (cmsg->cmsg_level == SOL_PACKET &&
1651 cmsg->cmsg_type == PACKET_AUXDATA &&
1652 cmsg->cmsg_len == CMSG_LEN(sizeof(struct tpacket_auxdata))) {
1653 struct tpacket_auxdata *aux = (struct tpacket_auxdata*)CMSG_DATA(cmsg);
/systemd/src/udev/
H A Dudev-ctrl.c327 struct cmsghdr *cmsg; local
382 cmsg = CMSG_FIRSTHDR(&smsg);
384 if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
389 cred = (struct ucred *) CMSG_DATA(cmsg);
H A Dudevd.c861 struct cmsghdr *cmsg; local
880 CMSG_FOREACH(cmsg, &msghdr) {
881 if (cmsg->cmsg_level == SOL_SOCKET &&
882 cmsg->cmsg_type == SCM_CREDENTIALS &&
883 cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
884 ucred = (struct ucred*) CMSG_DATA(cmsg);
/systemd/src/libudev/
H A Dlibudev-monitor.c588 struct cmsghdr *cmsg; local
639 cmsg = CMSG_FIRSTHDR(&smsg);
640 if (cmsg == NULL || cmsg->cmsg_type != SCM_CREDENTIALS) {
645 cred = (struct ucred *)CMSG_DATA(cmsg);
/systemd/src/coredump/
H A Dcoredump.c774 struct cmsghdr *cmsg, *found = NULL; local
779 CMSG_FOREACH(cmsg, &mh) {
780 if (cmsg->cmsg_level == SOL_SOCKET &&
781 cmsg->cmsg_type == SCM_RIGHTS &&
782 cmsg->cmsg_len == CMSG_LEN(sizeof(int))) {
784 found = cmsg;
/systemd/src/import/
H A Dimportd.c579 struct cmsghdr *cmsg; local
597 CMSG_FOREACH(cmsg, &msghdr)
598 if (cmsg->cmsg_level == SOL_SOCKET &&
599 cmsg->cmsg_type == SCM_CREDENTIALS &&
600 cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred)))
601 ucred = (struct ucred*) CMSG_DATA(cmsg);
/systemd/src/timesync/
H A Dtimesyncd-manager.c494 struct cmsghdr *cmsg; local
535 CMSG_FOREACH(cmsg, &msghdr) {
536 if (cmsg->cmsg_level != SOL_SOCKET)
539 switch (cmsg->cmsg_type) {
541 recv_time = (struct timespec *) CMSG_DATA(cmsg);
/systemd/src/core/
H A Dmanager.c1537 struct cmsghdr *cmsg; local
1561 CMSG_FOREACH(cmsg, &msghdr) {
1562 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SCM_RIGHTS) {
1564 fd_array = (int*) CMSG_DATA(cmsg);
1565 n_fds = (cmsg->cmsg_len - CMSG_LEN(0)) / sizeof(int);
1567 } else if (cmsg->cmsg_level == SOL_SOCKET &&
1568 cmsg->cmsg_type == SCM_CREDENTIALS &&
1569 cmsg->cmsg_len == CMSG_LEN(sizeof(struct ucred))) {
1571 ucred = (struct ucred*) CMSG_DATA(cmsg);
[all...]

Completed in 1557 milliseconds