Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
292439d2
A
accel-ppp
项目概览
Achou.Wang
/
accel-ppp
通知
6
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
accel-ppp
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
292439d2
编写于
9月 09, 2014
作者:
D
Dmitry Kozlov
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
ssh://git.code.sf.net/p/accel-ppp/code
上级
cc6e6565
6bed2a5a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
32 addition
and
3 deletion
+32
-3
accel-pppd/accel-ppp.conf
accel-pppd/accel-ppp.conf
+1
-0
accel-pppd/ctrl/ipoe/ipoe.c
accel-pppd/ctrl/ipoe/ipoe.c
+24
-3
accel-pppd/ctrl/ipoe/ipoe.h
accel-pppd/ctrl/ipoe/ipoe.h
+7
-0
未找到文件。
accel-pppd/accel-ppp.conf
浏览文件 @
292439d2
...
@@ -117,6 +117,7 @@ start=dhcpv4
...
@@ -117,6 +117,7 @@ start=dhcpv4
#attr-dhcp-router-ip=DHCP-Router-IP-Address
#attr-dhcp-router-ip=DHCP-Router-IP-Address
#attr-dhcp-mask=DHCP-Mask
#attr-dhcp-mask=DHCP-Mask
#attr-dhcp-lease-time=DHCP-Lease-Time
#attr-dhcp-lease-time=DHCP-Lease-Time
#attr-dhcp-opt82=DHCP-Option82
#attr-l4-redirect=L4-Redirect
#attr-l4-redirect=L4-Redirect
#local-net=192.168.0.0/16
#local-net=192.168.0.0/16
#lua-file=/etc/accel-ppp.lua
#lua-file=/etc/accel-ppp.lua
...
...
accel-pppd/ctrl/ipoe/ipoe.c
浏览文件 @
292439d2
...
@@ -33,9 +33,6 @@
...
@@ -33,9 +33,6 @@
#include "ipset.h"
#include "ipset.h"
#include "connlimit.h"
#include "connlimit.h"
#ifdef RADIUS
#include "radius.h"
#endif
#include "ipoe.h"
#include "ipoe.h"
...
@@ -119,6 +116,7 @@ static int conf_attr_dhcp_router_ip;
...
@@ -119,6 +116,7 @@ static int conf_attr_dhcp_router_ip;
static
int
conf_attr_dhcp_mask
;
static
int
conf_attr_dhcp_mask
;
static
int
conf_attr_dhcp_lease_time
;
static
int
conf_attr_dhcp_lease_time
;
static
int
conf_attr_l4_redirect
;
static
int
conf_attr_l4_redirect
;
static
const
char
*
conf_attr_dhcp_opt82
;
#endif
#endif
static
int
conf_l4_redirect_table
;
static
int
conf_l4_redirect_table
;
static
int
conf_l4_redirect_on_reject
;
static
int
conf_l4_redirect_on_reject
;
...
@@ -155,6 +153,7 @@ static mempool_t disc_item_pool;
...
@@ -155,6 +153,7 @@ static mempool_t disc_item_pool;
static
mempool_t
req_item_pool
;
static
mempool_t
req_item_pool
;
static
int
connlimit_loaded
;
static
int
connlimit_loaded
;
static
int
radius_loaded
;
static
LIST_HEAD
(
serv_list
);
static
LIST_HEAD
(
serv_list
);
static
pthread_mutex_t
serv_lock
=
PTHREAD_MUTEX_INITIALIZER
;
static
pthread_mutex_t
serv_lock
=
PTHREAD_MUTEX_INITIALIZER
;
...
@@ -179,6 +178,7 @@ static void ipoe_session_keepalive(struct dhcpv4_packet *pack);
...
@@ -179,6 +178,7 @@ static void ipoe_session_keepalive(struct dhcpv4_packet *pack);
static
void
add_interface
(
const
char
*
ifname
,
int
ifindex
,
const
char
*
opt
,
int
parent_ifindex
,
int
vid
);
static
void
add_interface
(
const
char
*
ifname
,
int
ifindex
,
const
char
*
opt
,
int
parent_ifindex
,
int
vid
);
static
int
get_offer_delay
();
static
int
get_offer_delay
();
static
void
__ipoe_session_start
(
struct
ipoe_session
*
ses
);
static
void
__ipoe_session_start
(
struct
ipoe_session
*
ses
);
static
int
ipoe_rad_send_request
(
struct
rad_plugin_t
*
rad
,
struct
rad_packet_t
*
pack
);
static
struct
ipoe_session
*
ipoe_session_lookup
(
struct
ipoe_serv
*
serv
,
struct
dhcpv4_packet
*
pack
,
struct
ipoe_session
**
opt82_ses
)
static
struct
ipoe_session
*
ipoe_session_lookup
(
struct
ipoe_serv
*
serv
,
struct
dhcpv4_packet
*
pack
,
struct
ipoe_session
**
opt82_ses
)
{
{
...
@@ -528,6 +528,14 @@ static void ipoe_session_start(struct ipoe_session *ses)
...
@@ -528,6 +528,14 @@ static void ipoe_session_start(struct ipoe_session *ses)
if
(
ses
->
serv
->
opt_shared
&&
ipoe_create_interface
(
ses
))
if
(
ses
->
serv
->
opt_shared
&&
ipoe_create_interface
(
ses
))
return
;
return
;
#ifdef RADIUS
if
(
conf_attr_dhcp_opt82
&&
ses
->
relay_agent
&&
radius_loaded
)
{
ses
->
radius
.
send_access_request
=
ipoe_rad_send_request
;
ses
->
radius
.
send_accounting_request
=
ipoe_rad_send_request
;
rad_register_plugin
(
&
ses
->
ses
,
&
ses
->
radius
);
}
#endif
r
=
pwdb_check
(
&
ses
->
ses
,
username
,
PPP_PAP
,
conf_password
?
conf_password
:
username
);
r
=
pwdb_check
(
&
ses
->
ses
,
username
,
PPP_PAP
,
conf_password
?
conf_password
:
username
);
if
(
r
==
PWDB_NO_IMPL
)
{
if
(
r
==
PWDB_NO_IMPL
)
{
passwd
=
pwdb_get_passwd
(
&
ses
->
ses
,
ses
->
ses
.
username
);
passwd
=
pwdb_get_passwd
(
&
ses
->
ses
,
ses
->
ses
.
username
);
...
@@ -1743,6 +1751,17 @@ static void ev_radius_coa(struct ev_radius_t *ev)
...
@@ -1743,6 +1751,17 @@ static void ev_radius_coa(struct ev_radius_t *ev)
if
(
l4_redirect
!=
ses
->
l4_redirect
&&
ev
->
ses
->
state
==
AP_STATE_ACTIVE
)
if
(
l4_redirect
!=
ses
->
l4_redirect
&&
ev
->
ses
->
state
==
AP_STATE_ACTIVE
)
ipoe_change_l4_redirect
(
ses
,
l4_redirect
);
ipoe_change_l4_redirect
(
ses
,
l4_redirect
);
}
}
static
int
ipoe_rad_send_request
(
struct
rad_plugin_t
*
rad
,
struct
rad_packet_t
*
pack
)
{
struct
ipoe_session
*
ses
=
container_of
(
rad
,
typeof
(
*
ses
),
radius
);
if
(
!
ses
->
relay_agent
)
return
0
;
return
rad_packet_add_octets
(
pack
,
NULL
,
conf_attr_dhcp_opt82
,
ses
->
relay_agent
->
data
,
ses
->
relay_agent
->
len
);
}
#endif
#endif
static
void
ipoe_serv_release
(
struct
ipoe_serv
*
serv
)
static
void
ipoe_serv_release
(
struct
ipoe_serv
*
serv
)
...
@@ -2541,6 +2560,7 @@ static void load_radius_attrs(void)
...
@@ -2541,6 +2560,7 @@ static void load_radius_attrs(void)
parse_conf_rad_attr
(
"attr-dhcp-mask"
,
&
conf_attr_dhcp_mask
);
parse_conf_rad_attr
(
"attr-dhcp-mask"
,
&
conf_attr_dhcp_mask
);
parse_conf_rad_attr
(
"attr-dhcp-lease-time"
,
&
conf_attr_dhcp_lease_time
);
parse_conf_rad_attr
(
"attr-dhcp-lease-time"
,
&
conf_attr_dhcp_lease_time
);
parse_conf_rad_attr
(
"attr-l4-redirect"
,
&
conf_attr_l4_redirect
);
parse_conf_rad_attr
(
"attr-l4-redirect"
,
&
conf_attr_l4_redirect
);
conf_attr_dhcp_opt82
=
conf_get_opt
(
"ipoe"
,
"attr-dhcp-opt82"
);
}
}
#endif
#endif
...
@@ -3061,6 +3081,7 @@ static void ipoe_init(void)
...
@@ -3061,6 +3081,7 @@ static void ipoe_init(void)
#endif
#endif
connlimit_loaded
=
triton_module_loaded
(
"connlimit"
);
connlimit_loaded
=
triton_module_loaded
(
"connlimit"
);
radius_loaded
=
triton_module_loaded
(
"radius"
);
}
}
DEFINE_INIT
(
52
,
ipoe_init
);
DEFINE_INIT
(
52
,
ipoe_init
);
accel-pppd/ctrl/ipoe/ipoe.h
浏览文件 @
292439d2
...
@@ -9,6 +9,10 @@
...
@@ -9,6 +9,10 @@
#include "ipdb.h"
#include "ipdb.h"
#include "dhcpv4.h"
#include "dhcpv4.h"
#ifdef RADIUS
#include "radius.h"
#endif
#ifndef ETH_ALEN
#ifndef ETH_ALEN
#define ETH_ALEN 6
#define ETH_ALEN 6
#endif
#endif
...
@@ -77,6 +81,9 @@ struct ipoe_session {
...
@@ -77,6 +81,9 @@ struct ipoe_session {
int
relay_retransmit
;
int
relay_retransmit
;
int
ifindex
;
int
ifindex
;
struct
ipv4db_item_t
ipv4
;
struct
ipv4db_item_t
ipv4
;
#ifdef RADIUS
struct
rad_plugin_t
radius
;
#endif
int
ifcfg
:
1
;
int
ifcfg
:
1
;
int
started
:
1
;
int
started
:
1
;
int
terminating
:
1
;
int
terminating
:
1
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录