/tools/testing/selftests/android/ion/ |
D | ipcsocket.c | 110 struct cmsghdr *cmsg; in sendtosocket() local 144 cmsg = CMSG_FIRSTHDR(&msgh); in sendtosocket() 145 cmsg->cmsg_level = SOL_SOCKET; in sendtosocket() 146 cmsg->cmsg_type = SCM_RIGHTS; in sendtosocket() 147 cmsg->cmsg_len = CMSG_LEN(len); in sendtosocket() 148 memcpy(CMSG_DATA(cmsg), &buffd, len); in sendtosocket() 166 struct cmsghdr *cmsg; in receivefromsocket() local 197 cmsg = CMSG_FIRSTHDR(&msgh); in receivefromsocket() 198 cmsg->cmsg_level = SOL_SOCKET; in receivefromsocket() 199 cmsg->cmsg_type = SCM_RIGHTS; in receivefromsocket() [all …]
|
/tools/perf/trace/beauty/include/linux/ |
D | socket.h | 103 #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg)) argument 104 #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg)) argument 108 #define CMSG_DATA(cmsg) \ argument 109 ((void *)(cmsg) + sizeof(struct cmsghdr)) 110 #define CMSG_USER_DATA(cmsg) \ argument 111 ((void __user *)(cmsg) + sizeof(struct cmsghdr)) 119 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \ argument 120 (cmsg)->cmsg_len <= (unsigned long) \ 122 ((char *)(cmsg) - (char *)(mhdr)->msg_control))) 123 #define for_each_cmsghdr(cmsg, msg) \ argument [all …]
|
/tools/testing/selftests/net/ |
D | timestamping.c | 140 struct cmsghdr *cmsg; in printpacket() local 153 for (cmsg = CMSG_FIRSTHDR(msg); in printpacket() 154 cmsg; in printpacket() 155 cmsg = CMSG_NXTHDR(msg, cmsg)) { in printpacket() 156 printf(" cmsg len %zu: ", cmsg->cmsg_len); in printpacket() 157 switch (cmsg->cmsg_level) { in printpacket() 160 switch (cmsg->cmsg_type) { in printpacket() 163 (struct timeval *)CMSG_DATA(cmsg); in printpacket() 171 (struct timespec *)CMSG_DATA(cmsg); in printpacket() 179 (struct timespec *)CMSG_DATA(cmsg); in printpacket() [all …]
|
D | udpgso_bench_tx.c | 139 static void flush_cmsg(struct cmsghdr *cmsg) in flush_cmsg() argument 147 switch (cmsg->cmsg_level) { in flush_cmsg() 149 if (cmsg->cmsg_type == SO_TIMESTAMPING) { in flush_cmsg() 151 tss = (struct scm_timestamping *)CMSG_DATA(cmsg); in flush_cmsg() 156 cmsg->cmsg_type); in flush_cmsg() 161 switch (cmsg->cmsg_type) { in flush_cmsg() 165 err = (struct sock_extended_err *)CMSG_DATA(cmsg); in flush_cmsg() 200 cmsg->cmsg_type); in flush_cmsg() 206 cmsg->cmsg_level); in flush_cmsg() 216 struct cmsghdr *cmsg; in flush_errqueue_recv() local [all …]
|
D | rxtimestamp.c | 183 struct cmsghdr *cmsg; in do_recv() local 207 for (cmsg = CMSG_FIRSTHDR(&hdr); cmsg != NULL; in do_recv() 208 cmsg = CMSG_NXTHDR(&hdr, cmsg)) { in do_recv() 209 if (cmsg->cmsg_level != SOL_SOCKET) in do_recv() 211 cmsg->cmsg_level); in do_recv() 212 switch (cmsg->cmsg_type) { in do_recv() 220 ts = (struct scm_timestamping *)CMSG_DATA(cmsg); in do_recv() 227 error(1, 0, "Unexpected cmsg_type %d", cmsg->cmsg_type); in do_recv()
|
D | udpgso_bench_rx.c | 220 struct cmsghdr *cmsg; in recv_msg() local 235 for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; in recv_msg() 236 cmsg = CMSG_NXTHDR(&msg, cmsg)) { in recv_msg() 237 if (cmsg->cmsg_level == SOL_UDP in recv_msg() 238 && cmsg->cmsg_type == UDP_GRO) { in recv_msg() 239 *gso_size = *(int *)CMSG_DATA(cmsg); in recv_msg()
|
D | msg_zerocopy.c | 363 struct cmsghdr *cmsg; in do_recvmsg_completion() local 377 for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { in do_recvmsg_completion() 378 if (cmsg->cmsg_level == SOL_RDS && in do_recvmsg_completion() 379 cmsg->cmsg_type == RDS_CMSG_ZCOPY_COMPLETION) { in do_recvmsg_completion() 381 ck = (struct rds_zcopy_cookies *)CMSG_DATA(cmsg); in do_recvmsg_completion() 387 cmsg->cmsg_level, cmsg->cmsg_type); in do_recvmsg_completion()
|
D | tls.c | 1120 struct cmsghdr *cmsg; in TEST_F() local 1133 cmsg = CMSG_FIRSTHDR(&msg); in TEST_F() 1134 cmsg->cmsg_level = SOL_TLS; in TEST_F() 1136 cmsg->cmsg_type = TLS_SET_RECORD_TYPE; in TEST_F() 1137 cmsg->cmsg_len = CMSG_LEN(cmsg_len); in TEST_F() 1138 *CMSG_DATA(cmsg) = record_type; in TEST_F() 1139 msg.msg_controllen = cmsg->cmsg_len; in TEST_F() 1148 cmsg = CMSG_FIRSTHDR(&msg); in TEST_F() 1149 EXPECT_NE(cmsg, NULL); in TEST_F() 1150 EXPECT_EQ(cmsg->cmsg_level, SOL_TLS); in TEST_F() [all …]
|
D | txtimestamp.c | 485 struct cmsghdr *cmsg; in do_test() local 628 cmsg = CMSG_FIRSTHDR(&msg); in do_test() 629 cmsg->cmsg_level = SOL_SOCKET; in do_test() 630 cmsg->cmsg_type = SO_TIMESTAMPING; in do_test() 631 cmsg->cmsg_len = CMSG_LEN(sizeof(uint32_t)); in do_test() 633 *((uint32_t *) CMSG_DATA(cmsg)) = report_opt; in do_test()
|
/tools/testing/selftests/bpf/ |
D | test_sock_addr.c | 1229 int init_pktinfo(int domain, struct cmsghdr *cmsg) in init_pktinfo() argument 1235 cmsg->cmsg_level = SOL_IP; in init_pktinfo() 1236 cmsg->cmsg_type = IP_PKTINFO; in init_pktinfo() 1237 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); in init_pktinfo() 1238 pktinfo4 = (struct in_pktinfo *)CMSG_DATA(cmsg); in init_pktinfo() 1244 cmsg->cmsg_level = SOL_IPV6; in init_pktinfo() 1245 cmsg->cmsg_type = IPV6_PKTINFO; in init_pktinfo() 1246 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); in init_pktinfo() 1247 pktinfo6 = (struct in6_pktinfo *)CMSG_DATA(cmsg); in init_pktinfo()
|