FileDocCategorySizeDatePackage
Address.javaAPI DocApache Tomcat 6.0.144718Fri Jul 20 04:20:34 BST 2007org.apache.tomcat.jni

Address

public class Address extends Object
Address
author
Mladen Turk
version
$Revision: 467222 $, $Date: 2006-10-24 05:17:11 +0200 (mar., 24 oct. 2006) $

Fields Summary
public static String
APR_ANYADDR
Constructors Summary
Methods Summary
public static native booleanequal(long a, long b)
See if the IP addresses in two APR socket addresses are equivalent. Appropriate logic is present for comparing IPv4-mapped IPv6 addresses with IPv4 addresses.

param
a One of the APR socket addresses.
param
b The other APR socket address. The return value will be True if the addresses are equivalent.

public static native booleanfill(Sockaddr info, long sa)
Fill the Sockaddr class from apr_sockaddr_t

param
info Sockaddr class to fill
param
sa Structure pointer

public static native longget(int which, long sock)
Return an apr_sockaddr_t from an apr_socket_t

param
which Which interface do we want the apr_sockaddr_t for?
param
sock The socket to use
return
The returned apr_sockaddr_t.

public static native SockaddrgetInfo(long sa)
Create the Sockaddr object from apr_sockaddr_t

param
sa Structure pointer

public static native java.lang.Stringgetip(long sa)
Return the IP address (in numeric address string format) in an APR socket address. APR will allocate storage for the IP address string from the pool of the apr_sockaddr_t.

param
sa The socket address to reference.
return
The IP address.

public static native java.lang.Stringgetnameinfo(long sa, int flags)
Look up the host name from an apr_sockaddr_t.

param
sa The apr_sockaddr_t.
param
flags Special processing flags.
return
The hostname.

public static native intgetservbyname(long sockaddr, java.lang.String servname)
Given an apr_sockaddr_t and a service name, set the port for the service

param
sockaddr The apr_sockaddr_t that will have its port set
param
servname The name of the service you wish to use
return
APR status code.

public static native longinfo(java.lang.String hostname, int family, int port, int flags, long p)
Create apr_sockaddr_t from hostname, address family, and port.

param
hostname The hostname or numeric address string to resolve/parse, or NULL to build an address that corresponds to 0.0.0.0 or ::
param
family The address family to use, or APR_UNSPEC if the system should decide.
param
port The port number.
param
flags Special processing flags:
APR_IPV4_ADDR_OK first query for IPv4 addresses; only look
for IPv6 addresses if the first query failed;
only valid if family is APR_UNSPEC and hostname
isn't NULL; mutually exclusive with
APR_IPV6_ADDR_OK
APR_IPV6_ADDR_OK first query for IPv6 addresses; only look
for IPv4 addresses if the first query failed;
only valid if family is APR_UNSPEC and hostname
isn't NULL and APR_HAVE_IPV6; mutually exclusive
with APR_IPV4_ADDR_OK
param
p The pool for the apr_sockaddr_t and associated storage.
return
The new apr_sockaddr_t.