| 1 | #=============================================================================== | ||
| 2 | # PODNAME: Net::IP::Identifier::Plugin::Internal | ||
| 3 | # ABSTRACT: identify Internal (non-routable) IP addresses | ||
| 4 | # | ||
| 5 | # AUTHOR: Reid Augustin (REID) | ||
| 6 | # EMAIL: reid@hellosix.com | ||
| 7 | # CREATED: Wed Apr 1 12:11:51 PDT 2015 | ||
| 8 | #=============================================================================== | ||
| 9 | |||
| 10 | use 5.008; | ||
| 11 | use strict; | ||
| 12 | use warnings; | ||
| 13 | |||
| 14 | package Net::IP::Identifier::Plugin::Internal; | ||
| 15 | |||
| 16 | use Role::Tiny::With; | ||
| 17 | with qw( Net::IP::Identifier_Role ); | ||
| 18 | |||
| 19 | our $VERSION = '0.106'; # VERSION | ||
| 20 | |||
| 21 | sub new { | ||
| 22 | my ($class, %opts) = @_; | ||
| 23 | |||
| 24 | my $self = {}; | ||
| 25 | bless $self, (ref $class || $class); | ||
| 26 | |||
| 27 | # List of internal (non-routable) IP blocks | ||
| 28 | $self->ips( | ||
| 29 | '10.0.0.0 - 10.255.255.255', # for general public use - RFC 1918 | ||
| 30 | '100.64.0.0/10', # carrier grade (not for general public use!) RFC 6598 | ||
| 31 | '169.254.1.0 - 169.254.254.255', # Link Local (zero-conf) RFC 6890 and RFC 3927 | ||
| 32 | '172.16.0.0 - 172.31.255.255', # for general public use - RFC 1918 | ||
| 33 | '192.168.0.0 - 192.168.255.255', # for general public use - RFC 1918 | ||
| 34 | 'fc00::/7', # Unique Local Address (ULA) RFC 4193 (global scope!) | ||
| 35 | 'fec0::/10', # deprecated since Sept 2004 RFC 3879 | ||
| 36 | 'fe80::/10', # Link Local RFC 4862 | ||
| 37 | ); | ||
| 38 | return $self; | ||
| 39 | } | ||
| 40 | |||
| 41 | sub name { | ||
| 42 | return 'internal'; | ||
| 43 | } | ||
| 44 | |||
| 45 | 1; | ||
| 46 | |||
| 47 | __END__ |