Presentation is loading. Please wait.

Presentation is loading. Please wait.

FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls.

Similar presentations


Presentation on theme: "FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls."— Presentation transcript:

1 FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls

2 Integrating an FTP Server Register Callback Routines For… RETRieve STORe LIST CWD RMDir DELEte MKDir others Application Entry FSInitialize(int numusers) FSStartServer(void)

3 FTP Server Sample Code #include fservapi.h

4 Registering Command Callbacks int FSRegisterRETR (int (*app_RETRp)(char *, unsigned long)); int FSRegisterSTOR (int (*app_STORp)(char *, int, char *, unsigned long)); int FSRegisterSYST (int (*app_SYSTp)(char *, char *, unsigned long)); int FSRegisterLIST (int (*app_LISTp)(char *, unsigned long)); int FSRegisterNLST (int (*app_NLSTp)(char *, unsigned long)); int FSRegisterCWD (int (*app_CWDp)(char *, unsigned long)); int FSRegisterMKD (int (*app_MKDp)(char *, unsigned long)); int FSRegisterRMD (int (*app_RMDp)(char *, unsigned long)); int FSRegisterDELE (int (*app_DELEp)(char *, unsigned long));

5 Registering Other Callbacks int FSRegisterControlClose (int (*app_cResetp)(char *, unsigned long));// called when control connection terminated int FSRegisterDataClose (int (*app_dResetp)(char *, unsigned long));// called when data connection terminated

6 Other FTP Server API Calls int FSHandleToSocket(unsigned long handle); // identifies socket used for the request void FSProperties (char *tnamep, int priority, int sysstack, int usrstack, int mode, int flags);// allows changing task properties – not recommended int FSSequenceNumber (unsigned long handle);// returns the sequence number of the data socket char *FSUserName (unsigned long handle);// points to current session user name int FSTimeout(unsigned long);// changes the inactivity timeout

7 FTP Server Summary Register handlers for each FTP command Identify logged on user with FSUserName Clean up by registering callbacks for control and data socket close events

8 Net+Os v6.0 Enhancements File System

9 FTP Server (File System) Allow FTP client to login and access the file system Store files Retrieve files Delete files Rename files Display the current working directory (pwd) Change the current working directory –To change to different volume, use slash ‘/’ before volume’s name List a directory (dir or ls) Remove a directory

10 File system permission Depends on the user’s access value defined during login User with multiple group ID –Use the same ID group as directory where a file/directory was created –Use smaller group ID when creating a file/directory in ROOT directory (group 1-8)

11 FTP Server (File System) FSInstallFileSystem –Setup the File System for the FTP Server –Setup the directory when FTP client logs in.


Download ppt "FTP Server API Implementing the FTP Server Registering FTP Command Callbacks Data and Control Port Close Callbacks Other Server Calls."

Similar presentations


Ads by Google