fehQlibs 26
Qlibs
Loading...
Searching...
No Matches
Functions
ip6.c File Reference

handling of IPv6 addresses More...

#include "fmt.h"
#include "byte.h"
#include "scan.h"
#include "ip.h"
#include "str.h"
Include dependency graph for ip6.c:

Go to the source code of this file.

Functions

unsigned int ip6_fmt (char *s, char ip[16])
 ip6_fmt convert IPv6 address to compactified IPv6 address string
 
unsigned int ip6_fmt_flat (char *s, char ip[16])
 ip6_fmt_flat convert IPv6 address to IPv6 address string
 
unsigned int ia6_fmt (char *s, char ip[16])
 ia6_fmt convert IPv6 address to inverse DNS nibble format 1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.ip6.arpa
 
unsigned int ip6_scan_flat (const char *s, char ip[16])
 ip6_scan_flat convert IPv6 address string to IPv6 address array
 
unsigned int ip6_scan (const char *s, char ip[16])
 ip6_scan parse compactified IPv6 address string and convert to IPv6 address array
 
unsigned int ip6_scanbracket (const char *s, char ip[16])
 ip6_scanbracket parse IPv6 string address enclosed in brackets
 
unsigned int ip6_ifscan (char *s, char ip[16], stralloc *ifname)
 ip6_ifscan parse compactified IPv6 address string concatinated with the interface name: fe80::1eth0
 
unsigned int ip6_cidr (char *s, char ip[16], unsigned long *plen)
 ip6_cidr parse compactified IPv6 address string concatinated with the prefix length: fe80::1/64
 
unsigned int ip6_bytestring (stralloc *ipstring, char ip[16], int prefix)
 ip6_bytestring parse IPv6 address and represent as char string with length prefix
 

Detailed Description

handling of IPv6 addresses

Authors
djb, fefe, feh ucspi-tcp, ucspi-tcp6

Definition in file ip6.c.

Function Documentation

◆ ia6_fmt()

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

ia6_fmt convert IPv6 address to inverse DNS nibble format 1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.1.2.3.4.5.6.7.8.9.a.b.c.d.e.f.ip6.arpa

Parameters
inputIPv6 char array output: pointer to IPv6 address string
Returns
int length of address

Definition at line 102 of file ip6.c.

Here is the call graph for this function:

◆ ip6_bytestring()

unsigned int ip6_bytestring ( stralloc ipstring,
char  ip[16],
int  prefix 
)

ip6_bytestring parse IPv6 address and represent as char string with length prefix

Parameters
inputIPv6 char array, prefix length output: pointer to stralloc bit string;
Returns
n: number of bytes, if ok; -1: memory shortage

Definition at line 310 of file ip6.c.

Here is the call graph for this function:

◆ ip6_cidr()

unsigned int ip6_cidr ( char *  s,
char  ip[16],
unsigned long *  plen 
)

ip6_cidr parse compactified IPv6 address string concatinated with the prefix length: fe80::1/64

Parameters
inputpointer to IPv6 address string output: IPv6 char array, long plen
Returns
int length of ip6_address/ip

Definition at line 290 of file ip6.c.

Here is the call graph for this function:

◆ ip6_fmt()

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

ip6_fmt convert IPv6 address to compactified IPv6 address string

Parameters
inputIPv6 char array output: pointer to IPv6 address string
Returns
int length of address (ok > 0)

Definition at line 21 of file ip6.c.

Here is the call graph for this function:

◆ ip6_fmt_flat()

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

ip6_fmt_flat convert IPv6 address to IPv6 address string

Parameters
inputIPv6 char array output: pointer to IPv6 address string
Returns
int length of address (ok > 0)

Definition at line 84 of file ip6.c.

Here is the call graph for this function:

◆ ip6_ifscan()

unsigned int ip6_ifscan ( char *  s,
char  ip[16],
stralloc ifname 
)

ip6_ifscan parse compactified IPv6 address string concatinated with the interface name: fe80::1eth0

Parameters
inputpointer to IPv6 address string output: IPv6 char array, stralloc interface_name
Returns
int length of ip6_address/ip

Definition at line 262 of file ip6.c.

Here is the call graph for this function:

◆ ip6_scan()

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

ip6_scan parse compactified IPv6 address string and convert to IPv6 address array

Parameters
inputpointer to IPv6 address string output: IPv6 char array
Returns
int length of ip6_address/ip

Definition at line 151 of file ip6.c.

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

◆ ip6_scan_flat()

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

ip6_scan_flat convert IPv6 address string to IPv6 address array

Parameters
inputpointer to IPv6 address string output: IPv6 char array
Returns
int length of address (ok > 0)

Definition at line 129 of file ip6.c.

Here is the call graph for this function:

◆ ip6_scanbracket()

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

ip6_scanbracket parse IPv6 string address enclosed in brackets

Parameters
inputpointer to IPv6 address string output: IPv6 char array
Returns
int length of ip_address (ok > 0)

Definition at line 243 of file ip6.c.

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