File: fxp.h

package info (click to toggle)
proftpd-dfsg 1.3.4a-5%2Bdeb7u3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 27,820 kB
  • sloc: perl: 154,169; ansic: 128,582; sh: 13,564; php: 11,586; makefile: 2,156
file content (100 lines) | stat: -rw-r--r-- 3,465 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * ProFTPD - mod_sftp SFTP
 * Copyright (c) 2008-2011 TJ Saunders
 *
 * 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, TJ Saunders 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.
 *
 * $Id: fxp.h,v 1.10 2011/05/23 20:40:13 castaglia Exp $
 */

#include "mod_sftp.h"

#ifdef HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif

#ifndef MOD_SFTP_FXP_H
#define MOD_SFTP_FXP_H

/* SFTP Packet Types */
#define SFTP_SSH2_FXP_INIT		1
#define SFTP_SSH2_FXP_VERSION		2
#define SFTP_SSH2_FXP_OPEN		3
#define SFTP_SSH2_FXP_CLOSE		4 
#define SFTP_SSH2_FXP_READ		5 
#define SFTP_SSH2_FXP_WRITE		6
#define SFTP_SSH2_FXP_LSTAT		7
#define SFTP_SSH2_FXP_FSTAT		8
#define SFTP_SSH2_FXP_SETSTAT		9
#define SFTP_SSH2_FXP_FSETSTAT		10 
#define SFTP_SSH2_FXP_OPENDIR		11
#define SFTP_SSH2_FXP_READDIR		12
#define SFTP_SSH2_FXP_REMOVE		13
#define SFTP_SSH2_FXP_MKDIR		14
#define SFTP_SSH2_FXP_RMDIR		15
#define SFTP_SSH2_FXP_REALPATH		16
#define SFTP_SSH2_FXP_STAT		17
#define SFTP_SSH2_FXP_RENAME		18
#define SFTP_SSH2_FXP_READLINK		19
#define SFTP_SSH2_FXP_SYMLINK		20
#define SFTP_SSH2_FXP_LINK		21
#define SFTP_SSH2_FXP_LOCK		22
#define SFTP_SSH2_FXP_UNLOCK		23
#define SFTP_SSH2_FXP_STATUS		101
#define SFTP_SSH2_FXP_HANDLE		102
#define SFTP_SSH2_FXP_DATA		103
#define SFTP_SSH2_FXP_NAME		104
#define SFTP_SSH2_FXP_ATTRS		105
#define SFTP_SSH2_FXP_EXTENDED		200
#define SFTP_SSH2_FXP_EXTENDED_REPLY	201

/* SFTP Extensions */
#define SFTP_FXP_EXT_CHECK_FILE		0x0001
#define SFTP_FXP_EXT_COPY_FILE		0x0002
#define SFTP_FXP_EXT_VERSION_SELECT	0x0004
#define SFTP_FXP_EXT_POSIX_RENAME	0x0008
#define SFTP_FXP_EXT_STATVFS		0x0010
#define SFTP_FXP_EXT_VENDOR_ID		0x0020
#define SFTP_FXP_EXT_SPACE_AVAIL	0x0040

#define SFTP_FXP_EXT_DEFAULT \
  (SFTP_FXP_EXT_CHECK_FILE|SFTP_FXP_EXT_COPY_FILE|SFTP_FXP_EXT_VERSION_SELECT|SFTP_FXP_EXT_POSIX_RENAME|SFTP_FXP_EXT_SPACE_AVAIL|SFTP_FXP_EXT_STATVFS)

int sftp_fxp_handle_packet(pool *, void *, uint32_t, char *, uint32_t);

int sftp_fxp_open_session(uint32_t);
int sftp_fxp_close_session(uint32_t);

int sftp_fxp_set_displaylogin(const char *);
int sftp_fxp_set_extensions(unsigned long);

int sftp_fxp_set_protocol_version(unsigned int, unsigned int);

/* Set the SFTP protocol version at which UTF8 decoding/encoding will be done
 * on the paths/strings sent to/from the SFTP client.  The default SFTP
 * protocol version at which this happens, by IETF Draft, is 4.  Some sites
 * (e.g. Japanese sites) may need the encoding facilities for other SFTP
 * protocol versions, however.
 */
int sftp_fxp_set_utf8_protocol_version(unsigned int);

void sftp_fxp_use_gmt(int);

#endif