summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2009-06-21 18:53:53 +1000
committerDarren Tucker <dtucker@zip.com.au>2009-06-21 18:53:53 +1000
commitc5564e1c4c41ae9af96973e2996e2a4285acbae8 (patch)
treef9fae51c40975704cc73af6073914b00821e3009 /monitor.c
parent1cc55d7a607455d75db0204b5acebce47667b0f8 (diff)
- andreas@cvs.openbsd.org 2009/05/28 16:50:16
[sshd.c packet.c serverloop.c monitor_wrap.c clientloop.c sshconnect.c monitor.c Added roaming.h roaming_common.c roaming_dummy.c] Keep track of number of bytes read and written. Needed for upcoming changes. Most code from Martin Forssen, maf at appgate dot com. ok markus@ Also, applied appropriate changes to Makefile.in
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/monitor.c b/monitor.c
index 61242e6d0..36a9e1dc1 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.102 2009/05/25 06:48:01 andreas Exp $ */ 1/* $OpenBSD: monitor.c,v 1.103 2009/05/28 16:50:16 andreas Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -125,6 +125,8 @@ struct {
125 u_int ilen; 125 u_int ilen;
126 u_char *output; 126 u_char *output;
127 u_int olen; 127 u_int olen;
128 u_int64_t sent_bytes;
129 u_int64_t recv_bytes;
128} child_state; 130} child_state;
129 131
130/* Functions on the monitor that answer unprivileged requests */ 132/* Functions on the monitor that answer unprivileged requests */
@@ -1679,6 +1681,10 @@ monitor_apply_keystate(struct monitor *pmonitor)
1679 child_state.olen); 1681 child_state.olen);
1680 memset(child_state.output, 0, child_state.olen); 1682 memset(child_state.output, 0, child_state.olen);
1681 xfree(child_state.output); 1683 xfree(child_state.output);
1684
1685 /* Roaming */
1686 if (compat20)
1687 roam_set_bytes(child_state.sent_bytes, child_state.recv_bytes);
1682} 1688}
1683 1689
1684static Kex * 1690static Kex *
@@ -1794,6 +1800,12 @@ mm_get_keystate(struct monitor *pmonitor)
1794 child_state.input = buffer_get_string(&m, &child_state.ilen); 1800 child_state.input = buffer_get_string(&m, &child_state.ilen);
1795 child_state.output = buffer_get_string(&m, &child_state.olen); 1801 child_state.output = buffer_get_string(&m, &child_state.olen);
1796 1802
1803 /* Roaming */
1804 if (compat20) {
1805 child_state.sent_bytes = buffer_get_int64(&m);
1806 child_state.recv_bytes = buffer_get_int64(&m);
1807 }
1808
1797 buffer_free(&m); 1809 buffer_free(&m);
1798} 1810}
1799 1811