|
Defines |
| #define | STRINGIFY(x) # x |
| #define | TOSTRING(x) STRINGIFY(x) |
| #define | hton64(x) ((uint64_t)((htonl(((uint32_t)((x)>>32)&0xFFFFFFFF))))|((uint64_t)(htonl((uint32_t)((x)&0xFFFFFFFF)))<<32)) |
| #define | ntoh64(x) ((uint64_t)((ntohl(((uint32_t)((x)>>32)&0xFFFFFFFF))))|((uint64_t)(ntohl((uint32_t)((x)&0xFFFFFFFF)))<<32)) |
| #define | Attribute_GetType(x) ((x)>>1) |
| #define | Attribute_GetHF(x) ((x)&1) |
| #define | Attribute_GetTypeHF(x, y) (((x)<<1)|((y)&1)) |
| #define | hextobin(x) ((x)>'9'?((x)>'Z'?(((x)-0x27)&0x0F):(((x)-0x07)&0x0F)):((x)&0x0F)) |
| #define | ishex(x) ((((x)>='0')&&((x)<='9'))||(((x)>='A')&&((x)<='Z'))||(((x)>='a')&&((x)<='z'))) |
Functions |
| unsigned | hex2bytes (char *s, uint8_t **dest) |
| | convert string representation of hex value into array of bytes
|
| const char * | bin2str (const uint8_t *data, uint32_t len) |
| | Create printable representation of byte string. If data in set are ASCII characters, then representation is given string, else the format is "0x...".
|
| void | hexalize (uint8_t **data, unsigned *len) |
| | If data passed to function are in format "0x..." then convert such valu to correspondig byte array, else leave text string.
|
| BIGNUM * | HexToBignum (const uint8_t *hex, uint32_t len) |
| | Convert a hex representation to BIGNUM.
|
| uint8_t * | Clone (const uint8_t *data, uint32_t len) |
| | Clone a buffer.
|
| void | PrintBuffer (unsigned char *buf, unsigned long len) |
| | Print a binary buffer in hex string format.
|
| void | PrintBignum (const BIGNUM *a) |
| uint32_t | StringToIP (char *str_ip) |
| | Convert IP address from string to binary format e.g. 1.2.34 --> 0x04030201.
|
| char * | IPToString (uint32_t ip) |
| | Convert an IP addr from binary format to string e.g. 0x04030201 --> 1.2.3.4.
|