ucspi-ssl  0.99e
TLS encryption for IPv6 communication
uint16_unpack.c
Go to the documentation of this file.
1 #include "uint16.h"
2 
3 void uint16_unpack(const char s[2],uint16 *u)
4 {
5  uint16 result;
6 
7  result = (unsigned char) s[1];
8  result <<= 8;
9  result += (unsigned char) s[0];
10 
11  *u = result;
12 }
13 
14 void uint16_unpack_big(const char s[2],uint16 *u)
15 {
16  uint16 result;
17 
18  result = (unsigned char) s[0];
19  result <<= 8;
20  result += (unsigned char) s[1];
21 
22  *u = result;
23 }
void uint16_unpack(const char s[2], uint16 *u)
Definition: uint16_unpack.c:3
void uint16_unpack_big(const char s[2], uint16 *u)
Definition: uint16_unpack.c:14
unsigned short uint16
Definition: uint16.h:4