Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
504e7b99
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 搜索 >>
提交
504e7b99
编写于
11月 30, 2015
作者:
D
Dmitry Kozlov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cli: show sesisons: introduced rx-bytes-raw,tx-bytes-raw fields
上级
adcaecd1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
24 addition
and
4 deletion
+24
-4
accel-pppd/cli/show_sessions.c
accel-pppd/cli/show_sessions.c
+24
-4
未找到文件。
accel-pppd/cli/show_sessions.c
浏览文件 @
504e7b99
...
...
@@ -476,7 +476,7 @@ static void format_bytes(char *buf, unsigned long long bytes)
double
d
;
if
(
bytes
<
1024
)
{
sprintf
(
buf
,
"%u
(%u B)"
,
(
unsigned
)
bytes
,
(
unsigned
)
bytes
);
sprintf
(
buf
,
"%u
B"
,
(
unsigned
)
bytes
);
return
;
}
...
...
@@ -492,7 +492,7 @@ static void format_bytes(char *buf, unsigned long long bytes)
}
d
=
(
double
)
bytes
/
m
;
sprintf
(
buf
,
"%
llu (%.1f %s)"
,
bytes
,
d
,
suffix
);
sprintf
(
buf
,
"%
.1f %s"
,
d
,
suffix
);
}
static
void
print_rx_bytes
(
struct
ap_session
*
ses
,
char
*
buf
)
...
...
@@ -513,6 +513,24 @@ static void print_tx_bytes(struct ap_session *ses, char *buf)
format_bytes
(
buf
,
4294967296ll
*
ses
->
acct_output_gigawords
+
stats
.
tx_bytes
);
}
static
void
print_rx_bytes_raw
(
struct
ap_session
*
ses
,
char
*
buf
)
{
if
(
!
stats_set
)
{
ap_session_read_stats
(
ses
,
&
stats
);
stats_set
=
1
;
}
sprintf
(
buf
,
"%llu"
,
4294967296ll
*
ses
->
acct_input_gigawords
+
stats
.
rx_bytes
);
}
static
void
print_tx_bytes_raw
(
struct
ap_session
*
ses
,
char
*
buf
)
{
if
(
!
stats_set
)
{
ap_session_read_stats
(
ses
,
&
stats
);
stats_set
=
1
;
}
sprintf
(
buf
,
"%llu"
,
4294967296ll
*
ses
->
acct_output_gigawords
+
stats
.
tx_bytes
);
}
static
void
print_rx_pkts
(
struct
ap_session
*
ses
,
char
*
buf
)
{
if
(
!
stats_set
)
{
...
...
@@ -568,8 +586,10 @@ static void init(void)
cli_show_ses_register
(
"called-sid"
,
"called station id"
,
print_called_sid
);
cli_show_ses_register
(
"sid"
,
"session id"
,
print_sid
);
cli_show_ses_register
(
"comp"
,
"compression/ecnryption method"
,
print_comp
);
cli_show_ses_register
(
"rx-bytes"
,
"received bytes"
,
print_rx_bytes
);
cli_show_ses_register
(
"tx-bytes"
,
"transmitted bytes"
,
print_tx_bytes
);
cli_show_ses_register
(
"rx-bytes"
,
"received bytes (human readable)"
,
print_rx_bytes
);
cli_show_ses_register
(
"tx-bytes"
,
"transmitted bytes (human readable)"
,
print_tx_bytes
);
cli_show_ses_register
(
"rx-bytes-raw"
,
"received bytes"
,
print_rx_bytes_raw
);
cli_show_ses_register
(
"tx-bytes-raw"
,
"transmitted bytes"
,
print_tx_bytes_raw
);
cli_show_ses_register
(
"rx-pkts"
,
"received packets"
,
print_rx_pkts
);
cli_show_ses_register
(
"tx-pkts"
,
"transmitted packets"
,
print_tx_pkts
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录