~ubuntu-branches/ubuntu/oneiric/nis/oneiric-proposed

« back to all changes in this revision

Viewing changes to ypbind-mt-1.19/src/ypbind_xdr.c

  • Committer: Bazaar Package Importer
  • Author(s): Scott James Remnant
  • Date: 2005-11-16 23:42:06 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20051116234206-p00omaw5ji5q0qhr
Tags: 3.15-3ubuntu1
Resynchronise with Debian.  (me)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
 
2
 
#include "ypbind.h"
3
 
 
4
 
bool_t
5
 
ypbind_xdr_domainname (XDR *xdrs, domainname *objp)
6
 
{
7
 
  if (!xdr_string (xdrs, objp, YPMAXDOMAIN))
8
 
    return FALSE;
9
 
  return TRUE;
10
 
}
11
 
 
12
 
bool_t
13
 
ypbind_xdr_resptype (XDR *xdrs, ypbind_resptype *objp)
14
 
{
15
 
  if (!xdr_enum (xdrs, (enum_t *) objp))
16
 
    return FALSE;
17
 
  return TRUE;
18
 
}
19
 
 
20
 
bool_t
21
 
ypbind_xdr_binding (XDR *xdrs, ypbind_binding *objp)
22
 
{
23
 
  if (!xdr_opaque (xdrs, objp->ypbind_binding_addr, 4))
24
 
    return FALSE;
25
 
  if (!xdr_opaque (xdrs, objp->ypbind_binding_port, 2))
26
 
    return FALSE;
27
 
  return TRUE;
28
 
}
29
 
 
30
 
bool_t
31
 
ypbind_xdr_resp (XDR *xdrs, ypbind_resp *objp)
32
 
{
33
 
  if (!ypbind_xdr_resptype (xdrs, &objp->ypbind_status))
34
 
    return FALSE;
35
 
  switch (objp->ypbind_status)
36
 
    {
37
 
    case YPBIND_FAIL_VAL:
38
 
      if (!xdr_u_int (xdrs, &objp->ypbind_resp_u.ypbind_error))
39
 
        return FALSE;
40
 
      break;
41
 
    case YPBIND_SUCC_VAL:
42
 
      if (!ypbind_xdr_binding (xdrs, &objp->ypbind_resp_u.ypbind_bindinfo))
43
 
        return FALSE;
44
 
      break;
45
 
    default:
46
 
      return FALSE;
47
 
    }
48
 
  return TRUE;
49
 
}
50
 
 
51
 
bool_t
52
 
ypbind_xdr_oldsetdom (XDR *xdrs, ypbind_oldsetdom *objp)
53
 
{
54
 
  if (!xdr_vector (xdrs, (char *)objp->ypoldsetdom_domain, YPMAXDOMAIN,
55
 
                   sizeof (char), (xdrproc_t) xdr_char))
56
 
    return FALSE;
57
 
  if (!ypbind_xdr_binding (xdrs, &objp->ypoldsetdom_binding))
58
 
    return FALSE;
59
 
  return TRUE;
60
 
}
61
 
 
62
 
bool_t
63
 
ypbind_xdr_setdom (XDR *xdrs, ypbind_setdom *objp)
64
 
{
65
 
  if (!ypbind_xdr_domainname (xdrs, &objp->ypsetdom_domain))
66
 
    return FALSE;
67
 
  if (!ypbind_xdr_binding (xdrs, &objp->ypsetdom_binding))
68
 
    return FALSE;
69
 
  if (!xdr_u_int (xdrs, &objp->ypsetdom_vers))
70
 
    return FALSE;
71
 
  return TRUE;
72
 
}