Groonga 3.0.9 Source Code Document
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
ngx_resolver.h
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) Igor Sysoev
4  * Copyright (C) Nginx, Inc.
5  */
6 
7 
8 #include <ngx_config.h>
9 #include <ngx_core.h>
10 
11 
12 #ifndef _NGX_RESOLVER_H_INCLUDED_
13 #define _NGX_RESOLVER_H_INCLUDED_
14 
15 
16 #define NGX_RESOLVE_A 1
17 #define NGX_RESOLVE_CNAME 5
18 #define NGX_RESOLVE_PTR 12
19 #define NGX_RESOLVE_MX 15
20 #define NGX_RESOLVE_TXT 16
21 #define NGX_RESOLVE_DNAME 39
22 
23 #define NGX_RESOLVE_FORMERR 1
24 #define NGX_RESOLVE_SERVFAIL 2
25 #define NGX_RESOLVE_NXDOMAIN 3
26 #define NGX_RESOLVE_NOTIMP 4
27 #define NGX_RESOLVE_REFUSED 5
28 #define NGX_RESOLVE_TIMEDOUT NGX_ETIMEDOUT
29 
30 
31 #define NGX_NO_RESOLVER (void *) -1
32 
33 #define NGX_RESOLVER_MAX_RECURSION 50
34 
35 
36 typedef struct {
38  struct sockaddr *sockaddr;
39  socklen_t socklen;
43 
44 
46 
48 
49 
50 typedef struct {
53 
54  /* PTR: resolved name, A: name to resolve */
55  u_char *name;
56 
57  u_short nlen;
58  u_short qlen;
59 
60  u_char *query;
61 
62  union {
63  in_addr_t addr;
64  in_addr_t *addrs;
65  u_char *cname;
66  } u;
67 
68  u_short naddrs;
69  u_short cnlen;
70 
71  time_t expire;
72  time_t valid;
73 
76 
77 
78 typedef struct {
79  /* has to be pointer because of "incomplete type" */
81  void *dummy;
83 
84  /* ident must be after 3 pointers */
86 
87  /* simple round robin DNS peers balancer */
90 
93 
96 
99 
102 
104  time_t expire;
105  time_t valid;
106 
109 
110 
115 
116  /* ident must be after 3 pointers */
118 
122 
124  in_addr_t *addrs;
125  in_addr_t addr;
126 
128  void *data;
130 
131  ngx_uint_t quick; /* unsigned quick:1; */
134 };
135 
136 
138  ngx_uint_t n);
140  ngx_resolver_ctx_t *temp);
146 
147 
148 #endif /* _NGX_RESOLVER_H_INCLUDED_ */