ucspi-tcp6 1.13.04
ucspi-tcp6
Loading...
Searching...
No Matches
ip6_bit.c File Reference
#include "ip.h"
#include "byte.h"
#include "str.h"
#include "fmt.h"
#include "stralloc.h"
#include "ip_bit.h"
Include dependency graph for ip6_bit.c:

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)

Detailed Description

Author
Li Minh Bui, feh @funcs bytetohex, ip6_bitstring, bitstring_ip6, ip6_fmt_str

Definition in file ip6_bit.c.

Macro Definition Documentation

◆ BITSUBSTITUTION

#define BITSUBSTITUTION

Definition at line 13 of file ip6_bit.c.

Function Documentation

◆ bitstring_ip6()

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.

Here is the caller graph for this function:

◆ bytetohex()

void bytetohex ( unsigned char decimal,
char hex[3] )

/fn bytetohex /brief Convert a number of max 255 to hex. /param decimal The decimal number. /param hex The converted hex value.

Definition at line 22 of file ip6_bit.c.

Here is the caller graph for this function:

◆ ip6_bitstring()

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.

Here is the caller graph for this function:

◆ ip6_fmt_str()

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.

Here is the call graph for this function:
Here is the caller graph for this function: