diff options
author | Damien Miller <djm@mindrot.org> | 2000-04-01 11:09:21 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-04-01 11:09:21 +1000 |
commit | b38eff8e4ff901df9cf1113a9f14d64c3565a401 (patch) | |
tree | 9a856898f15f7760ed95c5d47789a6f954b4ad2f /ssh.h | |
parent | 450a7a1ff40fe7c2d84c93b83cf2df53445d807d (diff) |
- Big OpenBSD CVS update (mainly beginnings of SSH2 infrastructure)
- [auth.c session.c sshd.c auth.h]
split sshd.c -> auth.c session.c sshd.c plus cleanup and goto-removal
- [bufaux.c bufaux.h]
support ssh2 bignums
- [channels.c channels.h clientloop.c sshd.c nchan.c nchan.h packet.c]
[readconf.c ssh.c ssh.h serverloop.c]
replace big switch() with function tables (prepare for ssh2)
- [ssh2.h]
ssh2 message type codes
- [sshd.8]
reorder Xr to avoid cutting
- [serverloop.c]
close(fdin) if fdin != fdout, shutdown otherwise, ok theo@
- [channels.c]
missing close
allow bigger packets
- [cipher.c cipher.h]
support ssh2 ciphers
- [compress.c]
cleanup, less code
- [dispatch.c dispatch.h]
function tables for different message types
- [log-server.c]
do not log() if debuggin to stderr
rename a cpp symbol, to avoid param.h collision
- [mpaux.c]
KNF
- [nchan.c]
sync w/ channels.c
Diffstat (limited to 'ssh.h')
-rw-r--r-- | ssh.h | 171 |
1 files changed, 1 insertions, 170 deletions
@@ -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(). */ |
487 | void fatal_remove_cleanup(void (*proc) (void *context), void *context); | 487 | void fatal_remove_cleanup(void (*proc) (void *context), void *context); |
488 | 488 | ||
489 | /*---------------- definitions for channels ------------------*/ | ||
490 | |||
491 | /* Sets specific protocol options. */ | ||
492 | void 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 | */ | ||
499 | int channel_allocate(int type, int sock, char *remote_name); | ||
500 | |||
501 | /* Free the channel and close its socket. */ | ||
502 | void channel_free(int channel); | ||
503 | |||
504 | /* Add any bits relevant to channels in select bitmasks. */ | ||
505 | void 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 | */ | ||
511 | void 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. */ | ||
514 | void 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 | */ | ||
521 | void channel_input_data(int payload_len); | ||
522 | |||
523 | /* Returns true if no channel has too much buffered data. */ | ||
524 | int channel_not_very_much_buffered_data(void); | ||
525 | |||
526 | /* This is called after receiving CHANNEL_CLOSE. */ | ||
527 | void channel_input_close(void); | ||
528 | |||
529 | /* This is called after receiving CHANNEL_CLOSE_CONFIRMATION. */ | ||
530 | void channel_input_close_confirmation(void); | ||
531 | |||
532 | /* This is called after receiving CHANNEL_OPEN_CONFIRMATION. */ | ||
533 | void channel_input_open_confirmation(void); | ||
534 | |||
535 | /* This is called after receiving CHANNEL_OPEN_FAILURE from the other side. */ | ||
536 | void channel_input_open_failure(void); | ||
537 | |||
538 | /* This closes any sockets that are listening for connections; this removes | ||
539 | any unix domain sockets. */ | ||
540 | void 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 | */ | ||
546 | void channel_close_all(void); | ||
547 | |||
548 | /* Returns the maximum file descriptor number used by the channels. */ | ||
549 | int channel_max_fd(void); | ||
550 | |||
551 | /* Returns true if there is still an open channel over the connection. */ | ||
552 | int 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 | */ | ||
559 | char *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 | */ | ||
566 | void | ||
567 | channel_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 | */ | ||
576 | void | ||
577 | channel_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 | */ | ||
585 | void 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 | */ | ||
592 | void 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 | */ | ||
599 | void 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 | */ | ||
605 | char *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 | */ | ||
612 | char *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 | */ | ||
619 | void x11_input_open(int payload_len); | ||
620 | |||
621 | /* | ||
622 | * Requests forwarding of X11 connections. This should be called on the | ||
623 | * client only. | ||
624 | */ | ||
625 | void 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 | */ | ||
631 | void x11_request_forwarding_with_spoofing(const char *proto, const char *data); | ||
632 | |||
633 | /* Sends a message to the server to request authentication fd forwarding. */ | ||
634 | void 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 | */ | ||
641 | char *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 | */ | ||
647 | void auth_input_request_forwarding(struct passwd * pw); | ||
648 | |||
649 | /* This is called to process an SSH_SMSG_AGENT_OPEN message. */ | ||
650 | void 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 | */ | ||
656 | int 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*. |