version 1.25, 2001/06/26 17:27:24 |
version 1.25.2.2, 2002/03/07 17:37:46 |
|
|
|
/* $OpenBSD$ */ |
|
|
/* |
/* |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Author: Tatu Ylonen <ylo@cs.hut.fi> |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
|
|
* called by a name other than "ssh" or "Secure Shell". |
* called by a name other than "ssh" or "Secure Shell". |
*/ |
*/ |
|
|
/* RCSID("$OpenBSD$"); */ |
|
|
|
#ifndef PACKET_H |
#ifndef PACKET_H |
#define PACKET_H |
#define PACKET_H |
|
|
|
|
void packet_put_int(u_int value); |
void packet_put_int(u_int value); |
void packet_put_bignum(BIGNUM * value); |
void packet_put_bignum(BIGNUM * value); |
void packet_put_bignum2(BIGNUM * value); |
void packet_put_bignum2(BIGNUM * value); |
void packet_put_string(const char *buf, u_int len); |
void packet_put_string(const void *buf, u_int len); |
void packet_put_cstring(const char *str); |
void packet_put_cstring(const char *str); |
void packet_put_raw(const char *buf, u_int len); |
void packet_put_raw(const void *buf, u_int len); |
void packet_send(void); |
void packet_send(void); |
|
|
int packet_read(int *payload_len_ptr); |
int packet_read(void); |
void packet_read_expect(int *payload_len_ptr, int type); |
void packet_read_expect(int type); |
int packet_read_poll(int *packet_len_ptr); |
int packet_read_poll(void); |
void packet_process_incoming(const char *buf, u_int len); |
void packet_process_incoming(const char *buf, u_int len); |
|
int packet_read_seqnr(u_int32_t *seqnr_p); |
|
int packet_read_poll_seqnr(u_int32_t *seqnr_p); |
|
|
u_int packet_get_char(void); |
u_int packet_get_char(void); |
u_int packet_get_int(void); |
u_int packet_get_int(void); |
void packet_get_bignum(BIGNUM * value, int *length_ptr); |
void packet_get_bignum(BIGNUM * value); |
void packet_get_bignum2(BIGNUM * value, int *length_ptr); |
void packet_get_bignum2(BIGNUM * value); |
char *packet_get_raw(int *length_ptr); |
void *packet_get_raw(int *length_ptr); |
char *packet_get_string(u_int *length_ptr); |
void *packet_get_string(u_int *length_ptr); |
void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2))); |
void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2))); |
void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); |
void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2))); |
|
|
|
|
int packet_connection_is_ipv4(void); |
int packet_connection_is_ipv4(void); |
int packet_remaining(void); |
int packet_remaining(void); |
void packet_send_ignore(int); |
void packet_send_ignore(int); |
void packet_inject_ignore(int); |
void packet_add_padding(u_char); |
|
|
void tty_make_modes(int, struct termios *); |
void tty_make_modes(int, struct termios *); |
void tty_parse_modes(int, int *); |
void tty_parse_modes(int, int *); |
|
|
int packet_set_maxsize(int); |
int packet_set_maxsize(int); |
#define packet_get_maxsize() max_packet_size |
#define packet_get_maxsize() max_packet_size |
|
|
#define packet_integrity_check(payload_len, expected_len, type) \ |
/* don't allow remaining bytes after the end of the message */ |
do { \ |
#define packet_check_eom() \ |
int _p = (payload_len), _e = (expected_len); \ |
|
if (_p != _e) { \ |
|
log("Packet integrity error (%d != %d) at %s:%d", \ |
|
_p, _e, __FILE__, __LINE__); \ |
|
packet_disconnect("Packet integrity error. (%d)", (type)); \ |
|
} \ |
|
} while (0) |
|
|
|
#define packet_done() \ |
|
do { \ |
do { \ |
int _len = packet_remaining(); \ |
int _len = packet_remaining(); \ |
if (_len > 0) { \ |
if (_len > 0) { \ |