/
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/netio.h
(8176B)
/* * 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 */
Save
cmd:
run