ReactOS 0.4.15-dev-7953-g1f49173
pmap_clnt.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__BEGIN_DECLS bool_t pmap_set (u_long, u_long, int, int)
 
bool_t pmap_unset (u_long, u_long)
 
struct pmaplistpmap_getmaps (struct sockaddr_in *)
 
enum clnt_stat pmap_rmtcall (struct sockaddr_in *, u_long, u_long, u_long, xdrproc_t, caddr_t, xdrproc_t, caddr_t, struct timeval, u_long *)
 
enum clnt_stat clnt_broadcast (u_long, u_long, u_long, xdrproc_t, void *, xdrproc_t, void *, resultproc_t)
 
u_short pmap_getport (struct sockaddr_in *, u_long, u_long, u_int)
 

Function Documentation

◆ clnt_broadcast()

enum clnt_stat clnt_broadcast ( u_long  ,
u_long  ,
u_long  ,
xdrproc_t  ,
void ,
xdrproc_t  ,
void ,
resultproc_t   
)

◆ pmap_getmaps()

struct pmaplist * pmap_getmaps ( struct sockaddr_in address)

Definition at line 65 of file pmap_getmaps.c.

67{
68 struct pmaplist *head = NULL;
70 struct timeval minutetimeout;
72
74
75 minutetimeout.tv_sec = 60;
76 minutetimeout.tv_usec = 0;
77 address->sin_port = htons(PMAPPORT);
79 PMAPVERS, &sock, 50, 500);
80 if (client != NULL) {
83 (xdrproc_t)xdr_pmaplist, &head, minutetimeout) !=
85 clnt_perror(client, "pmap_getmaps rpc problem");
86 }
88 }
89 address->sin_port = 0;
90 return (head);
91}
bool_t xdr_void(void)
Definition: xdr.c:92
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:199
#define CLNT_DESTROY(rh)
Definition: clnt.h:275
void clnt_perror(CLIENT *rpch, const char *s)
Definition: clnt_perror.c:181
__BEGIN_DECLS CLIENT * clnttcp_create(struct sockaddr_in *, u_long, u_long, SOCKET *, u_int, u_int)
@ RPC_SUCCESS
Definition: clnt_stat.h:22
#define NULL
Definition: types.h:112
u_int32_t rpcproc_t
Definition: types.h:106
#define assert(x)
Definition: debug.h:53
GLuint address
Definition: glext.h:9393
#define htons(x)
Definition: module.h:215
bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
Definition: pmap_prot2.c:83
#define PMAPPORT
Definition: pmap_prot.h:76
#define PMAPVERS
Definition: pmap_prot.h:78
#define PMAPPROC_DUMP
Definition: pmap_prot.h:85
#define PMAPPROG
Definition: pmap_prot.h:77
static FILE * client
Definition: client.c:41
Definition: tcpcore.h:1455
#define INVALID_SOCKET
Definition: winsock.h:332
UINT_PTR SOCKET
Definition: winsock.h:47
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144

◆ pmap_getport()

u_short pmap_getport ( struct sockaddr_in address,
u_long  program,
u_long  version,
u_int  protocol 
)

Definition at line 74 of file pmap_getport.c.

79{
80 u_short port = 0;
81 int sock = -1;
83 struct pmap parms;
84
86
87 address->sin_port = htons(PMAPPORT);
90 if (client != NULL) {
91 parms.pm_prog = program;
92 parms.pm_vers = version;
93 parms.pm_prot = protocol;
94 parms.pm_port = 0; /* not needed or used */
97 &parms, (xdrproc_t)xdr_u_short, &port, tottimeout) !=
101 } else if (port == 0) {
103 }
105 }
106 address->sin_port = 0;
107 return (port);
108}
bool_t xdr_u_short(XDR *xdrs, u_short *usp)
Definition: xdr.c:300
#define RPCSMALLMSGSIZE
Definition: clnt.h:179
#define clnt_geterr(rh, errp)
Definition: clnt.h:220
CLIENT * clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, struct timeval, int *, u_int, u_int)
#define RPC_PMAPFAILURE
Definition: clnt_stat.h:57
@ RPC_PROGNOTREGISTERED
Definition: clnt_stat.h:58
unsigned short u_short
Definition: types.h:81
static const WCHAR version[]
Definition: asmname.c:66
USHORT port
Definition: uri.c:228
GLuint program
Definition: glext.h:6723
static const struct timeval tottimeout
Definition: pmap_getport.c:44
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs)
Definition: pmap_prot.c:45
#define PMAPPROC_GETPORT
Definition: pmap_prot.h:84
Definition: pmap_prot.h:88
struct rpc_err cf_error
Definition: clnt.h:497
enum clnt_stat cf_stat
Definition: clnt.h:496
Definition: dhcpd.h:245

