- some initial changes to try to get ftp working over the Internet with firewalls etc

This commit is contained in:
Mark Vejvoda
2010-12-30 15:56:02 +00:00
parent 2ca50ee9f9
commit 3f0ee7a6cb
19 changed files with 265 additions and 77 deletions

View File

@@ -61,7 +61,9 @@ typedef struct
int rxBufWriteIdx; ///< currect write index of receive buffer rxBuf
char rxBuf[LEN_RXBUF]; ///< receive buffer for ftp commands
char workingDir[MAX_PATH_LEN]; ///< current working directory (absolute path which is relative to the root-path of the user account)
ip_t remoteIp; ///< IP of connected ftp client
ip_t remoteIp; ///< IP of connected ftp client
//ip_t remoteFTPServerIp; ///< IP of the FTP Server from the clients perspective
port_t remoteFTPServerPassivePort; ///< Port of the FTP Server from the clients perspective related to Passive connection
port_t remotePort; ///< Port of connected ftp client for control connection
port_t remoteDataPort; ///< Port of connected ftp client for data connection
int passive; ///< TRUE, if passive-mode is activated via PSV command
@@ -127,7 +129,7 @@ typedef struct
extern int ftpOpenSession(socket_t ctrlSocket, ip_t remoteIp, port_t remotePort);
extern int ftpCloseSession(int id);
extern ftpSession_S* ftpGetSession(int id);
extern ftpSession_S* ftpGetSession(int id);
extern int ftpAuthSession(int id);
extern const char* ftpGetRealPath(int id, const char* path, int normalize);
extern int ftpChangeDir(int id, const char* path);
@@ -151,7 +153,7 @@ extern uint32_t ftpGetUnixTime(void);
extern char *ftpStrcpy(char *dest, const char *src);
extern void ftpArchInit(void);
extern void ftpArchInit();
extern void ftpArchCleanup(void);
extern int ftpGetLocalTime(ftpTime_S *t);
extern void* ftpOpenDir(const char* path);

View File

@@ -32,6 +32,8 @@
#define FTP_ACC_DIR 8
#define FTP_ACC_FULL (FTP_ACC_RD | FTP_ACC_WR | FTP_ACC_LS | FTP_ACC_DIR)
#include "ftpTypes.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -40,7 +42,7 @@ int ftpCreateAccount(const char* name, const char* passw, const char* root, int
int ftpStart(int portNumber);
int ftpShutdown(void);
void ftpExecute(void);
int ftpState(void);
int ftpState(void);
#ifdef __cplusplus
}

View File

@@ -4,7 +4,7 @@
*
* ftpTypes.h - global type definitions
*
* Definitions of fixed size integers an helper macros.
* Definitions of fixed size integers an helper macros.
*
*
* This program is free software: you can redistribute it and/or modify
@@ -59,5 +59,10 @@ typedef uint16_t port_t;
#ifndef TRUE
#define TRUE 1
#endif
ip_t (*ftpFindExternalFTPServerIp)(ip_t clientIp);
void (*ftpAddUPNPPortForward)(int internalPort, int externalPort);
void (*ftpRemoveUPNPPortForward)(int internalPort, int externalPort);
#endif