rpcbind.h (064ed339d53d38ca3b43105dc6fc88512efed351) rpcbind.h (8f6d9dae92449b59bdafcb7777bc32f1b2726e48)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 */
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE

--- 7 unchanged lines hidden (view full) ---

16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 *
21 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22 * Use is subject to license terms.
23 */
24/*
25 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
26 */
24/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
25/* All Rights Reserved */
26/*
27 * University Copyright- Copyright (c) 1982, 1986, 1988
28 * The Regents of the University of California
29 * All Rights Reserved
30 *
31 * University Acknowledgment- Portions of this document are derived from

--- 4 unchanged lines hidden (view full) ---

36/*
37 * rpcbind.h
38 * The common header declarations
39 */
40
41#ifndef _RPCBIND_H
42#define _RPCBIND_H
43
27/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
28/* All Rights Reserved */
29/*
30 * University Copyright- Copyright (c) 1982, 1986, 1988
31 * The Regents of the University of California
32 * All Rights Reserved
33 *
34 * University Acknowledgment- Portions of this document are derived from

--- 4 unchanged lines hidden (view full) ---

39/*
40 * rpcbind.h
41 * The common header declarations
42 */
43
44#ifndef _RPCBIND_H
45#define _RPCBIND_H
46
44#pragma ident "%Z%%M% %I% %E% SMI"
45
46#ifdef PORTMAP
47#include <rpc/pmap_prot.h>
48#endif
49#include <rpc/rpcb_prot.h>
47#ifdef PORTMAP
48#include <rpc/pmap_prot.h>
49#endif
50#include <rpc/rpcb_prot.h>
50#include <signal.h>
51#include <synch.h>
51
52
52#include <tcpd.h>
53
54#ifdef __cplusplus
55extern "C" {
56#endif
57
58extern int debugging;
59extern int doabort;
53#ifdef __cplusplus
54extern "C" {
55#endif
56
57extern int debugging;
58extern int doabort;
59extern rwlock_t list_rbl_lock; /* Protects list_rbl */
60extern rpcblist_ptr list_rbl; /* A list of version 3 & 4 rpcbind services */
61extern char *loopback_dg; /* CLTS loopback transport, for set/unset */
62extern char *loopback_vc; /* COTS loopback transport, for set/unset */
63extern char *loopback_vc_ord; /* COTS_ORD loopback transport, for set/unset */
60extern rpcblist_ptr list_rbl; /* A list of version 3 & 4 rpcbind services */
61extern char *loopback_dg; /* CLTS loopback transport, for set/unset */
62extern char *loopback_vc; /* COTS loopback transport, for set/unset */
63extern char *loopback_vc_ord; /* COTS_ORD loopback transport, for set/unset */
64extern volatile sig_atomic_t sigrefresh; /* Did we receive a SIGHUP recently? */
65
66#ifdef PORTMAP
64
65#ifdef PORTMAP
66extern rwlock_t list_pml_lock; /* Protects list_pml */
67extern pmaplist *list_pml; /* A list of version 2 rpcbind services */
68extern char *udptrans; /* Name of UDP transport */
69extern char *tcptrans; /* Name of TCP transport */
70extern char *udp_uaddr; /* Universal UDP address */
71extern char *tcp_uaddr; /* Universal TCP address */
72#endif
73
67extern pmaplist *list_pml; /* A list of version 2 rpcbind services */
68extern char *udptrans; /* Name of UDP transport */
69extern char *tcptrans; /* Name of TCP transport */
70extern char *udp_uaddr; /* Universal UDP address */
71extern char *tcp_uaddr; /* Universal TCP address */
72#endif
73
74extern char *mergeaddr();
75extern int add_bndlist();
76extern int create_rmtcall_fd();
77extern bool_t is_bound();
78extern void my_svc_run();
79extern void rpcb_check_init(void);
74char *mergeaddr(SVCXPRT *, char *, char *, char *);
75int add_bndlist(struct netconfig *, struct t_bind *, struct t_bind *);
76int create_rmtcall_fd(struct netconfig *);
77bool_t is_bound(char *, char *);
78void set_rpcb_rmtcalls_max(int);
80
81/* TCP wrapper functions and variables. */
79
80/* TCP wrapper functions and variables. */
82extern boolean_t localxprt(SVCXPRT *, boolean_t);
83extern void qsyslog(int pri, const char *fmt, ...);
84extern boolean_t rpcb_check(SVCXPRT *, rpcproc_t, boolean_t);
85extern void rpcb_log(boolean_t, SVCXPRT *, rpcproc_t, rpcprog_t, boolean_t);
86extern boolean_t allow_indirect, wrap_enabled, verboselog, local_only;
81boolean_t localxprt(SVCXPRT *, boolean_t);
82void qsyslog(int pri, const char *fmt, ...);
83boolean_t rpcb_check(SVCXPRT *, rpcproc_t, boolean_t);
84void rpcb_log(boolean_t, SVCXPRT *, rpcproc_t, rpcprog_t, boolean_t);
85extern volatile boolean_t allow_indirect;
86extern volatile boolean_t wrap_enabled;
87extern volatile boolean_t verboselog;
88extern volatile boolean_t local_only;
87
88#define svc_getgencaller(transp) \
89 ((struct sockaddr_gen *)svc_getrpccaller((transp))->buf)
90
91#define RPCB_CHECK(xprt, proc) \
92 if ((wrap_enabled || local_only) && \
93 !rpcb_check((xprt), (proc), B_FALSE)) \
94 return

--- 11 unchanged lines hidden (view full) ---

106#define RPCB_LOG(xprt, proc, prog) \
107 if (wrap_enabled) \
108 rpcb_log(B_TRUE, (xprt), (proc), (prog), B_FALSE)
109
110#define PMAP_LOG(ans, xprt, proc, prog) \
111 if (wrap_enabled) \
112 rpcb_log(ans, (xprt), (proc), (prog), B_TRUE)
113
89
90#define svc_getgencaller(transp) \
91 ((struct sockaddr_gen *)svc_getrpccaller((transp))->buf)
92
93#define RPCB_CHECK(xprt, proc) \
94 if ((wrap_enabled || local_only) && \
95 !rpcb_check((xprt), (proc), B_FALSE)) \
96 return

--- 11 unchanged lines hidden (view full) ---

108#define RPCB_LOG(xprt, proc, prog) \
109 if (wrap_enabled) \
110 rpcb_log(B_TRUE, (xprt), (proc), (prog), B_FALSE)
111
112#define PMAP_LOG(ans, xprt, proc, prog) \
113 if (wrap_enabled) \
114 rpcb_log(ans, (xprt), (proc), (prog), B_TRUE)
115
114extern bool_t map_set(), map_unset();
116bool_t map_set(RPCB *, char *);
117bool_t map_unset(RPCB *, char *);
115
116/* Statistics gathering functions */
118
119/* Statistics gathering functions */
117extern void rpcbs_procinfo();
118extern void rpcbs_set();
119extern void rpcbs_unset();
120extern void rpcbs_getaddr();
121extern void rpcbs_rmtcall();
122extern rpcb_stat_byvers *rpcbproc_getstat();
120void rpcbs_procinfo(int, rpcproc_t);
121void rpcbs_set(int, bool_t);
122void rpcbs_unset(int, bool_t);
123void rpcbs_getaddr(int, rpcprog_t, rpcvers_t, char *, char *);
124void rpcbs_rmtcall(int, rpcproc_t, rpcprog_t, rpcvers_t, rpcproc_t, char *,
125 rpcblist_ptr);
126bool_t rpcbproc_getstat(void *, rpcb_stat_byvers **);
127bool_t xdr_rpcb_stat_byvers_ptr(XDR *, rpcb_stat_byvers **);
123
128
124extern struct netconfig *rpcbind_get_conf();
125extern void rpcbind_abort() __NORETURN;
129struct netconfig *rpcbind_get_conf();
130void rpcbind_abort() __NORETURN;
126
131
132#ifdef PORTMAP
133void pmap_service(struct svc_req *, SVCXPRT *xprt);
134#endif
135void rpcb_service_3(struct svc_req *, SVCXPRT *xprt);
136void rpcb_service_4(struct svc_req *, SVCXPRT *xprt);
137void read_warmstart(void);
138void write_warmstart(void);
139int Is_ipv6present(void);
140
141extern zoneid_t myzone;
142
127/* Common functions shared between versions */
143/* Common functions shared between versions */
128extern void rpcbproc_callit_com();
129extern bool_t *rpcbproc_set_com();
130extern bool_t *rpcbproc_unset_com();
131extern ulong_t *rpcbproc_gettime_com();
132extern struct netbuf *rpcbproc_uaddr2taddr_com();
133extern char **rpcbproc_taddr2uaddr_com();
134extern char **rpcbproc_getaddr_com();
135extern void delete_prog();
144void rpcbproc_callit_com(struct svc_req *, SVCXPRT *, ulong_t, int);
145bool_t rpcbproc_set_com(RPCB *, bool_t *, struct svc_req *, int);
146bool_t rpcbproc_unset_com(RPCB *, bool_t *, struct svc_req *, int);
147bool_t rpcbproc_gettime_com(void *, ulong_t *);
148bool_t rpcbproc_uaddr2taddr_com(char **, struct netbuf *, struct svc_req *);
149bool_t rpcbproc_taddr2uaddr_com(struct netbuf *, char **, struct svc_req *);
150bool_t rpcbproc_getaddr_com(RPCB *, char **, struct svc_req *, ulong_t);
151void delete_prog(rpcprog_t);
152bool_t rpcbproc_dump_com(void *, rpcblist_ptr **);
153char *getowner(SVCXPRT *, char *);
136
154
137extern uid_t rpcb_caller_uid(SVCXPRT *);
155int del_pmaplist(RPCB *);
156void delete_rbl(rpcblist_ptr);
138
157
158uid_t rpcb_caller_uid(SVCXPRT *);
159
160/* XDR functions */
161bool_t xdr_rpcblist_ptr_ptr(XDR *, rpcblist_ptr **);
162
139/* For different getaddr semantics */
140#define RPCB_ALLVERS 0
141#define RPCB_ONEVERS 1
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif /* _RPCBIND_H */
163/* For different getaddr semantics */
164#define RPCB_ALLVERS 0
165#define RPCB_ONEVERS 1
166
167#ifdef __cplusplus
168}
169#endif
170
171#endif /* _RPCBIND_H */