|
| 1 | +#!/usr/bin/env python |
| 2 | +# -*- coding: utf-8 -*- |
| 3 | +# |
| 4 | +# Copyright (c) 2008-2013, Bryan Davis |
| 5 | +# All rights reserved. |
| 6 | +# |
| 7 | +# Redistribution and use in source and binary forms, with or without |
| 8 | +# modification, are permitted provided that the following conditions are met: |
| 9 | +# - Redistributions of source code must retain the above copyright notice, |
| 10 | +# this list of conditions and the following disclaimer. |
| 11 | +# - Redistributions in binary form must reproduce the above copyright |
| 12 | +# notice, this list of conditions and the following disclaimer in the |
| 13 | +# documentation and/or other materials provided with the distribution. |
| 14 | +# |
| 15 | +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
| 16 | +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 17 | +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
| 18 | +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
| 19 | +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 20 | +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 21 | +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 22 | +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 23 | +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 24 | +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 25 | +# POSSIBILITY OF SUCH DAMAGE. |
| 26 | +"""Common and special use IPv4 address blocks.""" |
| 27 | + |
| 28 | +#: Broadcast messages to the current network (only valid as source address) |
| 29 | +#: (`RFC 5735 <https://tools.ietf.org/html/rfc5735>`_) |
| 30 | +CURRENT_NETWORK = "0.0.0.0/8" |
| 31 | + |
| 32 | +#: Private network |
| 33 | +#: (`RFC 1918 <https://tools.ietf.org/html/rfc1918>`_) |
| 34 | +PRIVATE_NETWORK_10 = "10.0.0.0/8" |
| 35 | + |
| 36 | +#: Carrier-grade NAT private network |
| 37 | +#: (`RFC 6598 <https://tools.ietf.org/html/rfc6598>`_) |
| 38 | +SHARED_ADDRESS_SPACE = "100.64.0.0/10" |
| 39 | + |
| 40 | +#: Loopback addresses on the local host |
| 41 | +#: (`RFC 5735 <https://tools.ietf.org/html/rfc5735>`_) |
| 42 | +LOOPBACK = "127.0.0.0/8" |
| 43 | + |
| 44 | +#: Common `localhost` address |
| 45 | +#: (`RFC 5735 <https://tools.ietf.org/html/rfc5735>`_) |
| 46 | +LOCALHOST = "127.0.0.1" |
| 47 | + |
| 48 | +#: Autoconfiguration when no IP address available |
| 49 | +#: (`RFC 3972 <https://tools.ietf.org/html/rfc3972>`_) |
| 50 | +LINK_LOCAL = "169.254.0.0/16" |
| 51 | + |
| 52 | +#: Private network |
| 53 | +#: (`RFC 1918 <https://tools.ietf.org/html/rfc1918>`_) |
| 54 | +PRIVATE_NETWORK_172_16 = "172.16.0.0/12" |
| 55 | + |
| 56 | +#: IETF protocol assignments reserved block |
| 57 | +#: (`RFC 5735 <https://tools.ietf.org/html/rfc5735>`_) |
| 58 | +IETF_PROTOCOL_RESERVED = "192.0.0.0/24" |
| 59 | + |
| 60 | +#: Dual-Stack Lite link address |
| 61 | +#: (`RFC 6333 <https://tools.ietf.org/html/rfc6333>`_) |
| 62 | +DUAL_STACK_LITE = "192.0.0.0/29" |
| 63 | + |
| 64 | +#: Documentation and example network |
| 65 | +#: (`RFC 5737 <https://tools.ietf.org/html/rfc5737>`_) |
| 66 | +TEST_NET_1 = "192.0.2.0/24" |
| 67 | + |
| 68 | +#: 6to4 anycast relay |
| 69 | +#: (`RFC 3068 <https://tools.ietf.org/html/rfc3068>`_) |
| 70 | +IPV6_TO_IPV4_RELAY = "192.88.99.0/24" |
| 71 | + |
| 72 | +#: Private network |
| 73 | +#: (`RFC 1918 <https://tools.ietf.org/html/rfc1918>`_) |
| 74 | +PRIVATE_NETWORK_192_168 = "192.168.0.0/16" |
| 75 | + |
| 76 | +#: Inter-network communications testing |
| 77 | +#: (`RFC 2544 <https://tools.ietf.org/html/rfc2544>`_) |
| 78 | +BENCHMARK_TESTS = "198.18.0.0/15" |
| 79 | + |
| 80 | +#: Documentation and example network |
| 81 | +#: (`RFC 5737 <https://tools.ietf.org/html/rfc5737>`_) |
| 82 | +TEST_NET_2 = "198.51.100.0/24" |
| 83 | + |
| 84 | +#: Documentation and example network |
| 85 | +#: (`RFC 5737 <https://tools.ietf.org/html/rfc5737>`_) |
| 86 | +TEST_NET_3 = "203.0.113.0/24" |
| 87 | + |
| 88 | +#: Multicast reserved block |
| 89 | +#: (`RFC 5771 <https://tools.ietf.org/html/rfc5771>`_) |
| 90 | +MULTICAST = "224.0.0.0/4" |
| 91 | + |
| 92 | +#: Link local multicast |
| 93 | +#: (`RFC 5771 <https://tools.ietf.org/html/rfc5771>`_) |
| 94 | +MULTICAST_LOCAL = "224.0.0.0/24" |
| 95 | + |
| 96 | +#: Forwardable multicast |
| 97 | +#: (`RFC 5771 <https://tools.ietf.org/html/rfc5771>`_) |
| 98 | +MULTICAST_INTERNETWORK = "224.0.1.0/24" |
| 99 | + |
| 100 | +#: Former Class E address space. Reserved for future use |
| 101 | +#: (`RFC 1700 <https://tools.ietf.org/html/rfc1700>`_) |
| 102 | +RESERVED = "240.0.0.0/4" |
| 103 | + |
| 104 | +#: Broadcast messages to the current network (only valid as destination address) |
| 105 | +#: (`RFC 919 <https://tools.ietf.org/html/rfc919>`_) |
| 106 | +BROADCAST = "255.255.255.255" |
0 commit comments