Changeset 82687 in vbox for trunk/include
- Timestamp:
- Jan 9, 2020 10:45:36 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/ftp.h
r82673 r82687 133 133 134 134 /** 135 * Structure for maintaining a FTP server client state. 136 */ 137 typedef struct RTFTPSERVERCLIENTSTATE 138 { 139 /** Timestamp (in ms) of last command issued by the client. */ 140 uint64_t tsLastCmdMs; 141 } RTFTPSERVERCLIENTSTATE; 142 /** Pointer to a FTP server client state. */ 143 typedef RTFTPSERVERCLIENTSTATE *PRTFTPSERVERCLIENTSTATE; 144 145 /** 146 * Structure for storing FTP server callback data. 147 */ 148 typedef struct RTFTPCALLBACKDATA 149 { 150 /** Pointer to the client state. */ 151 PRTFTPSERVERCLIENTSTATE pClient; 152 /** Saved user pointer. */ 153 void *pvUser; 154 /** Size (in bytes) of data at user pointer. */ 155 size_t cbUser; 156 } RTFTPCALLBACKDATA; 157 /** Pointer to FTP server callback data. */ 158 typedef RTFTPCALLBACKDATA *PRTFTPCALLBACKDATA; 159 160 /** 161 * Function callback table for the FTP server implementation. 162 * 163 * All callbacks are optional and therefore can be NULL. 164 */ 165 typedef struct RTFTPSERVERCALLBACKS 166 { 167 /** User pointer to data. Optional and can be NULL. */ 168 void *pvUser; 169 /** Size (in bytes) of user data pointing at. Optional and can be 0. */ 170 size_t cbUser; 171 DECLCALLBACKMEMBER(int, pfnOnUserConnect)(PRTFTPCALLBACKDATA pData, const char *pcszUser); 172 DECLCALLBACKMEMBER(int, pfnOnUserAuthenticate)(PRTFTPCALLBACKDATA pData, const char *pcszUser, const char *pcszPassword); 173 DECLCALLBACKMEMBER(int, pfnOnUserDisconnect)(PRTFTPCALLBACKDATA pData); 174 DECLCALLBACKMEMBER(int, pfnOnPathSetCurrent)(PRTFTPCALLBACKDATA pData, const char *pcszCWD); 175 DECLCALLBACKMEMBER(int, pfnOnPathGetCurrent)(PRTFTPCALLBACKDATA pData, char *pszPWD, size_t cbPWD); 176 DECLCALLBACKMEMBER(int, pfnOnList)(PRTFTPCALLBACKDATA pData, void **ppvData, size_t *pcbData); 177 } RTFTPSERVERCALLBACKS, *PRTFTPSERVERCALLBACKS; 178 /** Pointer to a FTP server callback data table. */ 179 typedef RTFTPSERVERCALLBACKS *PRTFTPSERVERCALLBACKS; 180 181 /** 135 182 * Creates a FTP server instance. 136 183 * … … 140 187 * If NULL or empty string the server is bound to all interfaces. 141 188 * @param uPort The port for creating a listening socket. 142 * @param p cszPathRoot Root path of the FTP server serving.189 * @param pCallbacks Callback table to use. 143 190 */ 144 191 RTR3DECL(int) RTFTPServerCreate(PRTFTPSERVER phFTPServer, const char *pcszAddress, uint16_t uPort, 145 const char *pcszPathRoot);192 PRTFTPSERVERCALLBACKS pCallbacks); 146 193 147 194 /**
Note:
See TracChangeset
for help on using the changeset viewer.