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.
 
 
 
 

45 lines
1.2 KiB

  1. /* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
  2. #ifndef IP6_H
  3. #define IP6_H
  4. #include "byte.h"
  5. #include "uint32.h"
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9. size_t scan_ip6(const char* src,char* ip);
  10. size_t fmt_ip6(char* dest,const char* ip);
  11. size_t fmt_ip6c(char* dest,const char* ip);
  12. size_t scan_ip6if(const char* src,char* ip,uint32* scope_id);
  13. size_t fmt_ip6if(char* dest,const char* ip,uint32 scope_id);
  14. size_t fmt_ip6ifc(char* dest,const char* ip,uint32 scope_id);
  15. size_t scan_ip6_flat(const char *src,char *);
  16. size_t fmt_ip6_flat(char *dest,const char *);
  17. /*
  18. ip6 address syntax: (h = hex digit), no leading '0' required
  19. 1. hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh:hhhh
  20. 2. any number of 0000 may be abbreviated as "::", but only once
  21. flat ip6 address syntax:
  22. hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
  23. */
  24. #define IP6_FMT 40
  25. #define FMT_IP6 40
  26. extern const char V4mappedprefix[12]; /*={0,0,0,0,0,0,0,0,0,0,0xff,0xff}; */
  27. extern const char V6loopback[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1}; */
  28. extern const char V6any[16]; /*={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}; */
  29. #define ip6_isv4mapped(ip) (byte_equal(ip,12,V4mappedprefix))
  30. #ifdef __cplusplus
  31. }
  32. #endif
  33. #endif