ucspi-ssl  0.99e
TLS encryption for IPv6 communication
ip6.h
Go to the documentation of this file.
1 #ifndef IP6_H
2 #define IP6_H
3 
4 #include "byte.h"
5 #include "stralloc.h"
6 
7 int ip6tobitstring(char *ip6address,stralloc *ip6string,unsigned int prefixlen);
8 int bitstringtoip6(stralloc *bits,stralloc *ip6address);
9 
10 extern unsigned int ip6_scan(const char *src,char *ip);
11 extern unsigned int ip6_compactaddr(char *s, char ip[16]);
12 extern unsigned int ip6_expandaddr(char *src, stralloc *dest);
13 extern int ip6tobitstring(char *, stralloc *, unsigned int);
14 /*
15  ip6 address syntax: (h = hex digit), no leading '0' required
16  1. hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh
17  2. any number of 0000 may be abbreviated as "::", but only once
18  flat ip6 address syntax:
19  hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
20 */
21 
22 #define IP6_FMT 40
23 
24 extern const unsigned char V4mappedprefix[12]; /*={0,0,0,0,0,0,0,0,0,0,0xff,0xff}; */
25 extern const unsigned char V6loopback[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; */
26 extern const unsigned char V6any[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; */
27 
28 #define ip6_isv4mapped(ip) (byte_equal(ip,12,V4mappedprefix))
29 
30 #define V4MAPPREFIX "::ffff:"
31 
32 #endif
unsigned int ip6_compactaddr(char *s, char ip[16])
const unsigned char V6any[16]
Definition: socket_v6any.c:2
int ip6tobitstring(char *ip6address, stralloc *ip6string, unsigned int prefixlen)
Definition: ip6_bit.c:20
unsigned int ip6_expandaddr(char *src, stralloc *dest)
const unsigned char V6loopback[16]
int bitstringtoip6(stralloc *bits, stralloc *ip6address)
Definition: ip6_bit.c:76
unsigned int ip6_scan(const char *src, char *ip)
const unsigned char V4mappedprefix[12]