mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-27 13:21:11 +03:00
added ssh_scp_request_new,ssh_scp_request_struct
This commit is contained in:
@@ -120,6 +120,7 @@ typedef struct ssh_agent_struct* ssh_agent;
|
||||
typedef struct ssh_session_struct* ssh_session;
|
||||
typedef struct ssh_kbdint_struct* ssh_kbdint;
|
||||
typedef struct ssh_scp_struct* ssh_scp;
|
||||
typedef struct ssh_scp_request_struct* ssh_scp_request;
|
||||
|
||||
/* Socket type */
|
||||
#ifdef _WIN32
|
||||
@@ -467,6 +468,12 @@ enum {
|
||||
SSH_SCP_READ
|
||||
};
|
||||
|
||||
enum ssh_scp_request_types {
|
||||
/** A new directory is going to be pulled */
|
||||
SSH_SCP_REQUEST_NEWDIR,
|
||||
/** A new file is going to be pulled */
|
||||
SSH_SCP_REQUEST_NEWFILE
|
||||
};
|
||||
LIBSSH_API ssh_scp ssh_scp_new(ssh_session session, int mode, const char *location);
|
||||
LIBSSH_API int ssh_scp_init(ssh_scp scp);
|
||||
LIBSSH_API int ssh_scp_close(ssh_scp scp);
|
||||
|
||||
@@ -359,6 +359,7 @@ enum ssh_scp_states {
|
||||
SSH_SCP_READ_READING, //File is opened and reading
|
||||
SSH_SCP_ERROR //Something bad happened
|
||||
};
|
||||
|
||||
struct ssh_scp_struct {
|
||||
ssh_session session;
|
||||
int mode;
|
||||
@@ -369,6 +370,15 @@ struct ssh_scp_struct {
|
||||
size_t processed;
|
||||
};
|
||||
|
||||
struct ssh_scp_request_struct {
|
||||
ssh_scp scp;
|
||||
enum ssh_scp_request_types type;
|
||||
char *name;
|
||||
char *mode;
|
||||
size_t size;
|
||||
int acked;
|
||||
};
|
||||
|
||||
struct ssh_message;
|
||||
|
||||
struct ssh_session_struct {
|
||||
@@ -857,6 +867,10 @@ int match_hostname(const char *host, const char *pattern, unsigned int len);
|
||||
void message_handle(SSH_SESSION *session, uint32_t type);
|
||||
int ssh_execute_message_callbacks(SSH_SESSION *session);
|
||||
|
||||
/* scp.c */
|
||||
|
||||
ssh_scp_request ssh_scp_request_new(void);
|
||||
|
||||
/* log.c */
|
||||
|
||||
#ifndef __FUNCTION__
|
||||
|
||||
@@ -266,3 +266,12 @@ int ssh_scp_write(ssh_scp scp, const void *buffer, size_t len){
|
||||
}
|
||||
return SSH_OK;
|
||||
}
|
||||
|
||||
ssh_scp_request ssh_scp_request_new(void){
|
||||
ssh_scp_request r=malloc(sizeof(struct ssh_scp_request_struct));
|
||||
if(r==NULL)
|
||||
return NULL;
|
||||
ZERO_STRUCTP(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user