pinging or else network devices from livecode
alex at tweedly.net
Mon Jan 24 12:38:39 CST 2011
No, the arp command doesn't send out anything.
My sample code did an "open datagram socket to tSocket " for each IP
address, which *will* cause the IP subsystem to send an arp request
packet for the IP address (if it's not already in the arp table), but
won't cause any packet to be sent to the other host even if the arp
request is successfully resolved (Note - needs to be a datagram socket,
if it had been a TCP open then it would have initiated a TCP handshake
to the other host, which is definitely not desirable).
The arp command will only add to the table if the "-s", "-S" or "-f"
arguments are used - definitely not advised for general use.
And of course the "-d" argument will delete one entry (or all entries).
On 24/01/2011 17:43, Bob Sneidar wrote:
> Wait a minute, the arp command does not send out anything does it? I thought arp only parsed out the current arp table for the device you are running the command on.
> Try flushing your arp cache, then running the arp command and see what you get. On a Unix terminal, the arp command needs a switch (parameter) like -a. Be careful here, because the arp command will also WRITE to the arp table. You can actually add an entry that registers an IP address to a hardware address. If there is anything wrong with what you tell it, you may lose connectivity to the device until you clear the arp table.
> On Jan 22, 2011, at 3:38 PM, Robert Brenstein wrote:
>> On 22.01.11 at 01:28 +0000 Alex Tweedly apparently wrote:
>>> You can't do ping directly from LC - LC only supports UDP and TCP sockets, not ICMP or raw.
>>> You could do it via shell - but too many devices may not respond to ping.
>>> Do you want to find all active IP addresses on your own subnet, or on any arbitrary subnet ?
>> At the moment I need to check only my own subnet, but checking another subnet will come later.
>>> If it's on your own, then here's what I'd do
>>> - try opening a UDP socket to each IP address
>>> - use shell / arp to see what's there.
>>> every device should respond to an arp request, so this is much more likely to find all active devices.
>> Just did a quickie try with your code. Sounds like it will do what I want.
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode