summaryrefslogtreecommitdiff
path: root/packet.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-16 11:18:38 +1000
committerDamien Miller <djm@mindrot.org>2000-04-16 11:18:38 +1000
commit4af51306d9a51459a5bef922df1037f876ae51fe (patch)
tree09ecfc215fce82345a3259f8a0f384b9a67906f0 /packet.h
parent5d1705ecf9bd3216dc99a84242bcdf2e7297d307 (diff)
- OpenBSD CVS updates.
[ssh.1 ssh.c] - ssh -2 [auth.c channels.c clientloop.c packet.c packet.h serverloop.c] [session.c sshconnect.c] - check payload for (illegal) extra data [ALL] - whitespace cleanup
Diffstat (limited to 'packet.h')
-rw-r--r--packet.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/packet.h b/packet.h
index 565a9bd36..93495bbfc 100644
--- a/packet.h
+++ b/packet.h
@@ -1,19 +1,19 @@
1/* 1/*
2 * 2 *
3 * packet.h 3 * packet.h
4 * 4 *
5 * Author: Tatu Ylonen <ylo@cs.hut.fi> 5 * Author: Tatu Ylonen <ylo@cs.hut.fi>
6 * 6 *
7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 7 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
8 * All rights reserved 8 * All rights reserved
9 * 9 *
10 * Created: Sat Mar 18 02:02:14 1995 ylo 10 * Created: Sat Mar 18 02:02:14 1995 ylo
11 * 11 *
12 * Interface for the packet protocol functions. 12 * Interface for the packet protocol functions.
13 * 13 *
14 */ 14 */
15 15
16/* RCSID("$Id: packet.h,v 1.13 2000/04/13 02:26:37 damien Exp $"); */ 16/* RCSID("$Id: packet.h,v 1.14 2000/04/16 01:18:44 damien Exp $"); */
17 17
18#ifndef PACKET_H 18#ifndef PACKET_H
19#define PACKET_H 19#define PACKET_H
@@ -52,7 +52,7 @@ void packet_close(void);
52 * key is used for both sending and reception. However, both directions are 52 * key is used for both sending and reception. However, both directions are
53 * encrypted independently of each other. Cipher types are defined in ssh.h. 53 * encrypted independently of each other. Cipher types are defined in ssh.h.
54 */ 54 */
55void 55void
56packet_set_encryption_key(const unsigned char *key, unsigned int keylen, 56packet_set_encryption_key(const unsigned char *key, unsigned int keylen,
57 int cipher_type); 57 int cipher_type);
58 58
@@ -201,6 +201,16 @@ do { \
201 } \ 201 } \
202} while (0) 202} while (0)
203 203
204#define packet_done() \
205do { \
206 int _len = packet_remaining(); \
207 if (_len > 0) { \
208 log("Packet integrity error (%d bytes remaining) at %s:%d", \
209 _len ,__FILE__, __LINE__); \
210 packet_disconnect("Packet integrity error."); \
211 } \
212} while (0)
213
204/* remote host is connected via a socket/ipv4 */ 214/* remote host is connected via a socket/ipv4 */
205int packet_connection_is_on_socket(void); 215int packet_connection_is_on_socket(void);
206int packet_connection_is_ipv4(void); 216int packet_connection_is_ipv4(void);
@@ -208,4 +218,7 @@ int packet_connection_is_ipv4(void);
208/* enable SSH2 packet format */ 218/* enable SSH2 packet format */
209void packet_set_ssh2_format(void); 219void packet_set_ssh2_format(void);
210 220
221/* returns remaining payload bytes */
222int packet_remaining(void);
223
211#endif /* PACKET_H */ 224#endif /* PACKET_H */