#include <RadiusAttribute.h>
Public Member Functions | |
RadiusAttribute () | |
RadiusAttribute (Octet) | |
RadiusAttribute (Octet, char *) | |
RadiusAttribute (Octet, string) | |
RadiusAttribute (Octet, int) | |
~RadiusAttribute (void) | |
RadiusAttribute & | operator= (const RadiusAttribute &) |
RadiusAttribute (const RadiusAttribute &) | |
int | getLength (void) |
void | setLength (Octet) |
int | getType (void) |
void | setType (Octet) |
Octet * | getValue (void) |
int | setValue (char *) |
int | setValue (string) |
int | setValue (int) |
int | setRecvValue (char *value) |
int | intFromBuf (void) |
string | ipFromBuf (void) |
void | dumpRadiusAttrib (void) |
char * | makePasswordHash (const char *password, char *hpassword, const char *sharedSecret, const char *authenticator) |
Private Attributes | |
Octet | type |
Octet | length |
Octet * | value |
|
The constructor sets the type to 0 and the value to NULL. |
|
The construcotr sets the type. The value is set to NULL.
|
|
The constructor creates an attribute. The type and the value can be set.
|
|
The constructor sets the type and the value.
|
|
The constructor sets the type and the value. The type must have the datatype integer as it is defined in the RFC of the radius protocol.
|
|
The destructor of the class. It frees the allocated memory for the value, if the pointer is not NULL. |
|
The copy constructor. |
|
Creates a dump of an attribute. |
|
The getter method for the length of the attribute
|
|
The getter method for the type of the attribute.
|
|
The getter method for the value.
|
|
Transform a attribute value to an integer, this makes only sense if the datatype is an integer. This dependents on the definition in the radius RFC or can be locked up in the file radius.h of this source code.
|
|
The method converts the value into an ip. The attribute must have the right datatype IPADDRESS.
|
|
Creates a password buffer with MD5/xOR hashing for the ATTRIB_User_Password. The password filed must be have a length of 16 Octets or a multiple of 16 Octets. If the password is longer than 16 characters, the XOR-hash is build of the first 16 chars, than a new XOR-hash is build over the first XOR-hash and the shared secret and so on. It if defined in the radius RFC.
|
|
The overloading of the assignment operator. |
|
The setter method for the length of the attribut. Normally it calculated automatically.
|
|
Extract the value of an received attribute in the buffer to the value field of an attribute. The order is still in network order. If you want to get it maybe as a char or integer you must to know which type it is. So you know the datatype and you can convert it. But this done in another method.
|
|
The setter method for the type of the attribute.
|
|
The method sets the value for an integer. The method writes the integer in a string and calls the method setValue(char *).
|
|
The method sets the value. Internal it converts the string into a char array and calls setValue(char *).
|
|
Set the value of the attribute. The representation of the value is changed, so it is ready to send over the network. The changes depend on the datatype IPADRESS, INTEGER, String. The datatype enum can be treated as an integer. A special attribut is the User password, the length must be 16 octets or a multipe of 16 Octets. Here it is only copied to the value. The datatypes ipv6addr,ifid, ipv6prefix, ipv6addr are treated as strings.
|
|
The attribute length, of the value |
|
The attibute type, see in radius.h |
|
A pointer to the value |