lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-devel] [task #7017] Implement DNS client


From: Frédéric Bernon
Subject: [lwip-devel] [task #7017] Implement DNS client
Date: Mon, 19 Nov 2007 22:50:33 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; fr; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9

Follow-up Comment #59, task #7017 (project lwip):

Ok, it's check in, hoping it is what you expected.

"Implement DNS_DOES_NAME_CHECK option (check if name received match the name
query), implement DNS_USES_STATIC_BUF (the place where copy dns payload to
parse the response), return an error if there is no place for a new query, and
fix some minor problems."

I not yet move DNS options in opt.h, I think we should be agree that some of
them should stay in dns.c (but which ones?).

To check the behavior, I do this code :

static void
dns_thread(void *arg)
{ struct ip_addr addr;
  err_t err;
  if ((err = netconn_gethostbyname((char*)(arg), &(addr))) == ERR_OK) {
    printf("netconn_gethostbyname(%s)==", (char*)(arg));
    ip_addr_debug_print(LWIP_DBG_ON, (&addr));
    printf("n");
  } else {
    printf("netconn_gethostbyname(%s)==%in", (char*)(arg), (int)(err));
  }
}

...

{
  sys_thread_new("dns_thread", dns_thread, (void*)("yoda.hymatom.fr"),  
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
  sys_thread_new("dns_thread", dns_thread, (void*)("host1.hymatom.fr"),
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
  sys_thread_new("dns_thread", dns_thread, (void*)("host2.hymatom.fr"),
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
  sys_thread_new("dns_thread", dns_thread, (void*)("host3.hymatom.fr"),  
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
  sys_thread_new("dns_thread", dns_thread, (void*)("host4.hymatom.fr"),  
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
  sys_thread_new("dns_thread", dns_thread, (void*)("host5.hymatom.fr"),
DEFAULT_THREAD_STACKSIZE, DEFAULT_THREAD_PRIO);
}

And I got good results (two of them returns -1, ERR_MEM, since table size is
4). Others give good results.

Last, I also test lwip_gethostbyname, but results are mixed due to the static
set of variables. inet_ntoa should also be avoid (same problem of course).


    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/task/?7017>

_______________________________________________
  Message posté via/par Savannah
  http://savannah.nongnu.org/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]