Mercurial > dropbear
comparison channel.h @ 1511:5916af64acd4 fuzz
merge from main
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Sat, 17 Feb 2018 19:29:51 +0800 |
parents | 47f36d8565cf |
children | 79eef94ccea9 |
comparison
equal
deleted
inserted
replaced
1457:32f990cc96b1 | 1511:5916af64acd4 |
---|---|
82 or failure). */ | 82 or failure). */ |
83 | 83 |
84 int flushing; | 84 int flushing; |
85 | 85 |
86 /* Used by client chansession to handle ~ escaping, NULL ignored otherwise */ | 86 /* Used by client chansession to handle ~ escaping, NULL ignored otherwise */ |
87 void (*read_mangler)(struct Channel*, unsigned char* bytes, int *len); | 87 void (*read_mangler)(const struct Channel*, const unsigned char* bytes, int *len); |
88 | 88 |
89 const struct ChanType* type; | 89 const struct ChanType* type; |
90 | 90 |
91 enum dropbear_channel_prio prio; | 91 enum dropbear_channel_prio prio; |
92 }; | 92 }; |
93 | 93 |
94 struct ChanType { | 94 struct ChanType { |
95 | 95 |
96 int sepfds; /* Whether this channel has separate pipes for in/out or not */ | 96 int sepfds; /* Whether this channel has separate pipes for in/out or not */ |
97 char *name; | 97 const char *name; |
98 int (*inithandler)(struct Channel*); | 98 int (*inithandler)(struct Channel*); |
99 int (*check_close)(struct Channel*); | 99 int (*check_close)(const struct Channel*); |
100 void (*reqhandler)(struct Channel*); | 100 void (*reqhandler)(struct Channel*); |
101 void (*closehandler)(struct Channel*); | 101 void (*closehandler)(const struct Channel*); |
102 }; | 102 }; |
103 | 103 |
104 /* Callback for connect_remote */ | 104 /* Callback for connect_remote */ |
105 void channel_connect_done(int result, int sock, void* user_data, const char* errstring); | 105 void channel_connect_done(int result, int sock, void* user_data, const char* errstring); |
106 | 106 |
107 void chaninitialise(const struct ChanType *chantypes[]); | 107 void chaninitialise(const struct ChanType *chantypes[]); |
108 void chancleanup(void); | 108 void chancleanup(void); |
109 void setchannelfds(fd_set *readfds, fd_set *writefds, int allow_reads); | 109 void setchannelfds(fd_set *readfds, fd_set *writefds, int allow_reads); |
110 void channelio(fd_set *readfd, fd_set *writefd); | 110 void channelio(const fd_set *readfd, const fd_set *writefd); |
111 struct Channel* getchannel(void); | 111 struct Channel* getchannel(void); |
112 /* Returns an arbitrary channel that is in a ready state - not | 112 /* Returns an arbitrary channel that is in a ready state - not |
113 being initialised and no EOF in either direction. NULL if none. */ | 113 being initialised and no EOF in either direction. NULL if none. */ |
114 struct Channel* get_any_ready_channel(void); | 114 struct Channel* get_any_ready_channel(void); |
115 | 115 |
116 void recv_msg_channel_open(void); | 116 void recv_msg_channel_open(void); |
117 void recv_msg_channel_request(void); | 117 void recv_msg_channel_request(void); |
118 void send_msg_channel_failure(struct Channel *channel); | 118 void send_msg_channel_failure(const struct Channel *channel); |
119 void send_msg_channel_success(struct Channel *channel); | 119 void send_msg_channel_success(const struct Channel *channel); |
120 void recv_msg_channel_data(void); | 120 void recv_msg_channel_data(void); |
121 void recv_msg_channel_extended_data(void); | 121 void recv_msg_channel_extended_data(void); |
122 void recv_msg_channel_window_adjust(void); | 122 void recv_msg_channel_window_adjust(void); |
123 void recv_msg_channel_close(void); | 123 void recv_msg_channel_close(void); |
124 void recv_msg_channel_eof(void); | 124 void recv_msg_channel_eof(void); |
133 #if DROPBEAR_LISTENERS || DROPBEAR_CLIENT | 133 #if DROPBEAR_LISTENERS || DROPBEAR_CLIENT |
134 int send_msg_channel_open_init(int fd, const struct ChanType *type); | 134 int send_msg_channel_open_init(int fd, const struct ChanType *type); |
135 void recv_msg_channel_open_confirmation(void); | 135 void recv_msg_channel_open_confirmation(void); |
136 void recv_msg_channel_open_failure(void); | 136 void recv_msg_channel_open_failure(void); |
137 #endif | 137 #endif |
138 void start_send_channel_request(struct Channel *channel, char *type); | 138 void start_send_channel_request(const struct Channel *channel, const char *type); |
139 | 139 |
140 void send_msg_request_success(void); | 140 void send_msg_request_success(void); |
141 void send_msg_request_failure(void); | 141 void send_msg_request_failure(void); |
142 | 142 |
143 | 143 |