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.
 
 
 
 

104 lines
3.2 KiB

  1. /* this header file comes from libowfat, http://www.fefe.de/libowfat/ */
  2. #ifndef DNS_H
  3. #define DNS_H
  4. #include "stralloc.h"
  5. #include "iopause.h"
  6. #include "taia.h"
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. #define DNS_C_IN "\0\1"
  11. #define DNS_C_ANY "\0\377"
  12. #define DNS_T_A "\0\1"
  13. #define DNS_T_NS "\0\2"
  14. #define DNS_T_CNAME "\0\5"
  15. #define DNS_T_SOA "\0\6"
  16. #define DNS_T_PTR "\0\14"
  17. #define DNS_T_HINFO "\0\15"
  18. #define DNS_T_MX "\0\17"
  19. #define DNS_T_TXT "\0\20"
  20. #define DNS_T_RP "\0\21"
  21. #define DNS_T_SIG "\0\30"
  22. #define DNS_T_KEY "\0\31"
  23. #define DNS_T_AAAA "\0\34"
  24. #define DNS_T_AXFR "\0\374"
  25. #define DNS_T_ANY "\0\377"
  26. struct dns_transmit {
  27. char *query; /* 0, or dynamically allocated */
  28. unsigned int querylen;
  29. char *packet; /* 0, or dynamically allocated */
  30. unsigned int packetlen;
  31. int s1; /* 0, or 1 + an open file descriptor */
  32. int tcpstate;
  33. unsigned int udploop;
  34. unsigned int curserver;
  35. struct taia deadline;
  36. unsigned int pos;
  37. const char *servers;
  38. char localip[16];
  39. unsigned int scope_id;
  40. char qtype[2];
  41. } ;
  42. void dns_random_init(const char *);
  43. unsigned int dns_random(unsigned int);
  44. void dns_sortip(char *,unsigned int);
  45. void dns_sortip6(char *,unsigned int);
  46. void dns_domain_free(char **);
  47. int dns_domain_copy(char **,const char *);
  48. unsigned int dns_domain_length(const char *);
  49. int dns_domain_equal(const char *,const char *);
  50. int dns_domain_suffix(const char *,const char *);
  51. unsigned int dns_domain_suffixpos(const char *,const char *);
  52. int dns_domain_fromdot(char **,const char *,size_t);
  53. int dns_domain_todot_cat(stralloc *,const char *);
  54. unsigned int dns_packet_copy(const char *,unsigned int,unsigned int,char *,unsigned int);
  55. unsigned int dns_packet_getname(const char *,unsigned int,unsigned int,char **);
  56. unsigned int dns_packet_skipname(const char *,unsigned int,unsigned int);
  57. int dns_transmit_start(struct dns_transmit *,const char *,int,const char *,const char *,const char *);
  58. void dns_transmit_free(struct dns_transmit *);
  59. void dns_transmit_io(struct dns_transmit *,iopause_fd *,struct taia *);
  60. int dns_transmit_get(struct dns_transmit *,const iopause_fd *,const struct taia *);
  61. int dns_resolvconfip(char *);
  62. int dns_resolve(const char *,const char *);
  63. extern struct dns_transmit dns_resolve_tx;
  64. int dns_ip4_packet(stralloc *,const char *,unsigned int);
  65. int dns_ip4(stralloc *,const stralloc *);
  66. int dns_ip6_packet(stralloc *,const char *,unsigned int);
  67. int dns_ip6(stralloc *,stralloc *);
  68. int dns_name_packet(stralloc *,const char *,unsigned int);
  69. void dns_name4_domain(char *,const char *);
  70. #define DNS_NAME4_DOMAIN 31
  71. int dns_name4(stralloc *,const char *);
  72. int dns_txt_packet(stralloc *,const char *,unsigned int);
  73. int dns_txt(stralloc *,const stralloc *);
  74. int dns_mx_packet(stralloc *,const char *,unsigned int);
  75. int dns_mx(stralloc *,const stralloc *);
  76. int dns_resolvconfrewrite(stralloc *);
  77. int dns_ip4_qualify_rules(stralloc *,stralloc *,const stralloc *,const stralloc *);
  78. int dns_ip4_qualify(stralloc *,stralloc *,const stralloc *);
  79. int dns_ip6_qualify_rules(stralloc *,stralloc *,const stralloc *,const stralloc *);
  80. int dns_ip6_qualify(stralloc *,stralloc *,const stralloc *);
  81. void dns_name6_domain(char *,const char *);
  82. #define DNS_NAME6_DOMAIN (4*16+11)
  83. int dns_name6(stralloc *,const char *);
  84. #ifdef __cplusplus
  85. }
  86. #endif
  87. #endif