|
PTLib
Version 2.14.3
|
This class is a single IP access control specification. More...
#include <ipacl.h>


Public Member Functions | |
| PIpAccessControlEntry (PIPSocket::Address addr, PIPSocket::Address msk, PBoolean allow) | |
| Create a new IP access control specification. More... | |
| PIpAccessControlEntry (const PString &description) | |
| PIpAccessControlEntry & | operator= (const PString &pstr) |
| Set a new IP access control specification. More... | |
| PIpAccessControlEntry & | operator= (const char *cstr) |
| virtual Comparison | Compare (const PObject &obj) const |
| Compare the two objects and return their relative rank. More... | |
| virtual void | PrintOn (ostream &strm) const |
| Output the contents of the object to the stream. More... | |
| virtual void | ReadFrom (istream &strm) |
| Input the contents of the object from the stream. More... | |
| PString | AsString () const |
| Convert the specification to a string, that can be processed by the Parse() function. More... | |
| PBoolean | IsValid () |
| Check the internal fields of the specification for validity. More... | |
| PBoolean | Parse (const PString &description) |
| Parse the description string into this IP access control specification. More... | |
| PBoolean | Match (PIPSocket::Address &address) |
| Check to see if the specified IP address match any of the conditions specifed in the Parse() function for this entry. More... | |
| const PString & | GetDomain () const |
| Get the domain part of entry. More... | |
| const PIPSocket::Address & | GetAddress () const |
| Get the address part of entry. More... | |
| const PIPSocket::Address & | GetMask () const |
| Get the mask part of entry. More... | |
| PBoolean | IsAllowed () const |
| Get the allowed flag of entry. More... | |
| PBoolean | IsHidden () const |
| Get the hidden flag of entry. More... | |
Public Member Functions inherited from PObject | |
| unsigned | GetTraceContextIdentifier () const |
| Get PTRACE context identifier. More... | |
| void | SetTraceContextIdentifier (unsigned id) |
| void | GetTraceContextIdentifier (PObject &obj) |
| void | GetTraceContextIdentifier (PObject *obj) |
| void | SetTraceContextIdentifier (const PObject &obj) |
| void | SetTraceContextIdentifier (const PObject *obj) |
| virtual | ~PObject () |
| virtual PObject * | Clone () const |
| Create a copy of the class on the heap. More... | |
| template<class CLS > | |
| CLS * | CloneAs () const |
| As for Clone() but converts to specified type. More... | |
| virtual PINDEX | HashFunction () const |
This function yields a hash value required by the PDictionary class. More... | |
| virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const |
| Determine the byte wise comparison of two objects. More... | |
| bool | operator== (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator!= (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator< (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator> (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator<= (const PObject &obj) const |
| Compare the two objects. More... | |
| bool | operator>= (const PObject &obj) const |
| Compare the two objects. More... | |
| virtual const char * | GetClass (unsigned ancestor=0) const |
| Get the current dynamic type of the object instance. More... | |
| PBoolean | IsClass (const char *cls) const |
| virtual PBoolean | InternalIsDescendant (const char *clsName) const |
| Determine if the dynamic type of the current instance is a descendent of the specified class. More... | |
| __inline const PObject * | PTraceObjectInstance () const |
Protected Attributes | |
| PString | domain |
| PIPSocket::Address | address |
| PIPSocket::Address | mask |
| PBoolean | allowed |
| PBoolean | hidden |
Protected Attributes inherited from PObject | |
| unsigned | m_traceContextIdentifier |
Additional Inherited Members | |
Public Types inherited from PObject | |
| enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 } |
Result of the comparison operation performed by the Compare() function. More... | |
Static Public Member Functions inherited from PObject | |
| static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size) |
| Internal function caled from CompareObjectMemoryDirect() More... | |
| static const char * | Class () |
| Get the name of the class as a C string. More... | |
| static __inline const PObject * | PTraceObjectInstance (const char *) |
| static __inline const PObject * | PTraceObjectInstance (const PObject *obj) |
Protected Member Functions inherited from PObject | |
| PObject () | |
| Constructor for PObject, made protected so cannot ever create one on its own. More... | |
Friends inherited from PObject | |
This class is a single IP access control specification.
| PIpAccessControlEntry::PIpAccessControlEntry | ( | PIPSocket::Address | addr, |
| PIPSocket::Address | msk, | ||
| PBoolean | allow | ||
| ) |
Create a new IP access control specification.
See the Parse() function for more details on the format of the description parameter.
| PIpAccessControlEntry::PIpAccessControlEntry | ( | const PString & | description | ) |
| PString PIpAccessControlEntry::AsString | ( | ) | const |
|
virtual |
Compare the two objects and return their relative rank.
LessThan, EqualTo or GreaterThan according to the relative rank of the objects. | obj | Object to compare against. |
Reimplemented from PObject.
|
inline |
Get the address part of entry.
References address.
|
inline |
Get the domain part of entry.
References domain.
|
inline |
Get the mask part of entry.
References mask.
|
inline |
Get the allowed flag of entry.
References allowed.
|
inline |
Get the hidden flag of entry.
References hidden.
| PBoolean PIpAccessControlEntry::IsValid | ( | ) |
Check the internal fields of the specification for validity.
| PBoolean PIpAccessControlEntry::Match | ( | PIPSocket::Address & | address | ) |
Check to see if the specified IP address match any of the conditions specifed in the Parse() function for this entry.
| address | Address to search for |
| PIpAccessControlEntry& PIpAccessControlEntry::operator= | ( | const PString & | pstr | ) |
Set a new IP access control specification.
See the Parse() function for more details on the format of the pstr and cstr parameters.
| PIpAccessControlEntry& PIpAccessControlEntry::operator= | ( | const char * | cstr | ) |
Parse the description string into this IP access control specification.
The string may be of several forms: n.n.n.n Simple IP number, this has an implicit mask of 255.255.255.255 n.n. IP with trailing dot, assumes a mask equal to the number of specified octets eg 10.1. is equivalent to 10.1.0.0/255.255.0.0 n.n.n.n/b An IP network using b bits of mask, for example 10.1.0.0/14 is equivalent to 10.0.1.0/255.248.0.0 n.n.n.n/m.m.m.m An IP network using the specified mask hostname A specific host name, this has an implicit mask of 255.255.255.255 .domain.dom Matches an IP number whose cannonical name (found using a reverse DNS lookup) ends with the specified domain.
| description | Description of the specification |
|
virtual |
Output the contents of the object to the stream.
This outputs the same format as the AsString() function.
| strm | Stream to print the object into. |
Reimplemented from PObject.
|
virtual |
|
protected |
Referenced by GetAddress().
|
protected |
Referenced by IsAllowed().
|
protected |
Referenced by GetDomain().
|
protected |
Referenced by IsHidden().
|
protected |
Referenced by GetMask().