example: add sftp server example
This add some sftp APIs for building a sftpserver in a callback based method. This also provides a sftp server example based on the APIs added. It is a stand-alone program, which means it will handle the connection establishment and the request from client side. This simple program registers the handle function during initialization and dispatches the corresponding handler when different messages come. A statvfs_reply function is also added in sftpserver.c, which can be used when writing sftp server to support extended statvfs submessage.
For testing, this add the corresponding test case in tests/server, which test the sftp session establishment and basic sftp functions for a sftpserver.
Checklist
-
Commits have Signed-off-by:
with name/author being identical to the commit author -
Code modified for feature -
Test suite updated with functionality tests -
Test suite updated with negative tests -
Documentation updated
Reviewer's checklist:
-
Any issues marked for closing are addressed -
There is a test suite reasonably covering new functionality or modifications -
Function naming, parameters, return values, types, etc., are consistent and according to CONTRIBUTING.md -
This feature/change has adequate documentation added -
No obvious mistakes in the code
Edited by zeyu sheng