Package | com.ericfeminella.net |
Class | public class IPV4Inspector |
Implements | IIPInspector |
Provides an API for validating and inspecting an IP version 4 Address (IPv4)
An IP address is 32 bits wide, and is composed of two parts: the network number, and the host number. By convention, it is expressed as four decimal numbers separated by periods, such as "200.1.2.3" representing the decimal value of each of the four bytes. Valid addresses thus range from 0.0.0.0 to 255.255.255.255, a total of about 4.3 billion addresses. The first few bits of the address indicate the Class that the address belongs to:
Property | Defined by | ||
---|---|---|---|
address : String | IPV4Inspector | ||
firstOctet : uint | IPV4Inspector | ||
parts : Array | IPV4Inspector |
Method | Defined by | ||
---|---|---|---|
IPV4Inspector(address:String)
Constructor
Creates a new IPv4Inspector instance and validates the IP address specified. | IPV4Inspector | ||
getHostOctet():String
Determines the host octet of the specified IP Address
| IPV4Inspector | ||
getIPAddress():String
Returns the Raw IP Address
| IPV4Inspector | ||
getNetworkClass():String
Determines the network class of the specified IP Address
Class D networks are reserved for multicasting and Class E networks are reserved for "experimental use". | IPV4Inspector | ||
getNetworkOctet():uint
Determines the network octet of the specified IP Address
| IPV4Inspector | ||
isLoopback():Boolean
Determines if the IPAddress is a loopback address.
| IPV4Inspector | ||
isValid():Boolean
Determines if the address specified is a valid IPv4 address
| IPV4Inspector | ||
isValidNetworkHost():Boolean
Determines if the IP Address is valid for Network assignment
The entire address range of 224.0.0.0 - 255.255.255.255 is unacceptable for assignment to network hosts, as is any address beginning with 127 | IPV4Inspector | ||
isWithinClassRange(networkClass:String):Boolean
Determines if the IP Address is within the Class range specified
| IPV4Inspector |
address | property |
protected var address:String
firstOctet | property |
protected var firstOctet:uint
parts | property |
protected var parts:Array
IPV4Inspector | () | constructor |
public function IPV4Inspector(address:String)
Constructor
Creates a new IPv4Inspector instance and validates the IP address specified. If IP address is not in valid IPv4 format an error is thrown
Parametersaddress:String — IP Address in which to validate
|
— |
getHostOctet | () | method |
public function getHostOctet():String
Determines the host octet of the specified IP Address
ReturnsString — the host octet of the specified IP Address
|
getIPAddress | () | method |
public function getIPAddress():String
Returns the Raw IP Address
ReturnsString — the Raw IP Address
|
getNetworkClass | () | method |
public function getNetworkClass():String
Determines the network class of the specified IP Address
Class D networks are reserved for multicasting and Class E networks are reserved for "experimental use". Class E addresses are reserved by the Internet Engineering Task Force (IETF). Neither Class D or Class E networks should be assigned to host devices.
ReturnsString — the class of the specified IP Address, Class A,B or C
|
getNetworkOctet | () | method |
public function getNetworkOctet():uint
Determines the network octet of the specified IP Address
Returnsuint — the network octet of the specified IP Address
|
isLoopback | () | method |
public function isLoopback():Boolean
Determines if the IPAddress is a loopback address.
An address starting with 127 is a loopback address and should never be used for addressing outside of the host
ReturnsBoolean — true if the address is a loopback address, otherwise false
|
isValid | () | method |
public function isValid():Boolean
Determines if the address specified is a valid IPv4 address
ReturnsBoolean — true if the IP address is a valid IPv4 address, false if not
|
isValidNetworkHost | () | method |
public function isValidNetworkHost():Boolean
Determines if the IP Address is valid for Network assignment
The entire address range of 224.0.0.0 - 255.255.255.255 is unacceptable for assignment to network hosts, as is any address beginning with 127
ReturnsBoolean — true if the address is valid for network assignment, otherwise false
|
isWithinClassRange | () | method |
public function isWithinClassRange(networkClass:String):Boolean
Determines if the IP Address is within the Class range specified
ParametersnetworkClass:String |
Boolean — true if the address is within the Class range specified, otherwise false
|