003 File Manager
Current Path:
/usr/local/include/proftpd
usr
/
local
/
include
/
proftpd
/
📁
..
📄
acconfig.h
(2.79 KB)
📄
ascii.h
(2.61 KB)
📄
auth.h
(6.23 KB)
📄
bindings.h
(7.84 KB)
📄
buildstamp.h
(50 B)
📄
ccan-json.h
(3.59 KB)
📄
child.h
(1.48 KB)
📄
class.h
(3.02 KB)
📄
cmd.h
(4.33 KB)
📄
compat.h
(2.03 KB)
📄
conf.h
(3.61 KB)
📄
config.h
(33.97 KB)
📄
configdb.h
(5.58 KB)
📄
ctrls.h
(7.92 KB)
📄
data.h
(2.52 KB)
📄
default_paths.h
(2.97 KB)
📄
dirtree.h
(7.45 KB)
📄
display.h
(2.46 KB)
📄
encode.h
(3.67 KB)
📄
env.h
(1.87 KB)
📄
error.h
(18.45 KB)
📄
event.h
(3.5 KB)
📄
expr.h
(2.16 KB)
📄
feat.h
(1.27 KB)
📄
filter.h
(2.06 KB)
📄
fsio.h
(18.58 KB)
📄
ftp.h
(8.92 KB)
📄
glibc-glob.h
(7.12 KB)
📄
hanson-tpl.h
(4.4 KB)
📄
help.h
(1.24 KB)
📄
ident.h
(1.3 KB)
📄
inet.h
(5.13 KB)
📄
jot.h
(8.44 KB)
📄
json.h
(5.34 KB)
📄
lastlog.h
(1.62 KB)
📄
libsupp.h
(3.42 KB)
📄
log.h
(6.66 KB)
📄
logfmt.h
(3.3 KB)
📄
memcache.h
(4.94 KB)
📄
mkhome.h
(1.53 KB)
📄
mod_ctrls.h
(3.38 KB)
📄
mod_dnsbl.h
(1.36 KB)
📄
mod_quotatab.h
(6.11 KB)
📄
mod_sftp.h
(8.98 KB)
📄
mod_snmp.h
(2.22 KB)
📄
mod_sql.h
(3.71 KB)
📄
mod_tls.h
(6.33 KB)
📄
mod_wrap2.h
(2.63 KB)
📄
modules.h
(6.3 KB)
📄
netacl.h
(2.51 KB)
📄
netaddr.h
(15.58 KB)
📄
netio.h
(7.98 KB)
📄
openbsd-blowfish.h
(2.88 KB)
📄
options.h
(8.12 KB)
📄
os.h
(7.03 KB)
📄
parser.h
(5.94 KB)
📄
pidfile.h
(1.3 KB)
📄
pool.h
(3.49 KB)
📄
pr-syslog.h
(3.47 KB)
📄
privs.h
(2.55 KB)
📄
proctitle.h
(1.64 KB)
📄
proftpd.h
(9.46 KB)
📄
random.h
(1.29 KB)
📄
redis.h
(15.21 KB)
📄
regexp.h
(3.15 KB)
📄
response.h
(3.07 KB)
📄
rlimit.h
(1.83 KB)
📄
scoreboard.h
(4.57 KB)
📄
session.h
(4.27 KB)
📄
sets.h
(1.94 KB)
📄
signals.h
(1.42 KB)
📄
stash.h
(2.12 KB)
📄
str.h
(5.37 KB)
📄
support.h
(4.39 KB)
📄
table.h
(11.43 KB)
📄
throttle.h
(1.26 KB)
📄
timers.h
(3.29 KB)
📄
trace.h
(2.36 KB)
📄
utf8.h
(1.37 KB)
📄
var.h
(4.32 KB)
📄
version.h
(1.59 KB)
📄
xferlog.h
(1.34 KB)
Editing: netio.h
/* * ProFTPD - FTP server daemon * Copyright (c) 1997, 1998 Public Flood Software * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net> * 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, Public Flood Software/MacGyver aka Habeeb J. Dihu * 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. */ /* Network IO stream layer */ #ifndef PR_NETIO_H #define PR_NETIO_H /* Network I/O stream types */ /* This indicates that the netio being registered should be used when * performing network I/O for the control connection. */ #define PR_NETIO_STRM_CTRL 0x00010 /* This indicates that the netio being registered should be used when * performing network I/O for the data connection. */ #define PR_NETIO_STRM_DATA 0x00020 /* This indicates that the netio being registered should be used when * performing network I/O for other connections (e.g. RFC931 lookups). * This is rarely used. */ #define PR_NETIO_STRM_OTHR 0x00040 /* Network I/O stream direction */ #define PR_NETIO_IO_RD 1 #define PR_NETIO_IO_WR 2 /* Network I/O stream session flags */ /* This indicates that netio functions are allowed to be interrupted by * EINTR, and to return -2. */ #define PR_NETIO_SESS_INTR (1 << 1) /* This is a temporary internal flag used to indicate that I/O on a * network stream has been aborted, and should return -2 at the next * possible instant. In combination with NETIO_INTR and interruptible * syscalls, this should be near instantly. This flag cannot be tested * for as it is cleared immediately after being detected. */ #define PR_NETIO_SESS_ABORT (1 << 2) /* Network I/O objects */ typedef struct { /* Pointer to the buffer memory. */ char *buf; /* Total length of the buffer. */ unsigned long buflen; /* Pointer to the current byte in the buffer. */ char *current; /* Number of bytes left in the buffer. */ size_t remaining; } pr_buffer_t; typedef struct netio_rec pr_netio_t; typedef struct { /* Memory pool for this object. */ struct pool_rec *strm_pool; /* Stream type */ int strm_type; /* File descriptor for this I/O stream. */ int strm_fd; /* I/O mode: PR_NETIO_IO_RD or PR_NETIO_IO_WR. Patterned after * open(2). */ int strm_mode; /* Poll interval for this stream. */ unsigned int strm_interval; /* Internal use. */ volatile unsigned long strm_flags; /* Buffer. */ pr_buffer_t *strm_buf; /* Arbitrary data for outside use. */ void *strm_data; /* errno, if applicable. */ int strm_errno; /* Private data for passing/retaining among modules. */ pr_table_t *notes; /* Pointer to the NetIO which opened this stream. */ pr_netio_t *strm_netio; } pr_netio_stream_t; #define PR_NETIO_ERRNO(s) ((s)->strm_errno) #define PR_NETIO_FD(s) ((s)->strm_fd) struct netio_rec { /* Memory pool for this object. */ struct pool_rec *pool; /* NetIO callbacks */ void (*abort)(pr_netio_stream_t *); int (*close)(pr_netio_stream_t *); pr_netio_stream_t *(*open)(pr_netio_stream_t *, int, int); int (*poll)(pr_netio_stream_t *); int (*postopen)(pr_netio_stream_t *); int (*read)(pr_netio_stream_t *, char *, size_t); pr_netio_stream_t *(*reopen)(pr_netio_stream_t *, int, int); int (*shutdown)(pr_netio_stream_t *, int); int (*write)(pr_netio_stream_t *, char *, size_t); /* Registering/owning module */ module *owner; const char *owner_name; }; /* Network IO function prototypes */ pr_buffer_t *pr_netio_buffer_alloc(pr_netio_stream_t *nstrm); void pr_netio_abort(pr_netio_stream_t *); int pr_netio_lingering_abort(pr_netio_stream_t *, long); int pr_netio_close(pr_netio_stream_t *); int pr_netio_lingering_close(pr_netio_stream_t *, long); #define NETIO_LINGERING_CLOSE_FL_NO_SHUTDOWN 0x00001 char *pr_netio_gets(char *, size_t, pr_netio_stream_t *); pr_netio_stream_t *pr_netio_open(pool *, int, int, int); int pr_netio_postopen(pr_netio_stream_t *); int pr_netio_printf(pr_netio_stream_t *, const char *, ...); int pr_netio_vprintf(pr_netio_stream_t *, const char *, va_list); /* pr_netio_printf_async() is for use inside alarm handlers, where no * pr_netio_poll() blocking is allowed. This is necessary because otherwise, * pr_netio_poll() can potentially hang forever if the send queue is maxed and * the socket has been closed. */ int pr_netio_printf_async(pr_netio_stream_t *, char *,...); /* pr_netio_poll() is needed instead of simply blocking read/write because * there is a race condition if the syscall _should_ be interrupted inside * read(), or write(), but the signal is received before we actually hit the * read or write call. select() alleviates this problem by timing out * (configurable by pr_netio_set_poll_interval()), restarting the syscall if * PR_NETIO_SESS_INTR is not set, or returning if it is set and we were * interrupted by a signal. If after the timeout PR_NETIO_SESS_ABORT is set * (presumably by a signal handler) or PR_NETIO_SESS_INTR & errno == EINTR, * we return 1. Otherwise, return zero when data is available, or -1 on * other errors. */ int pr_netio_poll(pr_netio_stream_t *); /* Read, from the given stream, into the buffer the requested size_t number * of bytes. The last argument is the minimum number of bytes to read before * returning 1 (or greater). */ int pr_netio_read(pr_netio_stream_t *, char *, size_t, int); pr_netio_stream_t *pr_netio_reopen(pr_netio_stream_t *, int, int); int pr_netio_shutdown(pr_netio_stream_t *, int); /* pr_netio_telnet_gets() is exactly like pr_netio_gets(), except a few special * telnet characters are handled (which takes care of the [IAC]ABOR * command, and odd clients */ char *pr_netio_telnet_gets(char *, size_t, pr_netio_stream_t *, pr_netio_stream_t *); /* Similar to pr_netio_telnet_gets(), except that it returns the number of * bytes stored in the given buffer, or -1 if there was an error. */ int pr_netio_telnet_gets2(char *, size_t, pr_netio_stream_t *, pr_netio_stream_t *); int pr_netio_write(pr_netio_stream_t *, char *, size_t); /* This is a bit odd, because io_ functions are opaque, we can't be sure * we are dealing with a conn_t or that it is in O_NONBLOCK mode. Trying * to do this without O_NONBLOCK would cause the kernel itself to block * here, and thus invalidate the whole principal. Instead we save * the flags and put the fd in O_NONBLOCK mode. */ int pr_netio_write_async(pr_netio_stream_t *, char *, size_t); void pr_netio_reset_poll_interval(pr_netio_stream_t *); void pr_netio_set_poll_interval(pr_netio_stream_t *, unsigned int); /* Allocate a NetIO object, and set all of its NetIO callbacks to their * default handlers. */ pr_netio_t *pr_alloc_netio(pool *); pr_netio_t *pr_alloc_netio2(pool *, module *, const char *); /* Register the given NetIO object and all its callbacks for the network * I/O layer's use. If given a NULL argument, it will automatically * instantiate and register the default NetIO object. */ int pr_register_netio(pr_netio_t *, int); /* Unregister the NetIO objects indicated by strm_types. */ int pr_unregister_netio(int); /* Peek at the NetIO registered for the given stream type. */ pr_netio_t *pr_get_netio(int); /* Initialize the network I/O layer. */ void init_netio(void); #endif /* PR_NETIO_H */
Upload File
Create Folder