summaryrefslogtreecommitdiff
path: root/channels.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:10:14 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:10:14 +1100
commit4f7becb44f26b61673b8478fd4aeee262adaf446 (patch)
tree29c6add44136bea0e0a4a1a60f21f884749aa444 /channels.c
parent1d2b6706ba1b2000bd807731e6d8e35691eaf8df (diff)
- deraadt@cvs.openbsd.org 2006/03/20 18:48:34
[channels.c fatal.c kex.c packet.c serverloop.c] spacing
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c22
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
196static void 195static void
197channel_register_fds(Channel *c, int rfd, int wfd, int efd, 196channel_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
243Channel * 241Channel *
244channel_new(char *ctype, int type, int rfd, int wfd, int efd, 242channel_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
345static void 342static void
346channel_close_fds(Channel *c) 343channel_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
360void 356void
361channel_free(Channel *c) 357channel_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
407void 402void
408channel_close_all(void) 403channel_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
421void 415void
422channel_stop_listening(void) 416channel_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
448int 441int
449channel_not_very_much_buffered_data(void) 442channel_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
478int 470int
479channel_still_open(void) 471channel_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
521int 512int
522channel_find_open(void) 513channel_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
566char * 556char *
567channel_open_message(void) 557channel_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
650void 641void
651channel_register_confirm(int id, channel_callback_fn *fn, void *ctx) 642channel_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
662void 654void
663channel_register_cleanup(int id, channel_callback_fn *fn, int do_close) 655channel_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
674void 667void
675channel_cancel_cleanup(int id) 668channel_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
686void 680void
687channel_register_filter(int id, channel_infilter_fn *ifn, 681channel_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
1458static int 1453static int
1459channel_handle_wfd(Channel *c, fd_set *readset, fd_set *writeset) 1454channel_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
1545static int 1541static int
1546channel_handle_efd(Channel *c, fd_set *readset, fd_set *writeset) 1542channel_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
1588static int 1585static int
1589channel_handle_ctl(Channel *c, fd_set *readset, fd_set *writeset) 1586channel_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
1615static int 1613static int
1616channel_check_window(Channel *c) 1614channel_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
1827void 1824void
1828channel_output_poll(void) 1825channel_output_poll(void)
1829{ 1826{
@@ -1943,7 +1940,6 @@ channel_output_poll(void)
1943 1940
1944 1941
1945/* -- protocol input */ 1942/* -- protocol input */
1946
1947void 1943void
1948channel_input_data(int type, u_int32_t seq, void *ctxt) 1944channel_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
2561void 2556void
2562channel_input_port_forward_request(int is_root, int gateway_ports) 2557channel_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 */
2633static int 2627static int
2634connect_to(const char *host, u_short port) 2628connect_to(const char *host, u_short port)