From dev-return-1964-apmail-apr-dev-archive=apr.apache.org@apr.apache.org Mon Apr 30 22:02:52 2001
Return-Path:
Delivered-To: apmail-apr-dev-archive@apr.apache.org
Received: (qmail 74198 invoked by uid 500); 30 Apr 2001 22:02:41 -0000
Mailing-List: contact dev-help@apr.apache.org; run by ezmlm
Precedence: bulk
List-Post:
List-Help:
List-Unsubscribe:
List-Subscribe:
Delivered-To: mailing list dev@apr.apache.org
Received: (qmail 74149 invoked from network); 30 Apr 2001 22:02:37 -0000
X-Authentication-Warning: adsl-77-241-65.rdu.bellsouth.net: trawick set sender to trawickj@bellsouth.net using -f
Sender: trawick@bellsouth.net
To: Jon Travis
Cc: dev@apr.apache.org
Subject: Re: [PATCH] socket family fetching
References: <20010430103952.A20374@covalent.net>
From: Jeff Trawick
Date: 30 Apr 2001 17:58:30 -0400
In-Reply-To: <20010430103952.A20374@covalent.net>
Message-ID:
Lines: 23
User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.3
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N
Jon Travis writes:
> I need a routine to fetch the socket family. I could just refer
> to the information in the sockaddr_t address length, but that is
> rather hackish. Anyway, here tis. We should also probably be
> moving towards making the sockaddr_t an opaque type, or at least
> some of the members.
I think that the better place to look is addr->sa.sin.sin_family.
Hopefully you should be able to return this as-is.
On first thought, the partial opaqueness makes sense (though I don't
know how to do that neatly in C). Thinking down the road, the number
of accessor functions could get out of hand (similar to the
apr_fileinfo_t issue). I'm mostly happy with apps peering into the
apr_sockaddr_t, though maybe we need to make it friendlier by adding
(e.g.) a family field which starts out as APR_UNSPEC and is set once
we know the family.
--
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...