Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
04c623f7
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 搜索 >>
提交
04c623f7
编写于
10月 14, 2010
作者:
K
Kozlov Dmitry
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fixed bug: incorrect handling of mppe ConfNak
improved ccp handling
上级
f2cca0f3
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
51 addition
and
9 deletion
+51
-9
accel-pptpd/ppp/ppp.c
accel-pptpd/ppp/ppp.c
+22
-1
accel-pptpd/ppp/ppp.h
accel-pptpd/ppp/ppp.h
+2
-0
accel-pptpd/ppp/ppp_ccp.c
accel-pptpd/ppp/ppp_ccp.c
+18
-2
accel-pptpd/ppp/ppp_ccp.h
accel-pptpd/ppp/ppp_ccp.h
+1
-1
accel-pptpd/ppp/ppp_fsm.c
accel-pptpd/ppp/ppp_fsm.c
+3
-1
accel-pptpd/ppp/ppp_ipcp.c
accel-pptpd/ppp/ppp_ipcp.c
+2
-2
accel-pptpd/ppp/ppp_lcp.c
accel-pptpd/ppp/ppp_lcp.c
+3
-2
未找到文件。
accel-pptpd/ppp/ppp.c
浏览文件 @
04c623f7
...
...
@@ -312,6 +312,27 @@ cont:
}
}
void
ppp_recv_proto_rej
(
struct
ppp_t
*
ppp
,
uint16_t
proto
)
{
struct
ppp_handler_t
*
ppp_h
;
list_for_each_entry
(
ppp_h
,
&
ppp
->
chan_handlers
,
entry
)
{
if
(
ppp_h
->
proto
==
proto
)
{
if
(
ppp_h
->
recv_proto_rej
)
ppp_h
->
recv_proto_rej
(
ppp_h
);
return
;
}
}
list_for_each_entry
(
ppp_h
,
&
ppp
->
unit_handlers
,
entry
)
{
if
(
ppp_h
->
proto
==
proto
)
{
if
(
ppp_h
->
recv_proto_rej
)
ppp_h
->
recv_proto_rej
(
ppp_h
);
return
;
}
}
}
void
__export
ppp_layer_started
(
struct
ppp_t
*
ppp
,
struct
ppp_layer_data_t
*
d
)
{
struct
layer_node_t
*
n
=
d
->
node
;
...
...
@@ -410,7 +431,7 @@ static int get_layer_order(const char *name)
if
(
!
strcmp
(
name
,
"lcp"
))
return
0
;
if
(
!
strcmp
(
name
,
"auth"
))
return
1
;
if
(
!
strcmp
(
name
,
"ccp"
))
return
2
;
if
(
!
strcmp
(
name
,
"ipcp"
))
return
3
;
if
(
!
strcmp
(
name
,
"ipcp"
))
return
2
;
return
-
1
;
}
...
...
accel-pptpd/ppp/ppp.h
浏览文件 @
04c623f7
...
...
@@ -130,6 +130,7 @@ struct ppp_handler_t
struct
list_head
entry
;
int
proto
;
void
(
*
recv
)(
struct
ppp_handler_t
*
);
void
(
*
recv_proto_rej
)(
struct
ppp_handler_t
*
h
);
};
struct
ppp_t
*
alloc_ppp
(
void
);
...
...
@@ -138,6 +139,7 @@ int establish_ppp(struct ppp_t *ppp);
int
ppp_chan_send
(
struct
ppp_t
*
ppp
,
void
*
data
,
int
size
);
int
ppp_unit_send
(
struct
ppp_t
*
ppp
,
void
*
data
,
int
size
);
void
lcp_send_proto_rej
(
struct
ppp_t
*
ppp
,
uint16_t
proto
);
void
ppp_recv_proto_rej
(
struct
ppp_t
*
ppp
,
uint16_t
proto
);
struct
ppp_fsm_t
*
ppp_lcp_init
(
struct
ppp_t
*
ppp
);
void
ppp_layer_started
(
struct
ppp_t
*
ppp
,
struct
ppp_layer_data_t
*
);
...
...
accel-pptpd/ppp/ppp_ccp.c
浏览文件 @
04c623f7
...
...
@@ -37,6 +37,7 @@ static void send_conf_rej(struct ppp_fsm_t*);
static
void
send_term_req
(
struct
ppp_fsm_t
*
fsm
);
static
void
send_term_ack
(
struct
ppp_fsm_t
*
fsm
);
static
void
ccp_recv
(
struct
ppp_handler_t
*
);
static
void
ccp_recv_proto_rej
(
struct
ppp_handler_t
*
);
static
void
ccp_options_init
(
struct
ppp_ccp_t
*
ccp
)
{
...
...
@@ -98,6 +99,7 @@ static struct ppp_layer_data_t *ccp_layer_init(struct ppp_t *ppp)
ccp
->
hnd
.
proto
=
PPP_CCP
;
ccp
->
hnd
.
recv
=
ccp_recv
;
ccp
->
hnd
.
recv_proto_rej
=
ccp_recv_proto_rej
;
ppp_register_unit_handler
(
ppp
,
&
ccp
->
hnd
);
...
...
@@ -223,8 +225,10 @@ static int send_conf_req(struct ppp_fsm_t *fsm)
ccp
->
need_req
=
0
;
if
(
ccp
->
passive
)
if
(
ccp
->
passive
)
{
ccp
->
passive
--
;
return
0
;
}
buf
=
_malloc
(
ccp
->
conf_req_len
);
ccp_hdr
=
(
struct
ccp_hdr_t
*
)
buf
;
...
...
@@ -508,8 +512,9 @@ static int ccp_recv_conf_nak(struct ppp_ccp_t *ccp, uint8_t *data, int size)
log_ppp_info
(
" "
);
lopt
->
h
->
print
(
log_ppp_info
,
lopt
,
data
);
}
if
(
lopt
->
h
->
recv_conf_nak
(
ccp
,
lopt
,
data
))
if
(
lopt
->
h
->
recv_conf_nak
&&
lopt
->
h
->
recv_conf_nak
(
ccp
,
lopt
,
data
))
res
=
-
1
;
lopt
->
state
=
CCP_OPT_NAK
;
break
;
}
}
...
...
@@ -688,6 +693,17 @@ static void ccp_recv(struct ppp_handler_t*h)
}
}
static
void
ccp_recv_proto_rej
(
struct
ppp_handler_t
*
h
)
{
struct
ppp_ccp_t
*
ccp
=
container_of
(
h
,
typeof
(
*
ccp
),
hnd
);
if
(
ccp
->
fsm
.
fsm_state
==
FSM_Initial
||
ccp
->
fsm
.
fsm_state
==
FSM_Closed
)
return
;
ppp_fsm_lower_down
(
&
ccp
->
fsm
);
ppp_fsm_close
(
&
ccp
->
fsm
);
}
int
ccp_option_register
(
struct
ccp_option_handler_t
*
h
)
{
/*struct ccp_option_drv_t *p;
...
...
accel-pptpd/ppp/ppp_ccp.h
浏览文件 @
04c623f7
...
...
@@ -84,8 +84,8 @@ struct ppp_ccp_t
int
ropt_len
;
int
conf_req_len
;
int
passive
;
int
started
:
1
;
int
passive
:
1
;
int
need_req
:
1
;
};
...
...
accel-pptpd/ppp/ppp_fsm.c
浏览文件 @
04c623f7
...
...
@@ -127,11 +127,13 @@ void ppp_fsm_close(struct ppp_fsm_t *layer)
switch
(
layer
->
fsm_state
)
{
case
FSM_Starting
:
if
(
layer
->
layer_finished
)
layer
->
layer_finished
(
layer
);
stop_timer
(
layer
);
layer
->
fsm_state
=
FSM_Initial
;
if
(
layer
->
layer_finished
)
layer
->
layer_finished
(
layer
);
break
;
case
FSM_Stopped
:
layer
->
fsm_state
=
FSM_Closed
;
stop_timer
(
layer
);
break
;
case
FSM_Stopping
:
layer
->
fsm_state
=
FSM_Closing
;
...
...
accel-pptpd/ppp/ppp_ipcp.c
浏览文件 @
04c623f7
...
...
@@ -613,8 +613,8 @@ static void ipcp_recv(struct ppp_handler_t*h)
case
TERMACK
:
if
(
conf_ppp_verbose
)
log_ppp_info
(
"recv [IPCP TermAck id=%x]
\n
"
,
hdr
->
id
);
ppp_fsm_recv_term_ack
(
&
ipcp
->
fsm
);
ppp_terminate
(
ipcp
->
ppp
,
0
);
//
ppp_fsm_recv_term_ack(&ipcp->fsm);
//
ppp_terminate(ipcp->ppp, 0);
break
;
case
CODEREJ
:
if
(
conf_ppp_verbose
)
...
...
accel-pptpd/ppp/ppp_lcp.c
浏览文件 @
04c623f7
...
...
@@ -674,7 +674,7 @@ void lcp_send_proto_rej(struct ppp_t *ppp, uint16_t proto)
.
hdr
.
code
=
PROTOREJ
,
.
hdr
.
id
=
++
lcp
->
fsm
.
id
,
.
hdr
.
len
=
htons
(
6
),
.
proto
=
proto
,
.
proto
=
ntohs
(
proto
)
,
};
if
(
conf_ppp_verbose
)
...
...
@@ -775,7 +775,8 @@ static void lcp_recv(struct ppp_handler_t*h)
break
;
case
PROTOREJ
:
if
(
conf_ppp_verbose
)
log_ppp_info
(
"recv [LCP ProtoRej id=%x <%x>]
\n
"
,
hdr
->
code
,
hdr
->
id
,
*
(
uint16_t
*
)(
hdr
+
1
));
log_ppp_info
(
"recv [LCP ProtoRej id=%x <%04x>]
\n
"
,
hdr
->
code
,
hdr
->
id
,
ntohs
(
*
(
uint16_t
*
)(
hdr
+
1
)));
ppp_recv_proto_rej
(
lcp
->
ppp
,
ntohs
(
*
(
uint16_t
*
)(
hdr
+
1
)));
break
;
case
IDENT
:
if
(
conf_ppp_verbose
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录