3 Portable definitions for internet addresses */
6 * Copyright (c) 2004,2007,2009 by Internet Systems Consortium, Inc. ("ISC")
7 * Copyright (c) 1996-2003 by Internet Software Consortium
9 * Permission to use, copy, modify, and distribute this software for any
10 * purpose with or without fee is hereby granted, provided that the above
11 * copyright notice and this permission notice appear in all copies.
13 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
14 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR
16 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
19 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21 * Internet Systems Consortium, Inc.
23 * Redwood City, CA 94063
25 * https://www.isc.org/
27 * This software has been written for Internet Systems Consortium
28 * by Ted Lemon in cooperation with Vixie Enterprises and Nominum, Inc.
29 * To learn more about Internet Systems Consortium, see
30 * ``https://www.isc.org/''. To learn more about Vixie Enterprises,
31 * see ``http://www.vix.com''. To learn more about Nominum, Inc., see
32 * ``http://www.nominum.com''.
35 /* An internet address of up to 128 bits. */
39 unsigned char iabuf [16];
43 struct iaddrlist *next;
48 /* struct iaddrmatch - used to compare a host IP against a subnet spec
50 * There is a space/speed tradeoff here implied by the use of a second
51 * struct iaddr to hold the mask; while using an unsigned (byte!) to
52 * represent the subnet prefix length would be more memory efficient,
53 * it makes run-time mask comparisons more expensive. Since such
54 * entries are used currently only in restricted circumstances
55 * (wanting to reject a subnet), the decision is in favour of run-time
66 struct iaddrmatchlist {
67 struct iaddrmatchlist *next;
68 struct iaddrmatch match;
73 * Structure to store information about a CIDR network.
81 struct iaddrcidrnetlist {
82 struct iaddrcidrnetlist *next;
83 struct iaddrcidrnet cidrnet;