[openbeosnetteam] Re: PPP, nameservers, DHCP, up/down reports

  • From: "Philippe Houdoin" <philippe.houdoin@xxxxxxx>
  • To: openbeosnetteam@xxxxxxxxxxxxx
  • Date: Thu, 17 Apr 2003 12:53:29 +0200 CEST

Waldemar ask:
> > > I meant the operating system. There must be a table of 
> > > nameservers 
> > > and the
> > > IP of each device. How can I add my nameservers (and the assigned 
> > > IP)
> > > dynamically to that OS table? Is it a call to the IP and/or DHCP 
> > > protocol
> > > module? It is a system-dependent question and has nothing to do 
> > > with 
> > > the PPP
> > > protocol itself.
> > 
> > Ah! I misunderstood you. The PPP add-on to net_server, at least, 
> > calls 
> > some net_server config routines available in netdb.h. However, the 
> > PPP 
> > add-on is extraordinarily closely tied to the net_server, so it 
> > seems 
> > likely that it may use secret handshakes and smoke signals, too.
> > -Nathan
> 
> And how shall I do it in BONE or even more important: in our stack?

To set interface IP address, both BONE and our stack use ifconfig 
command line tool.
To see how ifconfig ask the stack to bind a particular IP address to an 
interface, look at current/src/apps/bin/ifconfig/*.

Yes, it's code jungle. But, shortly put, you open a socket of AF_INET 
family, 
and then call ioctl() on it, passing SIOCAIFADDR and a ifreq struct 
filled.
Don't forget to fill the interface name ("tulip0" for example) you want 
to setup. 
ifreq struct is defined in current/headers/posix/net/if.h.

BONE have a more integrated DHCP support, and come with a dhconfig, 
that let you turn on or off the dhcp support of each interface. I dunno 
more how it works internaly, thought.

-Philippe

--
Fortune Cookie Says:

"Life to you is a bold and dashing responsibility"
                -- a Mary Chung's fortune cookie


Other related posts: