Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
39938324
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
39938324
编写于
8月 25, 2009
作者:
P
Patrick McHardy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netfilter: nfnetlink: constify message attributes and headers
Signed-off-by:
N
Patrick McHardy
<
kaber@trash.net
>
上级
3a6c2b41
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
55 addition
and
35 deletion
+55
-35
include/linux/netfilter/nfnetlink.h
include/linux/netfilter/nfnetlink.h
+2
-1
include/net/netfilter/nf_nat_core.h
include/net/netfilter/nf_nat_core.h
+1
-1
net/ipv4/netfilter/nf_nat_core.c
net/ipv4/netfilter/nf_nat_core.c
+3
-3
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_core.c
+1
-1
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_netlink.c
+33
-21
net/netfilter/nfnetlink.c
net/netfilter/nfnetlink.c
+1
-1
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_log.c
+4
-2
net/netfilter/nfnetlink_queue.c
net/netfilter/nfnetlink_queue.c
+6
-3
net/netfilter/xt_osf.c
net/netfilter/xt_osf.c
+4
-2
未找到文件。
include/linux/netfilter/nfnetlink.h
浏览文件 @
39938324
...
...
@@ -58,7 +58,8 @@ struct nfgenmsg {
struct
nfnl_callback
{
int
(
*
call
)(
struct
sock
*
nl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[]);
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[]);
const
struct
nla_policy
*
policy
;
/* netlink attribute policy */
const
u_int16_t
attr_count
;
/* number of nlattr's */
};
...
...
include/net/netfilter/nf_nat_core.h
浏览文件 @
39938324
...
...
@@ -31,6 +31,6 @@ struct nlattr;
extern
int
(
*
nfnetlink_parse_nat_setup_hook
)(
struct
nf_conn
*
ct
,
enum
nf_nat_manip_type
manip
,
struct
nlattr
*
attr
);
const
struct
nlattr
*
attr
);
#endif
/* _NF_NAT_CORE_H */
net/ipv4/netfilter/nf_nat_core.c
浏览文件 @
39938324
...
...
@@ -620,7 +620,7 @@ static const struct nla_policy nat_nla_policy[CTA_NAT_MAX+1] = {
};
static
int
nfnetlink_parse_nat
(
struct
nlattr
*
nat
,
nfnetlink_parse_nat
(
const
struct
nlattr
*
nat
,
const
struct
nf_conn
*
ct
,
struct
nf_nat_range
*
range
)
{
struct
nlattr
*
tb
[
CTA_NAT_MAX
+
1
];
...
...
@@ -656,7 +656,7 @@ nfnetlink_parse_nat(struct nlattr *nat,
static
int
nfnetlink_parse_nat_setup
(
struct
nf_conn
*
ct
,
enum
nf_nat_manip_type
manip
,
struct
nlattr
*
attr
)
const
struct
nlattr
*
attr
)
{
struct
nf_nat_range
range
;
...
...
@@ -671,7 +671,7 @@ nfnetlink_parse_nat_setup(struct nf_conn *ct,
static
int
nfnetlink_parse_nat_setup
(
struct
nf_conn
*
ct
,
enum
nf_nat_manip_type
manip
,
struct
nlattr
*
attr
)
const
struct
nlattr
*
attr
)
{
return
-
EOPNOTSUPP
;
}
...
...
net/netfilter/nf_conntrack_core.c
浏览文件 @
39938324
...
...
@@ -47,7 +47,7 @@
int
(
*
nfnetlink_parse_nat_setup_hook
)(
struct
nf_conn
*
ct
,
enum
nf_nat_manip_type
manip
,
struct
nlattr
*
attr
)
__read_mostly
;
const
struct
nlattr
*
attr
)
__read_mostly
;
EXPORT_SYMBOL_GPL
(
nfnetlink_parse_nat_setup_hook
);
DEFINE_SPINLOCK
(
nf_conntrack_lock
);
...
...
net/netfilter/nf_conntrack_netlink.c
浏览文件 @
39938324
...
...
@@ -704,7 +704,8 @@ ctnetlink_parse_tuple_proto(struct nlattr *attr,
}
static
int
ctnetlink_parse_tuple
(
struct
nlattr
*
cda
[],
struct
nf_conntrack_tuple
*
tuple
,
ctnetlink_parse_tuple
(
const
struct
nlattr
*
const
cda
[],
struct
nf_conntrack_tuple
*
tuple
,
enum
ctattr_tuple
type
,
u_int8_t
l3num
)
{
struct
nlattr
*
tb
[
CTA_TUPLE_MAX
+
1
];
...
...
@@ -740,7 +741,7 @@ ctnetlink_parse_tuple(struct nlattr *cda[], struct nf_conntrack_tuple *tuple,
}
static
inline
int
ctnetlink_parse_help
(
struct
nlattr
*
attr
,
char
**
helper_name
)
ctnetlink_parse_help
(
const
struct
nlattr
*
attr
,
char
**
helper_name
)
{
struct
nlattr
*
tb
[
CTA_HELP_MAX
+
1
];
...
...
@@ -764,7 +765,8 @@ static const struct nla_policy ct_nla_policy[CTA_MAX+1] = {
static
int
ctnetlink_del_conntrack
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_tuple_hash
*
h
;
struct
nf_conntrack_tuple
tuple
;
...
...
@@ -823,7 +825,8 @@ ctnetlink_del_conntrack(struct sock *ctnl, struct sk_buff *skb,
static
int
ctnetlink_get_conntrack
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_tuple_hash
*
h
;
struct
nf_conntrack_tuple
tuple
;
...
...
@@ -884,7 +887,7 @@ ctnetlink_get_conntrack(struct sock *ctnl, struct sk_buff *skb,
static
int
ctnetlink_parse_nat_setup
(
struct
nf_conn
*
ct
,
enum
nf_nat_manip_type
manip
,
struct
nlattr
*
attr
)
const
struct
nlattr
*
attr
)
{
typeof
(
nfnetlink_parse_nat_setup_hook
)
parse_nat_setup
;
...
...
@@ -914,7 +917,7 @@ ctnetlink_parse_nat_setup(struct nf_conn *ct,
#endif
static
int
ctnetlink_change_status
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_status
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
unsigned
long
d
;
unsigned
int
status
=
ntohl
(
nla_get_be32
(
cda
[
CTA_STATUS
]));
...
...
@@ -940,7 +943,7 @@ ctnetlink_change_status(struct nf_conn *ct, struct nlattr *cda[])
}
static
int
ctnetlink_change_nat
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_nat
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
#ifdef CONFIG_NF_NAT_NEEDED
int
ret
;
...
...
@@ -966,7 +969,7 @@ ctnetlink_change_nat(struct nf_conn *ct, struct nlattr *cda[])
}
static
inline
int
ctnetlink_change_helper
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_helper
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_helper
*
helper
;
struct
nf_conn_help
*
help
=
nfct_help
(
ct
);
...
...
@@ -1028,7 +1031,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[])
}
static
inline
int
ctnetlink_change_timeout
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_timeout
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
u_int32_t
timeout
=
ntohl
(
nla_get_be32
(
cda
[
CTA_TIMEOUT
]));
...
...
@@ -1042,9 +1045,10 @@ ctnetlink_change_timeout(struct nf_conn *ct, struct nlattr *cda[])
}
static
inline
int
ctnetlink_change_protoinfo
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_protoinfo
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
struct
nlattr
*
tb
[
CTA_PROTOINFO_MAX
+
1
],
*
attr
=
cda
[
CTA_PROTOINFO
];
const
struct
nlattr
*
attr
=
cda
[
CTA_PROTOINFO
];
struct
nlattr
*
tb
[
CTA_PROTOINFO_MAX
+
1
];
struct
nf_conntrack_l4proto
*
l4proto
;
int
err
=
0
;
...
...
@@ -1061,7 +1065,7 @@ ctnetlink_change_protoinfo(struct nf_conn *ct, struct nlattr *cda[])
#ifdef CONFIG_NF_NAT_NEEDED
static
inline
int
change_nat_seq_adj
(
struct
nf_nat_seq
*
natseq
,
struct
nlattr
*
attr
)
change_nat_seq_adj
(
struct
nf_nat_seq
*
natseq
,
const
struct
nlattr
*
const
attr
)
{
struct
nlattr
*
cda
[
CTA_NAT_SEQ_MAX
+
1
];
...
...
@@ -1089,7 +1093,8 @@ change_nat_seq_adj(struct nf_nat_seq *natseq, struct nlattr *attr)
}
static
int
ctnetlink_change_nat_seq_adj
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_nat_seq_adj
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
int
ret
=
0
;
struct
nf_conn_nat
*
nat
=
nfct_nat
(
ct
);
...
...
@@ -1120,7 +1125,8 @@ ctnetlink_change_nat_seq_adj(struct nf_conn *ct, struct nlattr *cda[])
#endif
static
int
ctnetlink_change_conntrack
(
struct
nf_conn
*
ct
,
struct
nlattr
*
cda
[])
ctnetlink_change_conntrack
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
int
err
;
...
...
@@ -1169,7 +1175,7 @@ ctnetlink_change_conntrack(struct nf_conn *ct, struct nlattr *cda[])
}
static
struct
nf_conn
*
ctnetlink_create_conntrack
(
struct
nlattr
*
cda
[],
ctnetlink_create_conntrack
(
const
struct
nlattr
*
const
cda
[],
struct
nf_conntrack_tuple
*
otuple
,
struct
nf_conntrack_tuple
*
rtuple
,
u8
u3
)
...
...
@@ -1304,7 +1310,8 @@ ctnetlink_create_conntrack(struct nlattr *cda[],
static
int
ctnetlink_new_conntrack
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_tuple
otuple
,
rtuple
;
struct
nf_conntrack_tuple_hash
*
h
=
NULL
;
...
...
@@ -1629,7 +1636,8 @@ static const struct nla_policy exp_nla_policy[CTA_EXPECT_MAX+1] = {
static
int
ctnetlink_get_expect
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_tuple
tuple
;
struct
nf_conntrack_expect
*
exp
;
...
...
@@ -1689,7 +1697,8 @@ ctnetlink_get_expect(struct sock *ctnl, struct sk_buff *skb,
static
int
ctnetlink_del_expect
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_expect
*
exp
;
struct
nf_conntrack_tuple
tuple
;
...
...
@@ -1767,13 +1776,15 @@ ctnetlink_del_expect(struct sock *ctnl, struct sk_buff *skb,
return
0
;
}
static
int
ctnetlink_change_expect
(
struct
nf_conntrack_expect
*
x
,
struct
nlattr
*
cda
[])
ctnetlink_change_expect
(
struct
nf_conntrack_expect
*
x
,
const
struct
nlattr
*
const
cda
[])
{
return
-
EOPNOTSUPP
;
}
static
int
ctnetlink_create_expect
(
struct
nlattr
*
cda
[],
u_int8_t
u3
,
u32
pid
,
int
report
)
ctnetlink_create_expect
(
const
struct
nlattr
*
const
cda
[],
u_int8_t
u3
,
u32
pid
,
int
report
)
{
struct
nf_conntrack_tuple
tuple
,
mask
,
master_tuple
;
struct
nf_conntrack_tuple_hash
*
h
=
NULL
;
...
...
@@ -1831,7 +1842,8 @@ ctnetlink_create_expect(struct nlattr *cda[], u_int8_t u3, u32 pid, int report)
static
int
ctnetlink_new_expect
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
cda
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
cda
[])
{
struct
nf_conntrack_tuple
tuple
;
struct
nf_conntrack_expect
*
exp
;
...
...
net/netfilter/nfnetlink.c
浏览文件 @
39938324
...
...
@@ -170,7 +170,7 @@ static int nfnetlink_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
if
(
err
<
0
)
return
err
;
err
=
nc
->
call
(
nfnl
,
skb
,
nlh
,
cda
);
err
=
nc
->
call
(
nfnl
,
skb
,
nlh
,
(
const
struct
nlattr
**
)
cda
);
if
(
err
==
-
EAGAIN
)
goto
replay
;
return
err
;
...
...
net/netfilter/nfnetlink_log.c
浏览文件 @
39938324
...
...
@@ -694,7 +694,8 @@ static struct notifier_block nfulnl_rtnl_notifier = {
static
int
nfulnl_recv_unsupp
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
nfqa
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
nfqa
[])
{
return
-
ENOTSUPP
;
}
...
...
@@ -716,7 +717,8 @@ static const struct nla_policy nfula_cfg_policy[NFULA_CFG_MAX+1] = {
static
int
nfulnl_recv_config
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
nfula
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
nfula
[])
{
struct
nfgenmsg
*
nfmsg
=
NLMSG_DATA
(
nlh
);
u_int16_t
group_num
=
ntohs
(
nfmsg
->
res_id
);
...
...
net/netfilter/nfnetlink_queue.c
浏览文件 @
39938324
...
...
@@ -608,7 +608,8 @@ static const struct nla_policy nfqa_verdict_policy[NFQA_MAX+1] = {
static
int
nfqnl_recv_verdict
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
nfqa
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
nfqa
[])
{
struct
nfgenmsg
*
nfmsg
=
NLMSG_DATA
(
nlh
);
u_int16_t
queue_num
=
ntohs
(
nfmsg
->
res_id
);
...
...
@@ -670,7 +671,8 @@ nfqnl_recv_verdict(struct sock *ctnl, struct sk_buff *skb,
static
int
nfqnl_recv_unsupp
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
nfqa
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
nfqa
[])
{
return
-
ENOTSUPP
;
}
...
...
@@ -687,7 +689,8 @@ static const struct nf_queue_handler nfqh = {
static
int
nfqnl_recv_config
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
nfqa
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
nfqa
[])
{
struct
nfgenmsg
*
nfmsg
=
NLMSG_DATA
(
nlh
);
u_int16_t
queue_num
=
ntohs
(
nfmsg
->
res_id
);
...
...
net/netfilter/xt_osf.c
浏览文件 @
39938324
...
...
@@ -70,7 +70,8 @@ static void xt_osf_finger_free_rcu(struct rcu_head *rcu_head)
}
static
int
xt_osf_add_callback
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
osf_attrs
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
osf_attrs
[])
{
struct
xt_osf_user_finger
*
f
;
struct
xt_osf_finger
*
kf
=
NULL
,
*
sf
;
...
...
@@ -112,7 +113,8 @@ static int xt_osf_add_callback(struct sock *ctnl, struct sk_buff *skb,
}
static
int
xt_osf_remove_callback
(
struct
sock
*
ctnl
,
struct
sk_buff
*
skb
,
struct
nlmsghdr
*
nlh
,
struct
nlattr
*
osf_attrs
[])
const
struct
nlmsghdr
*
nlh
,
const
struct
nlattr
*
const
osf_attrs
[])
{
struct
xt_osf_user_finger
*
f
;
struct
xt_osf_finger
*
sf
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录