|
|
This is the class that should be instantiated to access authentication.
Auth (EventLoop& eventloop)
| Auth |
bool set_method (const string& method)
| set_method |
void generate (vector<uint8_t>& pkt)
| generate |
Apply the authentication scheme to the packet.
bool verify (vector<uint8_t>& pkt, const IPv4& src_addr, bool new_peer)
| verify |
Verify that this packet has passed the authentication scheme.
bool verify (vector<uint8_t>& pkt, const IPv6& src_addr, bool new_peer)
| verify |
uint32_t additional_payload ()
| additional_payload |
[const]
Additional bytes that will be added to the payload.
const string& error ()
| error |
[const]
void reset ()
| reset |
Called to notify authentication system to reset.
bool set_simple_authentication_key (const string& password,
string& error_msg)
| set_simple_authentication_key |
Set a simple password authentication key.
Note that the current authentication handler is replaced with a simple password authentication handler.
Parameters:
password | the password to set. |
the | error message (if error). |
Returns: true on success, otherwise false.
bool delete_simple_authentication_key (string& error_msg)
| delete_simple_authentication_key |
Delete a simple password authentication key.
Note that after the deletion the simple password authentication handler is replaced with a Null authentication handler.
Parameters:
the | error message (if error). |
Returns: true on success, otherwise false.
bool set_md5_authentication_key (uint8_t key_id, const string& password,
uint32_t start_secs, uint32_t end_secs,
string& error_msg)
| set_md5_authentication_key |
Set an MD5 authentication key.
Note that the current authentication handler is replaced with an MD5 authentication handler.
Parameters:
key_id | unique ID associated with key. |
password | phrase used for MD5 digest computation. |
start_secs | start time in seconds since midnight 1 Jan 1970. |
end_secs | start time in seconds since midnight 1 Jan 1970. |
the | error message (if error). |
Returns: true on success, otherwise false.
bool delete_md5_authentication_key (uint8_t key_id, string& error_msg)
| delete_md5_authentication_key |
Delete an MD5 authentication key.
Note that after the deletion if there are no more valid MD5 keys, the MD5 authentication handler is replaced with a Null authentication handler.
Parameters:
key_id | the ID of the key to delete. |
the | error message (if error). |
Returns: true on success, otherwise false.