remotelimits.h

Go to the documentation of this file.
00001 /*  Defines constant limits given that resources are not local and
00002     therefore do not follow OS-defined constants
00003 
00004     Copyright (C) 2007  Alexander Lamaison <awl03@doc.ic.ac.uk>
00005 
00006     This program is free software; you can redistribute it and/or modify
00007     it under the terms of the GNU General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or
00009     (at your option) any later version.
00010 
00011     This program is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014     GNU General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License along
00017     with this program; if not, write to the Free Software Foundation, Inc.,
00018     51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
00019 */
00020 
00021 #ifndef REMOTELIMITS_H
00022 #define REMOTELIMITS_H
00023 
00024 #if _MSC_VER > 1000
00025 #pragma once
00026 #endif // _MSC_VER > 1000
00027 
00028 // String limits should not include the terminating NULL
00029 // TODO: Not sure if this is the case currently
00030 
00031 #define MAX_USERNAME_LEN          32
00032 #define MAX_USERNAME_LENZ         33
00033 
00034 // Under libc-5 the utmp and wtmp files only allow 8 chars for username
00035 #define MAX_USERNAME_LEN_UNIX      8
00036 // Under libc-6 this is increased to 32 characters
00037 #define MAX_USERNAME_LEN_LINUX    32
00038 // Apparently Win2k can have names up to 104 characters: 
00039 // http://www.microsoft.com/technet/prodtechnol/windows2000serv/deploy/confeat/08w2kada.mspx
00040 #define MAX_USERNAME_LEN_WIN      20
00041 
00042 #define MAX_HOSTNAME_LEN         255 // http://en.wikipedia.org/wiki/Hostname
00043 #define MAX_HOSTNAME_LENZ        256
00044 
00045 #define MAX_PATH_LEN            1023
00046 #define MAX_PATH_LENZ           1024
00047 #define MAX_PATH_LEN_WIN         248 // 260 including filename
00048 #define MAX_PATH_LEN_LINUX      4096
00049 
00050 #define MAX_FILENAME_LEN         255 // Choosing lower val as Windows FAT is
00051 #define MAX_FILENAME_LENZ        256 // also limited to 255. Makes things easier
00052 #define MAX_FILENAME_LEN_WIN     256 
00053 #define MAX_FILENAME_LEN_LINUX   255
00054 
00055 #define MIN_PORT                   0
00056 #define MAX_PORT               65535
00057 #define MAX_PORT_STR_LEN           5 // length of '65535' as a string
00058 
00059 #define PROTOCOL_LEN               7 // length of 'sftp://' as a string
00060 
00061 // Complete connection description of the form:
00062 //     sftp://username@hostname:port/path
00063 #define MAX_CANONICAL_LEN \
00064         (PROTOCOL_LEN + MAX_USERNAME_LEN + MAX_HOSTNAME_LEN \
00065         + MAX_PATH_LEN + MAX_PORT_STR_LEN + 2)
00066 
00067 #define MAX_LABEL_LEN             30 // Arbitrary - chosen to be easy to display
00068 #define MAX_LABEL_LENZ            31 
00069 
00070 #define SFTP_DEFAULT_PORT         22
00071 
00072 #endif REMOTELIMITS_H

Generated on Mon Nov 12 22:43:54 2007 for Swish by  doxygen 1.5.3