Home | History | Annotate | Download | only in common
      1   5647         samf /*
      2   5647         samf  * CDDL HEADER START
      3   5647         samf  *
      4   5647         samf  * The contents of this file are subject to the terms of the
      5   5647         samf  * Common Development and Distribution License (the "License").
      6   5647         samf  * You may not use this file except in compliance with the License.
      7   5647         samf  *
      8   5647         samf  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9   5647         samf  * or http://www.opensolaris.org/os/licensing.
     10   5647         samf  * See the License for the specific language governing permissions
     11   5647         samf  * and limitations under the License.
     12   5647         samf  *
     13   5647         samf  * When distributing Covered Code, include this CDDL HEADER in each
     14   5647         samf  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15   5647         samf  * If applicable, add the following below this CDDL HEADER, with the
     16   5647         samf  * fields enclosed by brackets "[]" replaced with your own identifying
     17   5647         samf  * information: Portions Copyright [yyyy] [name of copyright owner]
     18   5647         samf  *
     19   5647         samf  * CDDL HEADER END
     20   5647         samf  */
     21   5647         samf 
     22   5647         samf /*
     23   9885       Robert  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24   5647         samf  * Use is subject to license terms.
     25   5647         samf  */
     26   5647         samf 
     27   5647         samf #pragma	D depends_on library ip.d
     28   5647         samf #pragma	D depends_on library net.d
     29   5647         samf #pragma	D depends_on module genunix
     30   5647         samf 
     31  10326  Siddheshwar inline int T_RDMA = 4;
     32  10326  Siddheshwar #pragma D binding "1.5" T_RDMA
     33  10326  Siddheshwar 
     34   5647         samf typedef struct nfsv4opinfo {
     35   5647         samf 	uint64_t noi_xid;	/* unique transation ID */
     36   5647         samf 	cred_t *noi_cred;	/* credentials for operation */
     37   5647         samf 	string noi_curpath;	/* current file handle path (if any) */
     38   5647         samf } nfsv4opinfo_t;
     39   5647         samf 
     40   5647         samf typedef struct nfsv4cbinfo {
     41   5647         samf 	string nci_curpath;	/* current file handle path (if any) */
     42   5647         samf } nfsv4cbinfo_t;
     43   5647         samf 
     44   5647         samf #pragma D binding "1.5" translator
     45   5647         samf translator conninfo_t < struct svc_req *P > {
     46  10326  Siddheshwar 	ci_protocol = P->rq_xprt->xp_xpc.xpc_type == T_RDMA ? "rdma" :
     47  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "tcp" ? "ipv4" :
     48  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp" ? "ipv4" :
     49  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ? "ipv6" :
     50  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp6" ? "ipv6" :
     51   5647         samf 	    "<unknown>";
     52   5647         samf 
     53  10326  Siddheshwar 	ci_local = (P->rq_xprt->xp_xpc.xpc_netid == "tcp" ||
     54  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp") ?
     55   7208     vv149972 	    inet_ntoa(&((struct sockaddr_in *)
     56   7208     vv149972 	    P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin_addr.S_un.S_addr) :
     57  10326  Siddheshwar 	    (P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ||
     58  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp6") ?
     59   7208     vv149972 	    inet_ntoa6(&((struct sockaddr_in6 *)
     60   7208     vv149972 	    P->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin6_addr) :
     61   7208     vv149972 	    "unknown";
     62   5647         samf 
     63  10326  Siddheshwar 	ci_remote = (P->rq_xprt->xp_xpc.xpc_netid == "tcp" ||
     64  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp") ?
     65   7208     vv149972 	    inet_ntoa(&((struct sockaddr_in *)
     66   7208     vv149972 	    P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin_addr.S_un.S_addr) :
     67  10326  Siddheshwar 	    (P->rq_xprt->xp_xpc.xpc_netid == "tcp6" ||
     68  10326  Siddheshwar 	    P->rq_xprt->xp_xpc.xpc_netid == "udp6") ?
     69   7208     vv149972 	    inet_ntoa6(&((struct sockaddr_in6 *)
     70   7208     vv149972 	    P->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin6_addr) :
     71   7208     vv149972 	    "unknown";
     72   5647         samf };
     73   5647         samf 
     74   5647         samf #pragma D binding "1.5" translator
     75   5647         samf translator conninfo_t < struct compound_state *P > {
     76  10326  Siddheshwar 	ci_protocol = P->req->rq_xprt->xp_xpc.xpc_type == T_RDMA ? "rdma" :
     77  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_netid == "tcp" ? "ipv4" :
     78  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6" ? "ipv6" :
     79   5647         samf 	    "<unknown>";
     80   5647         samf 
     81  10326  Siddheshwar 	ci_local = (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp") ?
     82  10326  Siddheshwar 	    inet_ntoa(&((struct sockaddr_in *)
     83  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin_addr.S_un.S_addr) :
     84  10326  Siddheshwar 	    (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6") ?
     85  10326  Siddheshwar 	    inet_ntoa6(&((struct sockaddr_in6 *)
     86  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_lcladdr.buf)->sin6_addr) :
     87  10326  Siddheshwar 	    "unknown";
     88   5647         samf 
     89  10326  Siddheshwar 	ci_remote = (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp") ?
     90  10326  Siddheshwar 	    inet_ntoa(&((struct sockaddr_in *)
     91  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin_addr.S_un.S_addr) :
     92  10326  Siddheshwar 	    (P->req->rq_xprt->xp_xpc.xpc_netid == "tcp6") ?
     93  10326  Siddheshwar 	    inet_ntoa6(&((struct sockaddr_in6 *)
     94  10326  Siddheshwar 	    P->req->rq_xprt->xp_xpc.xpc_rtaddr.buf)->sin6_addr) :
     95  10326  Siddheshwar 	    "unknown";
     96  10326  Siddheshwar 
     97   5647         samf };
     98   5647         samf 
     99   5647         samf #pragma D binding "1.5" translator
    100   5647         samf translator nfsv4opinfo_t < struct compound_state *P > {
    101   5647         samf 	noi_xid = P->req->rq_xprt->xp_xid;
    102   5647         samf 	noi_cred = P->basecr;
    103   5647         samf 	noi_curpath = (P->vp == NULL) ? "<unknown>" : P->vp->v_path;
    104   5647         samf };
    105   5647         samf 
    106   5647         samf #pragma D binding "1.5" translator
    107   5647         samf translator conninfo_t < rfs4_client_t *P > {
    108   9885       Robert 	ci_protocol = (P->rc_addr.ss_family == AF_INET) ? "ipv4" : "ipv6";
    109   5647         samf 
    110   5647         samf 	ci_local = "<unknown>";
    111   5647         samf 
    112   9885       Robert 	ci_remote = (P->rc_addr.ss_family == AF_INET) ?
    113   5647         samf 	    inet_ntoa((ipaddr_t *)
    114   9885       Robert 	    &((struct sockaddr_in *)&P->rc_addr)->sin_addr) :
    115   9885       Robert 	    inet_ntoa6(&((struct sockaddr_in6 *)&P->rc_addr)->sin6_addr);
    116   5647         samf };
    117   5647         samf 
    118   5647         samf #pragma D binding "1.5" translator
    119   5647         samf translator nfsv4cbinfo_t < rfs4_deleg_state_t *P > {
    120   9885       Robert 	nci_curpath = (P->rds_finfo->rf_vp == NULL) ? "<unknown>" :
    121   9885       Robert 	    P->rds_finfo->rf_vp->v_path;
    122   5647         samf };
    123   5982          ahl 
    124   5982          ahl typedef struct nfsv3opinfo {
    125   5982          ahl 	uint64_t noi_xid;	/* unique transation ID */
    126   5982          ahl 	cred_t *noi_cred;	/* credentials for operation */
    127   5982          ahl 	string noi_curpath;	/* current file handle path (if any) */
    128   5982          ahl } nfsv3opinfo_t;
    129   5982          ahl 
    130   5982          ahl typedef struct nfsv3oparg nfsv3oparg_t;
    131   5982          ahl 
    132   5982          ahl #pragma D binding "1.5" translator
    133   5982          ahl translator nfsv3opinfo_t < nfsv3oparg_t *P > {
    134   5982          ahl 	noi_xid = ((struct svc_req *)arg0)->rq_xprt->xp_xid;
    135   5982          ahl 	noi_cred = (cred_t *)arg1;
    136   5982          ahl 	noi_curpath = (arg2 == 0 || ((vnode_t *)arg2)->v_path == NULL) ?
    137   5982          ahl 	    "<unknown>" : ((vnode_t *)arg2)->v_path;
    138   5982          ahl };
    139