Lines Matching refs:cmsg_len
67 print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) in print_fds() argument
69 size_t nfd = cmsg_len > CMSG_LEN(0) in print_fds()
70 ? (cmsg_len - CMSG_LEN(0)) / sizeof(int) : 0; in print_fds()
96 const size_t cmsg_len) in test_scm_rights1() argument
99 cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); in test_scm_rights1()
100 if (cmsg_len >= CMSG_LEN(0) in test_scm_rights1()
106 if (msg_controllen >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) in test_scm_rights1()
107 cmsg->cmsg_len = cmsg_len; in test_scm_rights1()
114 cmsg_len < msg_controllen ? cmsg_len : msg_controllen; in test_scm_rights1()
131 ", cmsg_type=SCM_RIGHTS", (unsigned long) cmsg_len); in test_scm_rights1()
149 const size_t *const cmsg_len) in test_scm_rights2() argument
152 cmsg_len[0] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[0]) : CMSG_LEN(0), in test_scm_rights2()
153 cmsg_len[1] > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len[1]) : CMSG_LEN(0) in test_scm_rights2()
155 if (cmsg_len[0] < CMSG_LEN(0) in test_scm_rights2()
164 cmsg[0]->cmsg_len = cmsg_len[0]; in test_scm_rights2()
167 if (cmsg_len[0] > CMSG_LEN(0)) in test_scm_rights2()
168 memcpy(CMSG_DATA(cmsg[0]), src[0], cmsg_len[0] - CMSG_LEN(0)); in test_scm_rights2()
171 if (msg_controllen1 >= MIN_SIZE_OF(struct cmsghdr, cmsg_len)) in test_scm_rights2()
172 cmsg[1]->cmsg_len = cmsg_len[1]; in test_scm_rights2()
178 cmsg_len[1] < msg_controllen1 ? cmsg_len[1] : msg_controllen1; in test_scm_rights2()
191 (unsigned long) cmsg_len[0]); in test_scm_rights2()
192 print_fds(cmsg[0], cmsg_len[0]); in test_scm_rights2()
194 (unsigned long) cmsg_len[1]); in test_scm_rights2()
212 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * nfds); in test_scm_rights3()
227 (unsigned) cmsg->cmsg_len); in test_scm_rights3()
228 print_fds(cmsg, cmsg->cmsg_len); in test_scm_rights3()
239 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval)); in test_scm_timestamp()
255 (unsigned) cmsg->cmsg_len, in test_scm_timestamp()
262 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long)); in test_scm_timestamp()
274 (unsigned) cmsg->cmsg_len, in test_scm_timestamp()
284 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec)); in test_scm_timestampns()
300 (unsigned) cmsg->cmsg_len, in test_scm_timestampns()
307 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long)); in test_scm_timestampns()
320 (unsigned) cmsg->cmsg_len, in test_scm_timestampns()
330 cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec)); in test_scm_timestamping()
351 (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, in test_scm_timestamping()
362 cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long)); in test_scm_timestamping()
375 (unsigned) cmsg->cmsg_len, in test_scm_timestamping()
380 print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) in print_security() argument
382 int n = cmsg_len > CMSG_LEN(0) ? cmsg_len - CMSG_LEN(0) : 0; in print_security()
394 const size_t cmsg_len, in test_scm_security() argument
399 cmsg_len > CMSG_LEN(0) ? CMSG_ALIGN(cmsg_len) : CMSG_LEN(0); in test_scm_security()
400 if (cmsg_len >= CMSG_LEN(0) in test_scm_security()
406 cmsg->cmsg_len = cmsg_len; in test_scm_security()
411 cmsg_len < msg_controllen ? cmsg_len : msg_controllen; in test_scm_security()
424 (unsigned long) cmsg_len, cmsg_level_str); in test_scm_security()
445 cmsg->cmsg_len = CMSG_LEN(0); in test_unknown_type()
450 mh->msg_controllen = cmsg->cmsg_len; in test_unknown_type()
457 (unsigned) cmsg->cmsg_len, cmsg_level_str, cmsg->cmsg_type, in test_unknown_type()
472 size_t cmsg_len; in test_sol_socket() local
474 for (cmsg_len = 0; in test_sol_socket()
475 cmsg_len <= msg_controllen + CMSG_LEN(0); in test_sol_socket()
476 cmsg_len++) { in test_sol_socket()
478 page, fds0, cmsg_len); in test_sol_socket()
489 size_t cmsg_len[2]; in test_sol_socket() local
491 for (cmsg_len[0] = CMSG_LEN(0); in test_sol_socket()
492 CMSG_ALIGN(cmsg_len[0]) + CMSG_LEN(0) <= msg_controllen in test_sol_socket()
493 && CMSG_ALIGN(cmsg_len[0]) <= CMSG_SPACE(sizeof(fds0)); in test_sol_socket()
494 cmsg_len[0]++) { in test_sol_socket()
496 msg_controllen - CMSG_ALIGN(cmsg_len[0]); in test_sol_socket()
498 for (cmsg_len[1] = 0; in test_sol_socket()
499 cmsg_len[1] <= msg_controllen1 + CMSG_LEN(0); in test_sol_socket()
500 cmsg_len[1]++) { in test_sol_socket()
502 page, fdps, cmsg_len); in test_sol_socket()
512 size_t cmsg_len; in test_sol_socket() local
514 for (cmsg_len = 0; in test_sol_socket()
515 cmsg_len <= msg_controllen + CMSG_LEN(0) in test_sol_socket()
516 && cmsg_len <= CMSG_LEN(sizeof(text)); in test_sol_socket()
517 cmsg_len++) { in test_sol_socket()
519 page, text, cmsg_len, in test_sol_socket()
542 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); in test_ip_pktinfo()
561 (unsigned) cmsg->cmsg_len, cmsg_type_str, in test_ip_pktinfo()
572 cmsg->cmsg_len = CMSG_LEN(sizeof(int)); in test_ip_uint()
587 (unsigned) cmsg->cmsg_len, cmsg_type_str, *u, len, in test_ip_uint()
598 cmsg->cmsg_len = CMSG_LEN(1); in test_ip_uint8_t()
611 (unsigned) cmsg->cmsg_len, cmsg_type_str, in test_ip_uint8_t()
641 cmsg->cmsg_len = CMSG_LEN(opts_len); in test_ip_opts()
655 (unsigned) cmsg->cmsg_len, cmsg_type_str); in test_ip_opts()
680 cmsg->cmsg_len = CMSG_LEN(sizeof(struct sock_ee)); in test_ip_recverr()
706 (unsigned) cmsg->cmsg_len, cmsg_type_str, in test_ip_recverr()
722 cmsg->cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in)); in test_ip_origdstaddr()
740 (unsigned) cmsg->cmsg_len, cmsg_type_str, in test_ip_origdstaddr()
781 cmsg->cmsg_len = CMSG_LEN(0); in test_unknown_level()
786 mh->msg_controllen = cmsg->cmsg_len; in test_unknown_level()
793 (unsigned) cmsg->cmsg_len, "SOL_TCP", cmsg->cmsg_type, in test_unknown_level()
810 cmsg->cmsg_len = len; in test_big_len()
824 (unsigned) cmsg->cmsg_len); in test_big_len()