Retrieve XID - NFS

This is a discussion on Retrieve XID - NFS ; Hello, I want to extract the XID out of RPC requests, but did not find any documentation how to achieve this. Anybody can give me a hint?...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Retrieve XID

  1. Retrieve XID

    Hello,

    I want to extract the XID out of RPC requests, but did not find any
    documentation how to achieve this. Anybody can give me a hint?

  2. Re: Retrieve XID

    Jochen Witte wrote in message news:...
    > Hello,
    >
    > I want to extract the XID out of RPC requests, but did not find any
    > documentation how to achieve this. Anybody can give me a hint?



    Use the svc_control interfaces and use the SVC_GETXID command.

    http://docs.sun.com/db/doc/816-1057/6m7gj02qt?a=view

  3. Re: Retrieve XID

    Am Tue, 06 Jul 2004 17:15:47 -0700 schrieb Mike Eisler:

    > Jochen Witte wrote in message news:...
    >> Hello,
    >>
    >> I want to extract the XID out of RPC requests, but did not find any
    >> documentation how to achieve this. Anybody can give me a hint?

    >
    >
    > Use the svc_control interfaces and use the SVC_GETXID command.
    >
    > http://docs.sun.com/db/doc/816-1057/6m7gj02qt?a=view


    But: there is no svc_control() in Linux - anybody knows how to do this in
    Linux? (glibc 2.3.3)

    Regards
    Jochen

  4. Re: Retrieve XID


    Am Thu, 05 Aug 2004 09:45:57 +0200 schrieb Jochen Witte:

    > Am Tue, 06 Jul 2004 17:15:47 -0700 schrieb Mike Eisler:
    >
    >> Jochen Witte wrote in message news:...
    >>> Hello,
    >>>
    >>> I want to extract the XID out of RPC requests, but did not find any
    >>> documentation how to achieve this. Anybody can give me a hint?

    >>
    >>
    >> Use the svc_control interfaces and use the SVC_GETXID command.
    >>
    >> http://docs.sun.com/db/doc/816-1057/6m7gj02qt?a=view

    >
    > But: there is no svc_control() in Linux - anybody knows how to do this in
    > Linux? (glibc 2.3.3)
    >
    > Regards
    > Jochen


    I finally found how to "solve" this -- just in case anybody is interested:

    The SVCXPRT struct (which is passed to every procedure) in rpc/svc.h
    is defined like this:

    ---snip---
    typedef struct SVCXPRT SVCXPRT;
    struct SVCXPRT {
    int xp_sock;
    u_short xp_port; /* associated port number */
    const struct xp_ops {
    bool_t (*xp_recv) (SVCXPRT *__xprt, struct rpc_msg *__msg);
    /* receive incoming requests */
    enum xprt_stat (*xp_stat) (SVCXPRT *__xprt);
    /* get transport status */
    bool_t (*xp_getargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
    caddr_t args_ptr); /* get arguments */
    bool_t (*xp_reply) (SVCXPRT *__xprt, struct rpc_msg *__msg);
    /* send reply */
    bool_t (*xp_freeargs) (SVCXPRT *__xprt, xdrproc_t __xdr_args,
    caddr_t args_ptr);
    /* free mem allocated for args */
    void (*xp_destroy) (SVCXPRT *__xprt);
    /* destroy this struct */
    } *xp_ops;
    int xp_addrlen; /* length of remote address */
    struct sockaddr_in xp_raddr; /* remote address */
    struct opaque_auth xp_verf; /* raw response verifier */
    caddr_t xp_p1; /* private */
    caddr_t xp_p2; /* private */
    char xp_pad [256]; /* padding, internal use */
    };
    ---snip---

    As one might see in the BSD CVS the member xp_p1 and xp_p2 are pointers to
    structures containing the XID for UDP requests (xp_p2) or TCP requests
    (xp_p1). This code originates from the original SUN sources and so I
    assumed this might be the same in Linux as in BSD or SOLARIS. Here are the
    accordiung structs:

    for xp_p1:
    ---snip---
    struct tcp_conn
    { /* kept in xprt->xp_p1 */
    enum xprt_stat strm_stat;
    u_long x_id;
    XDR xdrs;
    char verf_body[MAX_AUTH_BYTES];
    };
    typedef struct tcp_conn tcp_conn;
    ---snip---

    and for xp_p2:
    ---snip---
    struct svcudp_data { /* kept in xprt->xp_p2 */
    u_int su_iosz; /* byte size of send.recv buffer */
    u_long su_xid; /* transaction id */
    XDR su_xdrs; /* XDR handle */
    char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */
    char * su_cache; /* cached data, NULL if no cache */
    };
    typedef struct svcudp_data svcudp_data;
    ---snip---

    And voila - here ios the XID.

    Leaves the question, why this is "private" in Linux. => This has to be
    regarded as a hack...

    Jochen


  5. Re: Retrieve XID

    Jochen Witte wrote in message news:...
    > caddr_t xp_p1; /* private */
    > caddr_t xp_p2; /* private */
    > ---snip---
    >
    > As one might see in the BSD CVS the member xp_p1 and xp_p2 are pointers to
    > structures containing the XID for UDP requests (xp_p2) or TCP requests
    > (xp_p1). This code originates from the original SUN sources and so I
    > assumed this might be the same in Linux as in BSD or SOLARIS. Here are the
    > accordiung structs:
    >
    > for xp_p1:
    > ---snip---
    > struct tcp_conn
    > { /* kept in xprt->xp_p1 */
    > enum xprt_stat strm_stat;
    > u_long x_id;
    > XDR xdrs;
    > char verf_body[MAX_AUTH_BYTES];
    > };
    > typedef struct tcp_conn tcp_conn;
    > ---snip---
    >
    > and for xp_p2:
    > ---snip---
    > struct svcudp_data { /* kept in xprt->xp_p2 */
    > u_int su_iosz; /* byte size of send.recv buffer */
    > u_long su_xid; /* transaction id */
    > XDR su_xdrs; /* XDR handle */
    > char su_verfbody[MAX_AUTH_BYTES]; /* verifier body */
    > char * su_cache; /* cached data, NULL if no cache */
    > };
    > typedef struct svcudp_data svcudp_data;
    > ---snip---
    >
    > And voila - here ios the XID.
    >
    > Leaves the question, why this is "private" in Linux. => This has to be
    > regarded as a hack...


    The ONC RPC code in the GNU C library is derived from the
    source Sun released in 1980s and 1990s. It is just as private
    in the Solaris libnsl library. The difference being that
    the maintainers of the GNU RPC code haven't kept it up to date.

    I'm told the maintainers work for Red Hat. You could file a bug
    with Red Hat's bugzilla system to report the issue.
    >
    > Jochen


+ Reply to Thread