parent
a2189100dd
commit
7c2379d458
@ -1 +1 @@ |
||||
Subproject commit 6e201464060ace53db809d65da7b0e2800673f8f |
||||
Subproject commit 903ec858bc8ab00fc0fbd44c23f0ab7770772353 |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,190 @@ |
||||
/*
|
||||
* Please do not edit this file. |
||||
* It was generated using rpcgen. |
||||
*/ |
||||
|
||||
#ifndef _PORTMAP_H_RPCGEN |
||||
#define _PORTMAP_H_RPCGEN |
||||
|
||||
#include "xdr_impl.h" |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#define PMAP_PORT 111 |
||||
|
||||
struct pmap2_mapping { |
||||
u_int prog; |
||||
u_int vers; |
||||
u_int prot; |
||||
u_int port; |
||||
}; |
||||
typedef struct pmap2_mapping pmap2_mapping; |
||||
|
||||
struct pmap2_call_args { |
||||
u_int prog; |
||||
u_int vers; |
||||
u_int proc; |
||||
xdr_string_t args; |
||||
}; |
||||
typedef struct pmap2_call_args pmap2_call_args; |
||||
|
||||
struct pmap2_call_result { |
||||
u_int port; |
||||
xdr_string_t res; |
||||
}; |
||||
typedef struct pmap2_call_result pmap2_call_result; |
||||
|
||||
struct pmap2_mapping_list { |
||||
pmap2_mapping map; |
||||
struct pmap2_mapping_list *next; |
||||
}; |
||||
typedef struct pmap2_mapping_list pmap2_mapping_list; |
||||
|
||||
struct pmap2_dump_result { |
||||
struct pmap2_mapping_list *list; |
||||
}; |
||||
typedef struct pmap2_dump_result pmap2_dump_result; |
||||
|
||||
struct pmap3_string_result { |
||||
xdr_string_t addr; |
||||
}; |
||||
typedef struct pmap3_string_result pmap3_string_result; |
||||
|
||||
struct pmap3_mapping { |
||||
u_int prog; |
||||
u_int vers; |
||||
xdr_string_t netid; |
||||
xdr_string_t addr; |
||||
xdr_string_t owner; |
||||
}; |
||||
typedef struct pmap3_mapping pmap3_mapping; |
||||
|
||||
struct pmap3_mapping_list { |
||||
pmap3_mapping map; |
||||
struct pmap3_mapping_list *next; |
||||
}; |
||||
typedef struct pmap3_mapping_list pmap3_mapping_list; |
||||
|
||||
struct pmap3_dump_result { |
||||
struct pmap3_mapping_list *list; |
||||
}; |
||||
typedef struct pmap3_dump_result pmap3_dump_result; |
||||
|
||||
struct pmap3_call_args { |
||||
u_int prog; |
||||
u_int vers; |
||||
u_int proc; |
||||
xdr_string_t args; |
||||
}; |
||||
typedef struct pmap3_call_args pmap3_call_args; |
||||
|
||||
struct pmap3_call_result { |
||||
u_int port; |
||||
xdr_string_t res; |
||||
}; |
||||
typedef struct pmap3_call_result pmap3_call_result; |
||||
|
||||
struct pmap3_netbuf { |
||||
u_int maxlen; |
||||
xdr_string_t buf; |
||||
}; |
||||
typedef struct pmap3_netbuf pmap3_netbuf; |
||||
|
||||
typedef pmap2_mapping PMAP2SETargs; |
||||
|
||||
typedef pmap2_mapping PMAP2UNSETargs; |
||||
|
||||
typedef pmap2_mapping PMAP2GETPORTargs; |
||||
|
||||
typedef pmap2_call_args PMAP2CALLITargs; |
||||
|
||||
typedef pmap2_call_result PMAP2CALLITres; |
||||
|
||||
typedef pmap2_dump_result PMAP2DUMPres; |
||||
|
||||
typedef pmap3_mapping PMAP3SETargs; |
||||
|
||||
typedef pmap3_mapping PMAP3UNSETargs; |
||||
|
||||
typedef pmap3_mapping PMAP3GETADDRargs; |
||||
|
||||
typedef pmap3_string_result PMAP3GETADDRres; |
||||
|
||||
typedef pmap3_dump_result PMAP3DUMPres; |
||||
|
||||
typedef pmap3_call_result PMAP3CALLITargs; |
||||
|
||||
typedef pmap3_call_result PMAP3CALLITres; |
||||
|
||||
typedef pmap3_netbuf PMAP3UADDR2TADDRres; |
||||
|
||||
typedef pmap3_netbuf PMAP3TADDR2UADDRargs; |
||||
|
||||
typedef pmap3_string_result PMAP3TADDR2UADDRres; |
||||
|
||||
#define PMAP_PROGRAM 100000 |
||||
#define PMAP_V2 2 |
||||
|
||||
|
||||
#define PMAP2_NULL 0 |
||||
#define PMAP2_SET 1 |
||||
#define PMAP2_UNSET 2 |
||||
#define PMAP2_GETPORT 3 |
||||
#define PMAP2_DUMP 4 |
||||
#define PMAP2_CALLIT 5 |
||||
|
||||
#define PMAP_V3 3 |
||||
|
||||
|
||||
#define PMAP3_NULL 0 |
||||
#define PMAP3_SET 1 |
||||
#define PMAP3_UNSET 2 |
||||
#define PMAP3_GETADDR 3 |
||||
#define PMAP3_DUMP 4 |
||||
#define PMAP3_CALLIT 5 |
||||
#define PMAP3_GETTIME 6 |
||||
#define PMAP3_UADDR2TADDR 7 |
||||
#define PMAP3_TADDR2UADDR 8 |
||||
|
||||
|
||||
/* the xdr functions */ |
||||
|
||||
|
||||
extern bool_t xdr_pmap2_mapping (XDR *, pmap2_mapping*); |
||||
extern bool_t xdr_pmap2_call_args (XDR *, pmap2_call_args*); |
||||
extern bool_t xdr_pmap2_call_result (XDR *, pmap2_call_result*); |
||||
extern bool_t xdr_pmap2_mapping_list (XDR *, pmap2_mapping_list*); |
||||
extern bool_t xdr_pmap2_dump_result (XDR *, pmap2_dump_result*); |
||||
extern bool_t xdr_pmap3_string_result (XDR *, pmap3_string_result*); |
||||
extern bool_t xdr_pmap3_mapping (XDR *, pmap3_mapping*); |
||||
extern bool_t xdr_pmap3_mapping_list (XDR *, pmap3_mapping_list*); |
||||
extern bool_t xdr_pmap3_dump_result (XDR *, pmap3_dump_result*); |
||||
extern bool_t xdr_pmap3_call_args (XDR *, pmap3_call_args*); |
||||
extern bool_t xdr_pmap3_call_result (XDR *, pmap3_call_result*); |
||||
extern bool_t xdr_pmap3_netbuf (XDR *, pmap3_netbuf*); |
||||
extern bool_t xdr_PMAP2SETargs (XDR *, PMAP2SETargs*); |
||||
extern bool_t xdr_PMAP2UNSETargs (XDR *, PMAP2UNSETargs*); |
||||
extern bool_t xdr_PMAP2GETPORTargs (XDR *, PMAP2GETPORTargs*); |
||||
extern bool_t xdr_PMAP2CALLITargs (XDR *, PMAP2CALLITargs*); |
||||
extern bool_t xdr_PMAP2CALLITres (XDR *, PMAP2CALLITres*); |
||||
extern bool_t xdr_PMAP2DUMPres (XDR *, PMAP2DUMPres*); |
||||
extern bool_t xdr_PMAP3SETargs (XDR *, PMAP3SETargs*); |
||||
extern bool_t xdr_PMAP3UNSETargs (XDR *, PMAP3UNSETargs*); |
||||
extern bool_t xdr_PMAP3GETADDRargs (XDR *, PMAP3GETADDRargs*); |
||||
extern bool_t xdr_PMAP3GETADDRres (XDR *, PMAP3GETADDRres*); |
||||
extern bool_t xdr_PMAP3DUMPres (XDR *, PMAP3DUMPres*); |
||||
extern bool_t xdr_PMAP3CALLITargs (XDR *, PMAP3CALLITargs*); |
||||
extern bool_t xdr_PMAP3CALLITres (XDR *, PMAP3CALLITres*); |
||||
extern bool_t xdr_PMAP3UADDR2TADDRres (XDR *, PMAP3UADDR2TADDRres*); |
||||
extern bool_t xdr_PMAP3TADDR2UADDRargs (XDR *, PMAP3TADDR2UADDRargs*); |
||||
extern bool_t xdr_PMAP3TADDR2UADDRres (XDR *, PMAP3TADDR2UADDRres*); |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* !_PORTMAP_H_RPCGEN */ |
@ -0,0 +1,168 @@ |
||||
/* |
||||
Copyright (c) 2014, Ronnie Sahlberg |
||||
All rights reserved. |
||||
|
||||
Redistribution and use in source and binary forms, with or without |
||||
modification, are permitted provided that the following conditions are met: |
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this |
||||
list of conditions and the following disclaimer. |
||||
2. Redistributions in binary form must reproduce the above copyright notice, |
||||
this list of conditions and the following disclaimer in the documentation |
||||
and/or other materials provided with the distribution. |
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND |
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR |
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
||||
|
||||
The views and conclusions contained in the software and documentation are those |
||||
of the authors and should not be interpreted as representing official policies, |
||||
either expressed or implied, of the FreeBSD Project. |
||||
*/ |
||||
|
||||
const PMAP_PORT = 111; /* portmapper port number */ |
||||
|
||||
struct pmap2_mapping { |
||||
unsigned int prog; |
||||
unsigned int vers; |
||||
unsigned int prot; |
||||
unsigned int port; |
||||
}; |
||||
|
||||
struct pmap2_call_args { |
||||
unsigned int prog; |
||||
unsigned int vers; |
||||
unsigned int proc; |
||||
opaque args<>; |
||||
}; |
||||
|
||||
struct pmap2_call_result { |
||||
unsigned int port; |
||||
opaque res<>; |
||||
}; |
||||
|
||||
struct pmap2_mapping_list { |
||||
pmap2_mapping map; |
||||
pmap2_mapping_list *next; |
||||
}; |
||||
|
||||
struct pmap2_dump_result { |
||||
struct pmap2_mapping_list *list; |
||||
}; |
||||
|
||||
struct pmap3_string_result { |
||||
string addr<>; |
||||
}; |
||||
|
||||
struct pmap3_mapping { |
||||
unsigned int prog; |
||||
unsigned int vers; |
||||
string netid<>; |
||||
string addr<>; |
||||
string owner<>; |
||||
}; |
||||
|
||||
struct pmap3_mapping_list { |
||||
pmap3_mapping map; |
||||
pmap3_mapping_list *next; |
||||
}; |
||||
|
||||
struct pmap3_dump_result { |
||||
struct pmap3_mapping_list *list; |
||||
}; |
||||
|
||||
struct pmap3_call_args { |
||||
unsigned int prog; |
||||
unsigned int vers; |
||||
unsigned int proc; |
||||
opaque args<>; |
||||
}; |
||||
|
||||
struct pmap3_call_result { |
||||
unsigned int port; |
||||
opaque res<>; |
||||
}; |
||||
|
||||
struct pmap3_netbuf { |
||||
unsigned int maxlen; |
||||
/* This pretty much contains a sockaddr_storage. |
||||
* Beware differences in endianess for ss_family |
||||
* and whether or not ss_len exists. |
||||
*/ |
||||
opaque buf<>; |
||||
}; |
||||
|
||||
typedef pmap2_mapping PMAP2SETargs; |
||||
typedef pmap2_mapping PMAP2UNSETargs; |
||||
typedef pmap2_mapping PMAP2GETPORTargs; |
||||
typedef pmap2_call_args PMAP2CALLITargs; |
||||
typedef pmap2_call_result PMAP2CALLITres; |
||||
typedef pmap2_dump_result PMAP2DUMPres; |
||||
|
||||
typedef pmap3_mapping PMAP3SETargs; |
||||
typedef pmap3_mapping PMAP3UNSETargs; |
||||
typedef pmap3_mapping PMAP3GETADDRargs; |
||||
typedef pmap3_string_result PMAP3GETADDRres; |
||||
typedef pmap3_dump_result PMAP3DUMPres; |
||||
typedef pmap3_call_result PMAP3CALLITargs; |
||||
typedef pmap3_call_result PMAP3CALLITres; |
||||
typedef pmap3_netbuf PMAP3UADDR2TADDRres; |
||||
typedef pmap3_netbuf PMAP3TADDR2UADDRargs; |
||||
typedef pmap3_string_result PMAP3TADDR2UADDRres; |
||||
|
||||
program PMAP_PROGRAM { |
||||
version PMAP_V2 { |
||||
void |
||||
PMAP2_NULL(void) = 0; |
||||
|
||||
uint32_t |
||||
PMAP2_SET(PMAP2SETargs) = 1; |
||||
|
||||
uint32_t |
||||
PMAP2_UNSET(PMAP2UNSETargs) = 2; |
||||
|
||||
uint32_t |
||||
PMAP2_GETPORT(PMAP2GETPORTargs) = 3; |
||||
|
||||
PMAP2DUMPres |
||||
PMAP2_DUMP(void) = 4; |
||||
|
||||
PMAP2CALLITres |
||||
PMAP2_CALLIT(PMAP2CALLITargs) = 5; |
||||
} = 2; |
||||
version PMAP_V3 { |
||||
void |
||||
PMAP3_NULL(void) = 0; |
||||
|
||||
uint32_t |
||||
PMAP3_SET(PMAP3SETargs) = 1; |
||||
|
||||
uint32_t |
||||
PMAP3_UNSET(PMAP3UNSETargs) = 2; |
||||
|
||||
PMAP3GETADDRres |
||||
PMAP3_GETADDR(PMAP3GETADDRargs) = 3; |
||||
|
||||
PMAP3DUMPres |
||||
PMAP3_DUMP(void) = 4; |
||||
|
||||
PMAP3CALLITres |
||||
PMAP3_CALLIT(PMAP3CALLITargs) = 5; |
||||
|
||||
uint32_t |
||||
PMAP3_GETTIME(void) = 6; |
||||
|
||||
PMAP3UADDR2TADDRres |
||||
PMAP3_UADDR2TADDR(string) = 7; |
||||
|
||||
PMAP3TADDR2UADDRres |
||||
PMAP3_TADDR2UADDR(PMAP3TADDR2UADDRargs) = 8; |
||||
} = 3; |
||||
} = 100000; |
@ -0,0 +1,406 @@ |
||||
/*
|
||||
* Please do not edit this file. |
||||
* It was generated using rpcgen. |
||||
*/ |
||||
|
||||
#include "portmap.h" |
||||
#include "xdr_impl_inline.h" |
||||
|
||||
bool_t |
||||
xdr_pmap2_mapping (XDR *xdrs, pmap2_mapping *objp) |
||||
{ |
||||
|
||||
|
||||
if (xdrs->x_op == XDR_ENCODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->prot)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->port)) |
||||
return FALSE; |
||||
} else { |
||||
IXDR_PUT_U_LONG(buf, objp->prog); |
||||
IXDR_PUT_U_LONG(buf, objp->vers); |
||||
IXDR_PUT_U_LONG(buf, objp->prot); |
||||
IXDR_PUT_U_LONG(buf, objp->port); |
||||
} |
||||
return TRUE; |
||||
} else if (xdrs->x_op == XDR_DECODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->prot)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->port)) |
||||
return FALSE; |
||||
} else { |
||||
objp->prog = IXDR_GET_U_LONG(buf); |
||||
objp->vers = IXDR_GET_U_LONG(buf); |
||||
objp->prot = IXDR_GET_U_LONG(buf); |
||||
objp->port = IXDR_GET_U_LONG(buf); |
||||
} |
||||
return TRUE; |
||||
} |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->prot)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->port)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap2_call_args (XDR *xdrs, pmap2_call_args *objp) |
||||
{ |
||||
|
||||
|
||||
if (xdrs->x_op == XDR_ENCODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
|
||||
} else { |
||||
IXDR_PUT_U_LONG(buf, objp->prog); |
||||
IXDR_PUT_U_LONG(buf, objp->vers); |
||||
IXDR_PUT_U_LONG(buf, objp->proc); |
||||
} |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} else if (xdrs->x_op == XDR_DECODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
|
||||
} else { |
||||
objp->prog = IXDR_GET_U_LONG(buf); |
||||
objp->vers = IXDR_GET_U_LONG(buf); |
||||
objp->proc = IXDR_GET_U_LONG(buf); |
||||
} |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap2_call_result (XDR *xdrs, pmap2_call_result *objp) |
||||
{ |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->port)) |
||||
return FALSE; |
||||
if (!xdr_bytes(xdrs, &objp->res, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap2_mapping_list (XDR *xdrs, pmap2_mapping_list *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_mapping (xdrs, &objp->map)) |
||||
return FALSE; |
||||
if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (pmap2_mapping_list), (xdrproc_t) xdr_pmap2_mapping_list)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap2_dump_result (XDR *xdrs, pmap2_dump_result *objp) |
||||
{ |
||||
|
||||
if (!xdr_pointer (xdrs, (char **)&objp->list, sizeof (pmap2_mapping_list), (xdrproc_t) xdr_pmap2_mapping_list)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_string_result (XDR *xdrs, pmap3_string_result *objp) |
||||
{ |
||||
|
||||
if (!xdr_string (xdrs, &objp->addr, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_mapping (XDR *xdrs, pmap3_mapping *objp) |
||||
{ |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_string (xdrs, &objp->netid, ~0)) |
||||
return FALSE; |
||||
if (!xdr_string (xdrs, &objp->addr, ~0)) |
||||
return FALSE; |
||||
if (!xdr_string (xdrs, &objp->owner, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_mapping_list (XDR *xdrs, pmap3_mapping_list *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_mapping (xdrs, &objp->map)) |
||||
return FALSE; |
||||
if (!xdr_pointer (xdrs, (char **)&objp->next, sizeof (pmap3_mapping_list), (xdrproc_t) xdr_pmap3_mapping_list)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_dump_result (XDR *xdrs, pmap3_dump_result *objp) |
||||
{ |
||||
|
||||
if (!xdr_pointer (xdrs, (char **)&objp->list, sizeof (pmap3_mapping_list), (xdrproc_t) xdr_pmap3_mapping_list)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_call_args (XDR *xdrs, pmap3_call_args *objp) |
||||
{ |
||||
|
||||
|
||||
if (xdrs->x_op == XDR_ENCODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
|
||||
} else { |
||||
IXDR_PUT_U_LONG(buf, objp->prog); |
||||
IXDR_PUT_U_LONG(buf, objp->vers); |
||||
IXDR_PUT_U_LONG(buf, objp->proc); |
||||
} |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} else if (xdrs->x_op == XDR_DECODE) { |
||||
if (1) { |
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
|
||||
} else { |
||||
objp->prog = IXDR_GET_U_LONG(buf); |
||||
objp->vers = IXDR_GET_U_LONG(buf); |
||||
objp->proc = IXDR_GET_U_LONG(buf); |
||||
} |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->prog)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->vers)) |
||||
return FALSE; |
||||
if (!xdr_u_int (xdrs, &objp->proc)) |
||||
return FALSE; |
||||
if (!xdr_bytes(xdrs, &objp->args, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_call_result (XDR *xdrs, pmap3_call_result *objp) |
||||
{ |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->port)) |
||||
return FALSE; |
||||
if (!xdr_bytes(xdrs, &objp->res, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_pmap3_netbuf (XDR *xdrs, pmap3_netbuf *objp) |
||||
{ |
||||
|
||||
if (!xdr_u_int (xdrs, &objp->maxlen)) |
||||
return FALSE; |
||||
if (!xdr_bytes(xdrs, &objp->buf, ~0)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2SETargs (XDR *xdrs, PMAP2SETargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2UNSETargs (XDR *xdrs, PMAP2UNSETargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2GETPORTargs (XDR *xdrs, PMAP2GETPORTargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2CALLITargs (XDR *xdrs, PMAP2CALLITargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_call_args (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2CALLITres (XDR *xdrs, PMAP2CALLITres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_call_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP2DUMPres (XDR *xdrs, PMAP2DUMPres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap2_dump_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3SETargs (XDR *xdrs, PMAP3SETargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3UNSETargs (XDR *xdrs, PMAP3UNSETargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3GETADDRargs (XDR *xdrs, PMAP3GETADDRargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_mapping (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3GETADDRres (XDR *xdrs, PMAP3GETADDRres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_string_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3DUMPres (XDR *xdrs, PMAP3DUMPres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_dump_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3CALLITargs (XDR *xdrs, PMAP3CALLITargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_call_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3CALLITres (XDR *xdrs, PMAP3CALLITres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_call_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3UADDR2TADDRres (XDR *xdrs, PMAP3UADDR2TADDRres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_netbuf (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3TADDR2UADDRargs (XDR *xdrs, PMAP3TADDR2UADDRargs *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_netbuf (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
||||
|
||||
bool_t |
||||
xdr_PMAP3TADDR2UADDRres (XDR *xdrs, PMAP3TADDR2UADDRres *objp) |
||||
{ |
||||
|
||||
if (!xdr_pmap3_string_result (xdrs, objp)) |
||||
return FALSE; |
||||
return TRUE; |
||||
} |
@ -0,0 +1,160 @@ |
||||
/*
|
||||
* Please do not edit this file. |
||||
* It was generated using rpcgen. |
||||
*/ |
||||
|
||||
#ifndef _RPC_H_RPCGEN |
||||
#define _RPC_H_RPCGEN |
||||
|
||||
#include "xdr_impl.h" |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
extern "C" { |
||||
#endif |
||||
|
||||
#define RPC_MSG_VERSION 2 |
||||
|
||||
enum rpc_auth_flavor { |
||||
RPC_AUTH_NONE = 0, |
||||
RPC_AUTH_SYS = 1, |
||||
RPC_AUTH_SHORT = 2, |
||||
RPC_AUTH_DH = 3, |
||||
RPC_RPCSEC_GSS = 6, |
||||
}; |
||||
typedef enum rpc_auth_flavor rpc_auth_flavor; |
||||
|
||||
enum rpc_msg_type { |
||||
RPC_CALL = 0, |
||||
RPC_REPLY = 1, |
||||
}; |
||||
typedef enum rpc_msg_type rpc_msg_type; |
||||
|
||||
enum rpc_reply_stat { |
||||
RPC_MSG_ACCEPTED = 0, |
||||
RPC_MSG_DENIED = 1, |
||||
}; |
||||
typedef enum rpc_reply_stat rpc_reply_stat; |
||||
|
||||
enum rpc_accept_stat { |
||||
RPC_SUCCESS = 0, |
||||
RPC_PROG_UNAVAIL = 1, |
||||
RPC_PROG_MISMATCH = 2, |
||||
RPC_PROC_UNAVAIL = 3, |
||||
RPC_GARBAGE_ARGS = 4, |
||||
RPC_SYSTEM_ERR = 5, |
||||
}; |
||||
typedef enum rpc_accept_stat rpc_accept_stat; |
||||
|
||||
enum rpc_reject_stat { |
||||
RPC_MISMATCH = 0, |
||||
RPC_AUTH_ERROR = 1, |
||||
}; |
||||
typedef enum rpc_reject_stat rpc_reject_stat; |
||||
|
||||
enum rpc_auth_stat { |
||||
RPC_AUTH_OK = 0, |
||||
RPC_AUTH_BADCRED = 1, |
||||
RPC_AUTH_REJECTEDCRED = 2, |
||||
RPC_AUTH_BADVERF = 3, |
||||
RPC_AUTH_REJECTEDVERF = 4, |
||||
RPC_AUTH_TOOWEAK = 5, |
||||
RPC_AUTH_INVALIDRESP = 6, |
||||
RPC_AUTH_FAILED = 7, |
||||
}; |
||||
typedef enum rpc_auth_stat rpc_auth_stat; |
||||
|
||||
struct rpc_opaque_auth { |
||||
rpc_auth_flavor flavor; |
||||
xdr_string_t body; |
||||
}; |
||||
typedef struct rpc_opaque_auth rpc_opaque_auth; |
||||
|
||||
struct rpc_call_body { |
||||
u_int rpcvers; |
||||
u_int prog; |
||||
u_int vers; |
||||
u_int proc; |
||||
rpc_opaque_auth cred; |
||||
rpc_opaque_auth verf; |
||||
}; |
||||
typedef struct rpc_call_body rpc_call_body; |
||||
|
||||
struct rpc_mismatch_info { |
||||
u_int min_version; |
||||
u_int max_version; |
||||
}; |
||||
typedef struct rpc_mismatch_info rpc_mismatch_info; |
||||
|
||||
struct rpc_accepted_reply_body { |
||||
rpc_accept_stat stat; |
||||
union { |
||||
rpc_mismatch_info mismatch_info; |
||||
}; |
||||
}; |
||||
typedef struct rpc_accepted_reply_body rpc_accepted_reply_body; |
||||
|
||||
struct rpc_accepted_reply { |
||||
rpc_opaque_auth verf; |
||||
rpc_accepted_reply_body reply_data; |
||||
}; |
||||
typedef struct rpc_accepted_reply rpc_accepted_reply; |
||||
|
||||
struct rpc_rejected_reply { |
||||
rpc_reject_stat stat; |
||||
union { |
||||
rpc_mismatch_info mismatch_info; |
||||
rpc_auth_stat auth_stat; |
||||
}; |
||||
}; |
||||
typedef struct rpc_rejected_reply rpc_rejected_reply; |
||||
|
||||
struct rpc_reply_body { |
||||
rpc_reply_stat stat; |
||||
union { |
||||
rpc_accepted_reply areply; |
||||
rpc_rejected_reply rreply; |
||||
}; |
||||
}; |
||||
typedef struct rpc_reply_body rpc_reply_body; |
||||
|
||||
struct rpc_msg_body { |
||||
rpc_msg_type dir; |
||||
union { |
||||
rpc_call_body cbody; |
||||
rpc_reply_body rbody; |
||||
}; |
||||
}; |
||||
typedef struct rpc_msg_body rpc_msg_body; |
||||
|
||||
struct rpc_msg { |
||||
u_int xid; |
||||
rpc_msg_body body; |
||||
}; |
||||
typedef struct rpc_msg rpc_msg; |
||||
|
||||
/* the xdr functions */ |
||||
|
||||
|
||||
extern bool_t xdr_rpc_auth_flavor (XDR *, rpc_auth_flavor*); |
||||
extern bool_t xdr_rpc_msg_type (XDR *, rpc_msg_type*); |
||||
extern bool_t xdr_rpc_reply_stat (XDR *, rpc_reply_stat*); |
||||
extern bool_t xdr_rpc_accept_stat (XDR *, rpc_accept_stat*); |
||||
extern bool_t xdr_rpc_reject_stat (XDR *, rpc_reject_stat*); |
||||
extern bool_t xdr_rpc_auth_stat (XDR *, rpc_auth_stat*); |
||||
extern bool_t xdr_rpc_opaque_auth (XDR *, rpc_opaque_auth*); |
||||
extern bool_t xdr_rpc_call_body (XDR *, rpc_call_body*); |
||||
extern bool_t xdr_rpc_mismatch_info (XDR *, rpc_mismatch_info*); |
||||
extern bool_t xdr_rpc_accepted_reply_body (XDR *, rpc_accepted_reply_body*); |
||||
extern bool_t xdr_rpc_accepted_reply (XDR *, rpc_accepted_reply*); |
||||
extern bool_t xdr_rpc_rejected_reply (XDR *, rpc_rejected_reply*); |
||||
extern bool_t xdr_rpc_reply_body (XDR *, rpc_reply_body*); |
||||
extern bool_t xdr_rpc_msg_body (XDR *, rpc_msg_body*); |
||||
extern bool_t xdr_rpc_msg (XDR *, rpc_msg*); |
||||
|
||||
|
||||
#ifdef __cplusplus |
||||
} |
||||
#endif |
||||
|
||||
#endif /* !_RPC_H_RPCGEN */ |
@ -0,0 +1,113 @@ |
||||
/* Based on RFC 5531 - RPC: Remote Procedure Call Protocol Specification Version 2 */ |
||||
|
||||
const RPC_MSG_VERSION = 2; |
||||
|
||||
enum rpc_auth_flavor { |
||||
RPC_AUTH_NONE = 0, |
||||
RPC_AUTH_SYS = 1, |
||||
RPC_AUTH_SHORT = 2, |
||||
RPC_AUTH_DH = 3, |
||||
RPC_RPCSEC_GSS = 6 |
||||
}; |
||||
|
||||
enum rpc_msg_type { |
||||
RPC_CALL = 0, |
||||
RPC_REPLY = 1 |
||||
}; |
||||
|
||||
enum rpc_reply_stat { |
||||
RPC_MSG_ACCEPTED = 0, |
||||
RPC_MSG_DENIED = 1 |
||||
}; |
||||
|
||||
enum rpc_accept_stat { |
||||
RPC_SUCCESS = 0, |
||||
RPC_PROG_UNAVAIL = 1, |
||||
RPC_PROG_MISMATCH = 2, |
||||
RPC_PROC_UNAVAIL = 3, |
||||
RPC_GARBAGE_ARGS = 4, |
||||
RPC_SYSTEM_ERR = 5 |
||||
}; |
||||
|
||||
enum rpc_reject_stat { |
||||
RPC_MISMATCH = 0, |
||||
RPC_AUTH_ERROR = 1 |
||||
}; |
||||
|
||||
enum rpc_auth_stat { |
||||
RPC_AUTH_OK = 0, |
||||
/* |
||||
* failed at remote end |
||||
*/ |
||||
RPC_AUTH_BADCRED = 1, /* bogus credentials (seal broken) */ |
||||
RPC_AUTH_REJECTEDCRED = 2, /* client should begin new session */ |
||||
RPC_AUTH_BADVERF = 3, /* bogus verifier (seal broken) */ |
||||
RPC_AUTH_REJECTEDVERF = 4, /* verifier expired or was replayed */ |
||||
RPC_AUTH_TOOWEAK = 5, /* rejected due to security reasons */ |
||||
/* |
||||
* failed locally |
||||
*/ |
||||
RPC_AUTH_INVALIDRESP = 6, /* bogus response verifier */ |
||||
RPC_AUTH_FAILED = 7 /* some unknown reason */ |
||||
}; |
||||
|
||||
struct rpc_opaque_auth { |
||||
rpc_auth_flavor flavor; |
||||
opaque body<400>; |
||||
}; |
||||
|
||||
struct rpc_call_body { |
||||
u_int rpcvers; |
||||
u_int prog; |
||||
u_int vers; |
||||
u_int proc; |
||||
rpc_opaque_auth cred; |
||||
rpc_opaque_auth verf; |
||||
/* procedure-specific parameters start here */ |
||||
}; |
||||
|
||||
struct rpc_mismatch_info { |
||||
unsigned int min_version; |
||||
unsigned int max_version; |
||||
}; |
||||
|
||||
union rpc_accepted_reply_body switch (rpc_accept_stat stat) { |
||||
case RPC_SUCCESS: |
||||
void; |
||||
/* procedure-specific results start here */ |
||||
case RPC_PROG_MISMATCH: |
||||
rpc_mismatch_info mismatch_info; |
||||
default: |
||||
void; |
||||
}; |
||||
|
||||
struct rpc_accepted_reply { |
||||
rpc_opaque_auth verf; |
||||
rpc_accepted_reply_body reply_data; |
||||
}; |
||||
|
||||
union rpc_rejected_reply switch (rpc_reject_stat stat) { |
||||
case RPC_MISMATCH: |
||||
rpc_mismatch_info mismatch_info; |
||||
case RPC_AUTH_ERROR: |
||||
rpc_auth_stat auth_stat; |