ucspi-tcp6 1.13.02
ucspi-tcp6
|
#include "ip.h"
#include "byte.h"
#include "str.h"
#include "fmt.h"
#include "stralloc.h"
#include "ip_bit.h"
Go to the source code of this file.
Macros | |
#define | BITSUBSTITUTION |
Functions | |
void | bytetohex (unsigned char decimal, char hex[3]) |
int | ip6_bitstring (stralloc *ip6string, char *ip6addr, unsigned int prefix) |
int | bitstring_ip6 (stralloc *ip6addr, stralloc *ip6string) |
unsigned int | ip6_fmt_str (stralloc *dest, char *src) |
Definition in file ip6_bit.c.
int bitstring_ip6 | ( | stralloc * | ip6addr, |
stralloc * | ip6string | ||
) |
/fn bitstring_ip6 /brief This function converts a bit string which is produced by ip6_bitstring() into an IPv6 address. The string may start with a '^'. /param in: ip6string Source string which need to be converted. /param out ip6addr 0-terminated IPv6 destination address with net prefix. /return -1: No memory could allocated,0: Failure,1: Success.
Definition at line 102 of file ip6_bit.c.
void bytetohex | ( | unsigned char | decimal, |
char | hex[3] | ||
) |
int ip6_bitstring | ( | stralloc * | ip6string, |
char * | ip6addr, | ||
unsigned int | prefix | ||
) |
/fn ip6_bitstring /brief This function converts a IPv6 address into its binary representation. /param out: ip6string The destination address. /param in: ip6addr The source address. /param in: prefix The net prefix bits (maximum 128 bits for IPv6). /return -1: lack of memory; 1: non valid IPv6 address; 0: successful converted.
Definition at line 48 of file ip6_bit.c.
unsigned int ip6_fmt_str | ( | stralloc * | dest, |
char * | src | ||
) |
/fn ip6_fmt_str /brief This function expands any valid IPv6 address into its full format of 16 bytes. It returns the number of processed tokens on success. /param src Source IPv6 address. /param destination Expanded IPv6 address. /return -1: No memory could allocated; 1: failure, 0: success
Definition at line 161 of file ip6_bit.c.