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