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.
 
 
 
 

35 lines
1.1 KiB

  1. #ifndef IP6_H
  2. #define IP6_H
  3. #include "byte.h"
  4. #include "uint32.h"
  5. unsigned int scan_ip6(const char* src,char* ip);
  6. unsigned int fmt_ip6(char* dest,const char* ip);
  7. unsigned int fmt_ip6c(char* dest,const char* ip);
  8. unsigned int scan_ip6if(const char* src,char* ip,uint32* scope_id);
  9. unsigned int fmt_ip6if(char* dest,const char* ip,uint32 scope_id);
  10. unsigned int fmt_ip6ifc(char* dest,const char* ip,uint32 scope_id);
  11. unsigned int scan_ip6_flat(const char *src,char *);
  12. unsigned int fmt_ip6_flat(char *dest,const char *);
  13. /*
  14. ip6 address syntax: (h = hex digit), no leading '0' required
  15. 1. hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh
  16. 2. any number of 0000 may be abbreviated as "::", but only once
  17. flat ip6 address syntax:
  18. hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  19. */
  20. #define IP6_FMT 40
  21. extern const char V4mappedprefix[12]; /*={0,0,0,0,0,0,0,0,0,0,0xff,0xff}; */
  22. extern const char V6loopback[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; */
  23. extern const char V6any[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; */
  24. #define ip6_isv4mapped(ip) (byte_equal(ip,12,V4mappedprefix))
  25. #endif