diff options
author | Andreas Gunnarsson <andreas@cvs.openbsd.org> | 2009-05-27 06:36:08 +0000 |
---|---|---|
committer | Andreas Gunnarsson <andreas@cvs.openbsd.org> | 2009-05-27 06:36:08 +0000 |
commit | 562c9dda1d71bc6ac3940b83046a639f51284569 (patch) | |
tree | 95d2acac808b8380e7792143dc7c287af5bd8855 /usr.bin/ssh | |
parent | be16f61d021eb0ed2f1fb2d2ef0d99d4b084f4f8 (diff) |
Add packet_put_int64() and packet_get_int64(), part of a larger change
from Martin Forssen.
ok markus@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/packet.c | 16 | ||||
-rw-r--r-- | usr.bin/ssh/packet.h | 4 |
2 files changed, 18 insertions, 2 deletions
diff --git a/usr.bin/ssh/packet.c b/usr.bin/ssh/packet.c index 6869d86d586..8a3b1e124eb 100644 --- a/usr.bin/ssh/packet.c +++ b/usr.bin/ssh/packet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.c,v 1.161 2009/05/25 06:48:01 andreas Exp $ */ +/* $OpenBSD: packet.c,v 1.162 2009/05/27 06:36:07 andreas Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland @@ -587,6 +587,12 @@ packet_put_int(u_int value) } void +packet_put_int64(u_int64_t value) +{ + buffer_put_int64(&active_state->outgoing_packet, value); +} + +void packet_put_string(const void *buf, u_int len) { buffer_put_string(&active_state->outgoing_packet, buf, len); @@ -1457,6 +1463,14 @@ packet_get_int(void) return buffer_get_int(&active_state->incoming_packet); } +/* Returns an 64 bit integer from the packet data. */ + +u_int64_t +packet_get_int64(void) +{ + return buffer_get_int64(&active_state->incoming_packet); +} + /* * Returns an arbitrary precision integer from the packet data. The integer * must have been initialized before this call. diff --git a/usr.bin/ssh/packet.h b/usr.bin/ssh/packet.h index 9a9c97719a7..265fcf23664 100644 --- a/usr.bin/ssh/packet.h +++ b/usr.bin/ssh/packet.h @@ -1,4 +1,4 @@ -/* $OpenBSD: packet.h,v 1.50 2009/05/25 06:48:01 andreas Exp $ */ +/* $OpenBSD: packet.h,v 1.51 2009/05/27 06:36:07 andreas Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -39,6 +39,7 @@ void packet_set_authenticated(void); void packet_start(u_char); void packet_put_char(int ch); void packet_put_int(u_int value); +void packet_put_int64(u_int64_t value); void packet_put_bignum(BIGNUM * value); void packet_put_bignum2(BIGNUM * value); void packet_put_string(const void *buf, u_int len); @@ -55,6 +56,7 @@ int packet_read_poll_seqnr(u_int32_t *seqnr_p); u_int packet_get_char(void); u_int packet_get_int(void); +u_int64_t packet_get_int64(void); void packet_get_bignum(BIGNUM * value); void packet_get_bignum2(BIGNUM * value); void *packet_get_raw(u_int *length_ptr); |