Home
last modified time | relevance | path

Searched refs:cmsg (Results 1 – 25 of 50) sorted by relevance

12

/linux-6.1.9/drivers/isdn/capi/
Dcapiutil.c231 #define TYP (cdef[cmsg->par[cmsg->p]].typ)
232 #define OFF (((u8 *)cmsg) + cdef[cmsg->par[cmsg->p]].off)
234 static void jumpcstruct(_cmsg *cmsg) in jumpcstruct() argument
237 for (cmsg->p++, layer = 1; layer;) { in jumpcstruct()
239 cmsg->p++; in jumpcstruct()
464 #define NAME (pnames[cmsg->par[cmsg->p]])
466 static _cdebbuf *protocol_message_2_pars(_cdebbuf *cdb, _cmsg *cmsg, int level) in protocol_message_2_pars() argument
468 if (!cmsg->par) in protocol_message_2_pars()
471 for (; TYP != _CEND; cmsg->p++) { in protocol_message_2_pars()
483 cdb = bufprint(cdb, "%-*s = 0x%x\n", slen, NAME, *(u8 *) (cmsg->m + cmsg->l)); in protocol_message_2_pars()
[all …]
/linux-6.1.9/tools/testing/selftests/net/
Dcmsg_sender.c220 struct cmsghdr *cmsg; in ca_write_cmsg_u32() local
225 cmsg = (struct cmsghdr *)(cbuf + *cmsg_len); in ca_write_cmsg_u32()
230 cmsg->cmsg_level = level; in ca_write_cmsg_u32()
231 cmsg->cmsg_type = optname; in ca_write_cmsg_u32()
232 cmsg->cmsg_len = CMSG_LEN(sizeof(__u32)); in ca_write_cmsg_u32()
233 *(__u32 *)CMSG_DATA(cmsg) = uopt->val; in ca_write_cmsg_u32()
239 struct cmsghdr *cmsg; in cs_write_cmsg() local
268 cmsg = (struct cmsghdr *)(cbuf + cmsg_len); in cs_write_cmsg()
273 cmsg->cmsg_level = SOL_SOCKET; in cs_write_cmsg()
274 cmsg->cmsg_type = SCM_TXTIME; in cs_write_cmsg()
[all …]
Dudpgso_bench_tx.c138 static void flush_cmsg(struct cmsghdr *cmsg) in flush_cmsg() argument
146 switch (cmsg->cmsg_level) { in flush_cmsg()
148 if (cmsg->cmsg_type == SO_TIMESTAMPING) { in flush_cmsg()
150 tss = (struct scm_timestamping *)CMSG_DATA(cmsg); in flush_cmsg()
155 cmsg->cmsg_type); in flush_cmsg()
160 switch (cmsg->cmsg_type) { in flush_cmsg()
164 err = (struct sock_extended_err *)CMSG_DATA(cmsg); in flush_cmsg()
199 cmsg->cmsg_type); in flush_cmsg()
205 cmsg->cmsg_level); in flush_cmsg()
215 struct cmsghdr *cmsg; in flush_errqueue_recv() local
[all …]
Dtimestamping.c159 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 …]
Drxtimestamp.c183 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()
Dudpgso_bench_rx.c220 struct cmsghdr *cmsg; in recv_msg() local
236 for (cmsg = CMSG_FIRSTHDR(&msg); cmsg != NULL; in recv_msg()
237 cmsg = CMSG_NXTHDR(&msg, cmsg)) { in recv_msg()
238 if (cmsg->cmsg_level == SOL_UDP in recv_msg()
239 && cmsg->cmsg_type == UDP_GRO) { in recv_msg()
240 gsosizeptr = (uint16_t *) CMSG_DATA(cmsg); in recv_msg()
Dmsg_zerocopy.c363 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()
/linux-6.1.9/tools/perf/trace/beauty/include/linux/
Dsocket.h112 #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg)) argument
113 #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg)) argument
117 #define CMSG_DATA(cmsg) \ argument
118 ((void *)(cmsg) + sizeof(struct cmsghdr))
119 #define CMSG_USER_DATA(cmsg) \ argument
120 ((void __user *)(cmsg) + sizeof(struct cmsghdr))
128 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \ argument
129 (cmsg)->cmsg_len <= (unsigned long) \
131 ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
132 #define for_each_cmsghdr(cmsg, msg) \ argument
[all …]
/linux-6.1.9/include/linux/
Dsocket.h112 #define __CMSG_NXTHDR(ctl, len, cmsg) __cmsg_nxthdr((ctl),(len),(cmsg)) argument
113 #define CMSG_NXTHDR(mhdr, cmsg) cmsg_nxthdr((mhdr), (cmsg)) argument
117 #define CMSG_DATA(cmsg) \ argument
118 ((void *)(cmsg) + sizeof(struct cmsghdr))
119 #define CMSG_USER_DATA(cmsg) \ argument
120 ((void __user *)(cmsg) + sizeof(struct cmsghdr))
128 #define CMSG_OK(mhdr, cmsg) ((cmsg)->cmsg_len >= sizeof(struct cmsghdr) && \ argument
129 (cmsg)->cmsg_len <= (unsigned long) \
131 ((char *)(cmsg) - (char *)(mhdr)->msg_control)))
132 #define for_each_cmsghdr(cmsg, msg) \ argument
[all …]
/linux-6.1.9/drivers/md/
Dmd-cluster.c504 static void process_add_new_disk(struct mddev *mddev, struct cluster_msg *cmsg) in process_add_new_disk() argument
514 sprintf(disk_uuid + len, "%pU", cmsg->uuid); in process_add_new_disk()
515 snprintf(raid_slot, 16, "RAID_DISK=%d", le32_to_cpu(cmsg->raid_slot)); in process_add_new_disk()
733 static int __sendmsg(struct md_cluster_info *cinfo, struct cluster_msg *cmsg) in __sendmsg() argument
738 cmsg->slot = cpu_to_le32(slot); in __sendmsg()
746 memcpy(cinfo->message_lockres->lksb.sb_lvbptr, (void *)cmsg, in __sendmsg()
784 static int sendmsg(struct md_cluster_info *cinfo, struct cluster_msg *cmsg, in sendmsg() argument
791 ret = __sendmsg(cinfo, cmsg); in sendmsg()
981 struct cluster_msg cmsg = {0}; in resync_bitmap() local
984 cmsg.type = cpu_to_le32(BITMAP_NEEDS_SYNC); in resync_bitmap()
[all …]
/linux-6.1.9/net/ipv6/
Ddatagram.c763 struct cmsghdr *cmsg; in ip6_datagram_send_ctl() local
770 for_each_cmsghdr(cmsg, msg) { in ip6_datagram_send_ctl()
773 if (!CMSG_OK(msg, cmsg)) { in ip6_datagram_send_ctl()
778 if (cmsg->cmsg_level == SOL_SOCKET) { in ip6_datagram_send_ctl()
779 err = __sock_cmsg_send(sk, msg, cmsg, &ipc6->sockc); in ip6_datagram_send_ctl()
785 if (cmsg->cmsg_level != SOL_IPV6) in ip6_datagram_send_ctl()
788 switch (cmsg->cmsg_type) { in ip6_datagram_send_ctl()
795 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct in6_pktinfo))) { in ip6_datagram_send_ctl()
800 src_info = (struct in6_pktinfo *)CMSG_DATA(cmsg); in ip6_datagram_send_ctl()
848 if (cmsg->cmsg_len < CMSG_LEN(4)) { in ip6_datagram_send_ctl()
[all …]
/linux-6.1.9/samples/seccomp/
Duser-trap.c35 struct cmsghdr *cmsg; in send_fd() local
46 cmsg = CMSG_FIRSTHDR(&msg); in send_fd()
47 cmsg->cmsg_level = SOL_SOCKET; in send_fd()
48 cmsg->cmsg_type = SCM_RIGHTS; in send_fd()
49 cmsg->cmsg_len = CMSG_LEN(sizeof(int)); in send_fd()
50 *((int *)CMSG_DATA(cmsg)) = fd; in send_fd()
51 msg.msg_controllen = cmsg->cmsg_len; in send_fd()
64 struct cmsghdr *cmsg; in recv_fd() local
81 cmsg = CMSG_FIRSTHDR(&msg); in recv_fd()
83 return *((int *)CMSG_DATA(cmsg)); in recv_fd()
/linux-6.1.9/net/core/
Dscm.c65 static int scm_fp_copy(struct cmsghdr *cmsg, struct scm_fp_list **fplp) in scm_fp_copy() argument
67 int *fdp = (int*)CMSG_DATA(cmsg); in scm_fp_copy()
72 num = (cmsg->cmsg_len - sizeof(struct cmsghdr))/sizeof(int); in scm_fp_copy()
133 struct cmsghdr *cmsg; in __scm_send() local
136 for_each_cmsghdr(cmsg, msg) { in __scm_send()
147 if (!CMSG_OK(msg, cmsg)) in __scm_send()
150 if (cmsg->cmsg_level != SOL_SOCKET) in __scm_send()
153 switch (cmsg->cmsg_type) in __scm_send()
158 err=scm_fp_copy(cmsg, &p->fp); in __scm_send()
167 if (cmsg->cmsg_len != CMSG_LEN(sizeof(struct ucred))) in __scm_send()
[all …]
/linux-6.1.9/tools/testing/selftests/landlock/
Dbase_test.c282 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()
/linux-6.1.9/Documentation/networking/
Dtls.rst140 struct cmsghdr *cmsg;
146 cmsg = CMSG_FIRSTHDR(&msg);
147 cmsg->cmsg_level = SOL_TLS;
148 cmsg->cmsg_type = TLS_SET_RECORD_TYPE;
149 cmsg->cmsg_len = CMSG_LEN(cmsg_len);
150 *CMSG_DATA(cmsg) = record_type;
151 msg.msg_controllen = cmsg->cmsg_len;
168 type passed via cmsg. If no cmsg buffer is provided, an error is
170 received without a cmsg buffer set.
175 char cmsg[CMSG_SPACE(sizeof(unsigned char))];
[all …]
/linux-6.1.9/net/rds/
Dsend.c892 struct cmsghdr *cmsg; in rds_rm_size() local
902 for_each_cmsghdr(cmsg, msg) { in rds_rm_size()
903 if (!CMSG_OK(msg, cmsg)) in rds_rm_size()
906 if (cmsg->cmsg_level != SOL_RDS) in rds_rm_size()
909 switch (cmsg->cmsg_type) { in rds_rm_size()
928 retval = rds_rdma_extra_size(CMSG_DATA(cmsg), iov); in rds_rm_size()
972 struct cmsghdr *cmsg) in rds_cmsg_zcopy() argument
976 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*cookie)) || in rds_cmsg_zcopy()
979 cookie = CMSG_DATA(cmsg); in rds_cmsg_zcopy()
988 struct cmsghdr *cmsg; in rds_cmsg_send() local
[all …]
Drdma.c609 struct cmsghdr *cmsg, in rds_cmsg_rdma_args() argument
622 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_rdma_args)) in rds_cmsg_rdma_args()
626 args = CMSG_DATA(cmsg); in rds_cmsg_rdma_args()
809 struct cmsghdr *cmsg) in rds_cmsg_rdma_dest() argument
816 if (cmsg->cmsg_len < CMSG_LEN(sizeof(rds_rdma_cookie_t)) || in rds_cmsg_rdma_dest()
820 memcpy(&rm->m_rdma_cookie, CMSG_DATA(cmsg), sizeof(rm->m_rdma_cookie)); in rds_cmsg_rdma_dest()
852 struct cmsghdr *cmsg) in rds_cmsg_rdma_map() argument
854 if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_get_mr_args)) || in rds_cmsg_rdma_map()
858 return __rds_rdma_map(rs, CMSG_DATA(cmsg), &rm->m_rdma_cookie, in rds_cmsg_rdma_map()
866 struct cmsghdr *cmsg) in rds_cmsg_atomic() argument
[all …]
/linux-6.1.9/arch/um/os-Linux/drivers/
Dtuntap_user.c71 struct cmsghdr *cmsg; in tuntap_open_tramp() local
111 cmsg = CMSG_FIRSTHDR(&msg); in tuntap_open_tramp()
112 if (cmsg == NULL) { in tuntap_open_tramp()
117 if ((cmsg->cmsg_level != SOL_SOCKET) || in tuntap_open_tramp()
118 (cmsg->cmsg_type != SCM_RIGHTS)) { in tuntap_open_tramp()
123 *fd_out = ((int *) CMSG_DATA(cmsg))[0]; in tuntap_open_tramp()
/linux-6.1.9/net/
Dcompat.c106 #define CMSG_COMPAT_DATA(cmsg) \ argument
107 ((void __user *)((char __user *)(cmsg) + sizeof(struct compat_cmsghdr)))
125 struct compat_cmsghdr __user *cmsg, int cmsg_len) in cmsg_compat_nxthdr()
127 char __user *ptr = (char __user *)cmsg + CMSG_COMPAT_ALIGN(cmsg_len); in cmsg_compat_nxthdr()
183 struct compat_cmsghdr cmsg; in cmsghdr_from_user_compat_to_kern() local
184 if (copy_from_user(&cmsg, ucmsg, sizeof(cmsg))) in cmsghdr_from_user_compat_to_kern()
186 if (!CMSG_COMPAT_OK(cmsg.cmsg_len, ucmsg, kmsg)) in cmsghdr_from_user_compat_to_kern()
188 tmp = ((cmsg.cmsg_len - sizeof(*ucmsg)) + sizeof(struct cmsghdr)); in cmsghdr_from_user_compat_to_kern()
192 kcmsg->cmsg_level = cmsg.cmsg_level; in cmsghdr_from_user_compat_to_kern()
193 kcmsg->cmsg_type = cmsg.cmsg_type; in cmsghdr_from_user_compat_to_kern()
[all …]
/linux-6.1.9/arch/um/os-Linux/
Dfile.c510 struct cmsghdr *cmsg; in os_rcv_fd() local
529 cmsg = CMSG_FIRSTHDR(&msg); in os_rcv_fd()
530 if (cmsg == NULL) { in os_rcv_fd()
535 if ((cmsg->cmsg_level != SOL_SOCKET) || in os_rcv_fd()
536 (cmsg->cmsg_type != SCM_RIGHTS)) { in os_rcv_fd()
541 new = ((int *) CMSG_DATA(cmsg))[0]; in os_rcv_fd()
664 struct cmsghdr *cmsg = CMSG_FIRSTHDR(&msg); in os_sendmsg_fds() local
670 cmsg->cmsg_level = SOL_SOCKET; in os_sendmsg_fds()
671 cmsg->cmsg_type = SCM_RIGHTS; in os_sendmsg_fds()
672 cmsg->cmsg_len = CMSG_LEN(fds_size); in os_sendmsg_fds()
[all …]
/linux-6.1.9/net/rxrpc/
Dsendmsg.c499 struct cmsghdr *cmsg; in rxrpc_sendmsg_cmsg() local
506 for_each_cmsghdr(cmsg, msg) { in rxrpc_sendmsg_cmsg()
507 if (!CMSG_OK(msg, cmsg)) in rxrpc_sendmsg_cmsg()
510 len = cmsg->cmsg_len - sizeof(struct cmsghdr); in rxrpc_sendmsg_cmsg()
512 cmsg->cmsg_level, cmsg->cmsg_type, len); in rxrpc_sendmsg_cmsg()
514 if (cmsg->cmsg_level != SOL_RXRPC) in rxrpc_sendmsg_cmsg()
517 switch (cmsg->cmsg_type) { in rxrpc_sendmsg_cmsg()
522 p->call.user_call_ID = *(u32 *)CMSG_DATA(cmsg); in rxrpc_sendmsg_cmsg()
527 CMSG_DATA(cmsg); in rxrpc_sendmsg_cmsg()
538 p->abort_code = *(unsigned int *)CMSG_DATA(cmsg); in rxrpc_sendmsg_cmsg()
[all …]
/linux-6.1.9/tools/testing/selftests/net/mptcp/
Dmptcp_inq.c313 struct cmsghdr *cmsg; in get_tcp_inq() local
315 for (cmsg = CMSG_FIRSTHDR(msgh); cmsg ; cmsg = CMSG_NXTHDR(msgh, cmsg)) { in get_tcp_inq()
316 if (cmsg->cmsg_level == IPPROTO_TCP && cmsg->cmsg_type == TCP_CM_INQ) { in get_tcp_inq()
317 memcpy(inqv, CMSG_DATA(cmsg), sizeof(*inqv)); in get_tcp_inq()
Dmptcp_connect.c432 struct cmsghdr *cmsg; in process_cmsg() local
434 for (cmsg = CMSG_FIRSTHDR(msgh); cmsg ; cmsg = CMSG_NXTHDR(msgh, cmsg)) { in process_cmsg()
435 if (cmsg->cmsg_level == SOL_SOCKET && cmsg->cmsg_type == SO_TIMESTAMPNS_NEW) { in process_cmsg()
436 memcpy(&ts, CMSG_DATA(cmsg), sizeof(ts)); in process_cmsg()
440 if (cmsg->cmsg_level == IPPROTO_TCP && cmsg->cmsg_type == TCP_CM_INQ) { in process_cmsg()
441 memcpy(&inq, CMSG_DATA(cmsg), sizeof(inq)); in process_cmsg()
1078 static void apply_cmsg_types(int fd, const struct cfg_cmsg_types *cmsg) in apply_cmsg_types() argument
1082 if (cmsg->timestampns) in apply_cmsg_types()
1084 if (cmsg->tcp_inq) in apply_cmsg_types()
/linux-6.1.9/fs/nfsd/
Dnfs4recover.c750 __cld_pipe_upcall(struct rpc_pipe *pipe, void *cmsg, struct nfsd_net *nn) in __cld_pipe_upcall() argument
754 struct cld_upcall *cup = container_of(cmsg, struct cld_upcall, cu_u); in __cld_pipe_upcall()
757 msg.data = cmsg; in __cld_pipe_upcall()
774 cld_pipe_upcall(struct rpc_pipe *pipe, void *cmsg, struct nfsd_net *nn) in cld_pipe_upcall() argument
783 ret = __cld_pipe_upcall(pipe, cmsg, nn); in cld_pipe_upcall()
790 __cld_pipe_inprogress_downcall(const struct cld_msg_v2 __user *cmsg, in __cld_pipe_inprogress_downcall() argument
798 if (get_user(cmd, &cmsg->cm_cmd)) { in __cld_pipe_inprogress_downcall()
806 ci = &cmsg->cm_u.cm_clntinfo; in __cld_pipe_inprogress_downcall()
828 cnm = &cmsg->cm_u.cm_name; in __cld_pipe_inprogress_downcall()
856 struct cld_msg_v2 __user *cmsg = (struct cld_msg_v2 __user *)src; in cld_pipe_downcall() local
[all …]
/linux-6.1.9/net/ipv4/
Dip_sockglue.c246 struct cmsghdr *cmsg; in ip_cmsg_send() local
249 for_each_cmsghdr(cmsg, msg) { in ip_cmsg_send()
250 if (!CMSG_OK(msg, cmsg)) in ip_cmsg_send()
254 cmsg->cmsg_level == SOL_IPV6 && in ip_cmsg_send()
255 cmsg->cmsg_type == IPV6_PKTINFO) { in ip_cmsg_send()
258 if (cmsg->cmsg_len < CMSG_LEN(sizeof(*src_info))) in ip_cmsg_send()
260 src_info = (struct in6_pktinfo *)CMSG_DATA(cmsg); in ip_cmsg_send()
269 if (cmsg->cmsg_level == SOL_SOCKET) { in ip_cmsg_send()
270 err = __sock_cmsg_send(sk, msg, cmsg, &ipc->sockc); in ip_cmsg_send()
276 if (cmsg->cmsg_level != SOL_IP) in ip_cmsg_send()
[all …]

12