I have to write some code that could control the TCP/IP stack, like
adding/deleting routes, setting the IP address and the netmask (in fact,
some code that does the job of ifconfig and route utilities), activate
DHCP, …
Does anyone have clues for me (links to documentation, sample code, …) ?
I noticed in a recent message someone is using ioctl on a socket
structure, in combination with an ortentry structure, to add routes, but I
can’t find any documentation on this !!
I have to write some code that could control the TCP/IP stack, like
adding/deleting routes, setting the IP address and the netmask (in fact,
some code that does the job of ifconfig and route utilities), activate
DHCP, …
Does anyone have clues for me (links to documentation, sample code, …) ?
You can set ip addresses via either the SIOCSIFADDR or SIOCAIFADDR ioctls.
There is an example using SIOCSIFADDR in the thread entitled “more ioctl”
in this group.
I noticed in a recent message someone is using ioctl on a socket
structure, in combination with an ortentry structure, to add routes, but I
can’t find any documentation on this !!
SIOCADDRT is specific to the tiny stack. The full stack uses routing sockets
(AF_ROUTE). There is an example in the thread entitled “Big Stack Routing”
in this group.