Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
84ff56a8
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 搜索 >>
提交
84ff56a8
编写于
10月 14, 2010
作者:
K
Kozlov Dmitry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
due to libnl-1 is not thread safe, l2tp and shaper updated to use libnl-2
上级
763fe9e3
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
81 addition
and
36 deletion
+81
-36
README
README
+4
-4
accel-pptpd/ctrl/CMakeLists.txt
accel-pptpd/ctrl/CMakeLists.txt
+5
-1
accel-pptpd/ctrl/l2tp/CMakeLists.txt
accel-pptpd/ctrl/l2tp/CMakeLists.txt
+1
-1
accel-pptpd/ctrl/l2tp/netlink.c
accel-pptpd/ctrl/l2tp/netlink.c
+11
-11
accel-pptpd/extra/CMakeLists.txt
accel-pptpd/extra/CMakeLists.txt
+6
-2
accel-pptpd/extra/shaper_tbf.c
accel-pptpd/extra/shaper_tbf.c
+13
-13
accel-pptpd/ppp/ppp_ccp.c
accel-pptpd/ppp/ppp_ccp.c
+2
-1
accel-pptpd/ppp/ppp_lcp.c
accel-pptpd/ppp/ppp_lcp.c
+7
-0
contrib/gentoo/dev-libs/libnl/libnl-9999.ebuild
contrib/gentoo/dev-libs/libnl/libnl-9999.ebuild
+19
-0
contrib/gentoo/net-dialup/accel-pptp/accel-pptp-9999.ebuild
contrib/gentoo/net-dialup/accel-pptp/accel-pptp-9999.ebuild
+13
-3
未找到文件。
README
浏览文件 @
84ff56a8
...
...
@@ -23,7 +23,7 @@ Features
11. Extensible user/password database, implemented only Radius source
12. Extensible IP pool, implemented Radius and static pools
13. Supported pppd compatible ip-up/ip-down scripts
(Work on L2TP is in progress)
14. Builtin tbf shaper manager
Requirment
...
...
@@ -32,7 +32,7 @@ Requirment
2. kernel-2.6.25 or later
3. glibc-2.8 or later
4. cmake-2.6 or later
5. libnl-
1.1 or probably later
5. libnl-
2.0 or probably later (required for l2tp and builtin shaper)
Compilation and instalation
...
...
@@ -42,9 +42,9 @@ or specify other location via KDIR.
1. cd /path/to/accel-pptp-1.0
2. mkdir build
3. cd build
4. cmake [
-D BUILD_DRIVER=TRUE ] [ -D KDIR=/usr/src/linux ] [ -D CMAKE_INSTALL_PREFIX=/usr/local ] [ -D CMAKE_BUILD_TYPE=Debug ] [ -DLOG_PGSQL=TRUE
] ..
4. cmake [
-DBUILD_DRIVER=TRUE] [-DKDIR=/usr/src/linux] [-DCMAKE_INSTALL_PREFIX=/usr/local] [-DCMAKE_BUILD_TYPE=Debug] [-DLOG_PGSQL=TRUE] [-DL2TP=TRUE] [-DSHAPER=TRUE
] ..
Please note that the double dot record in the end of the command is essential. You'll get error if you miss it.
BUILD_DRIVER, KDIR, CMAKE_INSTALL_PREFIX, CMAKE_BUILD_TYPE, LOG_PGSQL are optional,
BUILD_DRIVER, KDIR, CMAKE_INSTALL_PREFIX, CMAKE_BUILD_TYPE, LOG_PGSQL
, L2TP, SHAPER
are optional,
but while pptp is not present in mainline kernel you probably need BUILD_DRIVER.
5. make
6. make install
...
...
accel-pptpd/ctrl/CMakeLists.txt
浏览文件 @
84ff56a8
ADD_SUBDIRECTORY
(
pptp
)
ADD_SUBDIRECTORY
(
pppoe
)
ADD_SUBDIRECTORY
(
l2tp
)
IF
(
L2TP
)
ADD_SUBDIRECTORY
(
l2tp
)
ENDIF
(
L2TP
)
accel-pptpd/ctrl/l2tp/CMakeLists.txt
浏览文件 @
84ff56a8
...
...
@@ -8,6 +8,6 @@ ADD_LIBRARY(l2tp SHARED
packet.c
netlink.c
)
TARGET_LINK_LIBRARIES
(
l2tp nl
)
TARGET_LINK_LIBRARIES
(
l2tp nl
-genl
)
INSTALL
(
TARGETS l2tp LIBRARY DESTINATION usr/lib/accel-pptp
)
accel-pptpd/ctrl/l2tp/netlink.c
浏览文件 @
84ff56a8
...
...
@@ -9,10 +9,10 @@ static int family;
void
l2tp_nl_delete_tunnel
(
int
tid
)
{
struct
nl_
handle
*
nl_sock
;
struct
nl_
sock
*
nl_sock
;
struct
nl_msg
*
msg
;
nl_sock
=
nl_
handle
_alloc
();
nl_sock
=
nl_
socket
_alloc
();
msg
=
nlmsg_alloc
();
genl_connect
(
nl_sock
);
...
...
@@ -25,15 +25,15 @@ void l2tp_nl_delete_tunnel(int tid)
nlmsg_free
(
msg
);
nl_close
(
nl_sock
);
nl_
handle_destroy
(
nl_sock
);
nl_
socket_free
(
nl_sock
);
}
void
l2tp_nl_create_tunnel
(
int
fd
,
int
tid
,
int
peer_tid
)
{
struct
nl_
handle
*
nl_sock
;
struct
nl_
sock
*
nl_sock
;
struct
nl_msg
*
msg
;
nl_sock
=
nl_
handle
_alloc
();
nl_sock
=
nl_
socket
_alloc
();
msg
=
nlmsg_alloc
();
genl_connect
(
nl_sock
);
...
...
@@ -51,15 +51,15 @@ void l2tp_nl_create_tunnel(int fd, int tid, int peer_tid)
nlmsg_free
(
msg
);
nl_close
(
nl_sock
);
nl_
handle_destroy
(
nl_sock
);
nl_
socket_free
(
nl_sock
);
}
void
l2tp_nl_create_session
(
int
tid
,
int
sid
,
int
peer_sid
)
{
struct
nl_
handle
*
nl_sock
;
struct
nl_
sock
*
nl_sock
;
struct
nl_msg
*
msg
;
nl_sock
=
nl_
handle
_alloc
();
nl_sock
=
nl_
socket
_alloc
();
msg
=
nlmsg_alloc
();
genl_connect
(
nl_sock
);
...
...
@@ -77,18 +77,18 @@ void l2tp_nl_create_session(int tid, int sid, int peer_sid)
nlmsg_free
(
msg
);
nl_close
(
nl_sock
);
nl_
handle_destroy
(
nl_sock
);
nl_
socket_free
(
nl_sock
);
}
static
void
__init
init
(
void
)
{
struct
nl_
handle
*
nl_sock
=
nl_handle
_alloc
();
struct
nl_
sock
*
nl_sock
=
nl_socket
_alloc
();
genl_connect
(
nl_sock
);
family
=
genl_ctrl_resolve
(
nl_sock
,
L2TP_GENL_NAME
);
nl_close
(
nl_sock
);
nl_
handle_destroy
(
nl_sock
);
nl_
socket_free
(
nl_sock
);
}
accel-pptpd/extra/CMakeLists.txt
浏览文件 @
84ff56a8
ADD_LIBRARY
(
pppd_compat SHARED pppd_compat.c
)
ADD_LIBRARY
(
ippool SHARED ippool.c
)
ADD_LIBRARY
(
sigchld SHARED sigchld.c
)
ADD_LIBRARY
(
shaper_tbf SHARED shaper_tbf.c
)
TARGET_LINK_LIBRARIES
(
shaper_tbf nl
)
INSTALL
(
TARGETS pppd_compat ippool sigchld
LIBRARY DESTINATION usr/lib/accel-pptp
)
IF
(
SHAPER
)
ADD_LIBRARY
(
shaper_tbf SHARED shaper_tbf.c
)
TARGET_LINK_LIBRARIES
(
shaper_tbf nl-route
)
INSTALL
(
TARGETS shaper_tbf LIBRARY DESTINATION usr/lib/accel-pptp
)
ENDIF
(
SHAPER
)
accel-pptpd/extra/shaper_tbf.c
浏览文件 @
84ff56a8
...
...
@@ -92,7 +92,7 @@ static void tc_calc_rtable(struct tc_ratespec *r, uint32_t *rtab, int cell_log,
r
->
cell_log
=
cell_log
;
}
static
int
install_tbf
(
struct
nl_
handle
*
h
,
int
ifindex
,
int
speed
)
static
int
install_tbf
(
struct
nl_
sock
*
h
,
int
ifindex
,
int
speed
)
{
struct
tc_tbf_qopt
opt
;
struct
nl_msg
*
msg
;
...
...
@@ -159,7 +159,7 @@ nla_put_failure:
return
-
1
;
}
static
int
install_ingress
(
struct
nl_
handle
*
h
,
int
ifindex
)
static
int
install_ingress
(
struct
nl_
sock
*
h
,
int
ifindex
)
{
struct
nl_msg
*
pmsg
;
...
...
@@ -200,7 +200,7 @@ nla_put_failure:
return
-
1
;
}
static
int
install_filter
(
struct
nl_
handle
*
h
,
int
ifindex
,
int
speed
)
static
int
install_filter
(
struct
nl_
sock
*
h
,
int
ifindex
,
int
speed
)
{
double
rate
=
speed
*
1000
/
8
;
double
bucket
=
rate
*
conf_burst_factor
;
...
...
@@ -323,7 +323,7 @@ nla_put_failure:
static
int
install_shaper
(
const
char
*
ifname
,
int
down_speed
,
int
up_speed
)
{
struct
nl_
handle
*
h
;
struct
nl_
sock
*
h
;
struct
ifreq
ifr
;
int
err
;
...
...
@@ -335,9 +335,9 @@ static int install_shaper(const char *ifname, int down_speed, int up_speed)
return
-
1
;
}
h
=
nl_
handle
_alloc
();
h
=
nl_
socket
_alloc
();
if
(
!
h
)
{
log_ppp_error
(
"tbf: nl_
handle
_alloc failed
\n
"
);
log_ppp_error
(
"tbf: nl_
socket
_alloc failed
\n
"
);
return
-
1
;
}
...
...
@@ -360,7 +360,7 @@ static int install_shaper(const char *ifname, int down_speed, int up_speed)
nl_close
(
h
);
out:
nl_
handle_destroy
(
h
);
nl_
socket_free
(
h
);
return
0
;
}
...
...
@@ -395,7 +395,7 @@ static struct shaper_pd_t *find_pd(struct ppp_t *ppp, int create)
static
int
remove_shaper
(
const
char
*
ifname
)
{
struct
nl_
handle
*
h
;
struct
nl_
sock
*
h
;
struct
ifreq
ifr
;
struct
nl_msg
*
pmsg
;
int
err
;
...
...
@@ -422,16 +422,16 @@ static int remove_shaper(const char *ifname)
.
tcm_parent
=
TC_H_INGRESS
,
};
h
=
nl_
handle
_alloc
();
h
=
nl_
socket
_alloc
();
if
(
!
h
)
{
log_ppp_error
(
"tbf: nl_
handle
_alloc failed
\n
"
);
log_ppp_error
(
"tbf: nl_
socket
_alloc failed
\n
"
);
return
-
1
;
}
err
=
nl_connect
(
h
,
NETLINK_ROUTE
);
if
(
err
<
0
)
{
log_ppp_error
(
"tbf: nl_connect: %s"
,
strerror
(
errno
));
nl_
handle_destroy
(
h
);
nl_
socket_free
(
h
);
return
-
1
;
}
...
...
@@ -466,7 +466,7 @@ static int remove_shaper(const char *ifname)
nlmsg_free
(
pmsg
);
nl_close
(
h
);
nl_
handle_destroy
(
h
);
nl_
socket_free
(
h
);
return
0
;
out_err:
...
...
@@ -476,7 +476,7 @@ out_err:
nlmsg_free
(
pmsg
);
nl_close
(
h
);
nl_
handle_destroy
(
h
);
nl_
socket_free
(
h
);
return
-
1
;
}
...
...
accel-pptpd/ppp/ppp_ccp.c
浏览文件 @
84ff56a8
...
...
@@ -607,7 +607,8 @@ static void ccp_recv(struct ppp_handler_t*h)
if
(
ccp
->
fsm
.
fsm_state
==
FSM_Initial
||
ccp
->
fsm
.
fsm_state
==
FSM_Closed
)
{
if
(
conf_ppp_verbose
)
log_ppp_warn
(
"CCP: discaring packet
\n
"
);
lcp_send_proto_rej
(
ccp
->
ppp
,
htons
(
PPP_CCP
));
if
(
ccp
->
fsm
.
fsm_state
==
FSM_Closed
)
lcp_send_proto_rej
(
ccp
->
ppp
,
htons
(
PPP_CCP
));
return
;
}
...
...
accel-pptpd/ppp/ppp_lcp.c
浏览文件 @
84ff56a8
...
...
@@ -690,6 +690,13 @@ static void lcp_recv(struct ppp_handler_t*h)
int
r
;
char
*
term_msg
;
if
(
lcp
->
fsm
.
fsm_state
==
FSM_Initial
||
lcp
->
fsm
.
fsm_state
==
FSM_Closed
)
{
/*if (conf_ppp_verbose)
log_ppp_warn("LCP: discaring packet\n");
lcp_send_proto_rej(ccp->ppp, htons(PPP_CCP));*/
return
;
}
if
(
lcp
->
ppp
->
chan_buf_size
<
PPP_HEADERLEN
+
2
)
{
log_ppp_warn
(
"LCP: short packet received
\n
"
);
return
;
...
...
contrib/gentoo/dev-libs/libnl/libnl-9999.ebuild
0 → 100644
浏览文件 @
84ff56a8
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/dev-libs/polylib/polylib-9999.ebuild,v 1.1 2008/09/21 08:46:58 vapier Exp $
EGIT_REPO_URI
=
"git://git.kernel.org/pub/scm/libs/netlink/libnl.git"
EGIT_BOOTSTRAP
=
"eautoreconf"
inherit git autotools eutils
DESCRIPTION
=
"Netlink library"
HOMEPAGE
=
"http://infradead.org/~tgr/libnl"
LICENSE
=
"GPL-2"
SLOT
=
"0"
KEYWORDS
=
"~amd64 ~x86"
IUSE
=
""
src_install
()
{
emake
DESTDIR
=
${
D
}
install
||
die
}
contrib/gentoo/net-dialup/accel-pptp/accel-pptp-9999.ebuild
浏览文件 @
84ff56a8
...
...
@@ -14,11 +14,13 @@ HOMEPAGE="http://accel-pptp.sourceforge.net/"
SLOT
=
"0"
LICENSE
=
"GPL"
KEYWORDS
=
"~amd64 ~x86"
IUSE
=
"postgres debug"
IUSE
=
"postgres debug
l2tp shaper
"
DEPEND
=
"dev-libs/openssl
DEPEND
=
">=sys-libs/glibc-2.8
dev-libs/openssl
dev-libs/libaio
dev-libs/libnl
l2tp? ( =dev-libs/libnl-9999 )
shaper? ( =dev-libs/libnl-9999 )
postgres? ( >=dev-db/postgresql-base-8.1 )"
RDEPEND
=
"
$DEPEND
...
...
@@ -47,6 +49,14 @@ src_configure() {
if
use postgres
;
then
mycmakeargs+
=(
"-DLOG_PGSQL=TRUE"
)
fi
if
use l2tp
;
then
mycmakeargs+
=(
"-DL2TP=TRUE"
)
fi
if
use shaper
;
then
mycmakeargs+
=(
"-DSHAPER=TRUE"
)
fi
cmake-utils_src_configure
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录