/illumos-gate/usr/src/uts/common/rpc/ |
H A D | rpc_calmsg.c | 54 xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg) in xdr_callmsg() argument 63 if (cmsg->rm_call.cb_cred.oa_length > MAX_AUTH_BYTES) in xdr_callmsg() 65 if (cmsg->rm_call.cb_verf.oa_length > MAX_AUTH_BYTES) in xdr_callmsg() 67 credrndup = RNDUP(cmsg->rm_call.cb_cred.oa_length); in xdr_callmsg() 68 verfrndup = RNDUP(cmsg->rm_call.cb_verf.oa_length); in xdr_callmsg() 72 IXDR_PUT_INT32(buf, cmsg->rm_xid); in xdr_callmsg() 73 IXDR_PUT_ENUM(buf, cmsg->rm_direction); in xdr_callmsg() 74 if (cmsg->rm_direction != CALL) in xdr_callmsg() 76 IXDR_PUT_INT32(buf, cmsg->rm_call.cb_rpcvers); in xdr_callmsg() 77 if (cmsg->rm_call.cb_rpcvers != RPC_MSG_VERSION) in xdr_callmsg() [all …]
|
H A D | rpc_prot.c | 325 xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) in xdr_callhdr() argument 327 cmsg->rm_direction = CALL; in xdr_callhdr() 328 cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; in xdr_callhdr() 330 xdr_u_int(xdrs, &(cmsg->rm_xid)) && in xdr_callhdr() 331 xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) && in xdr_callhdr() 332 xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_rpcvers)) && in xdr_callhdr() 333 xdr_rpcprog(xdrs, &(cmsg->rm_call.cb_prog))) in xdr_callhdr() 334 return (xdr_rpcvers(xdrs, &(cmsg->rm_call.cb_vers))); in xdr_callhdr()
|
/illumos-gate/usr/src/lib/libnsl/rpc/ |
H A D | rpc_callmsg.c | 49 xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg) in xdr_callmsg() argument 58 if (cmsg->rm_call.cb_cred.oa_length > MAX_AUTH_BYTES) in xdr_callmsg() 60 if (cmsg->rm_call.cb_verf.oa_length > MAX_AUTH_BYTES) in xdr_callmsg() 62 credrndup = RNDUP(cmsg->rm_call.cb_cred.oa_length); in xdr_callmsg() 63 verfrndup = RNDUP(cmsg->rm_call.cb_verf.oa_length); in xdr_callmsg() 67 IXDR_PUT_INT32(buf, cmsg->rm_xid); in xdr_callmsg() 68 IXDR_PUT_ENUM(buf, cmsg->rm_direction); in xdr_callmsg() 69 if (cmsg->rm_direction != CALL) in xdr_callmsg() 71 IXDR_PUT_INT32(buf, cmsg->rm_call.cb_rpcvers); in xdr_callmsg() 72 if (cmsg->rm_call.cb_rpcvers != RPC_MSG_VERSION) in xdr_callmsg() [all …]
|
H A D | rpc_prot.c | 253 xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg) in xdr_callhdr() argument 255 cmsg->rm_direction = CALL; in xdr_callhdr() 256 cmsg->rm_call.cb_rpcvers = RPC_MSG_VERSION; in xdr_callhdr() 258 xdr_u_int(xdrs, &(cmsg->rm_xid)) && in xdr_callhdr() 259 xdr_enum(xdrs, (enum_t *)&(cmsg->rm_direction)) && in xdr_callhdr() 260 xdr_u_int(xdrs, (uint_t *)&(cmsg->rm_call.cb_rpcvers)) && in xdr_callhdr() 261 xdr_u_int(xdrs, (uint_t *)&(cmsg->rm_call.cb_prog))) { in xdr_callhdr() 262 return (xdr_u_int(xdrs, (uint_t *)&(cmsg->rm_call.cb_vers))); in xdr_callhdr()
|
/illumos-gate/usr/src/uts/common/fs/sockfs/ |
H A D | socksubr.c | 86 #define CMSG_CONTENT(cmsg) (&((cmsg)[1])) argument 87 #define CMSG_CONTENTLEN(cmsg) ((cmsg)->cmsg_len - sizeof (struct cmsghdr)) argument 88 #define CMSG_VALID(cmsg, start, end) \ argument 89 (ISALIGNED_cmsghdr(cmsg) && \ 90 ((uintptr_t)(cmsg) >= (uintptr_t)(start)) && \ 91 ((uintptr_t)(cmsg) < (uintptr_t)(end)) && \ 92 ((ssize_t)(cmsg)->cmsg_len >= sizeof (struct cmsghdr)) && \ 93 ((uintptr_t)(cmsg) + (cmsg)->cmsg_len <= (uintptr_t)(end))) 936 struct cmsghdr *cmsg; in so_closefds() local 946 for (cmsg = (struct cmsghdr *)control; in so_closefds() [all …]
|
/illumos-gate/usr/src/lib/libsctp/common/ |
H A D | sctp.c | 264 struct cmsghdr *cmsg; in sctp_recvmsg() local 265 char cinmsg[sizeof (*sinfo) + sizeof (*cmsg) + _CMSG_HDR_ALIGNMENT]; in sctp_recvmsg() 294 for (cmsg = CMSG_FIRSTHDR(&hdr); cmsg != NULL; in sctp_recvmsg() 295 cmsg = CMSG_NXTHDR(&hdr, cmsg)) { in sctp_recvmsg() 296 if (cmsg->cmsg_level == IPPROTO_SCTP && in sctp_recvmsg() 297 cmsg->cmsg_type == SCTP_SNDRCV) { in sctp_recvmsg() 298 bcopy(CMSG_DATA(cmsg), sinfo, sizeof (*sinfo)); in sctp_recvmsg() 314 struct cmsghdr *cmsg; in sctp_send_common() local 315 char coutmsg[sizeof (*sinfo) + sizeof (*cmsg) + _CMSG_HDR_ALIGNMENT]; in sctp_send_common() 322 hdr.msg_controllen = sizeof (*cmsg) + sizeof (*sinfo); in sctp_send_common() [all …]
|
/illumos-gate/usr/src/uts/common/inet/sockmods/ |
H A D | socksctpsubr.c | 221 struct cmsghdr *cmsg; in sosctp_pack_cmsg() local 252 cmsg = (struct cmsghdr *)msg->msg_control; in sosctp_pack_cmsg() 253 ASSERT(ISALIGNED_cmsghdr(cmsg)); in sosctp_pack_cmsg() 261 bcopy(ocmsg, cmsg, ocmsg->cmsg_len); in sosctp_pack_cmsg() 263 cmsg = (struct cmsghdr *)((uchar_t *)cmsg + in sosctp_pack_cmsg() 265 ASSERT(ISALIGNED_cmsghdr(cmsg)); in sosctp_pack_cmsg() 280 struct cmsghdr *cmsg; in sosctp_find_cmsg() local 283 cmsg = (struct cmsghdr *)control; in sosctp_find_cmsg() 287 if ((char *)(cmsg + 1) > cend || in sosctp_find_cmsg() 288 ((char *)cmsg + cmsg->cmsg_len) > cend) { in sosctp_find_cmsg() [all …]
|
H A D | socksctp.c | 738 struct cmsghdr *cmsg; in sosctp_sendmsg() local 756 cmsg = sosctp_find_cmsg(msg->msg_control, optlen, SCTP_SNDRCV); in sosctp_sendmsg() 757 if (cmsg != NULL) { in sosctp_sendmsg() 758 if (cmsg->cmsg_len < in sosctp_sendmsg() 759 (sizeof (*sinfo) + sizeof (*cmsg))) { in sosctp_sendmsg() 763 sinfo = (struct sctp_sndrcvinfo *)(cmsg + 1); in sosctp_sendmsg() 938 struct cmsghdr *cmsg; in sosctp_seq_sendmsg() local 953 cmsg = sosctp_find_cmsg(msg->msg_control, msg->msg_controllen, in sosctp_seq_sendmsg() 955 if (cmsg != NULL) { in sosctp_seq_sendmsg() 956 if (cmsg->cmsg_len < (sizeof (*sinfo) + sizeof (*cmsg))) { in sosctp_seq_sendmsg() [all …]
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/in.routed/ |
H A D | common.c | 227 struct cmsghdr *cmsg; in find_ancillary() local 229 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in find_ancillary() 230 cmsg = CMSG_NXTHDR(msg, cmsg)) { in find_ancillary() 231 if (cmsg->cmsg_level == IPPROTO_IP && in find_ancillary() 232 cmsg->cmsg_type == cmsg_type) { in find_ancillary() 233 return (CMSG_DATA(cmsg)); in find_ancillary()
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/traceroute/ |
H A D | traceroute_aux6.c | 278 struct cmsghdr *cmsg; in update_hoplimit_ancillary_data() local 281 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in update_hoplimit_ancillary_data() 282 cmsg = CMSG_NXTHDR(msg, cmsg)) { in update_hoplimit_ancillary_data() 283 if (cmsg->cmsg_level == IPPROTO_IPV6 && in update_hoplimit_ancillary_data() 284 cmsg->cmsg_type == IPV6_HOPLIMIT) { in update_hoplimit_ancillary_data() 286 intp = (int *)(CMSG_DATA(cmsg)); in update_hoplimit_ancillary_data() 375 struct cmsghdr *cmsg; in find_ancillary_data() local 377 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in find_ancillary_data() 378 cmsg = CMSG_NXTHDR(msg, cmsg)) { in find_ancillary_data() 379 if (cmsg->cmsg_level == cmsg_level && in find_ancillary_data() [all …]
|
/illumos-gate/usr/src/uts/common/io/ib/clients/rdsv3/ |
H A D | rdma.c | 587 struct cmsghdr *cmsg) in rdsv3_cmsg_rdma_args() argument 594 if (cmsg->cmsg_len != CMSG_LEN(sizeof (struct rds_rdma_args)) || in rdsv3_cmsg_rdma_args() 598 ASSERT(sizeof (buf) >= cmsg->cmsg_len && ((uintptr_t)buf & 0x7) == 0); in rdsv3_cmsg_rdma_args() 600 bcopy(CMSG_DATA(cmsg), (char *)buf, cmsg->cmsg_len); in rdsv3_cmsg_rdma_args() 616 struct cmsghdr *cmsg) in rdsv3_cmsg_rdma_dest() argument 622 if (cmsg->cmsg_len != CMSG_LEN(sizeof (rds_rdma_cookie_t)) || in rdsv3_cmsg_rdma_dest() 626 (void) memcpy(&rm->m_rdma_cookie, CMSG_DATA(cmsg), in rdsv3_cmsg_rdma_dest() 660 struct cmsghdr *cmsg) in rdsv3_cmsg_rdma_map() argument 667 if (cmsg->cmsg_len != CMSG_LEN(sizeof (struct rds_get_mr_args)) || in rdsv3_cmsg_rdma_map() 671 ASSERT(sizeof (buf) >= cmsg->cmsg_len && ((uintptr_t)buf & 0x7) == 0); in rdsv3_cmsg_rdma_map() [all …]
|
H A D | send.c | 887 struct cmsghdr *cmsg; in rdsv3_cmsg_send() local 892 for (cmsg = CMSG_FIRSTHDR(msg); cmsg; cmsg = CMSG_NXTHDR(msg, cmsg)) { in rdsv3_cmsg_send() 894 if (cmsg->cmsg_level != SOL_RDS) in rdsv3_cmsg_send() 898 cmsg, rm, cmsg->cmsg_type); in rdsv3_cmsg_send() 903 switch (cmsg->cmsg_type) { in rdsv3_cmsg_send() 905 ret = rdsv3_cmsg_rdma_args(rs, rm, cmsg); in rdsv3_cmsg_send() 909 ret = rdsv3_cmsg_rdma_dest(rs, rm, cmsg); in rdsv3_cmsg_send() 913 ret = rdsv3_cmsg_rdma_map(rs, rm, cmsg); in rdsv3_cmsg_send()
|
H A D | rds_recv.c | 348 struct rds_rdma_notify cmsg; in rdsv3_notify_queue_get() local 372 msghdr->msg_controllen / CMSG_SPACE(sizeof (cmsg)); in rdsv3_notify_queue_get() 392 cmsg.user_token = notifier->n_user_token; in rdsv3_notify_queue_get() 393 cmsg.status = notifier->n_status; in rdsv3_notify_queue_get() 396 RDS_CMSG_RDMA_STATUS, sizeof (cmsg), &cmsg); in rdsv3_notify_queue_get()
|
/illumos-gate/usr/src/cmd/cmd-inet/sbin/dhcpagent/ |
H A D | packet.c | 839 struct cmsghdr *cmsg; in send_pkt_internal() local 992 msg.msg_controllen = sizeof (*cmsg) + _MAX_ALIGNMENT + in send_pkt_internal() 993 sizeof (*ipi6) + _MAX_ALIGNMENT + sizeof (*cmsg); in send_pkt_internal() 995 cmsg = CMSG_FIRSTHDR(&msg); in send_pkt_internal() 996 cmsg->cmsg_level = IPPROTO_IPV6; in send_pkt_internal() 997 cmsg->cmsg_type = IPV6_PKTINFO; in send_pkt_internal() 999 ipi6 = (struct in6_pktinfo *)CMSG_DATA(cmsg); in send_pkt_internal() 1008 cmsg->cmsg_len = (char *)(ipi6 + 1) - (char *)cmsg; in send_pkt_internal() 1013 cmsg = CMSG_NXTHDR(&msg, cmsg); in send_pkt_internal() 1014 msg.msg_controllen = (char *)cmsg - (char *)msg.msg_control; in send_pkt_internal() [all …]
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.lib/in.ripngd/ |
H A D | input.c | 53 struct cmsghdr *cmsg; in find_ancillary() local 55 for (cmsg = CMSG_FIRSTHDR(rmsg); cmsg != NULL; in find_ancillary() 56 cmsg = CMSG_NXTHDR(rmsg, cmsg)) { in find_ancillary() 57 if (cmsg->cmsg_level == IPPROTO_IPV6 && in find_ancillary() 58 cmsg->cmsg_type == cmsg_type) { in find_ancillary() 59 return (CMSG_DATA(cmsg)); in find_ancillary()
|
/illumos-gate/usr/src/boot/sys/sys/ |
H A D | socket.h | 498 #define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ argument 502 #define CMSG_NXTHDR(mhdr, cmsg) \ argument 503 ((char *)(cmsg) == NULL ? CMSG_FIRSTHDR(mhdr) : \ 504 ((char *)(cmsg) + _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len) + \ 508 (struct cmsghdr *)(void *)((char *)(cmsg) + \ 509 _ALIGN(((struct cmsghdr *)(cmsg))->cmsg_len)))
|
/illumos-gate/usr/src/uts/common/sys/ |
H A D | socketvar.h | 745 #define CMSG_NEXT(cmsg) \ argument 746 (struct cmsghdr *)((uintptr_t)(cmsg) + \ 747 ROUNDUP_cmsglen((cmsg)->cmsg_len)) 748 #define CMSG_CONTENT(cmsg) (&((cmsg)[1])) argument 749 #define CMSG_CONTENTLEN(cmsg) ((cmsg)->cmsg_len - sizeof (struct cmsghdr)) argument 750 #define CMSG_VALID(cmsg, start, end) \ argument 751 (ISALIGNED_cmsghdr(cmsg) && \ 752 ((uintptr_t)(cmsg) >= (uintptr_t)(start)) && \ 753 ((uintptr_t)(cmsg) < (uintptr_t)(end)) && \ 754 ((ssize_t)(cmsg)->cmsg_len >= sizeof (struct cmsghdr)) && \ [all …]
|
/illumos-gate/usr/src/uts/common/inet/sctp/ |
H A D | sctp_input.c | 328 struct cmsghdr *cmsg; in sctp_input_add_ancillary() local 358 optlen += sizeof (*cmsg) + sizeof (struct sctp_sndrcvinfo); in sctp_input_add_ancillary() 365 optlen += sizeof (*cmsg) + sizeof (struct in6_pktinfo); in sctp_input_add_ancillary() 373 optlen += sizeof (*cmsg) + sizeof (uint_t); in sctp_input_add_ancillary() 391 optlen += sizeof (*cmsg) + ipp->ipp_hopoptslen - in sctp_input_add_ancillary() 407 optlen += sizeof (*cmsg) + ipp->ipp_rthdrdstoptslen; in sctp_input_add_ancillary() 422 optlen += sizeof (*cmsg) + ipp->ipp_rthdrlen; in sctp_input_add_ancillary() 437 optlen += sizeof (*cmsg) + ipp->ipp_dstoptslen; in sctp_input_add_ancillary() 477 cmsg = (struct cmsghdr *)optptr; in sctp_input_add_ancillary() 478 cmsg->cmsg_level = IPPROTO_SCTP; in sctp_input_add_ancillary() [all …]
|
H A D | sctp_output.c | 186 struct cmsghdr *cmsg; in sctp_sendmsg() local 190 cmsg = (struct cmsghdr *)(mproto->b_rptr + tudr->OPT_offset); in sctp_sendmsg() 191 cend = ((char *)cmsg + tudr->OPT_length); in sctp_sendmsg() 195 if ((char *)(cmsg + 1) > cend || in sctp_sendmsg() 196 ((char *)cmsg + cmsg->cmsg_len) > cend) { in sctp_sendmsg() 199 if ((cmsg->cmsg_level == IPPROTO_SCTP) && in sctp_sendmsg() 200 (cmsg->cmsg_type == SCTP_SNDRCV)) { in sctp_sendmsg() 201 if (cmsg->cmsg_len < in sctp_sendmsg() 202 (sizeof (*sndrcv) + sizeof (*cmsg))) { in sctp_sendmsg() 205 sndrcv = (struct sctp_sndrcvinfo *)(cmsg + 1); in sctp_sendmsg() [all …]
|
/illumos-gate/usr/src/uts/common/sys/ib/clients/rdsv3/ |
H A D | rdma.h | 93 struct cmsghdr *cmsg); 95 struct cmsghdr *cmsg); 97 struct cmsghdr *cmsg);
|
/illumos-gate/usr/src/uts/common/io/ppp/spppcomp/ |
H A D | bsd-comp.c | 1094 mblk_t *cmsg = *dmpp, *mnext; in bsd_decompress() local 1129 rptr = cmsg->b_rptr; in bsd_decompress() 1130 rmax = cmsg->b_wptr; in bsd_decompress() 1139 mnext = cmsg->b_cont; \ in bsd_decompress() 1140 freeb(cmsg); \ in bsd_decompress() 1141 if ((cmsg = mnext) == NULL) { \ in bsd_decompress() 1145 rptr = cmsg->b_rptr; \ in bsd_decompress() 1146 rmax = cmsg->b_wptr; \ in bsd_decompress() 1182 freemsg(cmsg); in bsd_decompress() 1195 freemsg(cmsg); in bsd_decompress() [all …]
|
/illumos-gate/usr/src/cmd/cmd-inet/usr.sbin/ping/ |
H A D | ping_aux6.c | 1022 struct cmsghdr *cmsg; in pr_ext_headers() local 1026 for (cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in pr_ext_headers() 1027 cmsg = CMSG_NXTHDR(msg, cmsg)) { in pr_ext_headers() 1028 if (cmsg->cmsg_level == IPPROTO_IPV6) { in pr_ext_headers() 1029 switch (cmsg->cmsg_type) { in pr_ext_headers() 1045 pr_rthdr((uchar_t *)CMSG_DATA(cmsg)); in pr_ext_headers() 1049 Printf(" <option type %d>", cmsg->cmsg_type); in pr_ext_headers()
|
/illumos-gate/usr/src/test/os-tests/tests/minttl/ |
H A D | minttl.c | 517 for (const struct cmsghdr *cmsg = CMSG_FIRSTHDR(msg); cmsg != NULL; in ttl_check_ancil() local 518 cmsg = CMSG_NXTHDR(msg, cmsg)) { in ttl_check_ancil() 521 if (cmsg->cmsg_level != level || cmsg->cmsg_type != ttlopt) in ttl_check_ancil() 523 (void) memcpy(&val, CMSG_DATA(cmsg), sizeof (int)); in ttl_check_ancil()
|
/illumos-gate/usr/src/lib/libc/port/gen/ |
H A D | catgets.c | 97 char *cmsg = check_format( in catgets() local 99 if (cmsg == def_str) { in catgets()
|
/illumos-gate/usr/src/uts/common/inet/ |
H A D | optcom.c | 1944 struct cmsghdr *cmsg; in process_auxiliary_options() local 1952 for (cmsg = (struct cmsghdr *)control; in process_auxiliary_options() 1953 CMSG_VALID(cmsg, control, (uintptr_t)control + controllen); in process_auxiliary_options() 1954 cmsg = CMSG_NEXT(cmsg)) { in process_auxiliary_options() 1956 len = (t_uscalar_t)CMSG_CONTENTLEN(cmsg); in process_auxiliary_options() 1958 optd = proto_opt_lookup(cmsg->cmsg_level, cmsg->cmsg_type, in process_auxiliary_options() 1985 optd->opdes_name, len, (uchar_t *)CMSG_CONTENT(cmsg), in process_auxiliary_options() 1986 &outlen, (uchar_t *)CMSG_CONTENT(cmsg), optbuf, cr); in process_auxiliary_options()
|