The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/rpc/krpc.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * SPDX-License-Identifier: BSD-3-Clause
    3  *
    4  * Copyright (c) 2009, Sun Microsystems, Inc.
    5  * All rights reserved.
    6  *
    7  * Redistribution and use in source and binary forms, with or without
    8  * modification, are permitted provided that the following conditions are met:
    9  * - Redistributions of source code must retain the above copyright notice,
   10  *   this list of conditions and the following disclaimer.
   11  * - Redistributions in binary form must reproduce the above copyright notice,
   12  *   this list of conditions and the following disclaimer in the documentation
   13  *   and/or other materials provided with the distribution.
   14  * - Neither the name of Sun Microsystems, Inc. nor the names of its
   15  *   contributors may be used to endorse or promote products derived
   16  *   from this software without specific prior written permission.
   17  *
   18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
   19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
   22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR   
   23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
   28  * POSSIBILITY OF SUCH DAMAGE.
   29  *
   30  * $FreeBSD$
   31  */
   32 
   33 #ifndef _RPC_KRPC_H_
   34 #define _RPC_KRPC_H_
   35 
   36 #ifdef _KERNEL
   37 /*
   38  * Definitions now shared between client and server RPC for backchannels.
   39  */
   40 #define MCALL_MSG_SIZE 24
   41 
   42 void clnt_bck_svccall(void *, struct mbuf *, uint32_t);
   43 enum clnt_stat clnt_bck_call(CLIENT *, struct rpc_callextra *, rpcproc_t,
   44     struct mbuf *, struct mbuf **, struct timeval, SVCXPRT *);
   45 
   46 /*
   47  * A pending RPC request which awaits a reply. Requests which have
   48  * received their reply will have cr_xid set to zero and cr_mrep to
   49  * the mbuf chain of the reply.
   50  */
   51 struct ct_request {
   52         TAILQ_ENTRY(ct_request) cr_link;
   53         uint32_t                cr_xid;         /* XID of request */
   54         struct mbuf             *cr_mrep;       /* reply received by upcall */
   55         int                     cr_error;       /* any error from upcall */
   56         char                    cr_verf[MAX_AUTH_BYTES]; /* reply verf */
   57 };
   58 
   59 TAILQ_HEAD(ct_request_list, ct_request);
   60 
   61 struct rc_data {
   62         struct mtx              rc_lock;
   63         struct sockaddr_storage rc_addr; /* server address */
   64         struct netconfig*       rc_nconf; /* network type */
   65         rpcprog_t               rc_prog;  /* program number */
   66         rpcvers_t               rc_vers;  /* version number */
   67         size_t                  rc_sendsz;
   68         size_t                  rc_recvsz;
   69         struct timeval          rc_timeout;
   70         struct timeval          rc_retry;
   71         int                     rc_retries;
   72         int                     rc_privport;
   73         char                    *rc_waitchan;
   74         int                     rc_intr;
   75         int                     rc_connecting;
   76         int                     rc_closed;
   77         struct ucred            *rc_ucred;
   78         CLIENT*                 rc_client; /* underlying RPC client */
   79         struct rpc_err          rc_err;
   80         void                    *rc_backchannel;
   81         void                    (*rc_reconcall)(CLIENT *, void *,
   82                                     struct ucred *); /* reconection upcall */
   83         void                    *rc_reconarg;   /* upcall arg */
   84 };
   85 
   86 struct ct_data {
   87         struct mtx      ct_lock;
   88         int             ct_threads;     /* number of threads in clnt_vc_call */
   89         bool_t          ct_closing;     /* TRUE if we are closing */
   90         bool_t          ct_closed;      /* TRUE if we are closed */
   91         struct socket   *ct_socket;     /* connection socket */
   92         bool_t          ct_closeit;     /* close it on destroy */
   93         struct timeval  ct_wait;        /* wait interval in milliseconds */
   94         struct sockaddr_storage ct_addr; /* remote addr */
   95         struct rpc_err  ct_error;
   96         uint32_t        ct_xid;
   97         char            ct_mcallc[MCALL_MSG_SIZE]; /* marshalled callmsg */
   98         size_t          ct_mpos;        /* pos after marshal */
   99         const char      *ct_waitchan;
  100         int             ct_waitflag;
  101         struct mbuf     *ct_record;     /* current reply record */
  102         size_t          ct_record_resid; /* how much left of reply to read */
  103         bool_t          ct_record_eor;   /* true if reading last fragment */
  104         struct ct_request_list ct_pending;
  105         int             ct_upcallrefs;  /* Ref cnt of upcalls in prog. */
  106         SVCXPRT         *ct_backchannelxprt; /* xprt for backchannel */
  107 };
  108 
  109 struct cf_conn {  /* kept in xprt->xp_p1 for actual connection */
  110         enum xprt_stat strm_stat;
  111         struct mbuf *mpending;  /* unparsed data read from the socket */
  112         struct mbuf *mreq;      /* current record being built from mpending */
  113         uint32_t resid;         /* number of bytes needed for fragment */
  114         bool_t eor;             /* reading last fragment of current record */
  115 };
  116 
  117 #endif  /* _KERNEL */
  118 
  119 #endif  /* _RPC_KRPC_H_ */

Cache object: d7a7c8c12bd7f83b9f6414f886663c4d


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.