1 /* $NetBSD: inet.h,v 1.1.1.3 2014/07/12 11:57:56 spz Exp $ */
4 Portable definitions for internet addresses */
7 * Copyright (c) 2004,2007,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
8 * Copyright (c) 1996-2003 by Internet Software Consortium
10 * Permission to use, copy, modify, and distribute this software for any
11 * purpose with or without fee is hereby granted, provided that the above
12 * copyright notice and this permission notice appear in all copies.
14 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
15 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
17 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
20 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 * Internet Systems Consortium, Inc.
24 * Redwood City, CA 94063
26 * https://www.isc.org/
30 /* An internet address of up to 128 bits. */
34 unsigned char iabuf
[16];
38 struct iaddrlist
*next
;
43 /* struct iaddrmatch - used to compare a host IP against a subnet spec
45 * There is a space/speed tradeoff here implied by the use of a second
46 * struct iaddr to hold the mask; while using an unsigned (byte!) to
47 * represent the subnet prefix length would be more memory efficient,
48 * it makes run-time mask comparisons more expensive. Since such
49 * entries are used currently only in restricted circumstances
50 * (wanting to reject a subnet), the decision is in favour of run-time
61 struct iaddrmatchlist
{
62 struct iaddrmatchlist
*next
;
63 struct iaddrmatch match
;
68 * Structure to store information about a CIDR network.
76 struct iaddrcidrnetlist
{
77 struct iaddrcidrnetlist
*next
;
78 struct iaddrcidrnet cidrnet
;