Back to index

glibc  2.9
Functions
nis_server.c File Reference
#include <string.h>
#include <rpcsvc/nis.h>
#include "nis_xdr.h"
#include "nis_intern.h"

Go to the source code of this file.

Functions

nis_error nis_servstate (const nis_server *serv, const nis_tag *tags, const int numtags, nis_tag **result)
nis_error nis_stats (const nis_server *serv, const nis_tag *tags, const int numtags, nis_tag **result)
void nis_freetags (nis_tag *tags, const int numtags)

Function Documentation

void nis_freetags ( nis_tag *  tags,
const int  numtags 
)

Definition at line 79 of file nis_server.c.

{
  int i;

  for (i = 0; i < numtags; ++i)
    free (tags[i].tag_val);
  free (tags);
}
nis_error nis_servstate ( const nis_server *  serv,
const nis_tag *  tags,
const int  numtags,
nis_tag **  result 
)

Definition at line 27 of file nis_server.c.

{
  nis_taglist taglist;
  nis_taglist tagres;

  *result = 0;
  tagres.tags.tags_len = 0;
  tagres.tags.tags_val = NULL;
  taglist.tags.tags_len = numtags;
  taglist.tags.tags_val = (nis_tag *) tags;

  if (serv == NULL)
    return NIS_BADOBJECT;

  if (__do_niscall2 (serv, 1, NIS_SERVSTATE, (xdrproc_t) _xdr_nis_taglist,
                   (caddr_t) &taglist, (xdrproc_t) _xdr_nis_taglist,
                   (caddr_t) &tagres, 0, NULL) != RPC_SUCCESS)
    return NIS_RPCERROR;

  *result = tagres.tags.tags_val;

  return NIS_SUCCESS;
}

Here is the call graph for this function:

nis_error nis_stats ( const nis_server *  serv,
const nis_tag *  tags,
const int  numtags,
nis_tag **  result 
)

Definition at line 53 of file nis_server.c.

{
  nis_taglist taglist;
  nis_taglist tagres;

  *result = NULL;
  tagres.tags.tags_len = 0;
  tagres.tags.tags_val = NULL;
  taglist.tags.tags_len = numtags;
  taglist.tags.tags_val = (nis_tag *) tags;

  if (serv == NULL)
    return NIS_BADOBJECT;

  if (__do_niscall2 (serv, 1, NIS_STATUS, (xdrproc_t) _xdr_nis_taglist,
                   (caddr_t) &taglist, (xdrproc_t) _xdr_nis_taglist,
                   (caddr_t) &tagres, 0, NULL) != RPC_SUCCESS)
    return NIS_RPCERROR;

  *result = tagres.tags.tags_val;

  return NIS_SUCCESS;
}

Here is the call graph for this function: