ucspi-ssl  0.99e
TLS encryption for IPv6 communication
Macros | Functions | Variables
ip6.h File Reference
#include "byte.h"
#include "stralloc.h"
Include dependency graph for ip6.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define IP6_FMT   40
 
#define ip6_isv4mapped(ip)   (byte_equal(ip,12,V4mappedprefix))
 
#define V4MAPPREFIX   "::ffff:"
 

Functions

int ip6tobitstring (char *ip6address, stralloc *ip6string, unsigned int prefixlen)
 
int bitstringtoip6 (stralloc *bits, stralloc *ip6address)
 
unsigned int ip6_scan (const char *src, char *ip)
 
unsigned int ip6_compactaddr (char *s, char ip[16])
 
unsigned int ip6_expandaddr (char *src, stralloc *dest)
 

Variables

const unsigned char V4mappedprefix [12]
 
const unsigned char V6loopback [16]
 
const unsigned char V6any [16]
 

Macro Definition Documentation

◆ IP6_FMT

#define IP6_FMT   40

Definition at line 22 of file ip6.h.

◆ ip6_isv4mapped

#define ip6_isv4mapped (   ip)    (byte_equal(ip,12,V4mappedprefix))

Definition at line 28 of file ip6.h.

◆ V4MAPPREFIX

#define V4MAPPREFIX   "::ffff:"

Definition at line 30 of file ip6.h.

Function Documentation

◆ bitstringtoip6()

int bitstringtoip6 ( stralloc *  ip6string,
stralloc *  ip6addr 
)

This function converts a bit string which is produced by ip6tobitstring() into an IPv6 address. The string may start with a '^'.

Parameters
ip6stringSource string which need to be converted.
ip6addrDestination string.
Returns
-1: No memory could allocated,0: Failure,1: Success.

Definition at line 76 of file ip6_bit.c.

Here is the call graph for this function:

◆ ip6_compactaddr()

unsigned int ip6_compactaddr ( char *  s,
char  ip[16] 
)

This function converts a IPv6 address as 16 bytes char array into a compactified string.

Author
Felix von Leitner
Parameters
sDestination address.
ipSource address as 16 bytes char array.
Returns
0: failure, else: the number of characters of the return value.

Definition at line 15 of file ip6_compactaddr.c.

Here is the caller graph for this function:

◆ ip6_expandaddr()

unsigned int ip6_expandaddr ( char *  src,
stralloc *  destination 
)

This function expands any valid IPv6 address into its full format of 16 bytes. It returns the number of processed tokens on success.

Parameters
srcSource IPv6 address.
destinationExpanded IPv6 address.
Returns
-1: No memory could allocated, 0:failure, 1: success

Definition at line 15 of file ip6_expandaddr.c.

Here is the call graph for this function:

◆ ip6_scan()

unsigned int ip6_scan ( const char *  src,
char *  ip 
)
Here is the caller graph for this function:

◆ ip6tobitstring()

int ip6tobitstring ( char *  ip6address,
stralloc *  ip6string,
unsigned int  prefix 
)

This function converts a IPv6 address into its binary representation.

Parameters
ip6addressThe source address.
ip6stringThe destination address.
prefixThe net prefix bits (maximum 128 bits for IPv6).
Returns
-1:lack of memory,0: non valid IPv6 address,1: successful converted.

Definition at line 20 of file ip6_bit.c.

Here is the call graph for this function:

Variable Documentation

◆ V4mappedprefix

const unsigned char V4mappedprefix[12]

Definition at line 2 of file socket_v4mappedprefix.c.

◆ V6any

const unsigned char V6any[16]

Definition at line 2 of file socket_v6any.c.

◆ V6loopback

const unsigned char V6loopback[16]

Definition at line 2 of file socket_v6loopback.c.