Add missing g_enc_le2().

Sponsored by:	DARPA & NAI Labs.
This commit is contained in:
Poul-Henning Kamp 2002-09-30 08:47:46 +00:00
parent e19573391d
commit 5b3317e9e6
2 changed files with 9 additions and 0 deletions

View File

@ -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);

View File

@ -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)
{