How to Enable DNS (Using PPPD)

Mike Siers mikes at poliac.com
Fri Nov 2 15:22:08 UTC 2001


Hi Chris,
Well I got the C code working.  Basically all I did was set the
global variables rtems_bsdnet_nameserver_count and rtems_bsdnet_nameserver[]
values and then called the function res_init().  This function is the
one that updates the private data structures.  I am assuming even
the code that writes a new resolv.conf file would still need to call the
res_init() function to load the new nameserver addresses.

So I still prefer using the C code method since my application does not
need a file system.  I will leave the code to use the resolv.conf file
in the pppd source code.  However, I will make the C code the default
way of updating the nameservers.  If the global nameserver variables
are ever removed from RTEMS then all we should have to do is switch back
to use the resolv.conf function.

I have also made a few other small changes to the pppd code that I will
package up and send to Joel.  Below is current list of updates to the
pppd code since the last snapshot:

 - added support for setting nameserver addresses received from peer
 - added new callback functions to return pppdmain status value
 - added new callback function to be able to replace the chat program
   dialer with a different modem dialer function

Mike Siers

-----Original Message-----
From: cjohns at kiwi.objectivedesign.com.au
[mailto:cjohns at kiwi.objectivedesign.com.au]On Behalf Of Chris Johns
Sent: Thursday, November 01, 2001 8:58 PM
To: Mike Siers
Cc: rtems-users at oarcorp.com
Subject: Re: How to Enable DNS (Using PPPD)


Mike Siers wrote:
>
> Thanks for the hints.  The current version of the pppd code does
> have a reference to the resolv.conf file.  I would prefer to have
> the DNS entries updated using C code directly since my application
> has no need for a file system.
>

Well the TCP/IP stack needs a small number of files. To me the over head
of using them is worth it.

> I have added code to set the rtems_bsdnet_nameserver_count and
> rtems_bsdnet_nameserver[] values.

I do not think this code should be put back into RTEMS as this allows
applications to use interfaces that are not standard to the stack. These
RTEMS extensions may not exists in future ports of the stack as the
filesystem now exists and is stable.

>  But my calls to gethostbyname()
> are still failing (error code 2).  I will try a few other things
> and let you know if I get it to work.

The entries are only read from this table at start up. By the time you
add the extra code to support a C function call API I suspect you will
use more memory than the file will use. Please reconsider using the
file.

--
 Chris Johns, cjohns at cybertec.com.au





More information about the users mailing list