[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] scanning port of a mac?



At 08.39 1998.04.15, LAURENT BARDI wrote:
>moreover, i ve seen in 519r4 that we can create appletalk socket, is
>there a way to have a list of:
>-zone
>-node
>...

What exactly do you want there?  A list of all available AppleTalk
services?  In a particular zone, or ... ?

Here is a piece of code that will try (I think :) to connect to all
available ports on a the local machine:

#!perl -wl
$|++;
use Socket;
socket(SOCK, PF_APPLETALK, SOCK_STREAM, 0) or die $!;
@me = sockaddr_atlk(getsockname(SOCK));
for $a (0 .. 2**8-1) {
  print
    ((connect(SOCK, sockaddr_atlk($me[0], $me[1], $a))
    ? 'Yes' : 'No') . ": $me[0].$me[1].$a");
}
__END__

But it takes a long time to execute.  There are better ways, but none that
I know of from MacPerl.  Also, I don't know how to get the name/type/zone
back from the address via MacPerl.  This just checks addresses.

--
Chris Nandor          mailto:pudge@pobox.com         http://pudge.net/
%PGPKey=('B76E72AD',[1024,'0824 090B CE73 CA10  1FF7 7F13 8180 B6B6'])
#==               New Book:  MacPerl: Power and Ease               ==#
#==    Publishing Date: Early 1998. http://www.ptf.com/macperl/    ==#



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch