| 1 | /* |
|---|
| 2 | * ProFTPD - FTP server daemon |
|---|
| 3 | * Copyright (c) 1997, 1998 Public Flood Software |
|---|
| 4 | * Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <macgyver@tos.net> |
|---|
| 5 | * Copyright (c) 2001-2011 The ProFTPD Project team |
|---|
| 6 | * |
|---|
| 7 | * This program is free software; you can redistribute it and/or modify |
|---|
| 8 | * it under the terms of the GNU General Public License as published by |
|---|
| 9 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 10 | * (at your option) any later version. |
|---|
| 11 | * |
|---|
| 12 | * This program is distributed in the hope that it will be useful, |
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 15 | * GNU General Public License for more details. |
|---|
| 16 | * |
|---|
| 17 | * You should have received a copy of the GNU General Public License |
|---|
| 18 | * along with this program; if not, write to the Free Software |
|---|
| 19 | * Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
|---|
| 20 | * |
|---|
| 21 | * As a special exemption, Public Flood Software/MacGyver aka Habeeb J. Dihu |
|---|
| 22 | * and other respective copyright holders give permission to link this program |
|---|
| 23 | * with OpenSSL, and distribute the resulting executable, without including |
|---|
| 24 | * the source code for OpenSSL in the source distribution. |
|---|
| 25 | */ |
|---|
| 26 | |
|---|
| 27 | /* Data connection management prototypes |
|---|
| 28 | * $Id: data.h,v 1.22 2011/05/23 20:35:35 castaglia Exp $ |
|---|
| 29 | */ |
|---|
| 30 | |
|---|
| 31 | #ifndef PR_DATACONN_H |
|---|
| 32 | #define PR_DATACONN_H |
|---|
| 33 | |
|---|
| 34 | void pr_data_init(char *, int); |
|---|
| 35 | void pr_data_cleanup(void); |
|---|
| 36 | int pr_data_open(char *, char *, int, off_t); |
|---|
| 37 | void pr_data_close(int); |
|---|
| 38 | void pr_data_abort(int, int); |
|---|
| 39 | int pr_data_xfer(char *, int); |
|---|
| 40 | void pr_data_reset(void); |
|---|
| 41 | void pr_data_set_linger(long); |
|---|
| 42 | |
|---|
| 43 | /* Clear the session.xfer.p pool, if present, and reset any associated |
|---|
| 44 | * state. |
|---|
| 45 | */ |
|---|
| 46 | void pr_data_clear_xfer_pool(void); |
|---|
| 47 | |
|---|
| 48 | int pr_data_get_timeout(int); |
|---|
| 49 | void pr_data_set_timeout(int, int); |
|---|
| 50 | #define PR_DATA_TIMEOUT_IDLE 0x001 |
|---|
| 51 | #define PR_DATA_TIMEOUT_NO_TRANSFER 0x002 |
|---|
| 52 | #define PR_DATA_TIMEOUT_STALLED 0x004 |
|---|
| 53 | |
|---|
| 54 | #ifdef HAVE_SENDFILE |
|---|
| 55 | typedef |
|---|
| 56 | |
|---|
| 57 | #if defined(HAVE_AIX_SENDFILE) || defined(HAVE_HPUX_SENDFILE) || \ |
|---|
| 58 | defined(HAVE_LINUX_SENDFILE) || defined(HAVE_SOLARIS_SENDFILE) |
|---|
| 59 | ssize_t |
|---|
| 60 | #elif defined(HAVE_BSD_SENDFILE) || defined(HAVE_MACOSX_SENDFILE) |
|---|
| 61 | off_t |
|---|
| 62 | #else |
|---|
| 63 | #error "You have an unknown sendfile implementation." |
|---|
| 64 | #endif |
|---|
| 65 | |
|---|
| 66 | pr_sendfile_t; |
|---|
| 67 | |
|---|
| 68 | pr_sendfile_t pr_data_sendfile(int retr_fd, off_t *offset, off_t count); |
|---|
| 69 | #endif /* HAVE_SENDFILE */ |
|---|
| 70 | |
|---|
| 71 | #endif /* PR_DATACONN_H */ |
|---|