152 lines
5.7 KiB
C
152 lines
5.7 KiB
C
/*
|
|
******************************************************************************
|
|
* HEADER FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipssh_sftp.h,v $ $Revision: 1.9.48.3 $
|
|
* $Source: /home/interpeak/CVSRoot/ipssh/src/ipssh_sftp.h,v $
|
|
* $Author: jren $ $Date: 2017-12-13 02:40:08 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Roger Boden <roger@interpeak.se>
|
|
******************************************************************************
|
|
*/
|
|
#ifndef ipssh_sftp_h
|
|
#define ipssh_sftp_h
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
|
|
#include <ipssh_sftp_clt.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/* Packet types, sftp protocol */
|
|
#define IPSSH_FXP_INIT 1
|
|
#define IPSSH_FXP_VERSION 2
|
|
#define IPSSH_FXP_OPEN 3
|
|
#define IPSSH_FXP_CLOSE 4
|
|
#define IPSSH_FXP_READ 5
|
|
#define IPSSH_FXP_WRITE 6
|
|
#define IPSSH_FXP_LSTAT 7
|
|
#define IPSSH_FXP_FSTAT 8
|
|
#define IPSSH_FXP_SETSTAT 9
|
|
#define IPSSH_FXP_FSETSTAT 10
|
|
#define IPSSH_FXP_OPENDIR 11
|
|
#define IPSSH_FXP_READDIR 12
|
|
#define IPSSH_FXP_REMOVE 13
|
|
#define IPSSH_FXP_MKDIR 14
|
|
#define IPSSH_FXP_RMDIR 15
|
|
#define IPSSH_FXP_REALPATH 16
|
|
#define IPSSH_FXP_STAT 17
|
|
#define IPSSH_FXP_RENAME 18
|
|
#define IPSSH_FXP_READLINK 19
|
|
#define IPSSH_FXP_SYMLINK 20
|
|
#define IPSSH_FXP_STATUS 101
|
|
#define IPSSH_FXP_HANDLE 102
|
|
#define IPSSH_FXP_DATA 103
|
|
#define IPSSH_FXP_NAME 104
|
|
#define IPSSH_FXP_ATTRS 105
|
|
#define IPSSH_FXP_EXTENDED 200
|
|
#define IPSSH_FXP_EXTENDED_REPLY 201
|
|
/* The following values are defined by Wind River */
|
|
#define IPSSH_FXP_ACCESS 254
|
|
#define IPSSH_FXP_MAX 255
|
|
|
|
|
|
|
|
#define IPSSH_FILEXFER_ATTR_SIZE 0x00000001
|
|
#define IPSSH_FILEXFER_ATTR_UIDGID 0x00000002
|
|
#define IPSSH_FILEXFER_ATTR_PERMISSIONS 0x00000004
|
|
#define IPSSH_FILEXFER_ATTR_ACMODTIME 0x00000008
|
|
#define IPSSH_FILEXFER_ATTR_EXTENDED 0x80000000
|
|
|
|
#define IPSSH_FX_OK 0
|
|
#define IPSSH_FX_EOF 1
|
|
#define IPSSH_FX_NO_SUCH_FILE 2
|
|
#define IPSSH_FX_PERMISSION_DENIED 3
|
|
#define IPSSH_FX_FAILURE 4
|
|
#define IPSSH_FX_BAD_MESSAGE 5
|
|
#define IPSSH_FX_NO_CONNECTION 6
|
|
#define IPSSH_FX_CONNECTION_LOST 7
|
|
#define IPSSH_FX_OP_UNSUPPORTED 8
|
|
#define IPSSH_FX_INVALID_HANDLE 9
|
|
#define IPSSH_FX_NO_SUCH_PATH 10
|
|
#define IPSSH_FX_FILE_ALREADY_EXISTS 11
|
|
#define IPSSH_FX_WRITE_PROTECT 12
|
|
#define IPSSH_FX_NO_MEDIA 13
|
|
#define IPSSH_FX_NO_SPACE_ON_FILESYSTEM 14
|
|
#define IPSSH_FX_QUOTA_EXCEEDED 15
|
|
#define IPSSH_FX_UNKNOWN_PRINCIPLE 16
|
|
#define IPSSH_FX_LOCK_CONFlICT 17
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
IP_GLOBAL Ip_err ipssh_sftp_init(Ipssh_channel* channel);
|
|
IP_GLOBAL Ip_err ipssh_sftp_data_setup(Ipssh_conn* ssh_conn);
|
|
IP_GLOBAL void ipssh_sftp_data_free(Ipssh_conn* ssh_conn);
|
|
IP_GLOBAL Ipssh_pkt_handler ipssh_sftp_get_handler(Ip_s32 pkt_type);
|
|
IP_GLOBAL Ip_err ipssh_channel_data_sftp_handler(Ipssh_channel* channel, Ipcom_buffer* msg);
|
|
IP_GLOBAL void ipssh_sftp_cleanup(Ipssh_channel* channel);
|
|
IP_GLOBAL Ip_err ipssh_pack_attr(Ipcom_buffer* pkt, struct Ip_stat* buf, Ip_u32 flags);
|
|
IP_GLOBAL Ip_err ipssh_unpack_attr(Ipcom_buffer* buf, Ip_u32 attr_flags, struct Ip_stat* file_attr);
|
|
IP_GLOBAL Ip_mode_t ipssh_mode_ipcom2ssh(Ip_mode_t mode);
|
|
IP_GLOBAL Ip_mode_t ipssh_mode_ssh2ipcom(Ip_mode_t mode);
|
|
|
|
|
|
|
|
IP_GLOBAL Ip_err ipssh_sftp_srv_pkt_dispatch(Ipssh_channel* channel, Ipcom_buffer* pkt);
|
|
IP_GLOBAL Ip_err ipssh_sftp_clt_pkt_dispatch(Ipssh_channel* channel, Ipcom_buffer* pkt);
|
|
|
|
IP_GLOBAL void ipssh_channel_sftp_init(Ipssh_channel* channel, int ch_type);
|
|
|
|
|
|
IP_GLOBAL Ip_err ipssh_send_fxp_msg(Ipssh_channel* channel, Ipcom_buffer* msg);
|
|
IP_GLOBAL Ip_err ipssh_send_fxp_status(Ipssh_channel* channel, Ip_u32 req_id, Ip_u32 status);
|
|
|
|
IP_GLOBAL Ip_err ipssh_sftp_subsystem_init_cb(Ipssh_channel* channel, Ip_fd* sock);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|