comparison session.h @ 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 703c7cdd2577
children 16379795f80b
comparison
equal deleted inserted replaced
1068:9a6395ddb1b6 1069:2fa71c3b2827
20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23 * SOFTWARE. */ 23 * SOFTWARE. */
24 24
25 #ifndef _SESSION_H_ 25 #ifndef DROPBEAR_SESSION_H_
26 #define _SESSION_H_ 26 #define DROPBEAR_SESSION_H_
27 27
28 #include "includes.h" 28 #include "includes.h"
29 #include "options.h" 29 #include "options.h"
30 #include "buffer.h" 30 #include "buffer.h"
31 #include "signkey.h" 31 #include "signkey.h"
36 #include "listener.h" 36 #include "listener.h"
37 #include "packet.h" 37 #include "packet.h"
38 #include "tcpfwd.h" 38 #include "tcpfwd.h"
39 #include "chansession.h" 39 #include "chansession.h"
40 #include "dbutil.h" 40 #include "dbutil.h"
41 #include "netio.h"
41 42
42 extern int sessinitdone; /* Is set to 0 somewhere */ 43 extern int sessinitdone; /* Is set to 0 somewhere */
43 extern int exitflag; 44 extern int exitflag;
44 45
45 void common_session_init(int sock_in, int sock_out); 46 void common_session_init(int sock_in, int sock_out);
46 void session_loop(); 47 void session_loop(void(*loophandler)()) ATTRIB_NORETURN;
47 void session_cleanup(); 48 void session_cleanup();
48 void send_session_identification(); 49 void send_session_identification();
49 void send_msg_ignore(); 50 void send_msg_ignore();
50 void ignore_recv_response(); 51 void ignore_recv_response();
51 52
53 54
54 const char* get_user_shell(); 55 const char* get_user_shell();
55 void fill_passwd(const char* username); 56 void fill_passwd(const char* username);
56 57
57 /* Server */ 58 /* Server */
58 void svr_session(int sock, int childpipe); 59 void svr_session(int sock, int childpipe) ATTRIB_NORETURN;
59 void svr_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN; 60 void svr_dropbear_exit(int exitcode, const char* format, va_list param) ATTRIB_NORETURN;
60 void svr_dropbear_log(int priority, const char* format, va_list param); 61 void svr_dropbear_log(int priority, const char* format, va_list param);
61 62
62 /* Client */ 63 /* Client */
63 void cli_session(int sock_in, int sock_out); 64 void cli_session(int sock_in, int sock_out, struct dropbear_progress_connection *progress) ATTRIB_NORETURN;
65 void cli_connected(int result, int sock, void* userdata, const char *errstring);
64 void cleantext(unsigned char* dirtytext); 66 void cleantext(unsigned char* dirtytext);
65 67
66 /* crypto parameters that are stored individually for transmit and receive */ 68 /* crypto parameters that are stored individually for transmit and receive */
67 struct key_context_directional { 69 struct key_context_directional {
68 const struct dropbear_cipher *algo_crypt; 70 const struct dropbear_cipher *algo_crypt;
122 buffer *writepayload; /* Unencrypted payload to write - this is used 124 buffer *writepayload; /* Unencrypted payload to write - this is used
123 throughout the code, as handlers fill out this 125 throughout the code, as handlers fill out this
124 buffer with the packet to send. */ 126 buffer with the packet to send. */
125 struct Queue writequeue; /* A queue of encrypted packets to send */ 127 struct Queue writequeue; /* A queue of encrypted packets to send */
126 buffer *readbuf; /* From the wire, decrypted in-place */ 128 buffer *readbuf; /* From the wire, decrypted in-place */
127 buffer *payload; /* Post-decompression, the actual SSH packet */ 129 buffer *payload; /* Post-decompression, the actual SSH packet.
130 May have extra data at the beginning, will be
131 passed to packet processing functions positioned past
132 that, see payload_beginning */
133 unsigned int payload_beginning;
128 unsigned int transseq, recvseq; /* Sequence IDs */ 134 unsigned int transseq, recvseq; /* Sequence IDs */
129 135
130 /* Packet-handling flags */ 136 /* Packet-handling flags */
131 const packettype * packettypes; /* Packet handler mappings for this 137 const packettype * packettypes; /* Packet handler mappings for this
132 session, see process-packet.c */ 138 session, see process-packet.c */
146 152
147 unsigned int lastpacket; /* What the last received packet type was */ 153 unsigned int lastpacket; /* What the last received packet type was */
148 154
149 int signal_pipe[2]; /* stores endpoints of a self-pipe used for 155 int signal_pipe[2]; /* stores endpoints of a self-pipe used for
150 race-free signal handling */ 156 race-free signal handling */
157
158 m_list conn_pending;
151 159
152 /* time of the last packet send/receive, for keepalive. Not real-world clock */ 160 /* time of the last packet send/receive, for keepalive. Not real-world clock */
153 time_t last_packet_time_keepalive_sent; 161 time_t last_packet_time_keepalive_sent;
154 time_t last_packet_time_keepalive_recv; 162 time_t last_packet_time_keepalive_recv;
155 time_t last_packet_time_any_sent; 163 time_t last_packet_time_any_sent;
312 320
313 #ifdef DROPBEAR_CLIENT 321 #ifdef DROPBEAR_CLIENT
314 extern struct clientsession cli_ses; 322 extern struct clientsession cli_ses;
315 #endif /* DROPBEAR_CLIENT */ 323 #endif /* DROPBEAR_CLIENT */
316 324
317 #endif /* _SESSION_H_ */ 325 #endif /* DROPBEAR_SESSION_H_ */