|
|
@ -30,11 +30,13 @@
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
|
|
|
static enum SCP_CLIENT_STATES_E _scp_v1c_check_response(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
|
|
|
static enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
_scp_v1c_check_response(struct SCP_CONNECTION* c, struct SCP_SESSION* s);
|
|
|
|
|
|
|
|
|
|
|
|
/* client API */
|
|
|
|
/* client API */
|
|
|
|
/* 001 */
|
|
|
|
/* 001 */
|
|
|
|
enum SCP_CLIENT_STATES_E scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tui8 sz;
|
|
|
|
tui8 sz;
|
|
|
|
tui32 size;
|
|
|
|
tui32 size;
|
|
|
@ -42,7 +44,8 @@ enum SCP_CLIENT_STATES_E scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SE
|
|
|
|
init_stream(c->out_s, c->out_s->size);
|
|
|
|
init_stream(c->out_s, c->out_s->size);
|
|
|
|
init_stream(c->in_s, c->in_s->size);
|
|
|
|
init_stream(c->in_s, c->in_s->size);
|
|
|
|
|
|
|
|
|
|
|
|
size=19+17+4+ g_strlen(s->hostname) + g_strlen(s->username) + g_strlen(s->password);
|
|
|
|
size = 19 + 17 + 4 + g_strlen(s->hostname) + g_strlen(s->username) +
|
|
|
|
|
|
|
|
g_strlen(s->password);
|
|
|
|
if (s->addr_type == SCP_ADDRESS_TYPE_IPV4)
|
|
|
|
if (s->addr_type == SCP_ADDRESS_TYPE_IPV4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
size = size + 4;
|
|
|
|
size = size + 4;
|
|
|
@ -98,7 +101,8 @@ enum SCP_CLIENT_STATES_E scp_v1c_connect(struct SCP_CONNECTION* c, struct SCP_SE
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 004 */
|
|
|
|
/* 004 */
|
|
|
|
enum SCP_CLIENT_STATES_E scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
scp_v1c_resend_credentials(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tui8 sz;
|
|
|
|
tui8 sz;
|
|
|
|
tui32 size;
|
|
|
|
tui32 size;
|
|
|
@ -132,12 +136,17 @@ enum SCP_CLIENT_STATES_E scp_v1c_resend_credentials(struct SCP_CONNECTION* c, st
|
|
|
|
return _scp_v1c_check_response(c, s);
|
|
|
|
return _scp_v1c_check_response(c, s);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* 021 */ enum SCP_CLIENT_STATES_E scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass);
|
|
|
|
/* 021 */
|
|
|
|
/* 022 */ enum SCP_CLIENT_STATES_E scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c);
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
scp_v1c_pwd_change(struct SCP_CONNECTION* c, char* newpass);
|
|
|
|
|
|
|
|
/* 022 */
|
|
|
|
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
scp_v1c_pwd_change_cancel(struct SCP_CONNECTION* c);
|
|
|
|
|
|
|
|
|
|
|
|
/* 041 */
|
|
|
|
/* 041 */
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount, struct SCP_DISCONNECTED_SESSION** s)
|
|
|
|
scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount,
|
|
|
|
|
|
|
|
struct SCP_DISCONNECTED_SESSION** s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tui32 version = 1;
|
|
|
|
tui32 version = 1;
|
|
|
|
tui32 size = 12;
|
|
|
|
tui32 size = 12;
|
|
|
@ -247,7 +256,8 @@ scp_v1c_get_session_list(struct SCP_CONNECTION* c, int* scount, struct SCP_DISCO
|
|
|
|
|
|
|
|
|
|
|
|
/* 043 */
|
|
|
|
/* 043 */
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
enum SCP_CLIENT_STATES_E
|
|
|
|
scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s, SCP_SID sid)
|
|
|
|
scp_v1c_select_session(struct SCP_CONNECTION* c, struct SCP_SESSION* s,
|
|
|
|
|
|
|
|
SCP_SID sid)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tui32 version = 1;
|
|
|
|
tui32 version = 1;
|
|
|
|
tui32 size = 16;
|
|
|
|
tui32 size = 16;
|
|
|
@ -338,7 +348,8 @@ scp_v1c_select_session_cancel(struct SCP_CONNECTION* c)
|
|
|
|
return SCP_CLIENT_STATE_END;
|
|
|
|
return SCP_CLIENT_STATE_END;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static enum SCP_CLIENT_STATES_E _scp_v1c_check_response(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
static enum SCP_CLIENT_STATES_E
|
|
|
|
|
|
|
|
_scp_v1c_check_response(struct SCP_CONNECTION* c, struct SCP_SESSION* s)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tui32 version;
|
|
|
|
tui32 version;
|
|
|
|
tui32 size;
|
|
|
|
tui32 size;
|
|
|
@ -445,4 +456,3 @@ static enum SCP_CLIENT_STATES_E _scp_v1c_check_response(struct SCP_CONNECTION* c
|
|
|
|
|
|
|
|
|
|
|
|
return SCP_CLIENT_STATE_SEQUENCE_ERR;
|
|
|
|
return SCP_CLIENT_STATE_SEQUENCE_ERR;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|