diff options
author | Damien Miller <djm@mindrot.org> | 2010-09-24 22:15:11 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-09-24 22:15:11 +1000 |
commit | 65e42f87fe945a2bf30d7e02358554dbaefa8a4c (patch) | |
tree | 102c10a0b5328a40c79dca19d208f0ca0c1671b5 /misc.h | |
parent | 7fe2b1fec3b364faf952828f3875b8e7eed8feb4 (diff) |
- djm@cvs.openbsd.org 2010/09/22 22:58:51
[atomicio.c atomicio.h misc.c misc.h scp.c sftp-client.c]
[sftp-client.h sftp.1 sftp.c]
add an option per-read/write callback to atomicio
factor out bandwidth limiting code from scp(1) into a generic bandwidth
limiter that can be attached using the atomicio callback mechanism
add a bandwidth limit option to sftp(1) using the above
"very nice" markus@
Diffstat (limited to 'misc.h')
-rw-r--r-- | misc.h | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: misc.h,v 1.43 2010/07/13 23:13:16 djm Exp $ */ | 1 | /* $OpenBSD: misc.h,v 1.44 2010/09/22 22:58:51 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -80,6 +80,15 @@ void put_u32(void *, u_int32_t) | |||
80 | void put_u16(void *, u_int16_t) | 80 | void put_u16(void *, u_int16_t) |
81 | __attribute__((__bounded__( __minbytes__, 1, 2))); | 81 | __attribute__((__bounded__( __minbytes__, 1, 2))); |
82 | 82 | ||
83 | struct bwlimit { | ||
84 | size_t buflen; | ||
85 | u_int64_t rate, thresh, lamt; | ||
86 | struct timeval bwstart, bwend; | ||
87 | }; | ||
88 | |||
89 | void bandwidth_limit_init(struct bwlimit *, u_int64_t, size_t); | ||
90 | void bandwidth_limit(struct bwlimit *, size_t); | ||
91 | |||
83 | 92 | ||
84 | /* readpass.c */ | 93 | /* readpass.c */ |
85 | 94 | ||