packet.h (18a71195) packet.h (a8f6863a)
1/*
2 *
3 * packet.h
4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
9 *
10 * Created: Sat Mar 18 02:02:14 1995 ylo
11 *
12 * Interface for the packet protocol functions.
13 *
1/*
2 *
3 * packet.h
4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved
9 *
10 * Created: Sat Mar 18 02:02:14 1995 ylo
11 *
12 * Interface for the packet protocol functions.
13 *
14 * $FreeBSD$
15 */
16
14 */
15
17/* RCSID("$Id: packet.h,v 1.9 2000/01/04 16:54:58 markus Exp $"); */
16/* RCSID("$Id: packet.h,v 1.10 2000/03/16 20:56:14 markus Exp $"); */
18
19#ifndef PACKET_H
20#define PACKET_H
21
17
18#ifndef PACKET_H
19#define PACKET_H
20
22#include <openssl/bn.h>
21#include <ssl/bn.h>
23
24/*
25 * Sets the socket used for communication. Disables encryption until
26 * packet_set_encryption_key is called. It is permissible that fd_in and
27 * fd_out are the same descriptor; in that case it is assumed to be a socket.
28 */
29void packet_set_connection(int fd_in, int fd_out);
30

--- 109 unchanged lines hidden (view full) ---

140char *packet_get_string(unsigned int *length_ptr);
141
142/*
143 * Logs the error in syslog using LOG_INFO, constructs and sends a disconnect
144 * packet, closes the connection, and exits. This function never returns.
145 * The error message should not contain a newline. The total length of the
146 * message must not exceed 1024 bytes.
147 */
22
23/*
24 * Sets the socket used for communication. Disables encryption until
25 * packet_set_encryption_key is called. It is permissible that fd_in and
26 * fd_out are the same descriptor; in that case it is assumed to be a socket.
27 */
28void packet_set_connection(int fd_in, int fd_out);
29

--- 109 unchanged lines hidden (view full) ---

139char *packet_get_string(unsigned int *length_ptr);
140
141/*
142 * Logs the error in syslog using LOG_INFO, constructs and sends a disconnect
143 * packet, closes the connection, and exits. This function never returns.
144 * The error message should not contain a newline. The total length of the
145 * message must not exceed 1024 bytes.
146 */
148void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2)));;
147void packet_disconnect(const char *fmt,...) __attribute__((format(printf, 1, 2)));
149
150/*
151 * Sends a diagnostic message to the other side. This message can be sent at
152 * any time (but not while constructing another message). The message is
153 * printed immediately, but only if the client is being executed in verbose
154 * mode. These messages are primarily intended to ease debugging
155 * authentication problems. The total length of the message must not exceed
156 * 1024 bytes. This will automatically call packet_write_wait. If the
157 * remote side protocol flags do not indicate that it supports SSH_MSG_DEBUG,
158 * this will do nothing.
159 */
148
149/*
150 * Sends a diagnostic message to the other side. This message can be sent at
151 * any time (but not while constructing another message). The message is
152 * printed immediately, but only if the client is being executed in verbose
153 * mode. These messages are primarily intended to ease debugging
154 * authentication problems. The total length of the message must not exceed
155 * 1024 bytes. This will automatically call packet_write_wait. If the
156 * remote side protocol flags do not indicate that it supports SSH_MSG_DEBUG,
157 * this will do nothing.
158 */
160void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2)));;
159void packet_send_debug(const char *fmt,...) __attribute__((format(printf, 1, 2)));
161
162/* Checks if there is any buffered output, and tries to write some of the output. */
163void packet_write_poll(void);
164
165/* Waits until all pending output data has been written. */
166void packet_write_wait(void);
167
168/* Returns true if there is buffered data to write to the connection. */

--- 31 unchanged lines hidden ---
160
161/* Checks if there is any buffered output, and tries to write some of the output. */
162void packet_write_poll(void);
163
164/* Waits until all pending output data has been written. */
165void packet_write_wait(void);
166
167/* Returns true if there is buffered data to write to the connection. */

--- 31 unchanged lines hidden ---