Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
101ae68a
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 搜索 >>
提交
101ae68a
编写于
4月 05, 2016
作者:
D
Dmitry Kozlov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improved logging: if session's interface is empty log ctrl's interface
上级
a730a45b
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
14 addition
and
9 deletion
+14
-9
accel-pppd/ctrl/ipoe/ipoe.c
accel-pppd/ctrl/ipoe/ipoe.c
+5
-4
accel-pppd/ctrl/ipoe/ipoe.h
accel-pppd/ctrl/ipoe/ipoe.h
+1
-1
accel-pppd/ctrl/l2tp/l2tp.c
accel-pppd/ctrl/l2tp/l2tp.c
+1
-0
accel-pppd/ctrl/pppoe/pppoe.c
accel-pppd/ctrl/pppoe/pppoe.c
+1
-0
accel-pppd/ctrl/pptp/pptp.c
accel-pppd/ctrl/pptp/pptp.c
+1
-0
accel-pppd/include/ap_session.h
accel-pppd/include/ap_session.h
+1
-0
accel-pppd/log.c
accel-pppd/log.c
+1
-1
accel-pppd/logs/log_file.c
accel-pppd/logs/log_file.c
+1
-1
accel-pppd/logs/log_syslog.c
accel-pppd/logs/log_syslog.c
+1
-1
accel-pppd/logs/log_tcp.c
accel-pppd/logs/log_tcp.c
+1
-1
未找到文件。
accel-pppd/ctrl/ipoe/ipoe.c
浏览文件 @
101ae68a
...
...
@@ -1169,7 +1169,7 @@ static struct ipoe_session *ipoe_session_create_dhcpv4(struct ipoe_serv *serv, s
int
dlen
=
0
;
uint8_t
*
ptr
=
NULL
;
ses
=
ipoe_session_alloc
();
ses
=
ipoe_session_alloc
(
serv
->
ifname
);
if
(
!
ses
)
return
NULL
;
...
...
@@ -1780,7 +1780,7 @@ static struct ipoe_session *ipoe_session_create_up(struct ipoe_serv *serv, struc
if
(
l4_redirect_list_check
(
saddr
))
return
NULL
;
ses
=
ipoe_session_alloc
();
ses
=
ipoe_session_alloc
(
serv
->
ifname
);
if
(
!
ses
)
return
NULL
;
...
...
@@ -1843,7 +1843,7 @@ static void ipoe_session_create_auto(struct ipoe_serv *serv)
if
(
ap_shutdown
)
return
;
ses
=
ipoe_session_alloc
();
ses
=
ipoe_session_alloc
(
serv
->
ifname
);
if
(
!
ses
)
return
;
...
...
@@ -1870,7 +1870,7 @@ static void ipoe_session_create_auto(struct ipoe_serv *serv)
triton_context_wakeup
(
&
ses
->
ctx
);
}
struct
ipoe_session
*
ipoe_session_alloc
(
void
)
struct
ipoe_session
*
ipoe_session_alloc
(
const
char
*
ifname
)
{
struct
ipoe_session
*
ses
;
...
...
@@ -1894,6 +1894,7 @@ struct ipoe_session *ipoe_session_alloc(void)
ses
->
ctrl
.
terminate
=
ipoe_session_terminate
;
ses
->
ctrl
.
type
=
CTRL_TYPE_IPOE
;
ses
->
ctrl
.
name
=
"ipoe"
;
ses
->
ctrl
.
ifname
=
ifname
;
ses
->
l4_redirect_table
=
conf_l4_redirect_table
;
ses
->
ses
.
ctrl
=
&
ses
->
ctrl
;
...
...
accel-pppd/ctrl/ipoe/ipoe.h
浏览文件 @
101ae68a
...
...
@@ -130,7 +130,7 @@ struct ethhdr;
void
ipoe_recv_up
(
int
ifindex
,
struct
ethhdr
*
eth
,
struct
iphdr
*
iph
,
struct
_arphdr
*
arph
);
struct
ipoe_session
*
ipoe_session_alloc
(
void
);
struct
ipoe_session
*
ipoe_session_alloc
(
const
char
*
ifname
);
struct
ipoe_serv
*
ipoe_find_serv
(
const
char
*
ifname
);
...
...
accel-pppd/ctrl/l2tp/l2tp.c
浏览文件 @
101ae68a
...
...
@@ -1754,6 +1754,7 @@ static int l2tp_session_start_data_channel(struct l2tp_sess_t *sess)
sess
->
ctrl
.
type
=
CTRL_TYPE_L2TP
;
sess
->
ctrl
.
ppp
=
1
;
sess
->
ctrl
.
name
=
"l2tp"
;
sess
->
ctrl
.
ifname
=
""
;
sess
->
ctrl
.
started
=
apses_started
;
sess
->
ctrl
.
finished
=
apses_finished
;
sess
->
ctrl
.
terminate
=
ppp_terminate
;
...
...
accel-pppd/ctrl/pppoe/pppoe.c
浏览文件 @
101ae68a
...
...
@@ -344,6 +344,7 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui
conn
->
ctrl
.
type
=
CTRL_TYPE_PPPOE
;
conn
->
ctrl
.
ppp
=
1
;
conn
->
ctrl
.
name
=
"pppoe"
;
conn
->
ctrl
.
ifname
=
serv
->
ifname
;
conn
->
ctrl
.
mppe
=
conf_mppe
;
if
(
ppp_max_payload
>
ETH_DATA_LEN
-
8
)
...
...
accel-pppd/ctrl/pptp/pptp.c
浏览文件 @
101ae68a
...
...
@@ -683,6 +683,7 @@ static int pptp_connect(struct triton_md_handler_t *h)
conn
->
ctrl
.
type
=
CTRL_TYPE_PPTP
;
conn
->
ctrl
.
ppp
=
1
;
conn
->
ctrl
.
name
=
"pptp"
;
conn
->
ctrl
.
ifname
=
""
;
conn
->
ctrl
.
mppe
=
conf_mppe
;
conn
->
ctrl
.
calling_station_id
=
_malloc
(
17
);
...
...
accel-pppd/include/ap_session.h
浏览文件 @
101ae68a
...
...
@@ -43,6 +43,7 @@ struct ap_ctrl {
struct
triton_context_t
*
ctx
;
int
type
;
const
char
*
name
;
const
char
*
ifname
;
int
max_mtu
;
int
mppe
;
char
*
calling_station_id
;
...
...
accel-pppd/log.c
浏览文件 @
101ae68a
...
...
@@ -357,7 +357,7 @@ static void write_msg(FILE *f, struct _log_msg_t *msg, struct ap_session *ses)
fprintf
(
f
,
"[%04i-%02i-%02i %02i:%02i:%02i.%03i] "
,
tm
.
tm_year
+
1900
,
tm
.
tm_mon
+
1
,
tm
.
tm_mday
,
tm
.
tm_hour
,
tm
.
tm_min
,
tm
.
tm_sec
,
(
int
)
tv
.
tv_usec
/
1000
);
if
(
ses
)
fprintf
(
f
,
"%s: %s: "
,
ses
->
ifname
,
ses
->
sessionid
);
fprintf
(
f
,
"%s: %s: "
,
ses
->
ifname
[
0
]
?
ses
->
ifname
:
ses
->
ctrl
->
ifname
,
ses
->
sessionid
);
list_for_each_entry
(
chunk
,
&
msg
->
chunks
,
entry
)
fwrite
(
chunk
->
msg
,
chunk
->
len
,
1
,
f
);
...
...
accel-pppd/logs/log_file.c
浏览文件 @
101ae68a
...
...
@@ -245,7 +245,7 @@ static void set_hdr(struct log_msg_t *msg, struct ap_session *ses)
strftime
(
timestamp
,
sizeof
(
timestamp
),
"%Y-%m-%d %H:%M:%S"
,
&
tm
);
sprintf
(
msg
->
hdr
->
msg
,
"%s[%s]: %s: %s%s%s"
,
conf_color
?
level_color
[
msg
->
level
]
:
""
,
timestamp
,
level_name
[
msg
->
level
],
ses
?
ses
->
ifname
:
""
,
ses
?
(
ses
->
ifname
[
0
]
?
ses
->
ifname
:
ses
->
ctrl
->
ifname
)
:
""
,
ses
?
": "
:
""
,
conf_color
?
NORMAL_COLOR
:
""
);
msg
->
hdr
->
len
=
strlen
(
msg
->
hdr
->
msg
);
...
...
accel-pppd/logs/log_syslog.c
浏览文件 @
101ae68a
...
...
@@ -53,7 +53,7 @@ static void unpack_msg(struct log_msg_t *msg)
static
void
set_hdr
(
struct
log_msg_t
*
msg
,
struct
ap_session
*
ses
)
{
if
(
ses
)
{
if
(
snprintf
(
msg
->
hdr
->
msg
,
LOG_CHUNK_SIZE
,
"%s:%s: "
,
ses
->
ifname
,
ses
->
username
?
ses
->
username
:
""
))
if
(
snprintf
(
msg
->
hdr
->
msg
,
LOG_CHUNK_SIZE
,
"%s:%s: "
,
ses
->
ifname
[
0
]
?
ses
->
ifname
:
ses
->
ctrl
->
ifname
,
ses
->
username
?
ses
->
username
:
""
))
strcpy
(
msg
->
hdr
->
msg
+
LOG_CHUNK_SIZE
-
3
,
": "
);
}
else
msg
->
hdr
->
msg
[
0
]
=
0
;
...
...
accel-pppd/logs/log_tcp.c
浏览文件 @
101ae68a
...
...
@@ -137,7 +137,7 @@ static void set_hdr(struct log_msg_t *msg, struct ap_session *ses)
localtime_r
(
&
msg
->
timestamp
.
tv_sec
,
&
tm
);
strftime
(
timestamp
,
sizeof
(
timestamp
),
"%Y-%m-%d %H:%M:%S"
,
&
tm
);
sprintf
(
msg
->
hdr
->
msg
,
"[%s]: %s: %s: "
,
timestamp
,
level_name
[
msg
->
level
],
ses
?
ses
->
ifname
:
""
);
sprintf
(
msg
->
hdr
->
msg
,
"[%s]: %s: %s: "
,
timestamp
,
level_name
[
msg
->
level
],
ses
?
(
ses
->
ifname
[
0
]
?
ses
->
ifname
:
ses
->
ctrl
->
ifname
)
:
""
);
msg
->
hdr
->
len
=
strlen
(
msg
->
hdr
->
msg
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录