diff options
author | Gisle Aas <gisle@aas.no> | 2002-01-14 22:35:28 -0800 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-01-15 14:43:04 +0000 |
commit | 2a84dff3ea9dbc3670690c13c0f8f55f391c41cc (patch) | |
tree | 30cce9520b4f9598b15a55c950bb0c484928e8ab /ext/Socket/Socket.pm | |
parent | 271595ccfa2b8feb1491512173d5ac42651d16f1 (diff) | |
download | perl-2a84dff3ea9dbc3670690c13c0f8f55f391c41cc.tar.gz |
Socket::sockaddr_family
Message-ID: <lr1ygrk7gv.fsf@caliper.activestate.com>
p4raw-id: //depot/perl@14279
Diffstat (limited to 'ext/Socket/Socket.pm')
-rw-r--r-- | ext/Socket/Socket.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index dce0e88bc4..c8f2fdea9f 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -112,6 +112,15 @@ Note - does not return a number. Returns the 4-byte 'invalid' ip address. Normally equivalent to inet_aton('255.255.255.255'). +=item sockaddr_family SOCKADDR + +Takes a sockaddr structure (as returned by pack_sockaddr_in(), +pack_sockaddr_un() or the perl builtin functions getsockname() and +getpeername()) and returns the address family tag. It will match the +constant AF_INET for a sockaddr_in and AF_UNIX for a sockaddr_un. It +can be used to figure out what unpacker to use for a sockaddr of +unknown type. + =item sockaddr_in PORT, ADDRESS =item sockaddr_in SOCKADDR_IN @@ -173,7 +182,9 @@ require Exporter; use XSLoader (); @ISA = qw(Exporter); @EXPORT = qw( - inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in + inet_aton inet_ntoa + sockaddr_family + pack_sockaddr_in unpack_sockaddr_in pack_sockaddr_un unpack_sockaddr_un sockaddr_in sockaddr_un INADDR_ANY INADDR_BROADCAST INADDR_LOOPBACK INADDR_NONE |