OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [net/] [ns/] [dns/] [v2_0/] [doc/] [dns.sgml] - Blame information for rev 773

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
2
 
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
 
30
31
 
32
33
DNS for eCos and RedBoot
34
35
36
eCos and
37
RedBoot
38
can both use the DNS package to perform network name lookups.
39
40
41
42
DNS
43
44
DNS API
45
The DNS client uses the normal BSD API for performing lookups:
46
gethostbyname() and
47
gethostbyaddr().
48
49
There are a few restrictions:
50
51
52
Only IPv4 is supported, ie IPv6 addresses cannot be looked
53
up.
54
55
56
If the DNS server returns multiple authoritive records
57
for a host name, the hostent will only contain a record for the
58
first entry.
59
60
61
The code has been made thread safe. ie multiple threads
62
may call
63
gethostbyname()
64
 without causing problems to the hostent structure returned. What
65
is not safe is one thread using both
66
gethostbyname()
67
 and
68
gethostbyaddr().
69
A call to one will destroy the results from the previous call
70
to the other function.
71
72
73
To initialise the DNS client the following function must be
74
called:
75
#include <network.h>
76
int cyg_dns_res_init(struct in_addr *dns_server)
77
where dns_server is the address of the DNS server
78
the client should query. On Error this function returns -1, otherwise
79
 
80
been called, they will fail and return NULL.
81
 
82
A default, hard coded, server may be specified in the CDL option
83
CYGDAT_NS_DNS_DEFAULT_SERVER. The use of this is
84
controlled by CYGPKG_NS_DNS_DEFAULT. If this is
85
enabled, init_all_network_interfaces will
86
initialize the resolver with the hard coded address. The DHCP client
87
or user code my override this address by calling
88
cyg_dns_res_init again. 
89
 
90
The DNS client understands the concepts of the target being
91
in a domain. By default no domain will be used. Host name lookups
92
should be for fully qualified names. The domain name can be set
93
and retrieved using the functions:
94
95
  
96
    int getdomainname
97
    char *name
98
    size_t len
99
  
100
  
101
    int setdomainname
102
    const char *name
103
    size_t len
104
  
105
106
107
 
108
Alternatively, a hard coded domain name can be set using CDL.
109
The boolean CYGPKG_NS_DNS_DOMAINNAME enables this
110
and the domain name is taken from
111
CYGPKG_NS_DNS_DOMAINNAME_NAME.
112
 
113
Once set, the DNS client will first perform a lookup with the domain
114
name appended. If this fails it will then perform a second lookup
115
without the appended domain name. 
116
117
118

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.