Lines Matching refs:sshc

142   struct ssh_conn *sshc = &conn->proto.sshc;  in state()  local
211 if(sshc->state != nowstate) { in state()
213 (void *)sshc, names[sshc->state], names[nowstate]); in state()
217 sshc->state = nowstate; in state()
253 struct ssh_conn *sshc = &conn->proto.sshc; in wsftp_send() local
259 offset[0] = (word32)sshc->offset & 0xFFFFFFFF; in wsftp_send()
260 offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF; in wsftp_send()
262 rc = wolfSSH_SFTP_SendWritePacket(sshc->ssh_session, sshc->handle, in wsftp_send()
263 sshc->handleSz, in wsftp_send()
268 rc = wolfSSH_get_error(sshc->ssh_session); in wsftp_send()
285 len, sshc->offset); in wsftp_send()
286 sshc->offset += len; in wsftp_send()
299 struct ssh_conn *sshc = &conn->proto.sshc; in wsftp_recv() local
303 offset[0] = (word32)sshc->offset & 0xFFFFFFFF; in wsftp_recv()
304 offset[1] = (word32)(sshc->offset >> 32) & 0xFFFFFFFF; in wsftp_recv()
306 rc = wolfSSH_SFTP_SendReadPacket(sshc->ssh_session, sshc->handle, in wsftp_recv()
307 sshc->handleSz, in wsftp_recv()
311 rc = wolfSSH_get_error(sshc->ssh_session); in wsftp_recv()
329 sshc->offset += len; in wsftp_recv()
369 struct ssh_conn *sshc; in wssh_connect() local
389 sshc = &conn->proto.sshc; in wssh_connect()
390 sshc->ctx = wolfSSH_CTX_new(WOLFSSH_ENDPOINT_CLIENT, NULL); in wssh_connect()
391 if(!sshc->ctx) { in wssh_connect()
396 sshc->ssh_session = wolfSSH_new(sshc->ctx); in wssh_connect()
397 if(!sshc->ssh_session) { in wssh_connect()
402 rc = wolfSSH_SetUsername(sshc->ssh_session, conn->user); in wssh_connect()
409 wolfSSH_SetUserAuth(sshc->ctx, userauth); in wssh_connect()
410 wolfSSH_SetUserAuthCtx(sshc->ssh_session, data); in wssh_connect()
412 rc = wolfSSH_set_fd(sshc->ssh_session, (int)sock); in wssh_connect()
430 wolfSSH_free(sshc->ssh_session); in wssh_connect()
431 wolfSSH_CTX_free(sshc->ctx); in wssh_connect()
446 struct ssh_conn *sshc = &conn->proto.sshc; in wssh_statemach_act() local
453 switch(sshc->state) { in wssh_statemach_act()
459 rc = wolfSSH_connect(sshc->ssh_session); in wssh_statemach_act()
461 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
483 rc = wolfSSH_SFTP_connect(sshc->ssh_session); in wssh_statemach_act()
485 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
506 name = wolfSSH_SFTP_RealPath(sshc->ssh_session, (char *)"."); in wssh_statemach_act()
507 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
519 sshc->homedir = Curl_memdup0(name->fName, name->fSz); in wssh_statemach_act()
520 if(!sshc->homedir) in wssh_statemach_act()
521 sshc->actualcode = CURLE_OUT_OF_MEMORY; in wssh_statemach_act()
530 result = Curl_getworkingpath(data, sshc->homedir, &sftp_scp->path); in wssh_statemach_act()
532 sshc->actualcode = result; in wssh_statemach_act()
539 sshc->quote_item = data->set.quote; in wssh_statemach_act()
570 rc = wolfSSH_SFTP_STAT(sshc->ssh_session, sftp_scp->path, in wssh_statemach_act()
601 sshc->handleSz = sizeof(sshc->handle); in wssh_statemach_act()
602 rc = wolfSSH_SFTP_Open(sshc->ssh_session, sftp_scp->path, in wssh_statemach_act()
604 sshc->handle, &sshc->handleSz); in wssh_statemach_act()
606 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
677 sshc->offset += data->state.resume_from; in wssh_statemach_act()
691 sshc->actualcode = result; in wssh_statemach_act()
696 sshc->orig_waitfor = data->req.keepon; in wssh_statemach_act()
713 sshc->handleSz = sizeof(sshc->handle); in wssh_statemach_act()
714 rc = wolfSSH_SFTP_Open(sshc->ssh_session, sftp_scp->path, in wssh_statemach_act()
716 sshc->handle, &sshc->handleSz); in wssh_statemach_act()
718 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
742 rc = wolfSSH_SFTP_STAT(sshc->ssh_session, sftp_scp->path, &attrs); in wssh_statemach_act()
744 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
803 sshc->actualcode = result; in wssh_statemach_act()
811 if(sshc->handleSz) in wssh_statemach_act()
812 rc = wolfSSH_SFTP_Close(sshc->ssh_session, sshc->handle, in wssh_statemach_act()
813 sshc->handleSz); in wssh_statemach_act()
844 name = wolfSSH_SFTP_LS(sshc->ssh_session, sftp_scp->path); in wssh_statemach_act()
846 rc = wolfSSH_get_error(sshc->ssh_session); in wssh_statemach_act()
869 sshc->actualcode = CURLE_OUT_OF_MEMORY; in wssh_statemach_act()
876 sshc->actualcode = result; in wssh_statemach_act()
889 Curl_safefree(sshc->homedir); in wssh_statemach_act()
890 wolfSSH_free(sshc->ssh_session); in wssh_statemach_act()
891 wolfSSH_CTX_free(sshc->ctx); in wssh_statemach_act()
897 } while(!rc && (sshc->state != SSH_STOP)); in wssh_statemach_act()
905 struct ssh_conn *sshc = &conn->proto.sshc; in wssh_multi_statemach() local
911 *done = (sshc->state == SSH_STOP); in wssh_multi_statemach()
967 struct ssh_conn *sshc = &conn->proto.sshc; in wssh_do() local
971 sshc->actualcode = CURLE_OK; /* reset error code */ in wssh_do()
972 sshc->secondCreateDirs = 0; /* reset the create dir attempt state in wssh_do()
992 struct ssh_conn *sshc = &conn->proto.sshc; in wssh_block_statemach() local
995 while((sshc->state != SSH_STOP) && !result) { in wssh_block_statemach()
1124 if(conn->proto.sshc.ssh_session) { in wsftp_disconnect()