httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: apr_sockaddr_t
Date Fri, 10 Nov 2000 01:41:09 GMT

++1.

Ryan

> Index: include/apr_network_io.h
> ===================================================================
> RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v
> retrieving revision 1.65
> diff -u -r1.65 apr_network_io.h
> --- include/apr_network_io.h    2000/11/10 00:58:25     1.65
> +++ include/apr_network_io.h    2000/11/10 01:16:49
> @@ -119,6 +119,12 @@
>      APR_REMOTE
>  } apr_interface_e;
> 
> +/* Enum of the types of socket we can create... */
> +typedef enum {
> +    APR_TCP_V4,
> +    APR_TCP_V6
> +} apr_sockettype_e;
> +
>  /* I guess not everybody uses inet_addr.  This defines apr_inet_addr
>   * appropriately.
>   */
> @@ -136,6 +142,29 @@
> 
>  /* use apr_uint16_t just in case some system has a short that isn't 16
> bits... */
>  typedef apr_uint16_t            apr_port_t;
> +
> +/* we're going to roll our own sockaddr type as we want to make sure
> + * we have protocol independance for APR...
> + *
> + * It's defined here as I think it should all be platform safe...
> + */
> +typedef struct {
> +    apr_pool_t *cont;              /* The pool to use... */
> +    char *hostname;                /* The hostname */
> +    char *port_str;                /* String representation of port */
> +    apr_port_t port;               /* numeric port */
> +    union {
> +        struct sockaddr_in sin;    /* IPv4 sockaddr structure */
> +#if APR_HAVE_IPV6
> +        struct sockaddr_in6 sin6;  /* IPv6 sockaddr structure */
> +#endif
> +    } sa;
> +    apr_socklen_t sa_len;          /* How big is the sockaddr we're using?
> */
> +    int addr_len;                  /* How big should the address buffer be?
> +                                    * 16 for v4 or 48 for v6
> +                                    * used in inet_ntop...
> +                                    */
> +} apr_sockaddr_t;
> 
>  #if APR_HAS_SENDFILE
>  /* Define flags passed in on apr_sendfile() */
> 
> 
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message