diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/channels.c b/channels.c index 239da8e9b..1ff7152a8 100644 --- a/channels.c +++ b/channels.c | |||
@@ -192,7 +192,6 @@ channel_lookup(int id) | |||
192 | * Register filedescriptors for a channel, used when allocating a channel or | 192 | * Register filedescriptors for a channel, used when allocating a channel or |
193 | * when the channel consumer/producer is ready, e.g. shell exec'd | 193 | * when the channel consumer/producer is ready, e.g. shell exec'd |
194 | */ | 194 | */ |
195 | |||
196 | static void | 195 | static void |
197 | channel_register_fds(Channel *c, int rfd, int wfd, int efd, | 196 | channel_register_fds(Channel *c, int rfd, int wfd, int efd, |
198 | int extusage, int nonblock) | 197 | int extusage, int nonblock) |
@@ -239,7 +238,6 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd, | |||
239 | * Allocate a new channel object and set its type and socket. This will cause | 238 | * Allocate a new channel object and set its type and socket. This will cause |
240 | * remote_name to be freed. | 239 | * remote_name to be freed. |
241 | */ | 240 | */ |
242 | |||
243 | Channel * | 241 | Channel * |
244 | channel_new(char *ctype, int type, int rfd, int wfd, int efd, | 242 | channel_new(char *ctype, int type, int rfd, int wfd, int efd, |
245 | u_int window, u_int maxpack, int extusage, char *remote_name, int nonblock) | 243 | u_int window, u_int maxpack, int extusage, char *remote_name, int nonblock) |
@@ -341,7 +339,6 @@ channel_close_fd(int *fdp) | |||
341 | } | 339 | } |
342 | 340 | ||
343 | /* Close all channel fd/socket. */ | 341 | /* Close all channel fd/socket. */ |
344 | |||
345 | static void | 342 | static void |
346 | channel_close_fds(Channel *c) | 343 | channel_close_fds(Channel *c) |
347 | { | 344 | { |
@@ -356,7 +353,6 @@ channel_close_fds(Channel *c) | |||
356 | } | 353 | } |
357 | 354 | ||
358 | /* Free the channel and close its fd/socket. */ | 355 | /* Free the channel and close its fd/socket. */ |
359 | |||
360 | void | 356 | void |
361 | channel_free(Channel *c) | 357 | channel_free(Channel *c) |
362 | { | 358 | { |
@@ -403,7 +399,6 @@ channel_free_all(void) | |||
403 | * Closes the sockets/fds of all channels. This is used to close extra file | 399 | * Closes the sockets/fds of all channels. This is used to close extra file |
404 | * descriptors after a fork. | 400 | * descriptors after a fork. |
405 | */ | 401 | */ |
406 | |||
407 | void | 402 | void |
408 | channel_close_all(void) | 403 | channel_close_all(void) |
409 | { | 404 | { |
@@ -417,7 +412,6 @@ channel_close_all(void) | |||
417 | /* | 412 | /* |
418 | * Stop listening to channels. | 413 | * Stop listening to channels. |
419 | */ | 414 | */ |
420 | |||
421 | void | 415 | void |
422 | channel_stop_listening(void) | 416 | channel_stop_listening(void) |
423 | { | 417 | { |
@@ -444,7 +438,6 @@ channel_stop_listening(void) | |||
444 | * Returns true if no channel has too much buffered data, and false if one or | 438 | * Returns true if no channel has too much buffered data, and false if one or |
445 | * more channel is overfull. | 439 | * more channel is overfull. |
446 | */ | 440 | */ |
447 | |||
448 | int | 441 | int |
449 | channel_not_very_much_buffered_data(void) | 442 | channel_not_very_much_buffered_data(void) |
450 | { | 443 | { |
@@ -474,7 +467,6 @@ channel_not_very_much_buffered_data(void) | |||
474 | } | 467 | } |
475 | 468 | ||
476 | /* Returns true if any channel is still open. */ | 469 | /* Returns true if any channel is still open. */ |
477 | |||
478 | int | 470 | int |
479 | channel_still_open(void) | 471 | channel_still_open(void) |
480 | { | 472 | { |
@@ -517,7 +509,6 @@ channel_still_open(void) | |||
517 | } | 509 | } |
518 | 510 | ||
519 | /* Returns the id of an open channel suitable for keepaliving */ | 511 | /* Returns the id of an open channel suitable for keepaliving */ |
520 | |||
521 | int | 512 | int |
522 | channel_find_open(void) | 513 | channel_find_open(void) |
523 | { | 514 | { |
@@ -562,7 +553,6 @@ channel_find_open(void) | |||
562 | * suitable for sending to the client. The message contains crlf pairs for | 553 | * suitable for sending to the client. The message contains crlf pairs for |
563 | * newlines. | 554 | * newlines. |
564 | */ | 555 | */ |
565 | |||
566 | char * | 556 | char * |
567 | channel_open_message(void) | 557 | channel_open_message(void) |
568 | { | 558 | { |
@@ -647,6 +637,7 @@ channel_request_start(int id, char *service, int wantconfirm) | |||
647 | packet_put_cstring(service); | 637 | packet_put_cstring(service); |
648 | packet_put_char(wantconfirm); | 638 | packet_put_char(wantconfirm); |
649 | } | 639 | } |
640 | |||
650 | void | 641 | void |
651 | channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) | 642 | channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) |
652 | { | 643 | { |
@@ -659,6 +650,7 @@ channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) | |||
659 | c->confirm = fn; | 650 | c->confirm = fn; |
660 | c->confirm_ctx = ctx; | 651 | c->confirm_ctx = ctx; |
661 | } | 652 | } |
653 | |||
662 | void | 654 | void |
663 | channel_register_cleanup(int id, channel_callback_fn *fn, int do_close) | 655 | channel_register_cleanup(int id, channel_callback_fn *fn, int do_close) |
664 | { | 656 | { |
@@ -671,6 +663,7 @@ channel_register_cleanup(int id, channel_callback_fn *fn, int do_close) | |||
671 | c->detach_user = fn; | 663 | c->detach_user = fn; |
672 | c->detach_close = do_close; | 664 | c->detach_close = do_close; |
673 | } | 665 | } |
666 | |||
674 | void | 667 | void |
675 | channel_cancel_cleanup(int id) | 668 | channel_cancel_cleanup(int id) |
676 | { | 669 | { |
@@ -683,6 +676,7 @@ channel_cancel_cleanup(int id) | |||
683 | c->detach_user = NULL; | 676 | c->detach_user = NULL; |
684 | c->detach_close = 0; | 677 | c->detach_close = 0; |
685 | } | 678 | } |
679 | |||
686 | void | 680 | void |
687 | channel_register_filter(int id, channel_infilter_fn *ifn, | 681 | channel_register_filter(int id, channel_infilter_fn *ifn, |
688 | channel_outfilter_fn *ofn) | 682 | channel_outfilter_fn *ofn) |
@@ -1455,6 +1449,7 @@ channel_handle_rfd(Channel *c, fd_set *readset, fd_set *writeset) | |||
1455 | } | 1449 | } |
1456 | return 1; | 1450 | return 1; |
1457 | } | 1451 | } |
1452 | |||
1458 | static int | 1453 | static int |
1459 | channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset) | 1454 | channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset) |
1460 | { | 1455 | { |
@@ -1542,6 +1537,7 @@ channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset) | |||
1542 | } | 1537 | } |
1543 | return 1; | 1538 | return 1; |
1544 | } | 1539 | } |
1540 | |||
1545 | static int | 1541 | static int |
1546 | channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset) | 1542 | channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset) |
1547 | { | 1543 | { |
@@ -1585,6 +1581,7 @@ channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset) | |||
1585 | } | 1581 | } |
1586 | return 1; | 1582 | return 1; |
1587 | } | 1583 | } |
1584 | |||
1588 | static int | 1585 | static int |
1589 | channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset) | 1586 | channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset) |
1590 | { | 1587 | { |
@@ -1612,6 +1609,7 @@ channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset) | |||
1612 | } | 1609 | } |
1613 | return 1; | 1610 | return 1; |
1614 | } | 1611 | } |
1612 | |||
1615 | static int | 1613 | static int |
1616 | channel_check_window(Channel *c) | 1614 | channel_check_window(Channel *c) |
1617 | { | 1615 | { |
@@ -1823,7 +1821,6 @@ channel_after_select(fd_set *readset, fd_set *writeset) | |||
1823 | 1821 | ||
1824 | 1822 | ||
1825 | /* If there is data to send to the connection, enqueue some of it now. */ | 1823 | /* If there is data to send to the connection, enqueue some of it now. */ |
1826 | |||
1827 | void | 1824 | void |
1828 | channel_output_poll(void) | 1825 | channel_output_poll(void) |
1829 | { | 1826 | { |
@@ -1943,7 +1940,6 @@ channel_output_poll(void) | |||
1943 | 1940 | ||
1944 | 1941 | ||
1945 | /* -- protocol input */ | 1942 | /* -- protocol input */ |
1946 | |||
1947 | void | 1943 | void |
1948 | channel_input_data(int type, u_int32_t seq, void *ctxt) | 1944 | channel_input_data(int type, u_int32_t seq, void *ctxt) |
1949 | { | 1945 | { |
@@ -2557,7 +2553,6 @@ channel_request_rforward_cancel(const char *host, u_short port) | |||
2557 | * listening for the port, and sends back a success reply (or disconnect | 2553 | * listening for the port, and sends back a success reply (or disconnect |
2558 | * message if there was an error). This never returns if there was an error. | 2554 | * message if there was an error). This never returns if there was an error. |
2559 | */ | 2555 | */ |
2560 | |||
2561 | void | 2556 | void |
2562 | channel_input_port_forward_request(int is_root, int gateway_ports) | 2557 | channel_input_port_forward_request(int is_root, int gateway_ports) |
2563 | { | 2558 | { |
@@ -2628,7 +2623,6 @@ channel_clear_permitted_opens(void) | |||
2628 | 2623 | ||
2629 | } | 2624 | } |
2630 | 2625 | ||
2631 | |||
2632 | /* return socket to remote host, port */ | 2626 | /* return socket to remote host, port */ |
2633 | static int | 2627 | static int |
2634 | connect_to(const char *host, u_short port) | 2628 | connect_to(const char *host, u_short port) |