Diffstat (limited to 'include/opkele/association.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | include/opkele/association.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/opkele/association.h b/include/opkele/association.h index a8f3915..72eff5b 100644 --- a/include/opkele/association.h +++ b/include/opkele/association.h | |||
@@ -32,37 +32,39 @@ namespace opkele { | |||
32 | * the secret | 32 | * the secret |
33 | */ | 33 | */ |
34 | secret_t _secret; | 34 | secret_t _secret; |
35 | /** | 35 | /** |
36 | * expiration time | 36 | * expiration time |
37 | */ | 37 | */ |
38 | time_t _expires; | 38 | time_t _expires; |
39 | /** | 39 | /** |
40 | * statelessness of the assoc_handle | 40 | * statelessness of the assoc_handle |
41 | */ | 41 | */ |
42 | bool _stateless; | 42 | bool _stateless; |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * @param __server the server name | 45 | * @param __server the server name |
46 | * @param __handle association handle | 46 | * @param __handle association handle |
47 | * @param __assoc_type association type | 47 | * @param __assoc_type association type |
48 | * @param __secret the secret | 48 | * @param __secret the secret |
49 | * @param __expires expiration time | 49 | * @param __expires expiration time |
50 | * @param __stateless statelessness of the assoc_handle | 50 | * @param __stateless statelessness of the assoc_handle |
51 | */ | 51 | */ |
52 | association(const string& __server, const string& __handle, | 52 | association(const string& __server, const string& __handle, |
53 | const string& __assoc_type, const secret_t& __secret, | 53 | const string& __assoc_type, const secret_t& __secret, |
54 | time_t __expires, bool __stateless) | 54 | time_t __expires, bool __stateless) |
55 | : _server(__server), _handle(__handle), _assoc_type(__assoc_type), | 55 | : _server(__server), _handle(__handle), _assoc_type(__assoc_type), |
56 | _secret(__secret), _expires(__expires), _stateless(__stateless) { } | 56 | _secret(__secret), _expires(__expires), _stateless(__stateless) { } |
57 | 57 | ||
58 | virtual string server() const { return _server; } | 58 | virtual string server() const { return _server; } |
59 | virtual string handle() const { return _handle; } | 59 | virtual string handle() const { return _handle; } |
60 | virtual string assoc_type() const { return _assoc_type; } | 60 | virtual string assoc_type() const { return _assoc_type; } |
61 | virtual secret_t secret() const { return _secret; } | 61 | virtual secret_t secret() const { return _secret; } |
62 | virtual int expires_in() const { return _expires-time(0); } | 62 | virtual int expires_in() const { return _expires-time(0); } |
63 | virtual bool stateless() const { return _stateless; } | 63 | virtual bool stateless() const { return _stateless; } |
64 | |||
65 | virtual bool is_expired() const { return _expires<time(0); } | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | } | 68 | } |
67 | 69 | ||
68 | #endif /* __OPKELE_ASSOCIATION_H */ | 70 | #endif /* __OPKELE_ASSOCIATION_H */ |