#include <License.h>
Inherits Object, and Singleton< T >< License >.
Inheritance diagram for License:


Public Member Functions | |
| int | check (const String &license) |
| int | check () |
| int | checkWithMsg () |
| String | mac () const |
| time_t | expirationTime () const |
| int | generate (const String &mac, const time_t expirationTime, String &license) |
Private Member Functions | |
| License () | |
| virtual | ~License () |
| int | mac (String &mac) |
| int | encode (char *encodedData, const char *data, const unsigned int size) |
| int | decode (char *dencodedData, const char *data, const unsigned int size) |
| unsigned char | crc (const char *data, const unsigned int size) |
Private Attributes | |
| time_t | _expirationTime |
| String | _mac |
Friends | |
| class | Singleton< License > |
Definition at line 42 of file License.h.
| License::License | ( | ) | [private] |
| License::~License | ( | ) | [private, virtual] |
Definition at line 151 of file License.cpp.
| int License::check | ( | const String & | license | ) |
Definition at line 25 of file License.cpp.
References _expirationTime, _mac, crc(), CSTRING(), decode(), ERROR, ERROR_BACKTRACE(), FAILED(), LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_TIME, MSG_LICENSE_INVALID, OK, and SWAP32_IF_BE.
| int License::check | ( | ) |
Definition at line 50 of file License.cpp.
References CSTRING(), decode(), ERROR, ERROR_BACKTRACE(), FAILED(), LICENSE_FILE_PATH, LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_MAC, mac(), MSG_FILE_CANNOT_CLOSE, MSG_FILE_CANNOT_OPEN, MSG_LICENSE_INVALID, and OK.
Referenced by checkWithMsg().
| int License::checkWithMsg | ( | ) |
Definition at line 84 of file License.cpp.
References check(), ERROR_BACKTRACE(), FAILED(), LICENSE_MSG, LICENSE_MSG_DELAY, and OK.
| String License::mac | ( | ) | const |
Definition at line 96 of file License.cpp.
References _mac.
Referenced by check(), generate(), and mac().
| time_t License::expirationTime | ( | ) | const |
Definition at line 106 of file License.cpp.
References crc(), CSTRING(), encode(), ERROR_BACKTRACE(), FAILED(), LICENSE_LIMIT_SIZE, LICENSE_MAC_ADDRESS_SIZE, LICENSE_MAGIC_TIME, mac(), OK, and SWAP32_IF_BE.
| int License::mac | ( | String & | mac | ) | [private] |
Definition at line 155 of file License.cpp.
References ERROR, LICENSE_IF_NAME, mac(), MSG_SOCKET_CANNOT_CLOSE, MSG_SOCKET_CANNOT_CREATE, MSG_SOCKET_CANNOT_GET_INFO, and OK.
| int License::encode | ( | char * | encodedData, | |
| const char * | data, | |||
| const unsigned int | size | |||
| ) | [private] |
Definition at line 179 of file License.cpp.
References DEBUG, OK, and SWAP32_IF_BE.
Referenced by generate().
| int License::decode | ( | char * | dencodedData, | |
| const char * | data, | |||
| const unsigned int | size | |||
| ) | [private] |
Definition at line 210 of file License.cpp.
References ERROR, MSG_LICENSE_INVALID, OK, and SWAP32_IF_BE.
Referenced by check().
| unsigned char License::crc | ( | const char * | data, | |
| const unsigned int | size | |||
| ) | [private] |
time_t License::_expirationTime [private] |
String License::_mac [private] |
1.5.1