Closing Ethernet

Leon Pollak leonp at plris.com
Fri Oct 17 21:53:39 UTC 2008


On Friday October 17 2008, Chris Johns wrote:
> Leon Pollak wrote:
> > Hello, all.
> >
> > I need to exit from the application which uses networking.
> > What is the proper way to close networking?
> > The only thing relevant I found was rtems_bsdnet_detach(...), but nobody
> > seems to call it...
> > And I do not know how...:-(
> >
> > And it seems to me not the correct routine...
Thanks, Chris.
I hope, my two other mails will be commented soon too...:-)
Waiting for the comments to finalize the corrections...


> There is not single defined way to close networking. Your application
> should close all sockets. For TCP you may need to consider the linger
> option. For UDP sockets your application handling the protocol may need to
> signal a disconnect to the remote end. Once all sockets are closed and you
> are happy the data has been sent you could "down" the interface. Check the
> FreeBSD ifconfig man page for details. The down option is documented as:
>
> down    Mark an interface ``down''.  When an interface is marked
> 	``down'', the system will not attempt to transmit messages
> 	through that interface.  If possible, the interface will be reset
> 	to disable reception as well.  This action does not automatically
> 	disable routes using the interface.
>
> After this there is nothing else you need to do.
Sure I miss something.
How can I issue ifconfig down...?


> The rtems_bsdnet_detach is available to provide a means for a specific
> driver to release any hardware resources it has. If RTEMS ever needs hot
> swap or plug and play support this can be used.
Still, I do not know how to call it.

May be I explained myself bad. Sorry.
What I need is to stop all the Ethernet HW as I am exiting from the 
application into boot loader to load another application.
If the HW will remain active, then, for example, incoming packet will cause an 
interrupt, while there is no code to server it.

So, how can I do this from my application?
>
> Regards
> Chris

Again, thanks and BR

-- 
Leon



More information about the users mailing list