comparison cli-session.c @ 1069:2fa71c3b2827 pam

merge pam branch up to date
author Matt Johnston <matt@ucc.asn.au>
date Mon, 16 Mar 2015 21:34:05 +0800
parents 73ea0dce9a57 01eea88963f3
children 16379795f80b
comparison
equal deleted inserted replaced
1068:9a6395ddb1b6 1069:2fa71c3b2827
35 #include "service.h" 35 #include "service.h"
36 #include "runopts.h" 36 #include "runopts.h"
37 #include "chansession.h" 37 #include "chansession.h"
38 #include "agentfwd.h" 38 #include "agentfwd.h"
39 #include "crypto_desc.h" 39 #include "crypto_desc.h"
40 40 #include "netio.h"
41 static void cli_remoteclosed(); 41
42 static void cli_remoteclosed() ATTRIB_NORETURN;
42 static void cli_sessionloop(); 43 static void cli_sessionloop();
43 static void cli_session_init(); 44 static void cli_session_init();
44 static void cli_finished(); 45 static void cli_finished() ATTRIB_NORETURN;
45 static void recv_msg_service_accept(void); 46 static void recv_msg_service_accept(void);
46 static void cli_session_cleanup(void); 47 static void cli_session_cleanup(void);
47 static void recv_msg_global_request_cli(void); 48 static void recv_msg_global_request_cli(void);
48 49
49 struct clientsession cli_ses; /* GLOBAL */ 50 struct clientsession cli_ses; /* GLOBAL */
91 &cli_chan_agent, 92 &cli_chan_agent,
92 #endif 93 #endif
93 NULL /* Null termination */ 94 NULL /* Null termination */
94 }; 95 };
95 96
96 void cli_session(int sock_in, int sock_out) { 97 void cli_connected(int result, int sock, void* userdata, const char *errstring)
98 {
99 struct sshsession *myses = userdata;
100 if (result == DROPBEAR_FAILURE) {
101 dropbear_exit("Connect failed: %s", errstring);
102 }
103 myses->sock_in = myses->sock_out = sock;
104 update_channel_prio();
105 }
106
107 void cli_session(int sock_in, int sock_out, struct dropbear_progress_connection *progress) {
97 108
98 common_session_init(sock_in, sock_out); 109 common_session_init(sock_in, sock_out);
110
111 if (progress) {
112 connect_set_writequeue(progress, &ses.writequeue);
113 }
99 114
100 chaninitialise(cli_chantypes); 115 chaninitialise(cli_chantypes);
101 116
102 /* Set up cli_ses vars */ 117 /* Set up cli_ses vars */
103 cli_session_init(); 118 cli_session_init();
119
104 120
105 /* Ready to go */ 121 /* Ready to go */
106 sessinitdone = 1; 122 sessinitdone = 1;
107 123
108 /* Exchange identification */ 124 /* Exchange identification */