Logo Search packages:      
Sourcecode: bayonne version File versions  Download package

bayonne_xdr.c

/*
 * Please do not edit this file.
 * It was generated using rpcgen.
 */

#include "bayonne_rpc.h"
/* Copyright (C) 2001 Open Source Telecom Corporation.
 *
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License version 2 as published by the Free Software Foundation.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 * 
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.                                                 
 */

bool_t
xdr_bayonne_conf (XDR *xdrs, bayonne_conf *objp)
{
      register int32_t *buf;

       if (!xdr_int (xdrs, &objp->count))
             return FALSE;
       if (!xdr_int (xdrs, &objp->limit))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->members.members_val, (u_int *) &objp->members.members_len, ~0,
            sizeof (int), (xdrproc_t) xdr_int))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_policy (XDR *xdrs, bayonne_policy *objp)
{
      register int32_t *buf;


      if (xdrs->x_op == XDR_ENCODE) {
             if (!xdr_string (xdrs, &objp->pol_name, BAYONNE_POLICY_NAME_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->pol_sched, BAYONNE_POLICY_SCHED_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->pol_number, BAYONNE_POLICY_NUMBER_SZ))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->pol_active))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->max_incoming))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->max_outgoing))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->tot_incoming))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->tot_outgoing))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->pol_members))
                         return FALSE;

            } else {
            IXDR_PUT_LONG(buf, objp->pol_active);
            IXDR_PUT_LONG(buf, objp->max_incoming);
            IXDR_PUT_LONG(buf, objp->max_outgoing);
            IXDR_PUT_LONG(buf, objp->tot_incoming);
            IXDR_PUT_LONG(buf, objp->tot_outgoing);
            IXDR_PUT_LONG(buf, objp->pol_members);
            }
             if (!xdr_array (xdrs, (char **)&objp->pol_ports.pol_ports_val, (u_int *) &objp->pol_ports.pol_ports_len, ~0,
                  sizeof (int), (xdrproc_t) xdr_int))
                   return FALSE;
            return TRUE;
      } else if (xdrs->x_op == XDR_DECODE) {
             if (!xdr_string (xdrs, &objp->pol_name, BAYONNE_POLICY_NAME_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->pol_sched, BAYONNE_POLICY_SCHED_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->pol_number, BAYONNE_POLICY_NUMBER_SZ))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 6 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->pol_active))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->max_incoming))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->max_outgoing))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->tot_incoming))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->tot_outgoing))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->pol_members))
                         return FALSE;

            } else {
            objp->pol_active = IXDR_GET_LONG(buf);
            objp->max_incoming = IXDR_GET_LONG(buf);
            objp->max_outgoing = IXDR_GET_LONG(buf);
            objp->tot_incoming = IXDR_GET_LONG(buf);
            objp->tot_outgoing = IXDR_GET_LONG(buf);
            objp->pol_members = IXDR_GET_LONG(buf);
            }
             if (!xdr_array (xdrs, (char **)&objp->pol_ports.pol_ports_val, (u_int *) &objp->pol_ports.pol_ports_len, ~0,
                  sizeof (int), (xdrproc_t) xdr_int))
                   return FALSE;
       return TRUE;
      }

       if (!xdr_string (xdrs, &objp->pol_name, BAYONNE_POLICY_NAME_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->pol_sched, BAYONNE_POLICY_SCHED_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->pol_number, BAYONNE_POLICY_NUMBER_SZ))
             return FALSE;
       if (!xdr_int (xdrs, &objp->pol_active))
             return FALSE;
       if (!xdr_int (xdrs, &objp->max_incoming))
             return FALSE;
       if (!xdr_int (xdrs, &objp->max_outgoing))
             return FALSE;
       if (!xdr_long (xdrs, &objp->tot_incoming))
             return FALSE;
       if (!xdr_long (xdrs, &objp->tot_outgoing))
             return FALSE;
       if (!xdr_int (xdrs, &objp->pol_members))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->pol_ports.pol_ports_val, (u_int *) &objp->pol_ports.pol_ports_len, ~0,
            sizeof (int), (xdrproc_t) xdr_int))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_mixer (XDR *xdrs, bayonne_mixer *objp)
{
      register int32_t *buf;


      if (xdrs->x_op == XDR_ENCODE) {
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->mixer_avail))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->mixer_used))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->mixer_groups))
                         return FALSE;

            } else {
            IXDR_PUT_LONG(buf, objp->mixer_avail);
            IXDR_PUT_LONG(buf, objp->mixer_used);
            IXDR_PUT_LONG(buf, objp->mixer_groups);
            }
             if (!xdr_array (xdrs, (char **)&objp->mixer_conf.mixer_conf_val, (u_int *) &objp->mixer_conf.mixer_conf_len, ~0,
                  sizeof (bayonne_conf), (xdrproc_t) xdr_bayonne_conf))
                   return FALSE;
            return TRUE;
      } else if (xdrs->x_op == XDR_DECODE) {
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->mixer_avail))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->mixer_used))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->mixer_groups))
                         return FALSE;

            } else {
            objp->mixer_avail = IXDR_GET_LONG(buf);
            objp->mixer_used = IXDR_GET_LONG(buf);
            objp->mixer_groups = IXDR_GET_LONG(buf);
            }
             if (!xdr_array (xdrs, (char **)&objp->mixer_conf.mixer_conf_val, (u_int *) &objp->mixer_conf.mixer_conf_len, ~0,
                  sizeof (bayonne_conf), (xdrproc_t) xdr_bayonne_conf))
                   return FALSE;
       return TRUE;
      }

       if (!xdr_int (xdrs, &objp->mixer_avail))
             return FALSE;
       if (!xdr_int (xdrs, &objp->mixer_used))
             return FALSE;
       if (!xdr_int (xdrs, &objp->mixer_groups))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->mixer_conf.mixer_conf_val, (u_int *) &objp->mixer_conf.mixer_conf_len, ~0,
            sizeof (bayonne_conf), (xdrproc_t) xdr_bayonne_conf))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_node (XDR *xdrs, bayonne_node *objp)
{
      register int32_t *buf;

      int i;
       if (!xdr_long (xdrs, &objp->node_update))
             return FALSE;
       if (!xdr_vector (xdrs, (char *)objp->node_name, 16,
            sizeof (char), (xdrproc_t) xdr_char))
             return FALSE;
       if (!xdr_long (xdrs, &objp->node_addr))
             return FALSE;
       if (!xdr_char (xdrs, &objp->node_version))
             return FALSE;
       if (!xdr_char (xdrs, &objp->node_buddies))
             return FALSE;
       if (!xdr_char (xdrs, &objp->node_ports))
             return FALSE;
       if (!xdr_vector (xdrs, (char *)objp->node_stat, 255,
            sizeof (char), (xdrproc_t) xdr_char))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_port (XDR *xdrs, bayonne_port *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, &objp->port_caller, BAYONNE_PORT_CALLER_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_dialed, BAYONNE_PORT_DIALED_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_name, BAYONNE_PORT_NAME_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_user, BAYONNE_PORT_USER_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_info, BAYONNE_PORT_INFO_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_lang, BAYONNE_PORT_LANG_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_gid, BAYONNE_PORT_GID_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->port_policy, BAYONNE_PORT_POLICY_SZ))
             return FALSE;
       if (!xdr_long (xdrs, &objp->port_caps))
             return FALSE;
       if (!xdr_long (xdrs, &objp->port_duration))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_error (XDR *xdrs, bayonne_error *objp)
{
      register int32_t *buf;

       if (!xdr_enum (xdrs, (enum_t *) objp))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_nodes (XDR *xdrs, bayonne_nodes *objp)
{
      register int32_t *buf;

       if (!xdr_array (xdrs, (char **)&objp->bayonne_nodes_val, (u_int *) &objp->bayonne_nodes_len, ~0,
            sizeof (bayonne_node), (xdrproc_t) xdr_bayonne_node))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_reserve (XDR *xdrs, bayonne_reserve *objp)
{
      register int32_t *buf;


      if (xdrs->x_op == XDR_ENCODE) {
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->conf_mixer))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->conf_alloc))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->conf_groups))
                         return FALSE;

            } else {
            IXDR_PUT_LONG(buf, objp->conf_mixer);
            IXDR_PUT_LONG(buf, objp->conf_alloc);
            IXDR_PUT_LONG(buf, objp->conf_groups);
            }
             if (!xdr_array (xdrs, (char **)&objp->conf_limits.conf_limits_val, (u_int *) &objp->conf_limits.conf_limits_len, ~0,
                  sizeof (int), (xdrproc_t) xdr_int))
                   return FALSE;
            return TRUE;
      } else if (xdrs->x_op == XDR_DECODE) {
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_int (xdrs, &objp->conf_mixer))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->conf_alloc))
                         return FALSE;
                   if (!xdr_int (xdrs, &objp->conf_groups))
                         return FALSE;

            } else {
            objp->conf_mixer = IXDR_GET_LONG(buf);
            objp->conf_alloc = IXDR_GET_LONG(buf);
            objp->conf_groups = IXDR_GET_LONG(buf);
            }
             if (!xdr_array (xdrs, (char **)&objp->conf_limits.conf_limits_val, (u_int *) &objp->conf_limits.conf_limits_len, ~0,
                  sizeof (int), (xdrproc_t) xdr_int))
                   return FALSE;
       return TRUE;
      }

       if (!xdr_int (xdrs, &objp->conf_mixer))
             return FALSE;
       if (!xdr_int (xdrs, &objp->conf_alloc))
             return FALSE;
       if (!xdr_int (xdrs, &objp->conf_groups))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->conf_limits.conf_limits_val, (u_int *) &objp->conf_limits.conf_limits_len, ~0,
            sizeof (int), (xdrproc_t) xdr_int))
             return FALSE;
      return TRUE;
}

bool_t
xdr_argv_string (XDR *xdrs, argv_string *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, objp, ~0))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_command (XDR *xdrs, bayonne_command *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, &objp->mod_name, BAYONNE_COMMAND_NAME_SZ))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->argv.argv_val, (u_int *) &objp->argv.argv_len, ~0,
            sizeof (argv_string), (xdrproc_t) xdr_argv_string))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_start (XDR *xdrs, bayonne_start *objp)
{
      register int32_t *buf;

       if (!xdr_int (xdrs, &objp->port))
             return FALSE;
       if (!xdr_string (xdrs, &objp->policy, BAYONNE_START_POLICY_SZ))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->argv.argv_val, (u_int *) &objp->argv.argv_len, ~0,
            sizeof (argv_string), (xdrproc_t) xdr_argv_string))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_request (XDR *xdrs, bayonne_request *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, &objp->req_policy, BAYONNE_REQUEST_POLICY_SZ))
             return FALSE;
       if (!xdr_int (xdrs, &objp->req_timeout))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->argv.argv_val, (u_int *) &objp->argv.argv_len, ~0,
            sizeof (argv_string), (xdrproc_t) xdr_argv_string))
             return FALSE;
      return TRUE;
}

bool_t
xdr_bayonne_info (XDR *xdrs, bayonne_info *objp)
{
      register int32_t *buf;


      if (xdrs->x_op == XDR_ENCODE) {
             if (!xdr_string (xdrs, &objp->tgi_user, BAYONNE_INFO_USER_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_node, BAYONNE_INFO_NODE_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_version, BAYONNE_INFO_VERSION_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_driver, BAYONNE_INFO_DRIVER_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_token, BAYONNE_INFO_TOKEN_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_policy, BAYONNE_INFO_POLICY_SZ))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_u_int (xdrs, &objp->nodes))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->ports))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->used))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->mixers))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->conferences))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->uid))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->gid))
                         return FALSE;
            } else {
                  IXDR_PUT_U_LONG(buf, objp->nodes);
                  IXDR_PUT_U_LONG(buf, objp->ports);
                  IXDR_PUT_U_LONG(buf, objp->used);
                  IXDR_PUT_U_LONG(buf, objp->mixers);
                  IXDR_PUT_U_LONG(buf, objp->conferences);
                  IXDR_PUT_LONG(buf, objp->uid);
                  IXDR_PUT_LONG(buf, objp->gid);
            }
            return TRUE;
      } else if (xdrs->x_op == XDR_DECODE) {
             if (!xdr_string (xdrs, &objp->tgi_user, BAYONNE_INFO_USER_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_node, BAYONNE_INFO_NODE_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_version, BAYONNE_INFO_VERSION_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_driver, BAYONNE_INFO_DRIVER_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_token, BAYONNE_INFO_TOKEN_SZ))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->tgi_policy, BAYONNE_INFO_POLICY_SZ))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 7 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_u_int (xdrs, &objp->nodes))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->ports))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->used))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->mixers))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->conferences))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->uid))
                         return FALSE;
                   if (!xdr_long (xdrs, &objp->gid))
                         return FALSE;
            } else {
                  objp->nodes = IXDR_GET_U_LONG(buf);
                  objp->ports = IXDR_GET_U_LONG(buf);
                  objp->used = IXDR_GET_U_LONG(buf);
                  objp->mixers = IXDR_GET_U_LONG(buf);
                  objp->conferences = IXDR_GET_U_LONG(buf);
                  objp->uid = IXDR_GET_LONG(buf);
                  objp->gid = IXDR_GET_LONG(buf);
            }
       return TRUE;
      }

       if (!xdr_string (xdrs, &objp->tgi_user, BAYONNE_INFO_USER_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->tgi_node, BAYONNE_INFO_NODE_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->tgi_version, BAYONNE_INFO_VERSION_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->tgi_driver, BAYONNE_INFO_DRIVER_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->tgi_token, BAYONNE_INFO_TOKEN_SZ))
             return FALSE;
       if (!xdr_string (xdrs, &objp->tgi_policy, BAYONNE_INFO_POLICY_SZ))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->nodes))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->ports))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->used))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->mixers))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->conferences))
             return FALSE;
       if (!xdr_long (xdrs, &objp->uid))
             return FALSE;
       if (!xdr_long (xdrs, &objp->gid))
             return FALSE;
      return TRUE;
}

Generated by  Doxygen 1.6.0   Back to index