Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Achou.Wang
accel-ppp
提交
4bbecf70
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 搜索 >>
提交
4bbecf70
编写于
10月 16, 2017
作者:
D
Dmitry Kozlov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
move build_ip6_addr function to ipdb.c
上级
ec3d2f29
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
10 deletion
+13
-10
accel-pppd/cli/show_sessions.c
accel-pppd/cli/show_sessions.c
+0
-10
accel-pppd/ipdb.c
accel-pppd/ipdb.c
+11
-0
accel-pppd/ipdb.h
accel-pppd/ipdb.h
+2
-0
未找到文件。
accel-pppd/cli/show_sessions.c
浏览文件 @
4bbecf70
...
...
@@ -408,16 +408,6 @@ static void print_ip6_dp(struct ap_session *ses, char *buf)
sprintf
(
ptr
,
"/%i"
,
a
->
prefix_len
);
}
static
void
build_ip6_addr
(
struct
ipv6db_addr_t
*
a
,
uint64_t
intf_id
,
struct
in6_addr
*
addr
)
{
memcpy
(
addr
,
&
a
->
addr
,
sizeof
(
*
addr
));
if
(
a
->
prefix_len
<=
64
)
*
(
uint64_t
*
)(
addr
->
s6_addr
+
8
)
=
intf_id
;
else
*
(
uint64_t
*
)(
addr
->
s6_addr
+
8
)
|=
intf_id
&
((
1
<<
(
128
-
a
->
prefix_len
))
-
1
);
}
static
void
print_ip6
(
struct
ap_session
*
ses
,
char
*
buf
)
{
struct
ipv6db_addr_t
*
a
;
...
...
accel-pppd/ipdb.c
浏览文件 @
4bbecf70
#include <string.h>
#include "triton.h"
#include "ipdb.h"
...
...
@@ -71,6 +73,15 @@ void __export ipdb_put_ipv6_prefix(struct ap_session *ses, struct ipv6db_prefix_
it
->
owner
->
put_ipv6_prefix
(
ses
,
it
);
}
void
__export
build_ip6_addr
(
struct
ipv6db_addr_t
*
a
,
uint64_t
intf_id
,
struct
in6_addr
*
addr
)
{
memcpy
(
addr
,
&
a
->
addr
,
sizeof
(
*
addr
));
if
(
a
->
prefix_len
<=
64
)
*
(
uint64_t
*
)(
addr
->
s6_addr
+
8
)
=
intf_id
;
else
*
(
uint64_t
*
)(
addr
->
s6_addr
+
8
)
|=
intf_id
&
((
1
<<
(
128
-
a
->
prefix_len
))
-
1
);
}
void
__export
ipdb_register
(
struct
ipdb_t
*
ipdb
)
{
...
...
accel-pppd/ipdb.h
浏览文件 @
4bbecf70
...
...
@@ -61,5 +61,7 @@ void ipdb_put_ipv6_prefix(struct ap_session *ses, struct ipv6db_prefix_t *it);
void
ipdb_register
(
struct
ipdb_t
*
);
void
build_ip6_addr
(
struct
ipv6db_addr_t
*
a
,
uint64_t
intf_id
,
struct
in6_addr
*
addr
);
#endif
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录