00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef MESSAGES_H_
00022 #define MESSAGES_H_
00023
00024 #include "config.h"
00025
00026 struct ssh_auth_request {
00027 char *username;
00028 int method;
00029 char *password;
00030 struct ssh_key_struct *pubkey;
00031 char signature_state;
00032 char kbdint_response;
00033 };
00034
00035 struct ssh_channel_request_open {
00036 int type;
00037 uint32_t sender;
00038 uint32_t window;
00039 uint32_t packet_size;
00040 char *originator;
00041 uint16_t originator_port;
00042 char *destination;
00043 uint16_t destination_port;
00044 };
00045
00046 struct ssh_service_request {
00047 char *service;
00048 };
00049
00050 struct ssh_global_request {
00051 int type;
00052 uint8_t want_reply;
00053 char *bind_address;
00054 uint16_t bind_port;
00055 };
00056
00057 struct ssh_channel_request {
00058 int type;
00059 ssh_channel channel;
00060 uint8_t want_reply;
00061
00062 char *TERM;
00063 uint32_t width;
00064 uint32_t height;
00065 uint32_t pxwidth;
00066 uint32_t pxheight;
00067 ssh_string modes;
00068
00069
00070 char *var_name;
00071 char *var_value;
00072
00073 char *command;
00074
00075 char *subsystem;
00076
00077
00078 uint8_t x11_single_connection;
00079 char *x11_auth_protocol;
00080 char *x11_auth_cookie;
00081 uint32_t x11_screen_number;
00082 };
00083
00084 struct ssh_message_struct {
00085 ssh_session session;
00086 int type;
00087 struct ssh_auth_request auth_request;
00088 struct ssh_channel_request_open channel_request_open;
00089 struct ssh_channel_request channel_request;
00090 struct ssh_service_request service_request;
00091 struct ssh_global_request global_request;
00092 };
00093
00094 SSH_PACKET_CALLBACK(ssh_packet_channel_open);
00095 SSH_PACKET_CALLBACK(ssh_packet_global_request);
00096
00097 #ifdef WITH_SERVER
00098 SSH_PACKET_CALLBACK(ssh_packet_service_request);
00099 SSH_PACKET_CALLBACK(ssh_packet_userauth_request);
00100 #endif
00101
00102 int ssh_message_handle_channel_request(ssh_session session, ssh_channel channel, ssh_buffer packet,
00103 const char *request, uint8_t want_reply);
00104 void ssh_message_queue(ssh_session session, ssh_message message);
00105 ssh_message ssh_message_pop_head(ssh_session session);
00106 int ssh_message_channel_request_open_reply_accept_channel(ssh_message msg, ssh_channel chan);
00107
00108 #endif