Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
897dde23
Commit
897dde23
authored
Mar 02, 2003
by
Art Haas
Committed by
David S. Miller
Mar 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BRIDGE]: C99 patches for net/bridge/netfilter.
parent
c069d58e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
34 deletions
+104
-34
net/bridge/netfilter/ebtable_broute.c
net/bridge/netfilter/ebtable_broute.c
+16
-6
net/bridge/netfilter/ebtable_filter.c
net/bridge/netfilter/ebtable_filter.c
+44
-14
net/bridge/netfilter/ebtable_nat.c
net/bridge/netfilter/ebtable_nat.c
+44
-14
No files found.
net/bridge/netfilter/ebtable_broute.c
View file @
897dde23
...
...
@@ -18,13 +18,20 @@
// EBT_ACCEPT means the frame will be bridged
// EBT_DROP means the frame will be routed
static
struct
ebt_entries
initial_chain
=
{
0
,
"BROUTING"
,
0
,
EBT_ACCEPT
,
0
};
static
struct
ebt_entries
initial_chain
=
{
.
name
=
"BROUTING"
,
.
policy
=
EBT_ACCEPT
,
};
static
struct
ebt_replace
initial_table
=
{
"broute"
,
1
<<
NF_BR_BROUTING
,
0
,
sizeof
(
struct
ebt_entries
),
{
[
NF_BR_BROUTING
]
&
initial_chain
},
0
,
NULL
,
(
char
*
)
&
initial_chain
.
name
=
"broute"
,
.
valid_hooks
=
1
<<
NF_BR_BROUTING
,
.
entries_size
=
sizeof
(
struct
ebt_entries
),
.
hook_entry
=
{
[
NF_BR_BROUTING
]
=
&
initial_chain
,
},
.
entries
=
(
char
*
)
&
initial_chain
};
static
int
check
(
const
struct
ebt_table_info
*
info
,
unsigned
int
valid_hooks
)
...
...
@@ -36,8 +43,11 @@ static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
static
struct
ebt_table
broute_table
=
{
{
NULL
,
NULL
},
"broute"
,
&
initial_table
,
1
<<
NF_BR_BROUTING
,
RW_LOCK_UNLOCKED
,
check
,
NULL
.
name
=
"broute"
,
.
table
=
&
initial_table
,
.
valid_hooks
=
1
<<
NF_BR_BROUTING
,
.
lock
=
RW_LOCK_UNLOCKED
,
.
check
=
check
,
};
static
int
ebt_broute
(
struct
sk_buff
**
pskb
)
...
...
net/bridge/netfilter/ebtable_filter.c
View file @
897dde23
...
...
@@ -16,16 +16,31 @@
static
struct
ebt_entries
initial_chains
[]
=
{
{
0
,
"INPUT"
,
0
,
EBT_ACCEPT
,
0
},
{
0
,
"FORWARD"
,
0
,
EBT_ACCEPT
,
0
},
{
0
,
"OUTPUT"
,
0
,
EBT_ACCEPT
,
0
}
{
.
name
=
"INPUT"
,
.
policy
=
EBT_ACCEPT
,
},
{
.
name
=
"FORWARD"
,
.
policy
=
EBT_ACCEPT
,
},
{
.
name
=
"OUTPUT"
,
.
policy
=
EBT_ACCEPT
,
}
};
static
struct
ebt_replace
initial_table
=
{
"filter"
,
FILTER_VALID_HOOKS
,
0
,
3
*
sizeof
(
struct
ebt_entries
),
{
[
NF_BR_LOCAL_IN
]
&
initial_chains
[
0
],
[
NF_BR_FORWARD
]
&
initial_chains
[
1
],
[
NF_BR_LOCAL_OUT
]
&
initial_chains
[
2
]
},
0
,
NULL
,
(
char
*
)
initial_chains
.
name
=
"filter"
,
.
valid_hooks
=
FILTER_VALID_HOOKS
,
.
entries_size
=
3
*
sizeof
(
struct
ebt_entries
),
.
hook_entry
=
{
[
NF_BR_LOCAL_IN
]
=
&
initial_chains
[
0
],
[
NF_BR_FORWARD
]
=
&
initial_chains
[
1
],
[
NF_BR_LOCAL_OUT
]
=
&
initial_chains
[
2
],
},
.
entries
=
(
char
*
)
initial_chains
};
static
int
check
(
const
struct
ebt_table_info
*
info
,
unsigned
int
valid_hooks
)
...
...
@@ -37,8 +52,11 @@ static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
static
struct
ebt_table
frame_filter
=
{
{
NULL
,
NULL
},
"filter"
,
&
initial_table
,
FILTER_VALID_HOOKS
,
RW_LOCK_UNLOCKED
,
check
,
NULL
.
name
=
"filter"
,
.
table
=
&
initial_table
,
.
valid_hooks
=
FILTER_VALID_HOOKS
,
.
lock
=
RW_LOCK_UNLOCKED
,
.
check
=
check
,
};
static
unsigned
int
...
...
@@ -49,12 +67,24 @@ ebt_hook (unsigned int hook, struct sk_buff **pskb, const struct net_device *in,
}
static
struct
nf_hook_ops
ebt_ops_filter
[]
=
{
{
{
NULL
,
NULL
},
ebt_hook
,
PF_BRIDGE
,
NF_BR_LOCAL_IN
,
NF_BR_PRI_FILTER_BRIDGED
},
{
{
NULL
,
NULL
},
ebt_hook
,
PF_BRIDGE
,
NF_BR_FORWARD
,
NF_BR_PRI_FILTER_BRIDGED
},
{
{
NULL
,
NULL
},
ebt_hook
,
PF_BRIDGE
,
NF_BR_LOCAL_OUT
,
NF_BR_PRI_FILTER_OTHER
}
{
.
hook
=
ebt_hook
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_LOCAL_IN
,
.
priority
=
NF_BR_PRI_FILTER_BRIDGED
,
},
{
.
hook
=
ebt_hook
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_FORWARD
,
.
priority
=
NF_BR_PRI_FILTER_BRIDGED
},
{
.
hook
=
ebt_hook
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_LOCAL_OUT
,
.
priority
=
NF_BR_PRI_FILTER_OTHER
}
};
static
int
__init
init
(
void
)
...
...
net/bridge/netfilter/ebtable_nat.c
View file @
897dde23
...
...
@@ -15,16 +15,31 @@
static
struct
ebt_entries
initial_chains
[]
=
{
{
0
,
"PREROUTING"
,
0
,
EBT_ACCEPT
,
0
},
{
0
,
"OUTPUT"
,
0
,
EBT_ACCEPT
,
0
},
{
0
,
"POSTROUTING"
,
0
,
EBT_ACCEPT
,
0
}
{
.
name
=
"PREROUTING"
,
.
policy
=
EBT_ACCEPT
,
},
{
.
name
=
"OUTPUT"
,
.
policy
=
EBT_ACCEPT
,
},
{
.
name
=
"POSTROUTING"
,
.
policy
=
EBT_ACCEPT
,
}
};
static
struct
ebt_replace
initial_table
=
{
"nat"
,
NAT_VALID_HOOKS
,
0
,
3
*
sizeof
(
struct
ebt_entries
),
{
[
NF_BR_PRE_ROUTING
]
&
initial_chains
[
0
],
[
NF_BR_LOCAL_OUT
]
&
initial_chains
[
1
],
[
NF_BR_POST_ROUTING
]
&
initial_chains
[
2
]
},
0
,
NULL
,
(
char
*
)
initial_chains
.
name
=
"nat"
,
.
valid_hooks
=
NAT_VALID_HOOKS
,
.
entries_size
=
3
*
sizeof
(
struct
ebt_entries
),
.
hook_entry
=
{
[
NF_BR_PRE_ROUTING
]
=
&
initial_chains
[
0
],
[
NF_BR_LOCAL_OUT
]
=
&
initial_chains
[
1
],
[
NF_BR_POST_ROUTING
]
=
&
initial_chains
[
2
],
},
.
entries
=
(
char
*
)
initial_chains
};
static
int
check
(
const
struct
ebt_table_info
*
info
,
unsigned
int
valid_hooks
)
...
...
@@ -36,8 +51,11 @@ static int check(const struct ebt_table_info *info, unsigned int valid_hooks)
static
struct
ebt_table
frame_nat
=
{
{
NULL
,
NULL
},
"nat"
,
&
initial_table
,
NAT_VALID_HOOKS
,
RW_LOCK_UNLOCKED
,
check
,
NULL
.
name
=
"nat"
,
.
table
=
&
initial_table
,
.
valid_hooks
=
NAT_VALID_HOOKS
,
.
lock
=
RW_LOCK_UNLOCKED
,
.
check
=
check
,
};
static
unsigned
int
...
...
@@ -55,12 +73,24 @@ ebt_nat_src(unsigned int hook, struct sk_buff **pskb, const struct net_device *i
}
static
struct
nf_hook_ops
ebt_ops_nat
[]
=
{
{
{
NULL
,
NULL
},
ebt_nat_dst
,
PF_BRIDGE
,
NF_BR_LOCAL_OUT
,
NF_BR_PRI_NAT_DST_OTHER
},
{
{
NULL
,
NULL
},
ebt_nat_src
,
PF_BRIDGE
,
NF_BR_POST_ROUTING
,
NF_BR_PRI_NAT_SRC
},
{
{
NULL
,
NULL
},
ebt_nat_dst
,
PF_BRIDGE
,
NF_BR_PRE_ROUTING
,
NF_BR_PRI_NAT_DST_BRIDGED
},
{
.
hook
=
ebt_nat_dst
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_LOCAL_OUT
,
.
priority
=
NF_BR_PRI_NAT_DST_OTHER
},
{
.
hook
=
ebt_nat_src
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_POST_ROUTING
,
.
priority
=
NF_BR_PRI_NAT_SRC
},
{
.
hook
=
ebt_nat_dst
,
.
pf
=
PF_BRIDGE
,
.
hooknum
=
NF_BR_PRE_ROUTING
,
.
priority
=
NF_BR_PRI_NAT_DST_BRIDGED
},
};
static
int
__init
init
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment