PIpAccessControlList Class Reference
#include <ipacl.h>
List of all members.
Detailed Description
This class is a list of IP address mask specifications used to validate if an address may or may not be used in a connection.
The list may be totally internal to the application, or may use system wide files commonly use under Linux (hosts.allow and hosts.deny file). These will be used regardless of the platform.
When a search is done using IsAllowed() function, the first entry that matches the specified IP address is found, and its allow flag returned. The list sorted so that the most specific IP number specification is first and the broadest onse later. The entry with the value having a mask of zero, that is the match all entry, is always last.
Constructor & Destructor Documentation
PIpAccessControlList::PIpAccessControlList |
( |
PBoolean |
defaultAllowance = PTrue |
) |
|
Create a new, empty, access control list.
Member Function Documentation
- Parameters:
-
| address | IP network address |
| mask | Mask for IP network |
| allow | Flag for if network is allowed or not |
- Parameters:
-
| description | Description of the IP match parameters |
Add the specified entry into the list. See the PIpAccessControlEntry class for more details on the format of the description
field.
- Returns:
- PTrue if the entries was successfully added.
- Parameters:
-
| entry | Entry for IP match parameters |
Create a new PIpAccessControl specification entry object. This may be used by an application to create descendents of PIpAccessControlEntry when extra information/functionality is required.
The default behaviour creates a PIpAccessControlEntry.
Find the PIpAccessControl specification for the address.
- Parameters:
-
| address | IP Address to find |
PBoolean PIpAccessControlList::GetDefaultAllowance |
( |
|
) |
const [inline] |
Get the default state for allowed access if the list is empty.
References defaultAllowance.
- Parameters:
-
| address | IP Address to test |
Test the address/connection for if it is allowed within this access control list. If the socket
form is used the peer address of the connection is tested.
If the list is empty then PTrue is returned. If the list is not empty, but the IP address does not match any entries in the list, then PFalse is returned. If a match is made then the allow state of that entry is returned.
- Returns:
- PTrue if the remote host address is allowed.
- Parameters:
-
PBoolean PIpAccessControlList::LoadHostsAccess |
( |
const char * |
daemonName = NULL |
) |
|
Load the system wide files commonly use under Linux (hosts.allow and hosts.deny file) for IP access. See the Linux man entries on these files for more information. Note, these files will be loaded regardless of the actual platform used. The directory returned by the PProcess::GetOSConfigDir() function is searched for the files.
The daemonName
parameter is used as the search argument in the hosts.allow/hosts.deny file. If this is NULL then the PProcess::GetName() function is used.
- Returns:
- PTrue if all the entries in the file were added, if any failed then PFalse is returned.
- Parameters:
-
| daemonName | Name of "daemon" application |
- Parameters:
-
| address | IP network address |
| mask | Mask for IP network |
Remove the specified entry into the list. See the PIpAccessControlEntry class for more details on the format of the description
field.
- Returns:
- PTrue if the entries was successfully removed.
- Parameters:
-
| description | Description of the IP match parameters |
void PIpAccessControlList::SetDefaultAllowance |
( |
PBoolean |
defAllow |
) |
[inline] |
Set the default state for allowed access if the list is empty.
References defaultAllowance.
Member Data Documentation
The documentation for this class was generated from the following file: