// -*-c++-*-
/* This file was automatically generated by rpcc. */

#ifndef __RPCC_SFSCD_PROT_H_INCLUDED__
#define __RPCC_SFSCD_PROT_H_INCLUDED__ 1

#include "xdrmisc.h"
#include "sfs_prot.h"
#include "nfsmounter.h"
#include "sfsagent.h"


struct sfscd_initarg {
  rpc_str<RPC_INFINITY> name;
};
void *sfscd_initarg_alloc ();
bool_t xdr_sfscd_initarg (XDR *, void *);
RPC_STRUCT_DECL (sfscd_initarg)

template<class T> inline bool
rpc_traverse (T &t, sfscd_initarg &obj)
{
  return rpc_traverse (t, obj.name);
}



struct sfscd_mountarg {
  sfs_connectarg carg;
  rpc_ptr<sfs_connectok> cres;
};
void *sfscd_mountarg_alloc ();
bool_t xdr_sfscd_mountarg (XDR *, void *);
RPC_STRUCT_DECL (sfscd_mountarg)

template<class T> bool
rpc_traverse (T &t, sfscd_mountarg &obj)
{
  return rpc_traverse (t, obj.carg)
    && rpc_traverse (t, obj.cres);
}



struct sfscd_mountok {
  int32_t mntflags;
  nfsmnt_handle fh;
};
void *sfscd_mountok_alloc ();
bool_t xdr_sfscd_mountok (XDR *, void *);
RPC_STRUCT_DECL (sfscd_mountok)

template<class T> bool
rpc_traverse (T &t, sfscd_mountok &obj)
{
  return rpc_traverse (t, obj.mntflags)
    && rpc_traverse (t, obj.fh);
}



struct sfscd_mountres {
  const int32_t err;
  union {
    union_entry_base _base;
    union_entry<sfscd_mountok> reply;
  };

#define rpcunion_tag_sfscd_mountres err
#define rpcunion_switch_sfscd_mountres(swarg, action, voidaction, defaction) \
  switch (swarg) { \
  case 0: \
    action (sfscd_mountok, reply); \
    break; \
  default: \
    voidaction; \
    break; \
  }

  sfscd_mountres (int32_t _tag = (int32_t) 0) : err (_tag)
    { _base.init (); set_err (_tag); }
  sfscd_mountres (const sfscd_mountres &_s)
    : err (_s.err)
    { _base.init (_s._base); }
  ~sfscd_mountres () { _base.destroy (); }
  sfscd_mountres &operator= (const sfscd_mountres &_s) {
    const_cast<int32_t &> (err) = _s.err;
    _base.assign (_s._base);
    return *this;
  }

  void set_err (int32_t _tag) {
    const_cast<int32_t &> (err) = _tag;
    rpcunion_switch_sfscd_mountres
      (_tag, RPCUNION_SET, _base.destroy (), _base.destroy ());
  }
};

template<class T> bool
rpc_traverse (T &t, sfscd_mountres &obj)
{
  int32_t tag = obj.err;
  if (!rpc_traverse (t, tag))
    return false;
  if (tag != obj.err)
    obj.set_err (tag);

  rpcunion_switch_sfscd_mountres
    (obj.err, RPCUNION_TRAVERSE, return true, return false);
}
inline bool
rpc_traverse (const stompcast_t &s, sfscd_mountres &obj)
{
  rpcunion_switch_sfscd_mountres
    (obj.err, RPCUNION_REC_STOMPCAST,
     obj._base.destroy (); return true, obj._base.destroy (); return true;);
}
void *sfscd_mountres_alloc ();
bool_t xdr_sfscd_mountres (XDR *, void *);
RPC_UNION_DECL (sfscd_mountres)



struct sfscd_authreq {
  const int32_t type;
  union {
    union_entry_base _base;
    union_entry<sfsagent_authinit_arg> init;
    union_entry<sfsagent_authmore_arg> more;
  };

#define rpcunion_tag_sfscd_authreq type
#define rpcunion_switch_sfscd_authreq(swarg, action, voidaction, defaction) \
  switch (swarg) { \
  case AGENTCB_AUTHINIT: \
    action (sfsagent_authinit_arg, init); \
    break; \
  case AGENTCB_AUTHMORE: \
    action (sfsagent_authmore_arg, more); \
    break; \
  default: \
    defaction; \
    break; \
  }

  sfscd_authreq (int32_t _tag = (int32_t) 0) : type (_tag)
    { _base.init (); set_type (_tag); }
  sfscd_authreq (const sfscd_authreq &_s)
    : type (_s.type)
    { _base.init (_s._base); }
  ~sfscd_authreq () { _base.destroy (); }
  sfscd_authreq &operator= (const sfscd_authreq &_s) {
    const_cast<int32_t &> (type) = _s.type;
    _base.assign (_s._base);
    return *this;
  }

  void set_type (int32_t _tag) {
    const_cast<int32_t &> (type) = _tag;
    rpcunion_switch_sfscd_authreq
      (_tag, RPCUNION_SET, _base.destroy (), _base.destroy ());
  }
};

template<class T> bool
rpc_traverse (T &t, sfscd_authreq &obj)
{
  int32_t tag = obj.type;
  if (!rpc_traverse (t, tag))
    return false;
  if (tag != obj.type)
    obj.set_type (tag);

  rpcunion_switch_sfscd_authreq
    (obj.type, RPCUNION_TRAVERSE, return true, return false);
}
inline bool
rpc_traverse (const stompcast_t &s, sfscd_authreq &obj)
{
  rpcunion_switch_sfscd_authreq
    (obj.type, RPCUNION_REC_STOMPCAST,
     obj._base.destroy (); return true, obj._base.destroy (); return true;);
}
void *sfscd_authreq_alloc ();
bool_t xdr_sfscd_authreq (XDR *, void *);
RPC_UNION_DECL (sfscd_authreq)


typedef u_int64_t sfs_aid;
void *sfs_aid_alloc ();
bool_t xdr_sfs_aid (XDR *, void *);
RPC_TYPEDEF_DECL (sfs_aid)


struct sfscd_agentreq_arg {
  sfs_aid aid;
  sfscd_authreq agentreq;
};
void *sfscd_agentreq_arg_alloc ();
bool_t xdr_sfscd_agentreq_arg (XDR *, void *);
RPC_STRUCT_DECL (sfscd_agentreq_arg)

template<class T> bool
rpc_traverse (T &t, sfscd_agentreq_arg &obj)
{
  return rpc_traverse (t, obj.aid)
    && rpc_traverse (t, obj.agentreq);
}


#ifndef SFSCD_PROGRAM
#define SFSCD_PROGRAM 344438
#endif /* !SFSCD_PROGRAM */
extern const rpc_program sfscd_program_1;
enum { SFSCD_VERSION = 1 };
enum {
  SFSCDPROC_NULL = 0,
  SFSCDPROC_INIT = 1,
  SFSCDPROC_MOUNT = 2,
  SFSCDPROC_UNMOUNT = 3,
  SFSCDPROC_FLUSHAUTH = 4,
  SFSCDPROC_CONDEMN = 5,
};
#define SFSCD_PROGRAM_1_APPLY_NOVOID(macro, void) \
  macro (SFSCDPROC_NULL, void, void) \
  macro (SFSCDPROC_INIT, sfscd_initarg, void) \
  macro (SFSCDPROC_MOUNT, sfscd_mountarg, sfscd_mountres) \
  macro (SFSCDPROC_UNMOUNT, nfspath3, void) \
  macro (SFSCDPROC_FLUSHAUTH, sfs_aid, void) \
  macro (SFSCDPROC_CONDEMN, nfspath3, void)
#define SFSCD_PROGRAM_1_APPLY(macro) \
  SFSCD_PROGRAM_1_APPLY_NOVOID(macro, void)


#ifndef SFSCDCB_PROGRAM
#define SFSCDCB_PROGRAM 344439
#endif /* !SFSCDCB_PROGRAM */
extern const rpc_program sfscdcb_program_1;
enum { SFSCDCB_VERSION = 1 };
enum {
  SFSCDCBPROC_NULL = 0,
  SFSCDCBPROC_AGENTREQ = 1,
  SFSCDCBPROC_IDLE = 2,
  SFSCDCBPROC_DELFS = 3,
  SFSCDCBPROC_HIDEFS = 4,
  SFSCDCBPROC_SHOWFS = 5,
};
#define SFSCDCB_PROGRAM_1_APPLY_NOVOID(macro, void) \
  macro (SFSCDCBPROC_NULL, void, void) \
  macro (SFSCDCBPROC_AGENTREQ, sfscd_agentreq_arg, sfsagent_auth_res) \
  macro (SFSCDCBPROC_IDLE, nfspath3, void) \
  macro (SFSCDCBPROC_DELFS, nfspath3, void) \
  macro (SFSCDCBPROC_HIDEFS, nfspath3, void) \
  macro (SFSCDCBPROC_SHOWFS, nfspath3, void)
#define SFSCDCB_PROGRAM_1_APPLY(macro) \
  SFSCDCB_PROGRAM_1_APPLY_NOVOID(macro, void)

#endif /* !__RPCC_SFSCD_PROT_H_INCLUDED__ */
