ReactOS  0.4.13-dev-100-gc8611ae
pmap_clnt.c File Reference
#include <wintirpc.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <rpc/rpc.h>
#include <rpc/pmap_prot.h>
#include <rpc/pmap_clnt.h>
#include <rpc/nettype.h>
#include <stdio.h>
#include <stdlib.h>
#include "rpc_com.h"
Include dependency graph for pmap_clnt.c:

Go to the source code of this file.

Functions

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

Function Documentation

◆ pmap_set()

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 }
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  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 }
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