Go to the source code of this file.
|
static TIME tree_evaluate_recurse | PROTO ((int *, unsigned char **, int *, struct tree *)) |
|
static TIME do_host_lookup | PROTO ((int *, unsigned char **, int *, struct dns_host_entry *)) |
|
static void do_data_copy | PROTO ((int *, unsigned char **, int *, unsigned char *, int)) |
|
pair | cons (caddr_t car, pair cdr) |
|
struct tree_cache * | tree_cache (struct tree *tree) |
|
struct tree * | tree_host_lookup (char *name) |
|
struct dns_host_entry * | enter_dns_host (char *name) |
|
struct tree * | tree_const (unsigned char *data, int len) |
|
struct tree * | tree_concat (struct tree *left, struct tree *right) |
|
struct tree * | tree_limit (struct tree *tree, int limit) |
|
int | tree_evaluate (struct tree_cache *tree_cache) |
|
static TIME | tree_evaluate_recurse (int *bufix, unsigned char **bufp, int *bufcount, struct tree *tree) |
|
static TIME | do_host_lookup (int *bufix, unsigned char **bufp, int *bufcount, struct dns_host_entry *dns) |
|
static void | do_data_copy (int *bufix, unsigned char **bufp, int *bufcount, unsigned char *data, int len) |
|
◆ cons()
◆ do_data_copy()
◆ do_host_lookup()
Definition at line 284 of file tree.c.
289{
292 int new_len;
293
294#ifdef DEBUG_EVAL
295 debug (
"time: now = %d dns = %d %d diff = %d",
297#endif
298
299
300 if (cur_time <= dns ->
timeout) {
301#ifdef DEBUG_EVAL
302 debug (
"easy copy: %x %d %x",
303 dns ->
data, dns -> data_len,
304 dns ->
data ? *(
int *)(dns ->
data) : 0);
305#endif
307 dns ->
data, dns -> data_len);
309 }
310#ifdef DEBUG_EVAL
312#endif
313
314
317#ifndef NO_H_ERRNO
320#endif
322#ifndef NO_H_ERRNO
323 break;
325 warn (
"%s: temporary name server failure",
327 break;
330 break;
332 warn (
"%s: no A record associated with address",
334 }
335#endif
336
337
339 }
340
341#ifdef DEBUG_EVAL
342 debug (
"Lookup succeeded; first address is %x",
344#endif
345
346
348 ;
349
350
352 if (dns -> buf_len <
i) {
354 (
unsigned char *)
dmalloc (new_len,
"do_host_lookup");
355
357 new_len = dns -> buf_len;
358 if (!dns -> buf_len) {
361 }
362 } else {
366 dns -> buf_len = new_len;
367 }
368 }
369
370
371
375 }
376#ifdef DEBUG_EVAL
377 debug (
"dns -> data: %x h -> h_addr_list [0]: %x",
379#endif
380 dns -> data_len = new_len;
381
382
383
385
386#ifdef DEBUG_EVAL
387 debug (
"hard copy: %x %d %x",
388 dns ->
data, dns -> data_len, *(
int *)(dns ->
data));
389#endif
392}
void dfree(void *ptr, char *name)
static void do_data_copy(int *bufix, unsigned char **bufp, int *bufcount, unsigned char *data, int len)
PHOSTENT WSAAPI gethostbyname(IN const char FAR *name)
GLenum GLuint GLenum GLsizei const GLchar * buf
GLfloat GLfloat GLfloat GLfloat h
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Referenced by tree_evaluate_recurse().
◆ enter_dns_host()
struct dns_host_entry * enter_dns_host |
( |
char * |
name | ) |
|
Definition at line 96 of file tree.c.
98{
99 struct dns_host_entry *dh;
100
101 if (!(dh = (
struct dns_host_entry *)
dmalloc
102 (sizeof (struct dns_host_entry), "enter_dns_host"))
104 "enter_dns_host")))
105 error (
"Can't allocate space for new host.");
107 dh ->
data = (
unsigned char *)0;
108 dh -> data_len = 0;
109 dh -> buf_len = 0;
111 return dh;
112}
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
Referenced by tree_host_lookup().
◆ PROTO() [1/3]
◆ PROTO() [2/3]
◆ PROTO() [3/3]
◆ tree_cache()
Definition at line 69 of file tree.c.
71{
73
74 tc = new_tree_cache (
"tree_cache");
76 return 0;
77 tc ->
value = (
unsigned char *)0;
82}
◆ tree_concat()
Definition at line 129 of file tree.c.
131{
133
134
135
136
141
142
146 "tree_concat");
148 error (
"No memory to concatenate constants.");
160 }
161
162
163 if (!(
nt = new_tree (
"tree_concat")))
164 error (
"No memory for data tree concatenation node.");
165 nt ->
op = TREE_CONCAT;
169}
NTSTATUS NTSTATUS void free_tree(tree *t) __attribute__((nonnull(1)))
◆ tree_const()
Definition at line 114 of file tree.c.
117{
119 if (!(
nt = new_tree (
"tree_const"))
120 || !(
nt ->
data.const_val.data =
121 (
unsigned char *)
dmalloc (
len,
"tree_const")))
122 error (
"No memory for constant data tree node.");
123 nt ->
op = TREE_CONST;
127}
◆ tree_evaluate()
Definition at line 194 of file tree.c.
196{
199 int bufix = 0;
200
201
202
204 return 1;
205
206
209
210
213 return 1;
214 }
215
216
217
218 if (!(bp = (
unsigned char *)
dmalloc (bufix,
"tree_evaluate")))
219 return 0;
220
221
223 bufix = 0;
224
225
226
227
229
230
231
237 return 1;
238}
static TIME tree_evaluate_recurse(int *bufix, unsigned char **bufp, int *bufcount, struct tree *tree)
◆ tree_evaluate_recurse()
Definition at line 240 of file tree.c.
245{
248
250 case TREE_CONCAT:
255 if (t1 > t2)
256 return t2;
257 return t1;
258
259 case TREE_HOST_LOOKUP:
262
263 case TREE_CONST:
268 return t1;
269
270 case TREE_LIMIT:
275 return t1;
276
277 default:
278 warn (
"Bad node id in tree: %d.");
280 return t1;
281 }
282}
static TIME do_host_lookup(int *bufix, unsigned char **bufp, int *bufcount, struct dns_host_entry *dns)
Referenced by tree_evaluate(), and tree_evaluate_recurse().
◆ tree_host_lookup()
Definition at line 84 of file tree.c.
86{
88 nt = new_tree (
"tree_host_lookup");
90 error (
"No memory for host lookup tree node.");
91 nt ->
op = TREE_HOST_LOOKUP;
94}
struct dns_host_entry * enter_dns_host(char *name)
◆ tree_limit()
Definition at line 171 of file tree.c.
174{
176
177
178 if (
tree ->
op == TREE_CONST) {
182 }
183
184
185 rv = new_tree ("tree_limit");
186 if (!rv)
187 return (
struct tree *)0;
188 rv ->
op = TREE_LIMIT;
191 return rv;
192}
◆ copyright
Initial value:=
"$Id: tree.c,v 1.10 1997/05/09 08:14:57 mellon Exp $ Copyright (c) 1995, 1996, 1997 The Internet Software Consortium. All rights reserved.\n"
Definition at line 44 of file tree.c.