diff options
author | phk <phk@FreeBSD.org> | 2002-09-30 08:47:46 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2002-09-30 08:47:46 +0000 |
commit | a2bc7673e2e0e78b7bc4be238831aab34d99f57b (patch) | |
tree | 054a163d793f80797fb14f393d33e28cd187e211 | |
parent | bd82e84c3032f6c9073ae0a3b53df5c3ac9a24b5 (diff) | |
download | FreeBSD-src-a2bc7673e2e0e78b7bc4be238831aab34d99f57b.zip FreeBSD-src-a2bc7673e2e0e78b7bc4be238831aab34d99f57b.tar.gz |
Add missing g_enc_le2().
Sponsored by: DARPA & NAI Labs.
-rw-r--r-- | sys/geom/geom.h | 1 | ||||
-rw-r--r-- | sys/geom/geom_enc.c | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sys/geom/geom.h b/sys/geom/geom.h index a5f35f1..493221b 100644 --- a/sys/geom/geom.h +++ b/sys/geom/geom.h @@ -300,6 +300,7 @@ uint32_t g_dec_be4(u_char *p); uint16_t g_dec_le2(u_char *p); uint32_t g_dec_le4(u_char *p); uint64_t g_dec_le8(u_char *p); +void g_enc_le2(u_char *p, uint16_t u); void g_enc_le4(u_char *p, uint32_t u); void g_enc_le8(u_char *p, uint64_t u); diff --git a/sys/geom/geom_enc.c b/sys/geom/geom_enc.c index 10d577e..fb87e77 100644 --- a/sys/geom/geom_enc.c +++ b/sys/geom/geom_enc.c @@ -82,6 +82,14 @@ g_dec_le2(u_char *p) return((p[1] << 8) | p[0]); } +void +g_enc_le2(u_char *p, uint16_t u) +{ + + p[0] = u & 0xff; + p[1] = (u >> 8) & 0xff; +} + uint32_t g_dec_le4(u_char *p) { |