Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move IP_ADDRESS to IpAddresses classes of each carrier
Signed-off-by: Shin-ichiro OGAWA <rust.stnard+git@gmail.com>
- Loading branch information
Showing
16 changed files
with
304 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class AbstractIpAddresses | ||
def valid_ip?(remote_ip_str) | ||
begin | ||
remote_ip = IPAddr.new(remote_ip_str) | ||
rescue | ||
return false | ||
end | ||
|
||
self.class.ip_address_list.any? {|ip| ip.include?(remote_ip)} | ||
end | ||
|
||
class << self | ||
def ip_address_list | ||
[] | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class Au < AbstractIpAddresses | ||
class << self | ||
def ip_address_list | ||
@@ip_address_list ||= [ | ||
"210.230.128.224/28", | ||
"121.111.227.160/27", | ||
"61.117.1.0/28", | ||
"219.108.158.0/27", | ||
"219.125.146.0/28", | ||
"61.117.2.32/29", | ||
"61.117.2.40/29", | ||
"219.108.158.40/29", | ||
"219.125.148.0/25", | ||
"222.5.63.0/25", | ||
"222.5.63.128/25", | ||
"222.5.62.128/25", | ||
"59.135.38.128/25", | ||
"219.108.157.0/25", | ||
"219.125.145.0/25", | ||
"121.111.231.0/25", | ||
"121.111.227.0/25", | ||
"118.152.214.192/26", | ||
"118.159.131.0/25", | ||
"118.159.133.0/25", | ||
"118.159.132.160/27", | ||
"111.86.142.0/26", | ||
"111.86.141.64/26", | ||
"111.86.141.128/26", | ||
"111.86.141.192/26", | ||
"118.159.133.192/26" | ||
].map {|ip| IPAddr.new(ip) } | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class Docomo < AbstractIpAddresses | ||
class << self | ||
def ip_address_list | ||
@@ip_address_list ||= [ | ||
"210.153.84.0/24", | ||
"210.136.161.0/24", | ||
"210.153.86.0/24", | ||
"124.146.174.0/24", | ||
"124.146.175.0/24", | ||
"202.229.176.0/24", | ||
"202.229.177.0/24", | ||
"202.229.178.0/24" | ||
].map {|ip| IPAddr.new(ip)} | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class Emobile < AbstractIpAddresses | ||
class << self | ||
def ip_address_list | ||
@@ip_address_list ||= [ | ||
"117.55.1.224/27" | ||
].map {|ip| IPAddr.new(ip) } | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class Softbank < AbstractIpAddresses | ||
class << self | ||
def ip_address_list | ||
@@ip_address_list ||= [ | ||
"123.108.237.0/27", | ||
"202.253.96.224/27", | ||
"210.146.7.192/26", | ||
"210.175.1.128/25" | ||
].map {|ip| IPAddr.new(ip) } | ||
end | ||
end | ||
end | ||
class Vodafone < Softbank | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,158 @@ | ||
module Jpmobile | ||
module Mobile | ||
module IpAddresses | ||
class Willcom < AbstractIpAddresses | ||
class << self | ||
def ip_address_list | ||
@@ip_address_list ||= [ | ||
"61.198.128.0/24", | ||
"61.198.129.0/24", | ||
"61.198.130.0/24", | ||
"61.198.131.0/24", | ||
"61.198.132.0/24", | ||
"61.198.133.0/24", | ||
"61.198.134.0/24", | ||
"61.198.135.0/24", | ||
"61.198.136.0/24", | ||
"61.198.137.0/24", | ||
"61.198.138.100/32", | ||
"61.198.138.101/32", | ||
"61.198.138.102/32", | ||
"61.198.138.103/32", | ||
"61.198.139.0/29", | ||
"61.198.139.128/27", | ||
"61.198.139.160/28", | ||
"61.198.140.0/24", | ||
"61.198.141.0/24", | ||
"61.198.142.0/24", | ||
"61.198.143.0/24", | ||
"61.198.160.0/24", | ||
"61.198.161.0/24", | ||
"61.198.162.0/24", | ||
"61.198.163.0/24", | ||
"61.198.164.0/24", | ||
"61.198.165.0/24", | ||
"61.198.166.0/24", | ||
"61.198.168.0/24", | ||
"61.198.169.0/24", | ||
"61.198.170.0/24", | ||
"61.198.171.0/24", | ||
"61.198.172.0/24", | ||
"61.198.173.0/24", | ||
"61.198.174.0/24", | ||
"61.198.175.0/24", | ||
"61.198.248.0/24", | ||
"61.198.249.0/24", | ||
"61.198.250.0/24", | ||
"61.198.251.0/24", | ||
"61.198.252.0/24", | ||
"61.198.253.0/24", | ||
"61.198.254.0/24", | ||
"61.198.255.0/24", | ||
"61.204.0.0/24", | ||
"61.204.2.0/24", | ||
"61.204.3.0/25", | ||
"61.204.3.128/25", | ||
"61.204.4.0/24", | ||
"61.204.5.0/24", | ||
"61.204.6.0/25", | ||
"61.204.6.128/25", | ||
"61.204.7.0/25", | ||
"61.204.92.0/24", | ||
"61.204.93.0/24", | ||
"61.204.94.0/24", | ||
"61.204.95.0/24", | ||
"114.20.49.0/24", | ||
"114.20.50.0/24", | ||
"114.20.51.0/24", | ||
"114.20.52.0/24", | ||
"114.20.53.0/24", | ||
"114.20.54.0/24", | ||
"114.20.55.0/24", | ||
"114.20.56.0/24", | ||
"114.20.57.0/24", | ||
"114.20.58.0/24", | ||
"114.20.59.0/24", | ||
"114.20.60.0/24", | ||
"114.20.61.0/24", | ||
"114.20.62.0/24", | ||
"114.20.63.0/24", | ||
"114.20.64.0/24", | ||
"114.20.65.0/24", | ||
"114.20.66.0/24", | ||
"114.20.67.0/24", | ||
"114.21.255.0/27", | ||
"125.28.0.0/24", | ||
"125.28.1.0/24", | ||
"125.28.15.0/24", | ||
"125.28.16.0/24", | ||
"125.28.17.0/24", | ||
"125.28.2.0/24", | ||
"125.28.3.0/24", | ||
"125.28.4.0/24", | ||
"125.28.5.0/24", | ||
"125.28.8.0/24", | ||
"210.168.246.0/24", | ||
"210.168.247.0/24", | ||
"210.169.92.0/24", | ||
"210.169.93.0/24", | ||
"210.169.94.0/24", | ||
"210.169.95.0/24", | ||
"210.169.96.0/24", | ||
"210.169.97.0/24", | ||
"210.169.98.0/24", | ||
"210.169.99.0/24", | ||
"211.126.192.128/25", | ||
"211.18.232.0/24", | ||
"211.18.233.0/24", | ||
"211.18.234.0/24", | ||
"211.18.235.0/24", | ||
"211.18.236.0/24", | ||
"211.18.237.0/24", | ||
"219.108.10.0/24", | ||
"219.108.11.0/24", | ||
"219.108.12.0/24", | ||
"219.108.13.0/24", | ||
"219.108.14.0/24", | ||
"219.108.15.0/24", | ||
"219.108.7.0/24", | ||
"219.108.8.0/24", | ||
"219.108.9.0/24", | ||
"221.119.0.0/24", | ||
"221.119.1.0/24", | ||
"221.119.2.0/24", | ||
"221.119.3.0/24", | ||
"221.119.4.0/24", | ||
"221.119.6.0/24", | ||
"221.119.7.0/24", | ||
"221.119.8.0/24", | ||
"221.119.9.0/24", | ||
"114.20.49.0/24", | ||
"114.20.50.0/24", | ||
"114.20.51.0/24", | ||
"114.20.52.0/24", | ||
"114.20.53.0/24", | ||
"114.20.54.0/24", | ||
"114.20.55.0/24", | ||
"114.20.56.0/24", | ||
"114.20.57.0/24", | ||
"114.20.58.0/24", | ||
"114.20.59.0/24", | ||
"114.20.60.0/24", | ||
"114.20.61.0/24", | ||
"114.20.62.0/24", | ||
"114.20.63.0/24", | ||
"114.20.64.0/24", | ||
"114.20.65.0/24", | ||
"114.20.66.0/24", | ||
"114.20.67.0/24", | ||
"114.21.255.0/27" | ||
].map {|ip| IPAddr.new(ip) } | ||
end | ||
end | ||
end | ||
class Ddipocket < Willcom | ||
end | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.