Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
837 B

21 years ago
#ifndef IP6_H
#define IP6_H
#include "byte.h"
unsigned int scan_ip6(const char *src,char *ip);
unsigned int fmt_ip6(char *dest,const char *ip);
21 years ago
unsigned int scan_ip6_flat(const char *src,char *);
unsigned int fmt_ip6_flat(char *dest,const char *);
21 years ago
/*
ip6 address syntax: (h = hex digit), no leading '0' required
1. hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh
2. any number of 0000 may be abbreviated as "::", but only once
flat ip6 address syntax:
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
*/
#define IP6_FMT 40
extern const unsigned char V4mappedprefix[12]; /*={0,0,0,0,0,0,0,0,0,0,0xff,0xff}; */
extern const unsigned char V6loopback[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; */
extern const unsigned char V6any[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; */
21 years ago
#define ip6_isv4mapped(ip) (byte_equal(ip,12,V4mappedprefix))
#endif