Lines Matching refs:cmsg
67 print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len)
75 int *fdp = (int *) CMSG_DATA(cmsg);
104 struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen);
107 cmsg->cmsg_len = cmsg_len;
109 cmsg->cmsg_level = SOL_SOCKET;
111 cmsg->cmsg_type = SCM_RIGHTS;
116 memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0));
118 mh->msg_control = cmsg;
128 printf(", msg_control=%p", cmsg);
132 print_fds(cmsg, src_len);
135 printf(", %p", (void *) cmsg + aligned_cms_len);
160 struct cmsghdr *const cmsg[2] = {
164 cmsg[0]->cmsg_len = cmsg_len[0];
165 cmsg[0]->cmsg_level = SOL_SOCKET;
166 cmsg[0]->cmsg_type = SCM_RIGHTS;
168 memcpy(CMSG_DATA(cmsg[0]), src[0], cmsg_len[0] - CMSG_LEN(0));
172 cmsg[1]->cmsg_len = cmsg_len[1];
174 cmsg[1]->cmsg_level = SOL_SOCKET;
176 cmsg[1]->cmsg_type = SCM_RIGHTS;
180 memcpy(CMSG_DATA(cmsg[1]), src[1], src1_len - CMSG_LEN(0));
182 mh->msg_control = cmsg[0];
192 print_fds(cmsg[0], cmsg_len[0]);
195 print_fds(cmsg[1], src1_len);
198 printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]);
210 struct cmsghdr *cmsg = get_cmsghdr(page, len);
212 cmsg->cmsg_len = CMSG_LEN(sizeof(int) * nfds);
213 cmsg->cmsg_level = SOL_SOCKET;
214 cmsg->cmsg_type = SCM_RIGHTS;
215 int *fdp = (int *) CMSG_DATA(cmsg);
220 mh->msg_control = cmsg;
227 (unsigned) cmsg->cmsg_len);
228 print_fds(cmsg, cmsg->cmsg_len);
237 struct cmsghdr *cmsg = get_cmsghdr(page, len);
239 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval));
240 cmsg->cmsg_level = SOL_SOCKET;
241 cmsg->cmsg_type = SCM_TIMESTAMP;
242 struct timeval *tv = (struct timeval *) CMSG_DATA(cmsg);
246 mh->msg_control = cmsg;
255 (unsigned) cmsg->cmsg_len,
260 cmsg = get_cmsghdr(page, len);
262 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long));
263 cmsg->cmsg_level = SOL_SOCKET;
264 cmsg->cmsg_type = SCM_TIMESTAMP;
266 mh->msg_control = cmsg;
274 (unsigned) cmsg->cmsg_len,
282 struct cmsghdr *cmsg = get_cmsghdr(page, len);
284 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec));
285 cmsg->cmsg_level = SOL_SOCKET;
286 cmsg->cmsg_type = SCM_TIMESTAMPNS;
287 struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg);
291 mh->msg_control = cmsg;
300 (unsigned) cmsg->cmsg_len,
305 cmsg = get_cmsghdr(page, len);
307 cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long));
308 cmsg->cmsg_level = SOL_SOCKET;
309 cmsg->cmsg_type = SCM_TIMESTAMPNS;
311 mh->msg_control = cmsg;
320 (unsigned) cmsg->cmsg_len,
328 struct cmsghdr *cmsg = get_cmsghdr(page, len);
330 cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec));
331 cmsg->cmsg_level = SOL_SOCKET;
332 cmsg->cmsg_type = SCM_TIMESTAMPING;
333 struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg);
341 mh->msg_control = cmsg;
351 (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec,
360 cmsg = get_cmsghdr(page, len);
362 cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long));
363 cmsg->cmsg_level = SOL_SOCKET;
364 cmsg->cmsg_type = SCM_TIMESTAMPING;
366 mh->msg_control = cmsg;
375 (unsigned) cmsg->cmsg_len,
380 print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len)
386 printf(", cmsg_data=\"%.*s\"", n, CMSG_DATA(cmsg));
404 struct cmsghdr *cmsg = get_cmsghdr(page, msg_controllen);
406 cmsg->cmsg_len = cmsg_len;
407 cmsg->cmsg_level = cmsg_level;
408 cmsg->cmsg_type = SCM_SECURITY;
413 memcpy(CMSG_DATA(cmsg), src, src_len - CMSG_LEN(0));
415 mh->msg_control = cmsg;
425 print_security(cmsg, src_len);
428 printf(", %p", (void *) cmsg + aligned_cms_len);
443 struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0));
445 cmsg->cmsg_len = CMSG_LEN(0);
446 cmsg->cmsg_level = cmsg_level;
447 cmsg->cmsg_type = 0xfacefeed;
449 mh->msg_control = cmsg;
450 mh->msg_controllen = cmsg->cmsg_len;
457 (unsigned) cmsg->cmsg_len, cmsg_level_str, cmsg->cmsg_type,
540 struct cmsghdr *const cmsg = get_cmsghdr(page, len);
542 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo));
543 cmsg->cmsg_level = SOL_IP;
544 cmsg->cmsg_type = cmsg_type;
546 struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg);
555 mh->msg_control = cmsg;
565 (unsigned) cmsg->cmsg_len, cmsg_type_str,
579 struct cmsghdr *const cmsg = get_cmsghdr(page, len);
581 cmsg->cmsg_len = CMSG_LEN(sizeof(int));
582 cmsg->cmsg_level = SOL_IP;
583 cmsg->cmsg_type = cmsg_type;
585 unsigned int *u = (void *) CMSG_DATA(cmsg);
588 mh->msg_control = cmsg;
596 (unsigned) cmsg->cmsg_len, cmsg_type_str, *u, len,
605 struct cmsghdr *const cmsg = get_cmsghdr(page, len);
607 cmsg->cmsg_len = CMSG_LEN(1);
608 cmsg->cmsg_level = SOL_IP;
609 cmsg->cmsg_type = cmsg_type;
610 *CMSG_DATA(cmsg) = 'A';
612 mh->msg_control = cmsg;
620 (unsigned) cmsg->cmsg_len, cmsg_type_str,
648 struct cmsghdr *cmsg = get_cmsghdr(page, len);
650 cmsg->cmsg_len = CMSG_LEN(opts_len);
651 cmsg->cmsg_level = SOL_IP;
652 cmsg->cmsg_type = cmsg_type;
655 CMSG_DATA(cmsg)[i] = 'A' + i;
657 mh->msg_control = cmsg;
664 (unsigned) cmsg->cmsg_len, cmsg_type_str);
665 print_ip_opts(CMSG_DATA(cmsg), opts_len);
687 struct cmsghdr *const cmsg = get_cmsghdr(page, len);
689 cmsg->cmsg_len = CMSG_LEN(sizeof(struct sock_ee));
690 cmsg->cmsg_level = SOL_IP;
691 cmsg->cmsg_type = cmsg_type;
693 struct sock_ee *const e = (struct sock_ee *) CMSG_DATA(cmsg);
704 mh->msg_control = cmsg;
715 (unsigned) cmsg->cmsg_len, cmsg_type_str,
729 struct cmsghdr *const cmsg = get_cmsghdr(page, len);
731 cmsg->cmsg_len = CMSG_LEN(sizeof(struct sockaddr_in));
732 cmsg->cmsg_level = SOL_IP;
733 cmsg->cmsg_type = cmsg_type;
735 struct sockaddr_in *const sin = (struct sockaddr_in *) CMSG_DATA(cmsg);
740 mh->msg_control = cmsg;
749 (unsigned) cmsg->cmsg_len, cmsg_type_str,
788 struct cmsghdr *cmsg = get_cmsghdr(page, CMSG_LEN(0));
790 cmsg->cmsg_len = CMSG_LEN(0);
791 cmsg->cmsg_level = SOL_TCP;
792 cmsg->cmsg_type = 0xdeadbeef;
794 mh->msg_control = cmsg;
795 mh->msg_controllen = cmsg->cmsg_len;
802 (unsigned) cmsg->cmsg_len, "SOL_TCP", cmsg->cmsg_type,
818 struct cmsghdr *const cmsg = tail_alloc(len);
819 cmsg->cmsg_len = len;
820 cmsg->cmsg_level = SOL_SOCKET;
821 cmsg->cmsg_type = SCM_RIGHTS;
823 mh->msg_control = cmsg;
833 (unsigned) cmsg->cmsg_len);
834 print_fds(cmsg, optmem_max);