Linux-Hams archive - February 1998: Format of fsa_sockaddr

Format of fsa_sockaddr

Kym Newbery ()
Mon, 2 Feb 1998 12:02:29 +1030 (CST)


Gday all..

I have been writing some Perl scripts to open AX25 sockets fairly
successfully, but I have some trouble passing the socket address to bind.

In C it's easy because you can use the struct fsa_sockaddr, in the
/usr/src/linux/net/ax25/af_ax25.h header file - but in Perl, I cannot
work out how I define a data structure to look like the fsa_sockaddr.

I have reverse-engineered the structure of the fsa_sockaddr and have
worked out which byte positions are used by which elements of
fsa_sockaddr (ie which of the callsigns / ssid bytes go where). The
fsa_sockaddr also includes some padding bytes - the location of which
are not immediately obvious!.

Anyway, as a perl hack, I have created a pack template that mirrors
the structure of the fsa_sockaddr.. but I suspect this template is not
very portable or robust...

Does anybody know the best way to 'emulate' the fsa_sockaddr structure
in perl ??

Regards
Kym

-- 
Kym B Newbery               | email  @work  niygf.nwew@rele.tunk.net
Hardware Design Engineer    | phone  @work  +61 8 8290 7904
British Aerospace Australia | fax    @work  +61 8 8290 8824
Salisbury, South Australia  | packet @home  vk5xkn@vk5wi.#adl.#sa.aus.oc