Logo Search packages:      
Sourcecode: ganglia version File versions

gm_protocol_xdr.c

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

#include "gm_protocol.h"
#define UDP_HEADER_SIZE 28
#define MAX_DESC_LEN 128
#define GM_PROTOCOL_GUARD

bool_t
xdr_Ganglia_value_types (XDR *xdrs, Ganglia_value_types *objp)
{
      register int32_t *buf;

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

bool_t
xdr_Ganglia_extra_data (XDR *xdrs, Ganglia_extra_data *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, &objp->name, ~0))
             return FALSE;
       if (!xdr_string (xdrs, &objp->data, ~0))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_metadata_message (XDR *xdrs, Ganglia_metadata_message *objp)
{
      register int32_t *buf;


      if (xdrs->x_op == XDR_ENCODE) {
             if (!xdr_string (xdrs, &objp->type, ~0))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->name, ~0))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->units, ~0))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_u_int (xdrs, &objp->slope))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->tmax))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->dmax))
                         return FALSE;

            } else {
            IXDR_PUT_U_LONG(buf, objp->slope);
            IXDR_PUT_U_LONG(buf, objp->tmax);
            IXDR_PUT_U_LONG(buf, objp->dmax);
            }
             if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0,
                  sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data))
                   return FALSE;
            return TRUE;
      } else if (xdrs->x_op == XDR_DECODE) {
             if (!xdr_string (xdrs, &objp->type, ~0))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->name, ~0))
                   return FALSE;
             if (!xdr_string (xdrs, &objp->units, ~0))
                   return FALSE;
            buf = XDR_INLINE (xdrs, 3 * BYTES_PER_XDR_UNIT);
            if (buf == NULL) {
                   if (!xdr_u_int (xdrs, &objp->slope))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->tmax))
                         return FALSE;
                   if (!xdr_u_int (xdrs, &objp->dmax))
                         return FALSE;

            } else {
            objp->slope = IXDR_GET_U_LONG(buf);
            objp->tmax = IXDR_GET_U_LONG(buf);
            objp->dmax = IXDR_GET_U_LONG(buf);
            }
             if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0,
                  sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data))
                   return FALSE;
       return TRUE;
      }

       if (!xdr_string (xdrs, &objp->type, ~0))
             return FALSE;
       if (!xdr_string (xdrs, &objp->name, ~0))
             return FALSE;
       if (!xdr_string (xdrs, &objp->units, ~0))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->slope))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->tmax))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->dmax))
             return FALSE;
       if (!xdr_array (xdrs, (char **)&objp->metadata.metadata_val, (u_int *) &objp->metadata.metadata_len, ~0,
            sizeof (Ganglia_extra_data), (xdrproc_t) xdr_Ganglia_extra_data))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_metric_id (XDR *xdrs, Ganglia_metric_id *objp)
{
      register int32_t *buf;

       if (!xdr_string (xdrs, &objp->host, ~0))
             return FALSE;
       if (!xdr_string (xdrs, &objp->name, ~0))
             return FALSE;
       if (!xdr_bool (xdrs, &objp->spoof))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_metadatadef (XDR *xdrs, Ganglia_metadatadef *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_Ganglia_metadata_message (xdrs, &objp->metric))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_metadatareq (XDR *xdrs, Ganglia_metadatareq *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_ushort (XDR *xdrs, Ganglia_gmetric_ushort *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_u_short (xdrs, &objp->us))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_short (XDR *xdrs, Ganglia_gmetric_short *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_short (xdrs, &objp->ss))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_int (XDR *xdrs, Ganglia_gmetric_int *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_int (xdrs, &objp->si))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_uint (XDR *xdrs, Ganglia_gmetric_uint *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_u_int (xdrs, &objp->ui))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_string (XDR *xdrs, Ganglia_gmetric_string *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_string (xdrs, &objp->str, ~0))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_float (XDR *xdrs, Ganglia_gmetric_float *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_float (xdrs, &objp->f))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_gmetric_double (XDR *xdrs, Ganglia_gmetric_double *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_metric_id (xdrs, &objp->metric_id))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, ~0))
             return FALSE;
       if (!xdr_double (xdrs, &objp->d))
             return FALSE;
      return TRUE;
}

bool_t
xdr_Ganglia_msg_formats (XDR *xdrs, Ganglia_msg_formats *objp)
{
      register int32_t *buf;

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

bool_t
xdr_Ganglia_metadata_msg (XDR *xdrs, Ganglia_metadata_msg *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_msg_formats (xdrs, &objp->id))
             return FALSE;
      switch (objp->id) {
      case gmetadata_full:
             if (!xdr_Ganglia_metadatadef (xdrs, &objp->Ganglia_metadata_msg_u.gfull))
                   return FALSE;
            break;
      case gmetadata_request:
             if (!xdr_Ganglia_metadatareq (xdrs, &objp->Ganglia_metadata_msg_u.grequest))
                   return FALSE;
            break;
      default:
            break;
      }
      return TRUE;
}

bool_t
xdr_Ganglia_value_msg (XDR *xdrs, Ganglia_value_msg *objp)
{
      register int32_t *buf;

       if (!xdr_Ganglia_msg_formats (xdrs, &objp->id))
             return FALSE;
      switch (objp->id) {
      case gmetric_ushort:
             if (!xdr_Ganglia_gmetric_ushort (xdrs, &objp->Ganglia_value_msg_u.gu_short))
                   return FALSE;
            break;
      case gmetric_short:
             if (!xdr_Ganglia_gmetric_short (xdrs, &objp->Ganglia_value_msg_u.gs_short))
                   return FALSE;
            break;
      case gmetric_int:
             if (!xdr_Ganglia_gmetric_int (xdrs, &objp->Ganglia_value_msg_u.gs_int))
                   return FALSE;
            break;
      case gmetric_uint:
             if (!xdr_Ganglia_gmetric_uint (xdrs, &objp->Ganglia_value_msg_u.gu_int))
                   return FALSE;
            break;
      case gmetric_string:
             if (!xdr_Ganglia_gmetric_string (xdrs, &objp->Ganglia_value_msg_u.gstr))
                   return FALSE;
            break;
      case gmetric_float:
             if (!xdr_Ganglia_gmetric_float (xdrs, &objp->Ganglia_value_msg_u.gf))
                   return FALSE;
            break;
      case gmetric_double:
             if (!xdr_Ganglia_gmetric_double (xdrs, &objp->Ganglia_value_msg_u.gd))
                   return FALSE;
            break;
      default:
            break;
      }
      return TRUE;
}

bool_t
xdr_Ganglia_25metric (XDR *xdrs, Ganglia_25metric *objp)
{
      register int32_t *buf;

       if (!xdr_int (xdrs, &objp->key))
             return FALSE;
       if (!xdr_string (xdrs, &objp->name, 16))
             return FALSE;
       if (!xdr_int (xdrs, &objp->tmax))
             return FALSE;
       if (!xdr_Ganglia_value_types (xdrs, &objp->type))
             return FALSE;
       if (!xdr_string (xdrs, &objp->units, 32))
             return FALSE;
       if (!xdr_string (xdrs, &objp->slope, 32))
             return FALSE;
       if (!xdr_string (xdrs, &objp->fmt, 32))
             return FALSE;
       if (!xdr_int (xdrs, &objp->msg_size))
             return FALSE;
       if (!xdr_string (xdrs, &objp->desc, 128))
             return FALSE;
       if (!xdr_pointer (xdrs, (char **)&objp->metadata, sizeof (int), (xdrproc_t) xdr_int))
             return FALSE;
      return TRUE;
}

Generated by  Doxygen 1.6.0   Back to index