/
usr
/
include
/
proftpd
/
/usr/include/proftpd
mkdir
upload
Name
Size
Mode
Actions
ascii.h
2674
0644
edit
dl
rm
auth.h
6381
0644
edit
dl
rm
base.h
3497
0644
edit
dl
rm
bindings.h
8027
0644
edit
dl
rm
buildstamp.h
50
0644
edit
dl
rm
ccan-json.h
3677
0644
edit
dl
rm
child.h
1511
0644
edit
dl
rm
class.h
3096
0644
edit
dl
rm
cmd.h
4463
0644
edit
dl
rm
compat.h
1324
0644
edit
dl
rm
conf.h
3948
0644
edit
dl
rm
config.h
36627
0644
edit
dl
rm
configdb.h
5864
0644
edit
dl
rm
ctrls.h
8524
0644
edit
dl
rm
data.h
2582
0644
edit
dl
rm
default_paths.h
3037
0644
edit
dl
rm
dirtree.h
7648
0644
edit
dl
rm
display.h
2514
0644
edit
dl
rm
encode.h
3757
0644
edit
dl
rm
env.h
1913
0644
edit
dl
rm
error.h
18894
0644
edit
dl
rm
event.h
3583
0644
edit
dl
rm
expr.h
2209
0644
edit
dl
rm
feat.h
1303
0644
edit
dl
rm
filter.h
2113
0644
edit
dl
rm
fsio.h
19528
0644
edit
dl
rm
ftp.h
9196
0644
edit
dl
rm
glibc-glob.h
7294
0644
edit
dl
rm
hanson-tpl.h
4505
0644
edit
dl
rm
help.h
1265
0644
edit
dl
rm
ident.h
1334
0644
edit
dl
rm
inet.h
5395
0644
edit
dl
rm
jot.h
8736
0644
edit
dl
rm
json.h
6282
0644
edit
dl
rm
lastlog.h
1655
0644
edit
dl
rm
log.h
6822
0644
edit
dl
rm
logfmt.h
3444
0644
edit
dl
rm
memcache.h
5056
0644
edit
dl
rm
mkhome.h
1569
0644
edit
dl
rm
modules.h
6474
0644
edit
dl
rm
mod_ctrls.h
4058
0644
edit
dl
rm
mod_sftp.h
10959
0644
edit
dl
rm
mod_tls.h
6478
0644
edit
dl
rm
netacl.h
2571
0644
edit
dl
rm
netaddr.h
15999
0644
edit
dl
rm
netio.h
8176
0644
edit
dl
rm
openbsd-blowfish.h
2967
0644
edit
dl
rm
options.h
8531
0644
edit
dl
rm
os.h
7391
0644
edit
dl
rm
parser.h
6351
0644
edit
dl
rm
pidfile.h
1331
0644
edit
dl
rm
pool.h
4138
0644
edit
dl
rm
pr-syslog.h
3552
0644
edit
dl
rm
privs.h
2613
0644
edit
dl
rm
proctitle.h
1682
0644
edit
dl
rm
proftpd.h
9727
0644
edit
dl
rm
random.h
1325
0644
edit
dl
rm
redis.h
15953
0644
edit
dl
rm
regexp.h
3720
0644
edit
dl
rm
response.h
3145
0644
edit
dl
rm
rlimit.h
1873
0644
edit
dl
rm
scoreboard.h
4760
0644
edit
dl
rm
session.h
4430
0644
edit
dl
rm
sets.h
1986
0644
edit
dl
rm
signals.h
1879
0644
edit
dl
rm
stash.h
2174
0644
edit
dl
rm
str.h
5729
0644
edit
dl
rm
support.h
4494
0644
edit
dl
rm
table.h
11883
0644
edit
dl
rm
throttle.h
1299
0644
edit
dl
rm
timers.h
3370
0644
edit
dl
rm
trace.h
2421
0644
edit
dl
rm
utf8.h
1407
0644
edit
dl
rm
var.h
4419
0644
edit
dl
rm
version.h
1631
0644
edit
dl
rm
xferlog.h
1374
0644
edit
dl
rm
Edit:
/usr/include/proftpd/bindings.h
(8027B)
/* * ProFTPD - FTP server daemon * Copyright (c) 2001-2020 The ProFTPD Project team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. * * As a special exemption, The ProFTPD Project team and other respective * copyright holders give permission to link this program with OpenSSL, and * distribute the resulting executable, without including the source code for * OpenSSL in the source distribution. */ /* ProFTPD bindings support routines. */ #ifndef PR_BINDINGS_H #define PR_BINDINGS_H #include "conf.h" #include "pool.h" /* NOTE: the is* members could possibly become a bitmasked number */ /* Structure associating an IP address to a server_rec */ typedef struct ipbind_rec { struct ipbind_rec *ib_next; /* IP address to which this binding is "bound" */ const pr_netaddr_t *ib_addr; unsigned int ib_port; /* Default server to handle requests to this binding. If namebinds are * present, they will be checked before using this server */ server_rec *ib_server; /* Listener associated with this binding. This listener, and * ib_server->listen, are the same listener. The duplicate locations * are necessary for inetd-run servers (at present). */ conn_t *ib_listener; /* List of name-based servers bound to the above IP address. Note that * if this functionality becomes widely adopted and used, a more efficient * search-and-lookup mechanism will be needed, for performance reasons. */ array_header *ib_namebinds; /* If this binding is the DefaultServer binding */ unsigned char ib_isdefault; /* If this binding handles localhost requests */ unsigned char ib_islocalhost; /* If this binding is active */ unsigned char ib_isactive; } pr_ipbind_t; /* Structure associating a name to a server_rec */ typedef struct namebind_rec { const char *nb_name; unsigned char nb_iswildcard; unsigned char nb_isactive; server_rec *nb_server; unsigned int nb_server_port; } pr_namebind_t; /* Define the size of the hash table used to store server configurations. * It needs to be a power of two. */ #define PR_BINDINGS_TABLE_SIZE 256 /* Given an fd returned by select(), accept() and return the connt_t structure * for the binding associated with that fd. Returns the conn_t if successful, * NULL if not found or if the arguments were NULL. */ conn_t *pr_ipbind_accept_conn(fd_set *readfds, int *listenfd); /* Create a new IP-based binding for the server given, using the provided * arguments. The new binding is added the list maintained by the bindings * layer. Returns 0 on success, -1 on failure. */ int pr_ipbind_create(server_rec *server, const pr_netaddr_t *addr, unsigned int port); /* Close all IP bindings associated with the given IP address/port combination. * The bindings are then marked as inactive, so that future lookups via * pr_ipbind_find() skip these bindings. Returns 0 on success, -1 on failure * (eg no associated bindings found). */ int pr_ipbind_close(const pr_netaddr_t *addr, unsigned int port, unsigned char close_namebinds); /* Close all listenings fds. This needs to happen just after a process * has been forked to handle a session. */ int pr_ipbind_close_listeners(void); /* Search through the given server's configuration records, and for each * associated bind configuration found, create an additional IP binding for * that bind address. Honors SocketBindTight, if set. Returns 0 on * success, -1 on failure (if server == NULL, for example). */ int pr_ipbind_add_binds(server_rec *server); /* Search the binding list, and return the pr_ipbind_t for the given addr and * port. If requested, skip over inactive bindings while searching. */ pr_ipbind_t *pr_ipbind_find(const pr_netaddr_t *addr, unsigned int port, unsigned char skip_inactive); /* Iterate through the binding list, returning the next ipbind. Returns NULL * once the end of the list is reached. If prev is NULL, the iterator * restarts at the beginning of the list. */ pr_ipbind_t *pr_ipbind_get(pr_ipbind_t *prev); /* Search the binding list, and return the server_rec * that is bound to the * given IP address/port combination. */ server_rec *pr_ipbind_get_server(const pr_netaddr_t *addr, unsigned int port); /* Listens on each file descriptor in the given set, and returns the file * descriptor associated with an incoming connection request. Returns -1 * on error, as when the fd_set argument is NULL. */ int pr_ipbind_listen(fd_set *readfds); /* Prepares the IP-based binding associated with the given server for listening. * Returns 0 on success, -1 on failure. */ int pr_ipbind_open(const pr_netaddr_t *addr, unsigned int port, conn_t *listen_conn, unsigned char isdefault, unsigned char islocalhost, unsigned char open_namebinds); conn_t *pr_ipbind_get_listening_conn(server_rec *server, const pr_netaddr_t *addr, unsigned int port); /* Close the pr_namebind_t with the given name. */ int pr_namebind_close(const char *name, const pr_netaddr_t *addr); /* Create a pr_namebind_t, similar to a pr_ipbind_t, which maps the name (usu. * DNS hostname) to the server_rec. The given addr is used to associate this * pr_namebind_t with the given IP address (to which the DNS hostname should * resolve). */ int pr_namebind_create(server_rec *server, const char *name, pr_ipbind_t *ipbind, const pr_netaddr_t *addr, unsigned int port); /* Search the Bindings layer, and return the pr_namebind_t associated with * the given addr, port, and name. If requested, skip over inactive * bindings while searching. */ pr_namebind_t *pr_namebind_find(const char *name, const pr_netaddr_t *addr, unsigned int port, unsigned char skip_inactive); /* Find the server_rec associated with the given name. If none are found, * default to the server_rec of the containing pr_ipbind_t. */ server_rec *pr_namebind_get_server(const char *name, const pr_netaddr_t *addr, unsigned int port); /* Opens the pr_namebind_t with the given name. */ int pr_namebind_open(const char *name, const pr_netaddr_t *addr, unsigned int port); /* Provides a count of the number of namebinds associated with this * server_rec. */ unsigned int pr_namebind_count(server_rec *); /* Initialize the Bindings layer. */ void init_bindings(void); /* Free the Bindings layer. */ void free_bindings(void); /* Macro error-handling wrappers */ #define PR_ADD_IPBINDS(s) \ if ((res = pr_ipbind_add_binds((s))) < 0) \ pr_log_pri(PR_LOG_NOTICE, \ "%s:%d: notice: unable to add binds to ipbind '%s': %s", \ __FILE__, __LINE__, (s)->ServerAddress, strerror(errno)) #define PR_CLOSE_IPBIND(a, p, c) \ if ((res = pr_ipbind_close((a), (p), (c))) < 0) \ pr_log_pri(PR_LOG_NOTICE, \ "%s:%d: notice: unable to close ipbind: %s", \ __FILE__, __LINE__, strerror(errno)) #define PR_CREATE_IPBIND(s, a, p) \ if ((res = pr_ipbind_create((s), (a), (p))) < 0) \ pr_log_pri(PR_LOG_NOTICE, \ "%s:%d: notice: unable to create ipbind '%s#%u': %s", \ __FILE__, __LINE__, (s)->ServerAddress, (p), strerror(errno)) #define PR_OPEN_IPBIND(a, p, c, d, l, o) \ if ((res = pr_ipbind_open((a), (p), (c), (d), (l), (o))) < 0) \ pr_log_pri(PR_LOG_NOTICE, \ "%s:%d: notice: unable to open ipbind '%s': %s", \ __FILE__, __LINE__, pr_netaddr_get_ipstr((a)), strerror(errno)) #endif /* PR_BINDINGS_H */
Save
cmd:
run