diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-07-19 22:20:02 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-07-19 22:20:02 +0400 |
commit | 3c343b7902755f6110d89c9a87bf8c08ed30c705 (patch) | |
tree | a32dc70bf5660e1b79e2ba0b5f01f02e7c095806 /accel-pppd/radius/backup.c | |
parent | 6fe9ea35fb1484c37aa5f7eb9b023780f986f1e8 (diff) | |
download | accel-ppp-3c343b7902755f6110d89c9a87bf8c08ed30c705.tar.gz accel-ppp-3c343b7902755f6110d89c9a87bf8c08ed30c705.zip |
radius: implemented Idle-Timeout
Diffstat (limited to 'accel-pppd/radius/backup.c')
-rw-r--r-- | accel-pppd/radius/backup.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/accel-pppd/radius/backup.c b/accel-pppd/radius/backup.c index 4c40ec61..a44a7606 100644 --- a/accel-pppd/radius/backup.c +++ b/accel-pppd/radius/backup.c @@ -21,6 +21,7 @@ #define RAD_TAG_TERMINATION_ACTION 8 #define RAD_TAG_ACCT_SERVER_ADDR 9 #define RAD_TAG_ACCT_SERVER_PORT 10 +#define RAD_TAG_IDLE_TIMEOUT 11 #define add_tag(id, data, size) if (!backup_add_tag(m, id, 0, data, size)) return -1; @@ -30,6 +31,7 @@ static int session_save(struct ap_session *ses, struct backup_mod *m) { struct radius_pd_t *rpd = find_pd(ses); uint64_t session_timeout = ses->start_time + rpd->session_timeout.expire_tv.tv_sec; + uint32_t idle_timeout = rpd->idle_timeout.period / 1000; if (!rpd) return 0; @@ -42,6 +44,9 @@ static int session_save(struct ap_session *ses, struct backup_mod *m) if (rpd->session_timeout.tpd) add_tag(RAD_TAG_SESSION_TIMEOUT, &session_timeout, 8); + if (rpd->idle_timeout.tpd) + add_tag(RAD_TAG_IDLE_TIMEOUT, &idle_timeout, 4); + if (ses->ipv4 == &rpd->ipv4_addr) add_tag(RAD_TAG_IPV4_ADDR, NULL, 0); @@ -113,6 +118,9 @@ void radius_restore_session(struct ap_session *ses, struct radius_pd_t *rpd) case RAD_TAG_SESSION_TIMEOUT: rpd->session_timeout.expire_tv.tv_sec = *(uint64_t *)tag->data - ses->start_time; break; + case RAD_TAG_IDLE_TIMEOUT: + rpd->idle_timeout.period = (*(uint32_t *)tag->data) * 1000; + break; case RAD_TAG_IPV4_ADDR: ses->ipv4 = &rpd->ipv4_addr; restore_ipv4_addr(ses); |