ISC DHCP
4.3.5
A reference DHCPv4 and DHCPv6 implementation
inet.h
Go to the documentation of this file.
1
/* inet.h
2
3
Portable definitions for internet addresses */
4
5
/*
6
* Copyright (c) 2004,2007,2009,2014 by Internet Systems Consortium, Inc. ("ISC")
7
* Copyright (c) 1996-2003 by Internet Software Consortium
8
*
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.
12
*
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.
20
*
21
* Internet Systems Consortium, Inc.
22
* 950 Charter Street
23
* Redwood City, CA 94063
24
* <info@isc.org>
25
* https://www.isc.org/
26
*
27
*/
28
29
/* An internet address of up to 128 bits. */
30
31
struct
iaddr
{
32
unsigned
len
;
33
unsigned
char
iabuf
[16];
34
};
35
36
struct
iaddrlist
{
37
struct
iaddrlist
*
next
;
38
struct
iaddr
addr;
39
};
40
41
42
/* struct iaddrmatch - used to compare a host IP against a subnet spec
43
*
44
* There is a space/speed tradeoff here implied by the use of a second
45
* struct iaddr to hold the mask; while using an unsigned (byte!) to
46
* represent the subnet prefix length would be more memory efficient,
47
* it makes run-time mask comparisons more expensive. Since such
48
* entries are used currently only in restricted circumstances
49
* (wanting to reject a subnet), the decision is in favour of run-time
50
* efficiency.
51
*/
52
53
struct
iaddrmatch
{
54
struct
iaddr
addr;
55
struct
iaddr
mask;
56
};
57
58
/* its list ... */
59
60
struct
iaddrmatchlist
{
61
struct
iaddrmatchlist
*
next
;
62
struct
iaddrmatch
match;
63
};
64
65
66
/*
67
* Structure to store information about a CIDR network.
68
*/
69
70
struct
iaddrcidrnet
{
71
struct
iaddr
lo_addr;
72
int
bits
;
73
};
74
75
struct
iaddrcidrnetlist
{
76
struct
iaddrcidrnetlist
*
next
;
77
struct
iaddrcidrnet
cidrnet;
78
};
79
iaddrlist::next
struct iaddrlist * next
Definition:
inet.h:37
iaddrcidrnet::bits
int bits
Definition:
inet.h:72
iaddr::iabuf
unsigned char iabuf[16]
Definition:
inet.h:33
iaddr::len
unsigned len
Definition:
inet.h:32
iaddrcidrnet
Definition:
inet.h:70
iaddrmatch
Definition:
inet.h:53
iaddrmatchlist::next
struct iaddrmatchlist * next
Definition:
inet.h:61
iaddrcidrnetlist
Definition:
inet.h:75
iaddrlist
Definition:
inet.h:36
iaddrcidrnetlist::next
struct iaddrcidrnetlist * next
Definition:
inet.h:76
iaddr
Definition:
inet.h:31
iaddrmatchlist
Definition:
inet.h:60
includes
inet.h
Generated on Thu Oct 6 2016 06:45:25 for ISC DHCP by
1.8.12