#include "buffer.h"Go to the source code of this file.
|
|
Definition at line 146 of file channels.h. Referenced by chan_is_dead(), chan_rcvd_close2(), channel_check_window(), and channel_output_poll(). |
|
|
Definition at line 145 of file channels.h. Referenced by chan_ibuf_empty(), chan_is_dead(), chan_send_close2(), channel_check_window(), and channel_output_poll(). |
|
|
Definition at line 148 of file channels.h. Referenced by chan_rcvd_eof2(), and channel_input_extended_data(). |
|
|
Definition at line 147 of file channels.h. Referenced by chan_send_eof2(), channel_output_poll(), and channel_pre_open(). |
|
|
Definition at line 121 of file channels.h. Referenced by session_set_fds(). |
|
|
Definition at line 122 of file channels.h. Referenced by channel_handle_efd(), channel_output_poll(), channel_pre_open(), and session_set_fds(). |
|
|
Definition at line 123 of file channels.h. Referenced by chan_is_dead(), channel_handle_efd(), channel_input_extended_data(), channel_pre_open(), client_process_control(), and ssh_session2_open(). |
|
|
Definition at line 137 of file channels.h. Referenced by chan_ibuf_empty(), chan_is_dead(), chan_rcvd_close2(), chan_rcvd_oclose1(), chan_send_close2(), and chan_set_istate(). |
|
|
Definition at line 134 of file channels.h. Referenced by chan_rcvd_close2(), chan_rcvd_oclose1(), chan_read_failed(), chan_send_ieof1(), channel_input_ieof(), channel_new(), channel_output_poll(), and channel_pre_open(). |
|
|
Definition at line 135 of file channels.h. Referenced by chan_ibuf_empty(), chan_rcvd_close2(), chan_rcvd_oclose1(), chan_read_failed(), chan_send_eof2(), chan_send_ieof1(), channel_input_ieof(), and channel_output_poll(). |
|
|
Definition at line 136 of file channels.h. Referenced by chan_ibuf_empty(), and chan_rcvd_oclose1(). |
|
|
Definition at line 143 of file channels.h. Referenced by chan_is_dead(), chan_obuf_empty(), chan_rcvd_close2(), chan_rcvd_ieof1(), chan_send_close2(), chan_set_ostate(), chan_write_failed1(), chan_write_failed2(), session_close_x11(), and session_exit_message(). |
|
|
Definition at line 140 of file channels.h. Referenced by chan_rcvd_close2(), chan_rcvd_eof2(), chan_rcvd_ieof1(), chan_send_oclose1(), chan_write_failed1(), chan_write_failed2(), channel_input_data(), channel_new(), and channel_pre_open(). |
|
|
Definition at line 141 of file channels.h. Referenced by chan_obuf_empty(), chan_rcvd_close2(), chan_rcvd_eof2(), chan_rcvd_ieof(), chan_rcvd_ieof1(), chan_send_oclose1(), chan_write_failed1(), chan_write_failed2(), and channel_pre_open(). |
|
|
Definition at line 142 of file channels.h. Referenced by chan_rcvd_ieof1(), and chan_write_failed1(). |
|
|
Definition at line 150 of file channels.h. Referenced by channel_handle_efd(), channel_handle_rfd(), and channel_pre_open(). |
|
|
Definition at line 126 of file channels.h. Referenced by client_process_control(), server_request_session(), and ssh_session2_open(). |
|
|
Definition at line 127 of file channels.h. Referenced by client_process_control(), session_set_fds(), and ssh_session2_open(). |
|
|
Definition at line 128 of file channels.h. Referenced by channel_setup_fwd_listener(), server_request_direct_tcpip(), server_request_tun(), and ssh_session2_setup(). |
|
|
Definition at line 129 of file channels.h. Referenced by channel_setup_fwd_listener(), client_request_agent(), client_request_forwarded_tcpip(), client_request_x11(), server_request_direct_tcpip(), server_request_tun(), and ssh_session2_setup(). |
|
|
Definition at line 130 of file channels.h. Referenced by auth_input_request_forwarding(), client_request_x11(), and x11_create_display_inet(). |
|
|
Definition at line 131 of file channels.h. Referenced by auth_input_request_forwarding(), client_request_agent(), and x11_create_display_inet(). |
|
|
Value: (compat20 && c->extended_usage == CHAN_EXTENDED_READ && \ (c->efd != -1 || \ buffer_len(&c->extended) > 0)) Definition at line 153 of file channels.h. Referenced by channel_output_poll(). |
|
|
Value: (compat20 && c->extended_usage == CHAN_EXTENDED_WRITE && \ c->efd != -1 && (!(c->flags & (CHAN_EOF_RCVD|CHAN_CLOSE_RCVD)) || \ buffer_len(&c->extended) > 0)) Definition at line 157 of file channels.h. Referenced by chan_rcvd_ieof(), and channel_pre_open(). |
|
|
Definition at line 49 of file channels.h. Referenced by auth_input_request_forwarding(), channel_find_open(), channel_handler_init_13(), channel_handler_init_15(), channel_handler_init_20(), channel_open_message(), channel_still_open(), and channel_stop_listening(). |
|
|
Definition at line 48 of file channels.h. Referenced by channel_find_open(), channel_input_close(), channel_input_close_confirmation(), channel_open_message(), channel_pre_input_draining(), channel_pre_x11_open_13(), and channel_still_open(). |
|
|
|
Definition at line 56 of file channels.h. Referenced by channel_find_open(), channel_handler_init_13(), channel_handler_init_15(), channel_handler_init_20(), channel_lookup(), channel_open_message(), channel_post_port_listener(), and channel_still_open(). |
|
|
Definition at line 51 of file channels.h. Referenced by channel_find_open(), channel_handle_rfd(), channel_handle_wfd(), channel_handler_init_13(), channel_lookup(), channel_open_message(), channel_output_poll(), and channel_still_open(). |
|
|
Definition at line 53 of file channels.h. Referenced by chan_rcvd_close2(), chan_shutdown_read(), chan_shutdown_write(), channel_find_open(), channel_lookup(), channel_open_message(), channel_set_fds(), channel_still_open(), server_input_channel_req(), server_request_session(), and session_input_channel_req(). |
|
|
Definition at line 58 of file channels.h. Referenced by channel_handler_init(). |
|
|
|
|
Definition at line 52 of file channels.h. Referenced by channel_find_open(), channel_handler_init_13(), channel_input_close(), channel_lookup(), channel_open_message(), and channel_still_open(). |
|
|
Definition at line 60 of file channels.h. Referenced by channel_setup_fwd_listener(). |
|
|
Definition at line 45 of file channels.h. Referenced by channel_find_open(), channel_handler_init_13(), channel_handler_init_15(), channel_handler_init_20(), channel_open_message(), channel_setup_fwd_listener(), channel_setup_local_fwd_listener(), channel_still_open(), and channel_stop_listening(). |
|
|
Definition at line 54 of file channels.h. Referenced by channel_cancel_rport_listener(), channel_find_open(), channel_handler_init_20(), channel_open_message(), channel_post_port_listener(), channel_setup_fwd_listener(), channel_setup_remote_fwd_listener(), channel_still_open(), and channel_stop_listening(). |
|
|
Definition at line 44 of file channels.h. Referenced by channel_find_open(), channel_handler_init_13(), channel_handler_init_15(), channel_handler_init_20(), channel_open_message(), channel_still_open(), channel_stop_listening(), and x11_create_display_inet(). |
|
|
Definition at line 50 of file channels.h. Referenced by channel_find_open(), channel_handler_init_13(), channel_handler_init_15(), channel_handler_init_20(), channel_input_data(), channel_lookup(), channel_open_message(), channel_still_open(), client_request_x11(), and x11_input_open(). |
|
|
Definition at line 57 of file channels.h. Referenced by chan_is_dead(), chan_mark_dead(), channel_find_open(), channel_open_message(), and channel_still_open(). |
|
|
Definition at line 63 of file channels.h. |
|
|
Definition at line 65 of file channels.h. |
|
|
Definition at line 66 of file channels.h. |
|
|
Definition at line 67 of file channels.h. |
|
|
Definition at line 3130 of file channels.c. References packet_send(), packet_start(), packet_write_wait(), and SSH_CMSG_AGENT_REQUEST_FORWARDING. Referenced by ssh_session(). 03131 { 03132 packet_start(SSH_CMSG_AGENT_REQUEST_FORWARDING); 03133 packet_send(); 03134 packet_write_wait(); 03135 }
|
|
|
Definition at line 144 of file nchan.c. References buffer_len(), CHAN_CLOSE_SENT, CHAN_INPUT_CLOSED, CHAN_INPUT_WAIT_DRAIN, CHAN_INPUT_WAIT_OCLOSE, chan_send_eof2(), chan_send_ieof1(), chan_set_istate(), compat20, debug2(), error(), Channel::flags, Channel::input, Channel::istate, and Channel::self. Referenced by channel_input_ieof(), channel_output_poll(), and channel_pre_x11_open(). 00145 { 00146 debug2("channel %d: ibuf empty", c->self); 00147 if (buffer_len(&c->input)) { 00148 error("channel %d: chan_ibuf_empty for non empty buffer", 00149 c->self); 00150 return; 00151 } 00152 switch (c->istate) { 00153 case CHAN_INPUT_WAIT_DRAIN: 00154 if (compat20) { 00155 if (!(c->flags & CHAN_CLOSE_SENT)) 00156 chan_send_eof2(c); 00157 chan_set_istate(c, CHAN_INPUT_CLOSED); 00158 } else { 00159 chan_send_ieof1(c); 00160 chan_set_istate(c, CHAN_INPUT_WAIT_OCLOSE); 00161 } 00162 break; 00163 default: 00164 error("channel %d: chan_ibuf_empty for istate %d", 00165 c->self, c->istate); 00166 break; 00167 } 00168 }
|
|
||||||||||||
|
Definition at line 398 of file nchan.c. References buffer_len(), CHAN_CLOSE_RCVD, CHAN_CLOSE_SENT, CHAN_EXTENDED_WRITE, CHAN_INPUT_CLOSED, CHAN_OUTPUT_CLOSED, chan_send_close2(), compat20, datafellows, debug2(), Channel::efd, Channel::extended, Channel::extended_usage, Channel::flags, Channel::istate, Channel::ostate, Channel::self, SSH_BUG_EXTEOF, SSH_CHANNEL_ZOMBIE, and Channel::type. Referenced by channel_garbage_collect(). 00399 { 00400 if (c->type == SSH_CHANNEL_ZOMBIE) { 00401 debug2("channel %d: zombie", c->self); 00402 return 1; 00403 } 00404 if (c->istate != CHAN_INPUT_CLOSED || c->ostate != CHAN_OUTPUT_CLOSED) 00405 return 0; 00406 if (!compat20) { 00407 debug2("channel %d: is dead", c->self); 00408 return 1; 00409 } 00410 if ((datafellows & SSH_BUG_EXTEOF) && 00411 c->extended_usage == CHAN_EXTENDED_WRITE && 00412 c->efd != -1 && 00413 buffer_len(&c->extended) > 0) { 00414 debug2("channel %d: active efd: %d len %d", 00415 c->self, c->efd, buffer_len(&c->extended)); 00416 return 0; 00417 } 00418 if (!(c->flags & CHAN_CLOSE_SENT)) { 00419 if (do_send) { 00420 chan_send_close2(c); 00421 } else { 00422 /* channel would be dead if we sent a close */ 00423 if (c->flags & CHAN_CLOSE_RCVD) { 00424 debug2("channel %d: almost dead", 00425 c->self); 00426 return 1; 00427 } 00428 } 00429 } 00430 if ((c->flags & CHAN_CLOSE_SENT) && 00431 (c->flags & CHAN_CLOSE_RCVD)) { 00432 debug2("channel %d: is dead", c->self); 00433 return 1; 00434 } 00435 return 0; 00436 }
|
|
|
Definition at line 392 of file nchan.c. References SSH_CHANNEL_ZOMBIE, and Channel::type. Referenced by channel_handle_ctl(), channel_handle_rfd(), channel_handle_wfd(), channel_post_connecting(), channel_post_x11_listener(), channel_pre_dynamic(), channel_pre_output_draining(), and session_close_x11(). 00393 { 00394 c->type = SSH_CHANNEL_ZOMBIE; 00395 }
|
|
|
Definition at line 208 of file nchan.c. References buffer_len(), CHAN_OUTPUT_CLOSED, CHAN_OUTPUT_WAIT_DRAIN, chan_send_oclose1(), chan_set_ostate(), chan_shutdown_write(), compat20, debug2(), error(), Channel::ostate, Channel::output, and Channel::self. Referenced by chan_rcvd_ieof(), and channel_pre_open(). 00209 { 00210 debug2("channel %d: obuf empty", c->self); 00211 if (buffer_len(&c->output)) { 00212 error("channel %d: chan_obuf_empty for non empty buffer", 00213 c->self); 00214 return; 00215 } 00216 switch (c->ostate) { 00217 case CHAN_OUTPUT_WAIT_DRAIN: 00218 chan_shutdown_write(c); 00219 if (!compat20) 00220 chan_send_oclose1(c); 00221 chan_set_ostate(c, CHAN_OUTPUT_CLOSED); 00222 break; 00223 default: 00224 error("channel %d: internal error: obuf_empty for ostate %d", 00225 c->self, c->ostate); 00226 break; 00227 } 00228 }
|
|
|
Definition at line 363 of file nchan.c. References buffer_len(), chan_obuf_empty(), CHAN_OUTPUT_WAIT_DRAIN, chan_rcvd_eof2(), chan_rcvd_ieof1(), CHANNEL_EFD_OUTPUT_ACTIVE, and compat20. Referenced by channel_input_ieof(). 00364 { 00365 if (compat20) 00366 chan_rcvd_eof2(c); 00367 else 00368 chan_rcvd_ieof1(c); 00369 if (c->ostate == CHAN_OUTPUT_WAIT_DRAIN && 00370 buffer_len(&c->output) == 0 && 00371 !CHANNEL_EFD_OUTPUT_ACTIVE(c)) 00372 chan_obuf_empty(c); 00373 }
|
|
|
Definition at line 375 of file nchan.c. References chan_rcvd_close2(), chan_rcvd_oclose1(), and compat20. Referenced by channel_input_oclose(). 00376 { 00377 if (compat20) 00378 chan_rcvd_close2(c); 00379 else 00380 chan_rcvd_oclose1(c); 00381 }
|
|
|
Definition at line 129 of file nchan.c. References CHAN_INPUT_OPEN, CHAN_INPUT_WAIT_DRAIN, chan_set_istate(), chan_shutdown_read(), debug2(), error(), Channel::istate, and Channel::self. Referenced by channel_handle_ctl(), channel_handle_rfd(), and channel_pre_x11_open(). 00130 { 00131 debug2("channel %d: read failed", c->self); 00132 switch (c->istate) { 00133 case CHAN_INPUT_OPEN: 00134 chan_shutdown_read(c); 00135 chan_set_istate(c, CHAN_INPUT_WAIT_DRAIN); 00136 break; 00137 default: 00138 error("channel %d: chan_read_failed for istate %d", 00139 c->self, c->istate); 00140 break; 00141 } 00142 }
|
|
|
Definition at line 383 of file nchan.c. References chan_write_failed1(), chan_write_failed2(), and compat20. Referenced by channel_handle_ctl(), channel_handle_wfd(), channel_pre_x11_open(), and session_exit_message(). 00384 { 00385 if (compat20) 00386 chan_write_failed2(c); 00387 else 00388 chan_write_failed1(c); 00389 }
|
|
||||||||||||
|
Definition at line 2602 of file channels.c. References all_opens_permitted, debug(), fatal(), ForwardPermission::host_to_connect, num_permitted_opens, ForwardPermission::port_to_connect, SSH_MAX_FORWARDS_PER_DIRECTION, and xstrdup(). Referenced by auth_parse_options(). 02603 { 02604 if (num_permitted_opens >= SSH_MAX_FORWARDS_PER_DIRECTION) 02605 fatal("channel_request_remote_forwarding: too many forwards"); 02606 debug("allow port forwarding to host %s port %d", host, port); 02607 02608 permitted_opens[num_permitted_opens].host_to_connect = xstrdup(host); 02609 permitted_opens[num_permitted_opens].port_to_connect = port; 02610 num_permitted_opens++; 02611 02612 all_opens_permitted = 0; 02613 }
|
|
||||||||||||
|
Definition at line 1815 of file channels.c. References channel_handler(), and channel_post. Referenced by client_loop(), server_loop(), and server_loop2(). 01816 { 01817 channel_handler(channel_post, readset, writeset); 01818 }
|
|
|
Definition at line 143 of file channels.c. References channels_alloc, and logit(). Referenced by channel_cancel_cleanup(), channel_lookup(), channel_register_cleanup(), and session_close_x11(). 00144 { 00145 Channel *c; 00146 00147 if (id < 0 || (u_int)id >= channels_alloc) { 00148 logit("channel_by_id: %d: bad id", id); 00149 return NULL; 00150 } 00151 c = channels[id]; 00152 if (c == NULL) { 00153 logit("channel_by_id: %d: bad id: channel free", id); 00154 return NULL; 00155 } 00156 return c; 00157 }
|
|
|
Definition at line 671 of file channels.c. References channel_by_id(), Channel::detach_close, Channel::detach_user, and logit(). Referenced by client_channel_closed(), session_close_by_channel(), session_close_single_x11(), and session_close_x11(). 00672 { 00673 Channel *c = channel_by_id(id); 00674 00675 if (c == NULL) { 00676 logit("channel_cancel_cleanup: %d: bad id", id); 00677 return; 00678 } 00679 c->detach_user = NULL; 00680 c->detach_close = 0; 00681 }
|
|
||||||||||||
|
Definition at line 2413 of file channels.c. References __func__, channel_free(), channels_alloc, debug2(), Channel::listening_port, Channel::path, SSH_CHANNEL_RPORT_LISTENER, and Channel::type. Referenced by server_input_global_request(). 02414 { 02415 u_int i; 02416 int found = 0; 02417 02418 for (i = 0; i < channels_alloc; i++) { 02419 Channel *c = channels[i]; 02420 02421 if (c != NULL && c->type == SSH_CHANNEL_RPORT_LISTENER && 02422 strncmp(c->path, host, sizeof(c->path)) == 0 && 02423 c->listening_port == port) { 02424 debug2("%s: close channel %d", __func__, i); 02425 channel_free(c); 02426 found = 1; 02427 } 02428 } 02429 02430 return (found); 02431 }
|
|
|
Definition at line 2616 of file channels.c. References num_permitted_opens, and xfree(). Referenced by auth_clear_options(). 02617 { 02618 int i; 02619 02620 for (i = 0; i < num_permitted_opens; i++) 02621 if (permitted_opens[i].host_to_connect != NULL) 02622 xfree(permitted_opens[i].host_to_connect); 02623 num_permitted_opens = 0; 02624 02625 }
|
|
|
Definition at line 404 of file channels.c. References channel_close_fds(), and channels_alloc. Referenced by child_close_fds(), and packet_disconnect(). 00405 { 00406 u_int i; 00407 00408 for (i = 0; i < channels_alloc; i++) 00409 if (channels[i] != NULL) 00410 channel_close_fds( |