Home
last modified time | relevance | path

Searched refs:cmsghdr (Results 1 – 25 of 86) sorted by relevance

1234

/freebsd-12.1/tools/regression/sockets/unix_cmsg/
H A Duc_common.c270 const struct cmsghdr *cmsghdr; in uc_message_send() local
279 if (cmsghdr != NULL) in uc_message_send()
317 const struct cmsghdr *cmsghdr; in uc_message_recv() local
341 if (cmsghdr != NULL) in uc_message_recv()
425 uc_check_cmsghdr(const struct cmsghdr *cmsghdr, int type, size_t size) in uc_check_cmsghdr() argument
427 if (cmsghdr == NULL) { in uc_check_cmsghdr()
433 cmsghdr->cmsg_level); in uc_check_cmsghdr()
484 struct cmsghdr *cmsghdr; in uc_msghdr_init_client() local
496 cmsghdr->cmsg_type = type; in uc_msghdr_init_client()
623 uc_check_scm_creds_cmsgcred(struct cmsghdr *cmsghdr) in uc_check_scm_creds_cmsgcred() argument
[all …]
H A Duc_common.h61 int uc_check_cmsghdr(const struct cmsghdr *cmsghdr, int type, size_t size);
85 int uc_check_scm_creds_cmsgcred(struct cmsghdr *cmsghdr);
86 int uc_check_scm_creds_sockcred(struct cmsghdr *cmsghdr);
H A Dt_cmsg_len.c51 struct cmsghdr *cmsghdr; in t_cmsg_len_client() local
70 cmsghdr = CMSG_FIRSTHDR(&msghdr); in t_cmsg_len_client()
78 cmsghdr->cmsg_len = socklen; in t_cmsg_len_client()
83 (u_int)cmsghdr->cmsg_len); in t_cmsg_len_client()
90 (u_int)cmsghdr->cmsg_len, (u_int)CMSG_LEN(0)); in t_cmsg_len_client()
H A Dt_cmsgcred_sockcred.c48 struct cmsghdr *cmsghdr; in t_cmsgcred_sockcred_server() local
95 if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) in t_cmsgcred_sockcred_server()
98 cmsghdr = CMSG_FIRSTHDR(&msghdr); in t_cmsgcred_sockcred_server()
100 if (uc_check_scm_creds_sockcred(cmsghdr) < 0) in t_cmsgcred_sockcred_server()
103 if (uc_check_scm_creds_cmsgcred(cmsghdr) < 0) in t_cmsgcred_sockcred_server()
H A Dt_cmsgcred.c82 struct cmsghdr *cmsghdr; in t_cmsgcred_server() local
118 if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) in t_cmsgcred_server()
121 cmsghdr = CMSG_FIRSTHDR(&msghdr); in t_cmsgcred_server()
122 if (uc_check_scm_creds_cmsgcred(cmsghdr) < 0) in t_cmsgcred_server()
H A Dt_xxxtime.c.in46 check_scm_%%TTYPE%%(struct cmsghdr *cmsghdr)
50 if (uc_check_cmsghdr(cmsghdr, %%SCM_TTYPE%%, sizeof(struct %%DTYPE%%)) < 0)
53 bt = (struct %%DTYPE%% *)CMSG_DATA(cmsghdr);
104 struct cmsghdr *cmsghdr; variable
140 if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0)
143 cmsghdr = CMSG_FIRSTHDR(&msghdr);
144 if (check_scm_%%TTYPE%%(cmsghdr) < 0)
H A Dt_sockcred.c76 struct cmsghdr *cmsghdr; in t_sockcred_server() local
136 if (uc_check_msghdr(&msghdr, sizeof(*cmsghdr)) < 0) in t_sockcred_server()
139 cmsghdr = CMSG_FIRSTHDR(&msghdr); in t_sockcred_server()
140 if (uc_check_scm_creds_sockcred(cmsghdr) < 0) in t_sockcred_server()
/freebsd-12.1/sys/netinet6/
H A Din6.h663 struct cmsghdr;
707 struct cmsghdr;
710 extern int inet6_option_init(void *, struct cmsghdr **, int);
711 extern int inet6_option_append(struct cmsghdr *, const uint8_t *,
714 extern int inet6_option_next(const struct cmsghdr *, uint8_t **);
718 extern struct cmsghdr *inet6_rthdr_init(void *, int);
721 extern int inet6_rthdr_lasthop(struct cmsghdr *, unsigned int);
723 extern int inet6_rthdr_reverse(const struct cmsghdr *, struct cmsghdr *);
725 extern int inet6_rthdr_segments(const struct cmsghdr *);
726 extern struct in6_addr *inet6_rthdr_getaddr(struct cmsghdr *, int);
[all …]
/freebsd-12.1/lib/libc/net/
H A Drthdr.c69 struct cmsghdr *
72 struct cmsghdr *ch = (struct cmsghdr *)bp; in inet6_rthdr_init()
99 inet6_rthdr_add(struct cmsghdr *cmsg, const struct in6_addr *addr, u_int flags) in inet6_rthdr_add()
141 inet6_rthdr_lasthop(struct cmsghdr *cmsg, unsigned int flags) in inet6_rthdr_lasthop()
179 inet6_rthdr_reverse(const struct cmsghdr *in, struct cmsghdr *out)
187 inet6_rthdr_segments(const struct cmsghdr *cmsg) in inet6_rthdr_segments()
210 inet6_rthdr_getaddr(struct cmsghdr *cmsg, int idx) in inet6_rthdr_getaddr()
240 inet6_rthdr_getflags(const struct cmsghdr *cmsg, int idx) in inet6_rthdr_getflags()
H A Dip6opt.c83 inet6_option_init(void *bp, struct cmsghdr **cmsgp, int type) in inet6_option_init()
85 struct cmsghdr *ch = (struct cmsghdr *)bp; in inet6_option_init()
110 inet6_option_append(struct cmsghdr *cmsg, const u_int8_t *typep, int multx, in inet6_option_append()
179 inet6_option_alloc(struct cmsghdr *cmsg, int datalen, int multx, int plusy) in inet6_option_alloc()
241 inet6_option_next(const struct cmsghdr *cmsg, u_int8_t **tptrp) in inet6_option_next()
297 inet6_option_find(const struct cmsghdr *cmsg, u_int8_t **tptrp, int type) in inet6_option_find()
H A Dsctp_sys_calls.c543 struct cmsghdr *cmsg; in sctp_sendmsg()
604 cmsg = (struct cmsghdr *)cmsgbuf; in sctp_sendmsg()
655 struct cmsghdr *cmsg; in sctp_send()
671 cmsg = (struct cmsghdr *)cmsgbuf; in sctp_send()
827 struct cmsghdr *cmsg; in sctp_recvmsg()
894 struct cmsghdr *cmsg; in sctp_recvv()
987 struct cmsghdr *cmsg; in sctp_sendv()
1014 cmsg = (struct cmsghdr *)cmsgbuf; in sctp_sendv()
1048 cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_prinfo))); in sctp_sendv()
1124 cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct in_addr))); in sctp_sendv()
[all …]
/freebsd-12.1/sys/sys/
H A Dsocket.h478 struct cmsghdr { struct
531 _ALIGN(sizeof(struct cmsghdr)))
537 _ALIGN(sizeof(struct cmsghdr)) > \
539 (struct cmsghdr *)0 : \
540 (struct cmsghdr *)(void *)((char *)(cmsg) + \
541 _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)))
548 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
549 (struct cmsghdr *)(mhdr)->msg_control : \
550 (struct cmsghdr *)0)
554 #define CMSG_SPACE(l) (_ALIGN(sizeof(struct cmsghdr)) + _ALIGN(l))
[all …]
/freebsd-12.1/tests/sys/kern/
H A Dunix_passfd_test.c124 struct cmsghdr *cm; in putfds()
127 cm = (struct cmsghdr *)buf; in putfds()
199 struct cmsghdr *cmsghdr; in recvfd_payload() local
224 cmsghdr = CMSG_FIRSTHDR(&msghdr); in recvfd_payload()
225 ATF_REQUIRE_MSG(cmsghdr != NULL, in recvfd_payload()
229 for (; cmsghdr != NULL; cmsghdr = CMSG_NXTHDR(&msghdr, cmsghdr)) { in recvfd_payload()
230 if (cmsghdr->cmsg_level == SOL_SOCKET && in recvfd_payload()
231 cmsghdr->cmsg_type == SCM_RIGHTS && in recvfd_payload()
232 cmsghdr->cmsg_len == CMSG_LEN(sizeof(int))) { in recvfd_payload()
235 } else if (cmsghdr->cmsg_level == SOL_SOCKET && in recvfd_payload()
[all …]
/freebsd-12.1/tools/regression/netinet6/inet6_rth/
H A Dinet6_rth-segments.c44 static void init_hdrs(struct msghdr *, struct cmsghdr *, char *, size_t);
227 struct cmsghdr cmh; in test_cmsg_nexthdr()
228 struct cmsghdr *cmhp, *cmhnextp; in test_cmsg_nexthdr()
285 struct cmsghdr cmh; in test_cmsg_firsthdr()
286 struct cmsghdr *cmhp; in test_cmsg_firsthdr()
328 init_hdrs(struct msghdr *mhp, struct cmsghdr *cmhp, char *bufp, size_t bufsize) in init_hdrs()
333 memset((void *)cmhp, 0, sizeof(struct cmsghdr)); in init_hdrs()
/freebsd-12.1/contrib/pf/pflogd/
H A Dprivsep_fdpass.c54 struct cmsghdr hdr; in send_fd()
57 struct cmsghdr *cmsg; in send_fd()
93 struct cmsghdr hdr; in receive_fd()
96 struct cmsghdr *cmsg; in receive_fd()
/freebsd-12.1/crypto/openssh/
H A Dmonitor_fdpass.c58 struct cmsghdr hdr; in mm_send_fd()
61 struct cmsghdr *cmsg; in mm_send_fd()
119 struct cmsghdr hdr; in mm_receive_fd()
122 struct cmsghdr *cmsg; in mm_receive_fd()
H A Ddefines.h540 #define CMSG_LEN(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + (len))
545 #define CMSG_SPACE(len) (__CMSG_ALIGN(sizeof(struct cmsghdr)) + __CMSG_ALIGN(len))
550 #define CMSG_DATA(cmsg) ((u_char *)(cmsg) + __CMSG_ALIGN(sizeof(struct cmsghdr)))
559 ((mhdr)->msg_controllen >= sizeof(struct cmsghdr) ? \
560 (struct cmsghdr *)(mhdr)->msg_control : \
561 (struct cmsghdr *)NULL)
/freebsd-12.1/lib/libnv/
H A Dmsgio.c70 msghdr_add_fd(struct cmsghdr *cmsg, int fd) in msghdr_add_fd()
84 msghdr_get_fd(struct cmsghdr *cmsg) in msghdr_get_fd()
171 struct cmsghdr *cmsg; in cred_send()
211 struct cmsghdr *cmsg; in cred_recv()
246 struct cmsghdr *cmsg; in fd_package_send()
295 struct cmsghdr *cmsg; in fd_package_recv()
/freebsd-12.1/contrib/netbsd-tests/net/fdpass/
H A Dfdpass.c51 struct cmsghdr hdr; in send_fd()
54 struct cmsghdr *cmsg; in send_fd()
103 struct cmsghdr hdr; in recv_fd()
106 struct cmsghdr *cmsg; in recv_fd()
/freebsd-12.1/sys/compat/cloudabi/
H A Dcloudabi_sock.c109 struct cmsghdr *chdr; in cloudabi_sock_recv()
161 struct cmsghdr *chdr; in cloudabi_sock_send()
167 chdr = mtod(control, struct cmsghdr *); in cloudabi_sock_send()
/freebsd-12.1/contrib/compiler-rt/lib/sanitizer_common/
H A Dsanitizer_platform_limits_openbsd.cc185 CHECK_TYPE_SIZE(cmsghdr);
186 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
187 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
188 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
H A Dsanitizer_platform_limits_solaris.cc240 CHECK_TYPE_SIZE(cmsghdr);
241 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_len);
242 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_level);
243 CHECK_SIZE_AND_OFFSET(cmsghdr, cmsg_type);
/freebsd-12.1/usr.bin/truss/
H A Dsyscalls.c1296 print_gen_cmsg(FILE *fp, struct cmsghdr *cmsghdr) in print_gen_cmsg() argument
1301 for (q = CMSG_DATA(cmsghdr); in print_gen_cmsg()
1302 q < (u_char *)cmsghdr + cmsghdr->cmsg_len; q++) { in print_gen_cmsg()
1415 print_sctp_cmsg(FILE *fp, bool receive, struct cmsghdr *cmsghdr) in print_sctp_cmsg() argument
1420 len = cmsghdr->cmsg_len; in print_sctp_cmsg()
1421 data = CMSG_DATA(cmsghdr); in print_sctp_cmsg()
1495 struct cmsghdr *cmsghdr; in print_cmsgs() local
1517 cmsghdr != NULL; in print_cmsgs()
1518 cmsghdr = CMSG_NXTHDR(msghdr, cmsghdr)) { in print_cmsgs()
1520 type = cmsghdr->cmsg_type; in print_cmsgs()
[all …]
/freebsd-12.1/contrib/mandoc/
H A Dcatman.c75 struct cmsghdr cmsghdr; in sock_fd_write() member
78 struct cmsghdr *cmsg; in sock_fd_write()
/freebsd-12.1/sys/kern/
H A Duipc_usrreq.c1982 struct cmsghdr *cm = mtod(control, struct cmsghdr *); in unp_externalize()
2078 cm = (struct cmsghdr *) in unp_externalize()
2126 struct cmsghdr *cp; in unp_internalize_cleanup_rights()
2132 cp = mtod(m, struct cmsghdr *); in unp_internalize_cleanup_rights()
2149 struct cmsghdr *cm; in unp_internalize()
2325 cm = (struct cmsghdr *) in unp_internalize()
2345 const struct cmsghdr *cm; in unp_addsockcred()
2370 cm = mtod(n, struct cmsghdr *); in unp_addsockcred()
2677 struct cmsghdr *cm; in unp_scan()
2686 cm = mtod(m, struct cmsghdr *); in unp_scan()
[all …]

1234