Referenced by getrpcport().

◆ pmap_rmtcall()

enum clnt_stat pmap_rmtcall ( struct sockaddr_in addr,
u_long  prog,
u_long  vers,
u_long  proc,
xdrproc_t  xdrargs,
caddr_t  argsp,
xdrproc_t  xdrres,
caddr_t  resp,
struct timeval  tout,
u_long port_ptr 
)

Definition at line 73 of file pmap_rmt.c.

81{
82 int sock = -1;
84 struct rmtcallargs a;
85 struct rmtcallres r;
86 enum clnt_stat stat;
87
88 assert(addr != NULL);
90
91 addr->sin_port = htons(PMAPPORT);
93 if (client != NULL) {
94 a.prog = prog;
95 a.vers = vers;
96 a.proc = proc;
97 a.args_ptr = argsp;
98 a.xdr_args = xdrargs;
99 r.port_ptr = port_ptr;
100 r.results_ptr = resp;
101 r.xdr_results = xdrres;
104 &r, tout);
106 } else {
108 }
109 addr->sin_port = 0;
110 return (stat);
111}
#define stat
Definition: acwin.h:99
__END_DECLS __BEGIN_DECLS CLIENT * clntudp_create(struct sockaddr_in *, u_long, u_long, struct timeval, int *)
clnt_stat
Definition: clnt_stat.h:21
@ RPC_FAILED
Definition: clnt_stat.h:68
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLenum const GLvoid * addr
Definition: glext.h:9621
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
char * prog
Definition: isohybrid.c:47
static HANDLE proc()
Definition: pdb.c:34
#define PMAPPROC_CALLIT
Definition: pmap_prot.h:86
bool_t xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp)
Definition: pmap_rmt.c:153
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
Definition: pmap_rmt.c:119
u_long * port_ptr
Definition: pmap_rmt.h:53
Definition: stat.h:55

◆ pmap_set()

__BEGIN_DECLS bool_t pmap_set ( u_long  program,
u_long  version,
int  protocol,
int  port 
)

Definition at line 55 of file pmap_clnt.c.

56{
57 bool_t rslt;
58 struct netbuf *na;
59 struct netconfig *nconf;
60 char buf[32];
61
62 if ((protocol != IPPROTO_UDP) && (protocol != IPPROTO_TCP)) {
63 return (FALSE);
64 }
65 nconf = __rpc_getconfip(protocol == IPPROTO_UDP ? "udp" : "tcp");
66 if (nconf == NULL) {
67 return (FALSE);
68 }
69 snprintf(buf, sizeof buf, "0.0.0.0.%d.%d",
70 (((u_int32_t)port) >> 8) & 0xff, port & 0xff);
71 na = uaddr2taddr(nconf, buf);
72 if (na == NULL) {
73 freenetconfigent(nconf);
74 return (FALSE);
75 }
76 rslt = rpcb_set((rpcprog_t)program, (rpcvers_t)version, nconf, na);
77 free(na);
78 freenetconfigent(nconf);
79 return (rslt);
80}
#define free
Definition: debug_ros.c:5
u_int32_t rpcprog_t
Definition: types.h:104
int32_t bool_t
Definition: types.h:101
#define FALSE
Definition: types.h:117
u_int32_t rpcvers_t
Definition: types.h:105
#define IPPROTO_TCP
Definition: ip.h:196
#define IPPROTO_UDP
Definition: ip.h:197
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
unsigned int u_int32_t
Definition: rosdhcp.h:35
struct netconfig * __rpc_getconfip(char *nettype) const
Definition: rpc_generic.c:235
struct netbuf * uaddr2taddr(const struct netconfig *nconf, const char *uaddr)
Definition: rpc_generic.c:619
bool_t rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, const struct netbuf *address)
Definition: rpcb_clnt.c:520
Definition: types.h:144
#define snprintf
Definition: wintirpc.h:48

◆ pmap_unset()

bool_t pmap_unset ( u_long  program,
u_long  version 
)

Definition at line 87 of file pmap_clnt.c.

88{
89 struct netconfig *nconf;
90 bool_t udp_rslt = FALSE;
91 bool_t tcp_rslt = FALSE;
92
93 nconf = __rpc_getconfip("udp");
94 if (nconf != NULL) {
96 nconf);
97 freenetconfigent(nconf);
98 }
99 nconf = __rpc_getconfip("tcp");
100 if (nconf != NULL) {
102 nconf);
103 freenetconfigent(nconf);
104 }
105 /*
106 * XXX: The call may still succeed even if only one of the
107 * calls succeeded. This was the best that could be
108 * done for backward compatibility.
109 */
110 return (tcp_rslt || udp_rslt);
111}
bool_t rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf)
Definition: rpcb_clnt.c:581