FuseGuard Logo

fuseguard.components.ip
Component IPListProvider

ip.IPListProvider

An abstract IP list provider, extend this component to create your own custom IP List Provider

Method Summary
public any init([any firewallInstance])
          Initialize the IPListManager
public void addIP([string listID], [struct data])
          Adds an IP to the list
public void addList([string listID=""], [struct data])
          Adds a list to the providers repository
public boolean assertValidIPData([any data])
          Throws exception if invalid or returns true if valid.
public boolean canAddList()
          Returns true if the provider supports adding a new list
public array getAllIPData([string listID])
          Returns an array of structs containing all the data
public string getCounter([any ipAddress], [string listID])
          Returns the value of the counter for the IP or empty string if IP does not have a counter value
public struct getDataByID([any ipID], [string listID])
          Returns a structure with info corresponding to the ID or an empty struct if list has no info about the ID
public string getIPAsInteger([any ip])
          Determines the protocol version and gets the IP as integer
public struct getIPData([any ipAddress], [string listID])
          Returns a structure with info about the IP or an empty struct if list has no info about the IP
public array getIPLists()
          Returns an array of structures with keys: name, type, id
public string getIPV4AsInteger([any ip])
          Returns an IPV4 address as an unsigned integer
public struct getIPV4CIDR([any ip])
public string getIPV4FromInteger([any ip])
          Given an unsigned integer returns a IPv4 address in decimal format
public string getIPV6AsInteger([any ip])
          Returns an IPV6 address as an unsigned integer
public string getIPV6FromInteger([any ip])
          Given an unsigned integer returns a IPv6 address
public numeric getIPVersion([any ip])
          Returns 4 or 6
public numeric getListCount([string listID])
          Returns the number of records in the list
public string getName()
          Returns the name of the list provider
public boolean hasIP([any ipAddress], [string listID])
public void incrementCounter([any ipAddress], [string listID])
          Increments the counter value by one. If the IP does not exist on the list yet it will add it to the list and set the counter to 1
public boolean isManagerEnabled()
          Returns true if provider can be managed by fuseguard manager
public boolean isValidIPVersion4([any ip])
          Returns true is valid ipv4 decimal format
public boolean isValidIPVersion4Integer([any ip])
          Returns true is valid ipv4 decimal format
public boolean isValidIPVersion6([any ip])
          Returns true if in valid IPv6 format
public boolean isValidIPVersion6Integer([any ip])
          Returns true if in valid IPv6 integer
public void removeIPLastUpdatedBefore([string listID=""], [date updatedBefore])
          Removes IPs that have not been updated since the date specified
public void updateIP([string ipID], [string listID], [struct data])
          Updates an IP in the list
 

Method Detail

addIP

public void addIP([string listID], [struct data])
Adds an IP to the list

Parameters:
[string listID]
[struct data]

addList

public void addList([string listID=""], [struct data])
Adds a list to the providers repository

Parameters:
[string listID=""]
[struct data]

assertValidIPData

public boolean assertValidIPData([any data])
Throws exception if invalid or returns true if valid.

Parameters:
[any data]

canAddList

public boolean canAddList()
Returns true if the provider supports adding a new list


getAllIPData

public array getAllIPData([string listID])
Returns an array of structs containing all the data

Parameters:
[string listID]

getCounter

public string getCounter([any ipAddress], [string listID])
Returns the value of the counter for the IP or empty string if IP does not have a counter value

Parameters:
[any ipAddress]
[string listID]

getDataByID

public struct getDataByID([any ipID], [string listID])
Returns a structure with info corresponding to the ID or an empty struct if list has no info about the ID

Parameters:
[any ipID]
[string listID]

getIPAsInteger

public string getIPAsInteger([any ip])
Determines the protocol version and gets the IP as integer

Parameters:
[any ip]

getIPData

public struct getIPData([any ipAddress], [string listID])
Returns a structure with info about the IP or an empty struct if list has no info about the IP

Parameters:
[any ipAddress]
[string listID]

getIPLists

public array getIPLists()
Returns an array of structures with keys: name, type, id


getIPV4AsInteger

public string getIPV4AsInteger([any ip])
Returns an IPV4 address as an unsigned integer

Parameters:
[any ip]

getIPV4CIDR

public struct getIPV4CIDR([any ip])
Parameters:
[any ip]

getIPV4FromInteger

public string getIPV4FromInteger([any ip])
Given an unsigned integer returns a IPv4 address in decimal format

Parameters:
[any ip]

getIPV6AsInteger

public string getIPV6AsInteger([any ip])
Returns an IPV6 address as an unsigned integer

Parameters:
[any ip]

getIPV6FromInteger

public string getIPV6FromInteger([any ip])
Given an unsigned integer returns a IPv6 address

Parameters:
[any ip]

getIPVersion

public numeric getIPVersion([any ip])
Returns 4 or 6

Parameters:
[any ip]

getListCount

public numeric getListCount([string listID])
Returns the number of records in the list

Parameters:
[string listID]

getName

public string getName()
Returns the name of the list provider


hasIP

public boolean hasIP([any ipAddress], [string listID])
Parameters:
[any ipAddress]
[string listID]

incrementCounter

public void incrementCounter([any ipAddress], [string listID])
Increments the counter value by one. If the IP does not exist on the list yet it will add it to the list and set the counter to 1

Parameters:
[any ipAddress]
[string listID]

init

public any init([any firewallInstance])
Initialize the IPListManager

Parameters:
[any firewallInstance]

isManagerEnabled

public boolean isManagerEnabled()
Returns true if provider can be managed by fuseguard manager


isValidIPVersion4

public boolean isValidIPVersion4([any ip])
Returns true is valid ipv4 decimal format

Parameters:
[any ip]

isValidIPVersion4Integer

public boolean isValidIPVersion4Integer([any ip])
Returns true is valid ipv4 decimal format

Parameters:
[any ip]

isValidIPVersion6

public boolean isValidIPVersion6([any ip])
Returns true if in valid IPv6 format

Parameters:
[any ip]

isValidIPVersion6Integer

public boolean isValidIPVersion6Integer([any ip])
Returns true if in valid IPv6 integer

Parameters:
[any ip]

removeIPLastUpdatedBefore

public void removeIPLastUpdatedBefore([string listID=""], [date updatedBefore])
Removes IPs that have not been updated since the date specified

Parameters:
[string listID=""]
[date updatedBefore]

updateIP

public void updateIP([string ipID], [string listID], [struct data])
Updates an IP in the list

Parameters:
[string ipID]
[string listID]
[struct data]