/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 | 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 | timestamping.c | 159 struct cmsghdr *cmsg; in printpacket() local 172 for (cmsg = CMSG_FIRSTHDR(msg); in printpacket() 173 cmsg; in printpacket() 174 cmsg = CMSG_NXTHDR(msg, cmsg)) { in printpacket() 175 printf(" cmsg len %zu: ", cmsg->cmsg_len); in printpacket() 176 switch (cmsg->cmsg_level) { in printpacket() 179 switch (cmsg->cmsg_type) { in printpacket() 182 (struct timeval *)CMSG_DATA(cmsg); in printpacket() 190 (struct timespec *)CMSG_DATA(cmsg); in printpacket() 198 (struct timespec *)CMSG_DATA(cmsg); in printpacket() [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 | 1182 struct cmsghdr *cmsg; in TEST_F() local 1195 cmsg = CMSG_FIRSTHDR(&msg); in TEST_F() 1196 cmsg->cmsg_level = SOL_TLS; in TEST_F() 1198 cmsg->cmsg_type = TLS_SET_RECORD_TYPE; in TEST_F() 1199 cmsg->cmsg_len = CMSG_LEN(cmsg_len); in TEST_F() 1200 *CMSG_DATA(cmsg) = record_type; in TEST_F() 1201 msg.msg_controllen = cmsg->cmsg_len; in TEST_F() 1210 cmsg = CMSG_FIRSTHDR(&msg); in TEST_F() 1211 EXPECT_NE(cmsg, NULL); in TEST_F() 1212 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/landlock/ |
D | base_test.c | 282 struct cmsghdr *cmsg; in TEST() local 301 cmsg = CMSG_FIRSTHDR(&msg); in TEST() 302 ASSERT_NE(NULL, cmsg); in TEST() 303 cmsg->cmsg_len = CMSG_LEN(sizeof(ruleset_fd_tx)); in TEST() 304 cmsg->cmsg_level = SOL_SOCKET; in TEST() 305 cmsg->cmsg_type = SCM_RIGHTS; in TEST() 306 memcpy(CMSG_DATA(cmsg), &ruleset_fd_tx, sizeof(ruleset_fd_tx)); in TEST() 325 cmsg = CMSG_FIRSTHDR(&msg); in TEST() 326 ASSERT_EQ(cmsg->cmsg_len, CMSG_LEN(sizeof(ruleset_fd_tx))); in TEST() 327 memcpy(&ruleset_fd_rx, CMSG_DATA(cmsg), sizeof(ruleset_fd_tx)); in TEST()
|
/tools/testing/selftests/net/mptcp/ |
D | mptcp_connect.c | 368 struct cmsghdr *cmsg; in process_cmsg() local 370 for (cmsg = CMSG_FIRSTHDR(msgh); cmsg ; cmsg = CMSG_NXTHDR(msgh, cmsg)) { in process_cmsg() 371 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMPNS_NEW) { in process_cmsg() 372 memcpy(&ts, CMSG_DATA(cmsg), sizeof(ts)); in process_cmsg() 916 static void apply_cmsg_types(int fd, const struct cfg_cmsg_types *cmsg) in apply_cmsg_types() argument 920 if (cmsg->timestampns) in apply_cmsg_types()
|
/tools/testing/selftests/bpf/ |
D | test_sock_addr.c | 995 int init_pktinfo(int domain, struct cmsghdr *cmsg) in init_pktinfo() argument 1001 cmsg->cmsg_level = SOL_IP; in init_pktinfo() 1002 cmsg->cmsg_type = IP_PKTINFO; in init_pktinfo() 1003 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in_pktinfo)); in init_pktinfo() 1004 pktinfo4 = (struct in_pktinfo *)CMSG_DATA(cmsg); in init_pktinfo() 1010 cmsg->cmsg_level = SOL_IPV6; in init_pktinfo() 1011 cmsg->cmsg_type = IPV6_PKTINFO; in init_pktinfo() 1012 cmsg->cmsg_len = CMSG_LEN(sizeof(struct in6_pktinfo)); in init_pktinfo() 1013 pktinfo6 = (struct in6_pktinfo *)CMSG_DATA(cmsg); in init_pktinfo()
|