summaryrefslogtreecommitdiff
path: root/ssh.h
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.h')
-rw-r--r--ssh.h171
1 files changed, 1 insertions, 170 deletions
diff --git a/ssh.h b/ssh.h
index 8bd708150..cc8940b53 100644
--- a/ssh.h
+++ b/ssh.h
@@ -13,7 +13,7 @@
13 * 13 *
14 */ 14 */
15 15
16/* RCSID("$Id: ssh.h,v 1.28 2000/03/26 03:04:54 damien Exp $"); */ 16/* RCSID("$Id: ssh.h,v 1.29 2000/04/01 01:09:26 damien Exp $"); */
17 17
18#ifndef SSH_H 18#ifndef SSH_H
19#define SSH_H 19#define SSH_H
@@ -486,175 +486,6 @@ void fatal_add_cleanup(void (*proc) (void *context), void *context);
486/* Removes a cleanup function to be called at fatal(). */ 486/* Removes a cleanup function to be called at fatal(). */
487void fatal_remove_cleanup(void (*proc) (void *context), void *context); 487void fatal_remove_cleanup(void (*proc) (void *context), void *context);
488 488
489/*---------------- definitions for channels ------------------*/
490
491/* Sets specific protocol options. */
492void channel_set_options(int hostname_in_open);
493
494/*
495 * Allocate a new channel object and set its type and socket. Remote_name
496 * must have been allocated with xmalloc; this will free it when the channel
497 * is freed.
498 */
499int channel_allocate(int type, int sock, char *remote_name);
500
501/* Free the channel and close its socket. */
502void channel_free(int channel);
503
504/* Add any bits relevant to channels in select bitmasks. */
505void channel_prepare_select(fd_set * readset, fd_set * writeset);
506
507/*
508 * After select, perform any appropriate operations for channels which have
509 * events pending.
510 */
511void channel_after_select(fd_set * readset, fd_set * writeset);
512
513/* If there is data to send to the connection, send some of it now. */
514void channel_output_poll(void);
515
516/*
517 * This is called when a packet of type CHANNEL_DATA has just been received.
518 * The message type has already been consumed, but channel number and data is
519 * still there.
520 */
521void channel_input_data(int payload_len);
522
523/* Returns true if no channel has too much buffered data. */
524int channel_not_very_much_buffered_data(void);
525
526/* This is called after receiving CHANNEL_CLOSE. */
527void channel_input_close(void);
528
529/* This is called after receiving CHANNEL_CLOSE_CONFIRMATION. */
530void channel_input_close_confirmation(void);
531
532/* This is called after receiving CHANNEL_OPEN_CONFIRMATION. */
533void channel_input_open_confirmation(void);
534
535/* This is called after receiving CHANNEL_OPEN_FAILURE from the other side. */
536void channel_input_open_failure(void);
537
538/* This closes any sockets that are listening for connections; this removes
539 any unix domain sockets. */
540void channel_stop_listening(void);
541
542/*
543 * Closes the sockets of all channels. This is used to close extra file
544 * descriptors after a fork.
545 */
546void channel_close_all(void);
547
548/* Returns the maximum file descriptor number used by the channels. */
549int channel_max_fd(void);
550
551/* Returns true if there is still an open channel over the connection. */
552int channel_still_open(void);
553
554/*
555 * Returns a string containing a list of all open channels. The list is
556 * suitable for displaying to the user. It uses crlf instead of newlines.
557 * The caller should free the string with xfree.
558 */
559char *channel_open_message(void);
560
561/*
562 * Initiate forwarding of connections to local port "port" through the secure
563 * channel to host:port from remote side. This never returns if there was an
564 * error.
565 */
566void
567channel_request_local_forwarding(u_short port, const char *host,
568 u_short remote_port, int gateway_ports);
569
570/*
571 * Initiate forwarding of connections to port "port" on remote host through
572 * the secure channel to host:port from local side. This never returns if
573 * there was an error. This registers that open requests for that port are
574 * permitted.
575 */
576void
577channel_request_remote_forwarding(u_short port, const char *host,
578 u_short remote_port);
579
580/*
581 * Permits opening to any host/port in SSH_MSG_PORT_OPEN. This is usually
582 * called by the server, because the user could connect to any port anyway,
583 * and the server has no way to know but to trust the client anyway.
584 */
585void channel_permit_all_opens(void);
586
587/*
588 * This is called after receiving CHANNEL_FORWARDING_REQUEST. This initates
589 * listening for the port, and sends back a success reply (or disconnect
590 * message if there was an error). This never returns if there was an error.
591 */
592void channel_input_port_forward_request(int is_root);
593
594/*
595 * This is called after receiving PORT_OPEN message. This attempts to
596 * connect to the given host:port, and sends back CHANNEL_OPEN_CONFIRMATION
597 * or CHANNEL_OPEN_FAILURE.
598 */
599void channel_input_port_open(int payload_len);
600
601/*
602 * Creates a port for X11 connections, and starts listening for it. Returns
603 * the display name, or NULL if an error was encountered.
604 */
605char *x11_create_display(int screen);
606
607/*
608 * Creates an internet domain socket for listening for X11 connections.
609 * Returns a suitable value for the DISPLAY variable, or NULL if an error
610 * occurs.
611 */
612char *x11_create_display_inet(int screen, int x11_display_offset);
613
614/*
615 * This is called when SSH_SMSG_X11_OPEN is received. The packet contains
616 * the remote channel number. We should do whatever we want, and respond
617 * with either SSH_MSG_OPEN_CONFIRMATION or SSH_MSG_OPEN_FAILURE.
618 */
619void x11_input_open(int payload_len);
620
621/*
622 * Requests forwarding of X11 connections. This should be called on the
623 * client only.
624 */
625void x11_request_forwarding(void);
626
627/*
628 * Requests forwarding for X11 connections, with authentication spoofing.
629 * This should be called in the client only.
630 */
631void x11_request_forwarding_with_spoofing(const char *proto, const char *data);
632
633/* Sends a message to the server to request authentication fd forwarding. */
634void auth_request_forwarding(void);
635
636/*
637 * Returns the name of the forwarded authentication socket. Returns NULL if
638 * there is no forwarded authentication socket. The returned value points to
639 * a static buffer.
640 */
641char *auth_get_socket_name(void);
642
643/*
644 * This if called to process SSH_CMSG_AGENT_REQUEST_FORWARDING on the server.
645 * This starts forwarding authentication requests.
646 */
647void auth_input_request_forwarding(struct passwd * pw);
648
649/* This is called to process an SSH_SMSG_AGENT_OPEN message. */
650void auth_input_open_request(void);
651
652/*
653 * Returns true if the given string matches the pattern (which may contain ?
654 * and * as wildcards), and zero if it does not match.
655 */
656int match_pattern(const char *s, const char *pattern);
657
658/* 489/*
659 * Expands tildes in the file name. Returns data allocated by xmalloc. 490 * Expands tildes in the file name. Returns data allocated by xmalloc.
660 * Warning: this calls getpw*. 491 * Warning: this calls getpw*.