14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * or http://www.opensolaris.org/os/licensing.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync *
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync/*
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Use is subject to license terms.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on library ip.d
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on library net.d
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D depends_on module genunix
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncinline int T_RDMA = 4;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" T_RDMA
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct nfsv4opinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint64_t noi_xid; /* unique transation ID */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cred_t *noi_cred; /* credentials for operation */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string noi_curpath; /* current file handle path (if any) */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} nfsv4opinfo_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct nfsv4cbinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string nci_curpath; /* current file handle path (if any) */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} nfsv4cbinfo_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator conninfo_t < struct svc_req *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_protocol = P->rq_xprt->xp_xpc.xpc_type == T_RDMA ? "rdma" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "tcp" ? "ipv4" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp" ? "ipv4" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ? "ipv6" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp6" ? "ipv6" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "<unknown>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_local = (P->rq_xprt->xp_xpc.xpc_netid == "tcp" ||
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa(&((struct sockaddr_in *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin_addr.S_un.S_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ||
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp6") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa6(&((struct sockaddr_in6 *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin6_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "unknown";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_remote = (P->rq_xprt->xp_xpc.xpc_netid == "tcp" ||
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa(&((struct sockaddr_in *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin_addr.S_un.S_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ||
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_netid == "udp6") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa6(&((struct sockaddr_in6 *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin6_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "unknown";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator conninfo_t < struct compound_state *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_protocol = P->req->rq_xprt->xp_xpc.xpc_type == T_RDMA ? "rdma" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_netid == "tcp" ? "ipv4" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6" ? "ipv6" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "<unknown>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_local = (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa(&((struct sockaddr_in *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin_addr.S_un.S_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa6(&((struct sockaddr_in6 *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin6_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "unknown";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_remote = (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa(&((struct sockaddr_in *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin_addr.S_un.S_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6") ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa6(&((struct sockaddr_in6 *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->req->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin6_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "unknown";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator nfsv4opinfo_t < struct compound_state *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_xid = P->req->rq_xprt->xp_xid;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_cred = P->basecr;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_curpath = (P->vp == NULL) ? "<unknown>" : P->vp->v_path;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator conninfo_t < rfs4_client_t *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_protocol = (P->rc_addr.ss_family == AF_INET) ? "ipv4" : "ipv6";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_local = "<unknown>";
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync ci_remote = (P->rc_addr.ss_family == AF_INET) ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa((ipaddr_t *)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync &((struct sockaddr_in *)&P->rc_addr)->sin_addr) :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync inet_ntoa6(&((struct sockaddr_in6 *)&P->rc_addr)->sin6_addr);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator nfsv4cbinfo_t < rfs4_deleg_state_t *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync nci_curpath = (P->rds_finfo->rf_vp == NULL) ? "<unknown>" :
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync P->rds_finfo->rf_vp->v_path;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct nfsv3opinfo {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync uint64_t noi_xid; /* unique transation ID */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync cred_t *noi_cred; /* credentials for operation */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync string noi_curpath; /* current file handle path (if any) */
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} nfsv3opinfo_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctypedef struct nfsv3oparg nfsv3oparg_t;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync#pragma D binding "1.5" translator
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsynctranslator nfsv3opinfo_t < nfsv3oparg_t *P > {
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_xid = ((struct svc_req *)arg0)->rq_xprt->xp_xid;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_cred = (cred_t *)arg1;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync noi_curpath = (arg2 == 0 || ((vnode_t *)arg2)->v_path == NULL) ?
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync "<unknown>" : ((vnode_t *)arg2)->v_path;
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync};