summaryrefslogtreecommitdiff
path: root/accel-pppd/radius
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2014-06-17 21:31:10 +0400
committerDmitry Kozlov <xeb@mail.ru>2014-06-17 21:31:10 +0400
commitd5776039b12c3c1016b3bb6ccede69bacf23ae1e (patch)
tree7c4b41d1cefc0f42438e61e6403a480d082ef3c7 /accel-pppd/radius
parentc69fb2ed39346fd5091a4e30606cb5bb866aa432 (diff)
downloadaccel-ppp-d5776039b12c3c1016b3bb6ccede69bacf23ae1e.tar.gz
accel-ppp-d5776039b12c3c1016b3bb6ccede69bacf23ae1e.zip
radius: introduced attr-tunnel-type option
If specified then accel-ppp will send tunnel type as string (pppoe,pptp,l2tp,ipoe).
Diffstat (limited to 'accel-pppd/radius')
-rw-r--r--accel-pppd/radius/radius.c4
-rw-r--r--accel-pppd/radius/radius_p.h1
-rw-r--r--accel-pppd/radius/req.c4
3 files changed, 9 insertions, 0 deletions
diff --git a/accel-pppd/radius/radius.c b/accel-pppd/radius/radius.c
index 26e59bad..a3b211ea 100644
--- a/accel-pppd/radius/radius.c
+++ b/accel-pppd/radius/radius.c
@@ -45,6 +45,8 @@ int conf_req_limit;
static const char *conf_default_realm;
static int conf_default_realm_len;
+const char *conf_attr_tunnel_type;
+
static LIST_HEAD(sessions);
static pthread_rwlock_t sessions_lock = PTHREAD_RWLOCK_INITIALIZER;
@@ -632,6 +634,8 @@ static int load_config(void)
if (opt)
conf_req_limit = atoi(opt);
+ conf_attr_tunnel_type = conf_get_opt("radius", "attr-tunnel-type");
+
conf_default_realm = conf_get_opt("radius", "default-realm");
if (conf_default_realm)
conf_default_realm_len = strlen(conf_default_realm);
diff --git a/accel-pppd/radius/radius_p.h b/accel-pppd/radius/radius_p.h
index f6262135..8ad69da0 100644
--- a/accel-pppd/radius/radius_p.h
+++ b/accel-pppd/radius/radius_p.h
@@ -138,6 +138,7 @@ extern int conf_acct_interim_interval;
extern int conf_accounting;
extern int conf_fail_time;
extern int conf_req_limit;
+extern const char *conf_attr_tunnel_type;
int rad_check_nas_pack(struct rad_packet_t *pack);
struct radius_pd_t *rad_find_session(const char *sessionid, const char *username, const char *port_id, int port, in_addr_t ipaddr, const char *csid);
diff --git a/accel-pppd/radius/req.c b/accel-pppd/radius/req.c
index 818252ee..d688f58a 100644
--- a/accel-pppd/radius/req.c
+++ b/accel-pppd/radius/req.c
@@ -109,6 +109,10 @@ static struct rad_req_t *__rad_req_alloc(struct radius_pd_t *rpd, int code, cons
if (rpd->attr_class)
if (rad_packet_add_octets(req->pack, NULL, "Class", rpd->attr_class, rpd->attr_class_len))
goto out_err;
+
+ if (conf_attr_tunnel_type)
+ if (rad_packet_add_str(req->pack, NULL, conf_attr_tunnel_type, rpd->ses->ctrl->name))
+ goto out_err;
list_for_each_entry(plugin, &req->rpd->plugin_list, entry) {
switch (code) {