ucspi-tcp6 1.13.02
ucspi-tcp6
|
#include "stralloc.h"
Go to the source code of this file.
Functions | |
int | bitstring_ip4 (stralloc *, stralloc *) |
int | ip4_bitstring (stralloc *, char *, unsigned int) |
void | getnum (char *, int, unsigned long *) |
int | bitstring_ip6 (stralloc *, stralloc *) |
int | ip6_bitstring (stralloc *, char *, unsigned int) |
unsigned int | ip6_fmt_str (stralloc *, char *) |
int bitstring_ip4 | ( | stralloc * | ip4addr, |
stralloc * | ip4string | ||
) |
/fn bitstring_ip4 /brief This function takes an IPv4 bitstring and translates it to an IPv4 address + prefix /param in: ip4string The source address (with '_' start token). /param out: ip4addr 0-terminated estination IPv4 address + net prefix (eg. 127.0.0.0/16). /return -1: lack of memory; 1: non valid IPv4 address; 0: successful converted.
Definition at line 69 of file ip4_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 getnum | ( | char * | buf, |
int | len, | ||
unsigned long * | u | ||
) |
Definition at line 75 of file tcprules.c.
int ip4_bitstring | ( | stralloc * | ip4string, |
char * | ip, | ||
unsigned int | prefix | ||
) |
/fn ip4_bitstring /brief This function converts a IPv4 address into its binary representation with given prefix len /param out: ip4string 0-terminated destination address. /param in: ip4address The source address. /param in: prefix The net prefix bits (maximum 32 bits for IPv4). /return -1: lack of memory; 1: non valid IP address; 0: successful converted.
Definition at line 26 of file ip4_bit.c.
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.