Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals

uIP hostname resolver functions
[The uIP TCP/IP stack]


Detailed Description

The uIP DNS resolver functions are used to lookup a hostname and map it to a numerical IP address. It maintains a list of resolved hostnames that can be queried with the resolv_lookup() function. New hostnames can be resolved using the resolv_query() function.

uIP DNS resolver´Â hostnameÀ» ã°Å³ª IPÁÖ¼Ò¸¦ ¸ÅÇνÃÄÑÁÖ´Â ¿ªÇÒÀ» ÇÑ´Ù. resolv_lookup() ÇÔ¼ö·Î ¸®½ºÆ®¿¡ Àִ ȣ½ºÆ®³×ÀÓÀ» ã°í, resolv_query() ÇÔ¼ö·Î »õ·Î¿î È£½ºÆ®³×ÀÓÀ» ¸®½ºÆ®·Î ¸¸µé¼öÀÖ´Ù.


When a hostname has been resolved (or found to be non-existant), the resolver code calls a callback function called resolv_found() that must be implemented by the module that uses the resolver.

È£½ºÆ®³×ÀÓÀÌ ¸®½ºÆ®¿¡ ÀÖÀ»¶§(¶Ç´Â Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì), resolverÀÇ ÄÚµå´Â resolv_found()¶ó´Â ÄݹéÇÔ¼ö¸¦ È£ÃâÇÑ´Ù. µû¶ó¼­ resulver¸¦ »ç¿ëÇÏ´Â ¸ðµâ¿¡¼­ ÀÌ ÇÔ¼ö¿¡ ´ëÇÑ Ã³¸®¸¦ ±¸ÇöÇØ¾ß ÇÑ´Ù.



Files

file  resolv.c
 DNS host name to IP address resolver.
DNSÈ£½ºÆ® À̸§À» IP·Î º¯È¯

file  resolv.h
 DNS resolver code header file.
DNS resolver Çì´õ ÆÄÀÏ


Functions

void resolv_found (char *name, u16_t *ipaddr)
 Callback function which is called when a hostname is found.
È£½ºÆ®³×ÀÓÀ» ã¾ÒÀ»¶§ È£ÃâµÇ´Â ÄݹéÇÔ¼ö.

void resolv_conf (u16_t *dnsserver)
 Configure which DNS server to use for queries.
DNS¼­¹ö¸¦ ÁöÁ¤ÇÑ´Ù.

u16_tresolv_getserver (void)
 Obtain the currently configured DNS server.
ÇöÀç ÁöÁ¤µÈ DNS¼­¹öÀÇ IPÁÖ¼Ò¸¦ ¾ò¾î¿Â´Ù.

void resolv_init (void)
 Initalize the resolver.
ÃʱâÈ­.

u16_tresolv_lookup (char *name)
 Look up a hostname in the array of known hostnames.
¾Ë·ÁÁø È£½ºÆ®³×ÀÓ ¹è¿­¿¡¼­ È£½ºÆ®³×ÀÓÀ» ã´Â´Ù.

void resolv_query (char *name)
 Queues a name so that a question for the name will be sent out.
³×Æ®¿öÅ©¿¡¼­ È£½ºÆ®³×ÀÓÀ» ã¾Æ¿Â´Ù.


Function Documentation

void resolv_conf u16_t dnsserver  ) 
 

Configure which DNS server to use for queries.

DNS¼­¹ö¸¦ ÁöÁ¤ ÇÑ´Ù.


Parameters:
dnsserver A pointer to a 4-byte representation of the IP address of the DNS server to be configured.
DNS¼­¹öÀÇ 4¹ÙÀÌÆ® IP¸¦ ³Ö¾îÁØ´Ù.

Here is the call graph for this function:

void resolv_found char *  name,
u16_t ipaddr
 

Callback function which is called when a hostname is found.

È£½ºÆ®³×ÀÓÀ» ã¾ÒÀ» ¶§ È£ÃâµÇ´Â ÄݹéÇÔ¼ö.


This function must be implemented by the module that uses the DNS resolver. It is called when a hostname is found, or when a hostname was not found.

È£½ºÆ®³×ÀÓÀ» ã¾Ò°Å³ª, ¸ø ã¾ÒÀ» ¶§ ÄݹéÇÔ¼ö¸¦ È£ÃâÇϱ⠶§¹®¿¡ DNS resover¸¦ »ç¿ëÇÏ´Â ¸ðµâ¿¡¼­´Â ÀÌ ÇÔ¼ö¸¦ ²À ±¸ÇöÇØÁà¾ß ÇÑ´Ù.


Parameters:
name A pointer to the name that was looked up.
ãÀ» È£½ºÆ®³×ÀÓÀÇ ¹è¿­ Æ÷ÀÎÅÍ.
ipaddr A pointer to a 4-byte array containing the IP address of the hostname, or NULL if the hostname could not be found.
IPÁÖ¼Ò¸¦ ´ãÀ» ¹è¿­, ¸¸¾à NULLÀ̸é ù¹øÂ° ÆÄ¶ó¹ÌÅÍÀÇ È£½ºÆ®³×ÀÓÀ» ¸øÃ£Àº°ÍÀÌ´Ù.

u16_t* resolv_getserver void   ) 
 

Obtain the currently configured DNS server.

ÇöÀç »ç¿ëµÇ´Â DNS¼­¹öÀÇ IPÁÖ¼Ò¸¦ ¾Ë¾Æ¿Â´Ù.


Returns:
A pointer to a 4-byte representation of the IP address of the currently configured DNS server or NULL if no DNS server has been configured.
ÇöÀç »ç¿ëµÇ°í ÀÖ´Â DNS¼­¹öÀÇ IPÁÖ¼Ò¸¦ ¸®ÅÏÇÑ´Ù. ¸¸¾à DNS¼­¹ö°¡ ¾ø´Ù¸é NULL.

u16_t* resolv_lookup char *  name  ) 
 

Look up a hostname in the array of known hostnames.

¾Ë·ÁÁø È£½ºÆ®³×ÀÓÀ» °¡Áö°íÀÖ´Â ¹è¿­¿¡¼­ È£½ºÆ®³×ÀÓÀ» ã´ÂÇÔ¼ö.


Note:
This function only looks in the internal array of known hostnames, it does not send out a query for the hostname if none was found. The function resolv_query() can be used to send a query for a hostname.

ÀÌ ÇÔ¼ö´Â ´ÜÁö Ä¿³Î ³»ºÎ Å×ÀÌºí¸¸ ã¾Æº»´Ù. È£½ºÆ®³×ÀÓÀ» ³×Æ®¿öÅ©¿¡¼­ ã¾Æ¿À´Â ÇÔ¼ö´Â resolv_query()ÀÌ´Ù.


Returns:
A pointer to a 4-byte representation of the hostname's IP address, or NULL if the hostname was not found in the array of hostnames.
È£½ºÆ®³×ÀÓ Å×À̺íÀ» µÚÁ®¼­ ¸¸¾à ã¾Ò´Ù¸é, ÇØ´ç IPÁÖ¼Ò¸¦, ¸ø ã¾Ò´Ù¸é NULLÀ» ¸®ÅÏÇÑ´Ù.

void resolv_query char *  name  ) 
 

Queues a name so that a question for the name will be sent out.

³×Æ®¿öÅ©¿¡¼­ È£½ºÆ®³×ÀÓÀ» ã¾Æ¿Â´Ù.


Parameters:
name The hostname that is to be queried.
Äõ¸®µÈ È£½ºÆ®³×ÀÓ.


Generated on Tue Oct 7 15:51:51 2003 for uIP 0.9 by doxygen 1.3.3