ReactOS  0.4.13-dev-551-gf37fb1f
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 )

Definition at line 65 of file pmap_getmaps.c.

67 {
68  struct pmaplist *head = NULL;
70  struct timeval minutetimeout;
71  CLIENT *client;
72 
73  assert(address != NULL);
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) !=
84  RPC_SUCCESS) {
85  clnt_perror(client, "pmap_getmaps rpc problem");
86  }
88  }
89  address->sin_port = 0;
90  return (head);
91 }
u_int32_t rpcproc_t
Definition: types.h:106
#define PMAPPROG
Definition: pmap_prot.h:77
struct outqueuenode * head
Definition: adnsresfilter.c:66
#define assert(x)
Definition: debug.h:53
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
void clnt_perror(CLIENT *rpch, const char *s)
Definition: clnt_perror.c:181
bool_t xdr_pmaplist(XDR *xdrs, struct pmaplist **rp)
Definition: pmap_prot2.c:83
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:199
smooth NULL
Definition: ftsmooth.c:416
#define PMAPVERS
Definition: pmap_prot.h:78
#define INVALID_SOCKET
Definition: winsock.h:332
#define PMAPPORT
Definition: pmap_prot.h:76
static FILE * client
Definition: client.c:41
GLuint address
Definition: glext.h:9393
#define PMAPPROC_DUMP
Definition: pmap_prot.h:85
bool_t xdr_void(void)
Definition: xdr.c:92
#define CLNT_DESTROY(rh)
Definition: clnt.h:275
__BEGIN_DECLS CLIENT * clnttcp_create(struct sockaddr_in *, u_long, u_long, SOCKET *, u_int, u_int)
Definition: tcpcore.h:1455
UINT_PTR SOCKET
Definition: winsock.h:47
#define htons(x)
Definition: module.h:213

◆ pmap_getport()

u_short pmap_getport ( struct sockaddr_in ,
u_long  ,
u_long  ,
u_int   
)

Definition at line 74 of file pmap_getport.c.

79 {
80  u_short port = 0;
81  int sock = -1;
82  CLIENT *client;
83  struct pmap parms;
84 
85  assert(address != NULL);
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) !=
98  RPC_SUCCESS){
101  } else if (port == 0) {
103  }
105  }
106  address->sin_port = 0;
107  return (port);
108 }
#define RPC_PMAPFAILURE
Definition: clnt_stat.h:57
u_int32_t rpcproc_t
Definition: types.h:106
#define PMAPPROG
Definition: pmap_prot.h:77
#define clnt_geterr(rh, errp)
Definition: clnt.h:220
bool_t xdr_pmap(XDR *xdrs, struct pmap *regs)
Definition: pmap_prot.c:45
#define assert(x)
Definition: debug.h:53
Definition: dhcpd.h:245
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:199
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define RPCSMALLMSGSIZE
Definition: clnt.h:179
#define PMAPVERS
Definition: pmap_prot.h:78
#define PMAPPROC_GETPORT
Definition: pmap_prot.h:84
#define PMAPPORT
Definition: pmap_prot.h:76
enum clnt_stat cf_stat
Definition: clnt.h:496
static FILE * client
Definition: client.c:41
GLuint address
Definition: glext.h:9393
unsigned short u_short
Definition: types.h:81
bool_t xdr_u_short(XDR *xdrs, u_short *usp)
Definition: xdr.c:300
#define CLNT_DESTROY(rh)
Definition: clnt.h:275
GLuint program
Definition: glext.h:6723
Definition: tcpcore.h:1455
struct rpc_err cf_error
Definition: clnt.h:497
#define htons(x)
Definition: module.h:213
CLIENT * clntudp_bufcreate(struct sockaddr_in *, u_long, u_long, struct timeval, int *, u_int, u_int)
USHORT port
Definition: uri.c:227
static const struct timeval tottimeout
Definition: pmap_getport.c:44
Definition: pmap_prot.h:88

Referenced by getrpcport().

◆ pmap_rmtcall()

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  
)

Definition at line 73 of file pmap_rmt.c.

81 {
82  int sock = -1;
83  CLIENT *client;
84  struct rmtcallargs a;
85  struct rmtcallres r;
86  enum clnt_stat stat;
87 
88  assert(addr != NULL);
89  assert(port_ptr != 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 {
107  stat = RPC_FAILED;
108  }
109  addr->sin_port = 0;
110  return (stat);
111 }
u_int32_t rpcproc_t
Definition: types.h:106
#define PMAPPROG
Definition: pmap_prot.h:77
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
char * prog
Definition: isohybrid.c:47
__END_DECLS __BEGIN_DECLS CLIENT * clntudp_create(struct sockaddr_in *, u_long, u_long, struct timeval, int *)
#define PMAPPROC_CALLIT
Definition: pmap_prot.h:86
#define assert(x)
Definition: debug.h:53
Definition: dhcpd.h:245
static HANDLE proc()
Definition: pdb.c:32
bool_t xdr_rmtcallres(XDR *xdrs, struct rmtcallres *crp)
Definition: pmap_rmt.c:153
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)
Definition: clnt.h:199
smooth NULL
Definition: ftsmooth.c:416
#define PMAPVERS
Definition: pmap_prot.h:78
bool_t xdr_rmtcall_args(XDR *xdrs, struct rmtcallargs *cap)
Definition: pmap_rmt.c:119
#define PMAPPORT
Definition: pmap_prot.h:76
static FILE * client
Definition: client.c:41
GLenum const GLvoid * addr
Definition: glext.h:9621
Definition: stat.h:55
_CRTIMP int __cdecl stat(const char *_Filename, struct stat *_Stat)
Definition: stat.h:345
u_long * port_ptr
Definition: pmap_rmt.h:53
#define CLNT_DESTROY(rh)
Definition: clnt.h:275
Definition: tcpcore.h:1455
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
#define htons(x)
Definition: module.h:213
clnt_stat
Definition: clnt_stat.h:21

◆ pmap_set()

__BEGIN_DECLS bool_t pmap_set ( u_long  ,
u_long  ,
int  ,
int   
)

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 }
u_int32_t rpcvers_t
Definition: types.h:105
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
int32_t bool_t
Definition: types.h:101
#define free
Definition: debug_ros.c:5
#define snprintf
Definition: wintirpc.h:48
struct netconfig * __rpc_getconfip(char *nettype) const
Definition: rpc_generic.c:235
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
bool_t rpcb_set(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf, const struct netbuf *address)
Definition: rpcb_clnt.c:520
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
struct netbuf * uaddr2taddr(const struct netconfig *nconf, const char *uaddr)
Definition: rpc_generic.c:619
u_int32_t rpcprog_t
Definition: types.h:104
unsigned int u_int32_t
Definition: rosdhcp.h:35
GLuint program
Definition: glext.h:6723
Definition: types.h:144
USHORT port
Definition: uri.c:227

◆ pmap_unset()

bool_t pmap_unset ( u_long  ,
u_long   
)

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 }
u_int32_t rpcvers_t
Definition: types.h:105
int32_t bool_t
Definition: types.h:101
struct netconfig * __rpc_getconfip(char *nettype) const
Definition: rpc_generic.c:235
void freenetconfigent(struct netconfig *netconfigp)
Definition: getnetconfig.c:530
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
bool_t rpcb_unset(rpcprog_t program, rpcvers_t version, const struct netconfig *nconf)
Definition: rpcb_clnt.c:581
u_int32_t rpcprog_t
Definition: types.h:104
GLuint program
Definition: glext.h:6723