[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RAW sockets
From: |
Kim F. Storm |
Subject: |
Re: RAW sockets |
Date: |
Sun, 25 Feb 2007 23:23:09 +0100 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.94 (gnu/linux) |
A Soare <address@hidden> writes:
>> > To trace the root , withut using external commands.
>>
>> What is that supposed to mean?
>>
>
> To find out the trace made by a IP packet from one destination to one other.
>
> It would be useful also to write a ping command, without using ping of shell.
If that's the purpose, I don't see it as "very useful".
On GNU/Linux, you need to be root to open a raw socket, so if you are
an ordinary user, you still have to use the external ping program
which is suid root.
I can hardly imagine Emacs running on a platform which does not
have a ping program - so why not use that?
It would be nice if someone wrote a generic ping.el wrapper around
different ping programs on various platforms, passing the proper set
of parameters to make them do the right things...
Then you could do (ping "host" 'ping-result 3 2) to send a maximum of
3 pings with 2 seconds interval to host "host", calling the
ping-result sentinel with 2 paramters (ping-result HOST TIME) where
TIME is the response time in seconds (a float) if host responds,
or TIME is nil if host does not respond.
--
Kim F. Storm <address@hidden> http://www.cua.dk