I just saw an archived message from Jonathan Sartin regarding root and ICMP 
from August of last year.

I hit this problem many years ago and the solution we developed was to create a 
separate executable that had root privilege.  So there was a Java class, a 
native code .so/.dll and the root executable.  When Java opened up an ICMP 
socket, the native code would fork the executable which would open the raw 
socket and pass the descriptors back to the native code running within the Java 
VM.

This has the advantage over fping in that you are not running an executable 
every time you want to ping.  The executable is run once to open the socket.  
Unless I am misunderstanding the use of fping.

The code was written over ten years ago and at the time there was a bug in 
Solaris with raw sockets.  If I remember correctly, closing a socket and 
opening a new socket but getting the same fd caused problems.  So we had to 
preallocate a chunk of sockets at the beginning.

One thing I added a few years ago is the sizing of the socket buffers to be 
able to handle X number of concurrent pings.  I was getting errors in Linux 
trying to do 255 concurrent pings but the socket buffer only being big enough 
to handle a few at a time.

I am no C developer and just the thought of caring for this code and porting it 
to other platforms gives me a headache.  But I am more than happy to contribute 
it as a starting point for someone else to run with.  It currently is compiled 
for Solaris/Intel, Redhat Linux/Intel and Windows/Intel.  The Windows code is 
different in that it does not require the separate executable.  It just opens 
the sockets.

Bob Kostes
www.altmantech.com
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Please read the OpenNMS Mailing List FAQ:
http://www.opennms.org/index.php/Mailing_List_FAQ

opennms-devel mailing list

To *unsubscribe* or change your subscription options, see the bottom of this 
page:
https://lists.sourceforge.net/lists/listinfo/opennms-devel

Reply via email to