Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f925f705
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f925f705
编写于
9月 06, 2013
作者:
J
Jozsef Kadlecsik
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netfilter: ipset: Rename extension offset ids to extension ids
Signed-off-by:
N
Jozsef Kadlecsik
<
kadlec@blackhole.kfki.hu
>
上级
a04d8b6b
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
43 addition
and
43 deletion
+43
-43
include/linux/netfilter/ipset/ip_set.h
include/linux/netfilter/ipset/ip_set.h
+8
-8
net/netfilter/ipset/ip_set_bitmap_gen.h
net/netfilter/ipset/ip_set_bitmap_gen.h
+2
-2
net/netfilter/ipset/ip_set_bitmap_ip.c
net/netfilter/ipset/ip_set_bitmap_ip.c
+5
-5
net/netfilter/ipset/ip_set_bitmap_ipmac.c
net/netfilter/ipset/ip_set_bitmap_ipmac.c
+5
-5
net/netfilter/ipset/ip_set_bitmap_port.c
net/netfilter/ipset/ip_set_bitmap_port.c
+5
-5
net/netfilter/ipset/ip_set_hash_gen.h
net/netfilter/ipset/ip_set_hash_gen.h
+11
-11
net/netfilter/ipset/ip_set_list_set.c
net/netfilter/ipset/ip_set_list_set.c
+7
-7
未找到文件。
include/linux/netfilter/ipset/ip_set.h
浏览文件 @
f925f705
...
...
@@ -56,20 +56,20 @@ enum ip_set_extension {
IPSET_EXT_COUNTER
=
(
1
<<
IPSET_EXT_BIT_COUNTER
),
};
/* Extension offsets */
enum
ip_set_offset
{
IPSET_OFFSET_TIMEOUT
=
0
,
IPSET_OFFSET_COUNTER
,
IPSET_OFFSET_MAX
,
};
#define SET_WITH_TIMEOUT(s) ((s)->extensions & IPSET_EXT_TIMEOUT)
#define SET_WITH_COUNTER(s) ((s)->extensions & IPSET_EXT_COUNTER)
/* Extension id, in size order */
enum
ip_set_ext_id
{
IPSET_EXT_ID_COUNTER
=
0
,
IPSET_EXT_ID_TIMEOUT
,
IPSET_EXT_ID_MAX
,
};
struct
ip_set_ext
{
u32
timeout
;
u64
packets
;
u64
bytes
;
u32
timeout
;
};
struct
ip_set
;
...
...
net/netfilter/ipset/ip_set_bitmap_gen.h
浏览文件 @
f925f705
...
...
@@ -33,9 +33,9 @@
#define mtype MTYPE
#define ext_timeout(e, m) \
(unsigned long *)((e) + (m)->offset[IPSET_
OFFSET
_TIMEOUT])
(unsigned long *)((e) + (m)->offset[IPSET_
EXT_ID
_TIMEOUT])
#define ext_counter(e, m) \
(struct ip_set_counter *)((e) + (m)->offset[IPSET_
OFFSET
_COUNTER])
(struct ip_set_counter *)((e) + (m)->offset[IPSET_
EXT_ID
_COUNTER])
#define get_ext(map, id) ((map)->extensions + (map)->dsize * (id))
static
void
...
...
net/netfilter/ipset/ip_set_bitmap_ip.c
浏览文件 @
f925f705
...
...
@@ -45,7 +45,7 @@ struct bitmap_ip {
u32
hosts
;
/* number of hosts in a subnet */
size_t
memsize
;
/* members size */
size_t
dsize
;
/* extensions struct size */
size_t
offset
[
IPSET_
OFFSET
_MAX
];
/* Offsets to extensions */
size_t
offset
[
IPSET_
EXT_ID
_MAX
];
/* Offsets to extensions */
u8
netmask
;
/* subnet netmask */
u32
timeout
;
/* timeout parameter */
struct
timer_list
gc
;
/* garbage collection */
...
...
@@ -342,9 +342,9 @@ bitmap_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
set
->
extensions
|=
IPSET_EXT_COUNTER
;
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipct_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_ipct_elem
,
timeout
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_ipct_elem
,
counter
);
if
(
!
init_map_ip
(
set
,
map
,
first_ip
,
last_ip
,
...
...
@@ -360,7 +360,7 @@ bitmap_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
bitmap_ip_gc_init
(
set
,
bitmap_ip_gc
);
}
else
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipc_elem
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_ipc_elem
,
counter
);
if
(
!
init_map_ip
(
set
,
map
,
first_ip
,
last_ip
,
...
...
@@ -371,7 +371,7 @@ bitmap_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
}
}
else
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipt_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_ipt_elem
,
timeout
);
if
(
!
init_map_ip
(
set
,
map
,
first_ip
,
last_ip
,
...
...
net/netfilter/ipset/ip_set_bitmap_ipmac.c
浏览文件 @
f925f705
...
...
@@ -52,7 +52,7 @@ struct bitmap_ipmac {
struct
timer_list
gc
;
/* garbage collector */
size_t
memsize
;
/* members size */
size_t
dsize
;
/* size of element */
size_t
offset
[
IPSET_
OFFSET
_MAX
];
/* Offsets to extensions */
size_t
offset
[
IPSET_
EXT_ID
_MAX
];
/* Offsets to extensions */
};
/* ADT structure for generic function args */
...
...
@@ -405,9 +405,9 @@ bitmap_ipmac_create(struct ip_set *set, struct nlattr *tb[],
set
->
extensions
|=
IPSET_EXT_COUNTER
;
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipmacct_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_ipmacct_elem
,
timeout
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_ipmacct_elem
,
counter
);
if
(
!
init_map_ipmac
(
set
,
map
,
first_ip
,
last_ip
,
...
...
@@ -421,7 +421,7 @@ bitmap_ipmac_create(struct ip_set *set, struct nlattr *tb[],
bitmap_ipmac_gc_init
(
set
,
bitmap_ipmac_gc
);
}
else
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipmacc_elem
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_ipmacc_elem
,
counter
);
if
(
!
init_map_ipmac
(
set
,
map
,
first_ip
,
last_ip
,
...
...
@@ -432,7 +432,7 @@ bitmap_ipmac_create(struct ip_set *set, struct nlattr *tb[],
}
}
else
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_ipmact_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_ipmact_elem
,
timeout
);
if
(
!
init_map_ipmac
(
set
,
map
,
first_ip
,
last_ip
,
elements
))
{
...
...
net/netfilter/ipset/ip_set_bitmap_port.c
浏览文件 @
f925f705
...
...
@@ -39,7 +39,7 @@ struct bitmap_port {
u32
elements
;
/* number of max elements in the set */
size_t
memsize
;
/* members size */
size_t
dsize
;
/* extensions struct size */
size_t
offset
[
IPSET_
OFFSET
_MAX
];
/* Offsets to extensions */
size_t
offset
[
IPSET_
EXT_ID
_MAX
];
/* Offsets to extensions */
u32
timeout
;
/* timeout parameter */
struct
timer_list
gc
;
/* garbage collection */
};
...
...
@@ -282,9 +282,9 @@ bitmap_port_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
set
->
extensions
|=
IPSET_EXT_COUNTER
;
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_portct_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_portct_elem
,
timeout
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_portct_elem
,
counter
);
if
(
!
init_map_port
(
set
,
map
,
first_port
,
last_port
))
{
kfree
(
map
);
...
...
@@ -297,7 +297,7 @@ bitmap_port_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
bitmap_port_gc_init
(
set
,
bitmap_port_gc
);
}
else
{
map
->
dsize
=
sizeof
(
struct
bitmap_portc_elem
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
bitmap_portc_elem
,
counter
);
if
(
!
init_map_port
(
set
,
map
,
first_port
,
last_port
))
{
kfree
(
map
);
...
...
@@ -306,7 +306,7 @@ bitmap_port_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
}
}
else
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
map
->
dsize
=
sizeof
(
struct
bitmap_portt_elem
);
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
bitmap_portt_elem
,
timeout
);
if
(
!
init_map_port
(
set
,
map
,
first_port
,
last_port
))
{
kfree
(
map
);
...
...
net/netfilter/ipset/ip_set_hash_gen.h
浏览文件 @
f925f705
...
...
@@ -179,9 +179,9 @@ hbucket_elem_add(struct hbucket *n, u8 ahash_max, size_t dsize)
#endif
/* IP_SET_HASH_WITH_NETS */
#define ext_timeout(e, h) \
(unsigned long *)(((void *)(e)) + (h)->offset[IPSET_
OFFSET
_TIMEOUT])
(unsigned long *)(((void *)(e)) + (h)->offset[IPSET_
EXT_ID
_TIMEOUT])
#define ext_counter(e, h) \
(struct ip_set_counter *)(((void *)(e)) + (h)->offset[IPSET_
OFFSET
_COUNTER])
(struct ip_set_counter *)(((void *)(e)) + (h)->offset[IPSET_
EXT_ID
_COUNTER])
#endif
/* _IP_SET_HASH_GEN_H */
...
...
@@ -278,7 +278,7 @@ struct htype {
u32
initval
;
/* random jhash init value */
u32
timeout
;
/* timeout value, if enabled */
size_t
dsize
;
/* data struct size */
size_t
offset
[
IPSET_
OFFSET
_MAX
];
/* Offsets to extensions */
size_t
offset
[
IPSET_
EXT_ID
_MAX
];
/* Offsets to extensions */
struct
timer_list
gc
;
/* garbage collection when timeout enabled */
struct
mtype_elem
next
;
/* temporary storage for uadd */
#ifdef IP_SET_HASH_WITH_MULTI
...
...
@@ -1059,11 +1059,11 @@ IPSET_TOKEN(HTYPE, _create)(struct ip_set *set, struct nlattr *tb[], u32 flags)
if
(
set
->
family
==
NFPROTO_IPV4
)
{
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
ct_elem
));
h
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
h
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
ct_elem
),
timeout
);
h
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
h
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
ct_elem
),
counter
);
...
...
@@ -1072,11 +1072,11 @@ IPSET_TOKEN(HTYPE, _create)(struct ip_set *set, struct nlattr *tb[], u32 flags)
}
else
{
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
ct_elem
));
h
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
h
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
ct_elem
),
timeout
);
h
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
h
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
ct_elem
),
counter
);
...
...
@@ -1088,7 +1088,7 @@ IPSET_TOKEN(HTYPE, _create)(struct ip_set *set, struct nlattr *tb[], u32 flags)
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
c_elem
));
h
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
h
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
c_elem
),
counter
);
...
...
@@ -1096,7 +1096,7 @@ IPSET_TOKEN(HTYPE, _create)(struct ip_set *set, struct nlattr *tb[], u32 flags)
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
c_elem
));
h
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
h
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
c_elem
),
counter
);
...
...
@@ -1107,14 +1107,14 @@ IPSET_TOKEN(HTYPE, _create)(struct ip_set *set, struct nlattr *tb[], u32 flags)
set
->
extensions
|=
IPSET_EXT_TIMEOUT
;
if
(
set
->
family
==
NFPROTO_IPV4
)
{
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
t_elem
));
h
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
h
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
4
t_elem
),
timeout
);
IPSET_TOKEN
(
HTYPE
,
4
_gc_init
)(
set
,
IPSET_TOKEN
(
HTYPE
,
4
_gc
));
}
else
{
h
->
dsize
=
sizeof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
t_elem
));
h
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
h
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
IPSET_TOKEN
(
HTYPE
,
6
t_elem
),
timeout
);
IPSET_TOKEN
(
HTYPE
,
6
_gc_init
)(
set
,
...
...
net/netfilter/ipset/ip_set_list_set.c
浏览文件 @
f925f705
...
...
@@ -59,7 +59,7 @@ struct set_adt_elem {
/* Type structure */
struct
list_set
{
size_t
dsize
;
/* element size */
size_t
offset
[
IPSET_
OFFSET
_MAX
];
/* Offsets to extensions */
size_t
offset
[
IPSET_
EXT_ID
_MAX
];
/* Offsets to extensions */
u32
size
;
/* size of set list array */
u32
timeout
;
/* timeout value */
struct
timer_list
gc
;
/* garbage collection */
...
...
@@ -73,9 +73,9 @@ list_set_elem(const struct list_set *map, u32 id)
}
#define ext_timeout(e, m) \
(unsigned long *)((void *)(e) + (m)->offset[IPSET_
OFFSET
_TIMEOUT])
(unsigned long *)((void *)(e) + (m)->offset[IPSET_
EXT_ID
_TIMEOUT])
#define ext_counter(e, m) \
(struct ip_set_counter *)((void *)(e) + (m)->offset[IPSET_
OFFSET
_COUNTER])
(struct ip_set_counter *)((void *)(e) + (m)->offset[IPSET_
EXT_ID
_COUNTER])
static
int
list_set_ktest
(
struct
ip_set
*
set
,
const
struct
sk_buff
*
skb
,
...
...
@@ -667,9 +667,9 @@ list_set_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
if
(
!
map
)
return
-
ENOMEM
;
set
->
extensions
|=
IPSET_EXT_TIMEOUT
;
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
setct_elem
,
timeout
);
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
setct_elem
,
counter
);
list_set_gc_init
(
set
,
list_set_gc
);
}
else
{
...
...
@@ -677,7 +677,7 @@ list_set_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
sizeof
(
struct
setc_elem
),
0
);
if
(
!
map
)
return
-
ENOMEM
;
map
->
offset
[
IPSET_
OFFSET
_COUNTER
]
=
map
->
offset
[
IPSET_
EXT_ID
_COUNTER
]
=
offsetof
(
struct
setc_elem
,
counter
);
}
}
else
if
(
tb
[
IPSET_ATTR_TIMEOUT
])
{
...
...
@@ -686,7 +686,7 @@ list_set_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
if
(
!
map
)
return
-
ENOMEM
;
set
->
extensions
|=
IPSET_EXT_TIMEOUT
;
map
->
offset
[
IPSET_
OFFSET
_TIMEOUT
]
=
map
->
offset
[
IPSET_
EXT_ID
_TIMEOUT
]
=
offsetof
(
struct
sett_elem
,
timeout
);
list_set_gc_init
(
set
,
list_set_gc
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录