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
233f8451
Commit
233f8451
authored
May 03, 2003
by
Bart De Schuymer
Committed by
David S. Miller
May 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[EBTABLES]: Add ebtables match for the pkt_type member of an skbuff.
parent
659a58e3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
91 additions
and
8 deletions
+91
-8
include/linux/netfilter_bridge/ebt_pkttype.h
include/linux/netfilter_bridge/ebt_pkttype.h
+11
-0
net/bridge/netfilter/Kconfig
net/bridge/netfilter/Kconfig
+16
-4
net/bridge/netfilter/Makefile
net/bridge/netfilter/Makefile
+5
-4
net/bridge/netfilter/ebt_pkttype.c
net/bridge/netfilter/ebt_pkttype.c
+59
-0
No files found.
include/linux/netfilter_bridge/ebt_pkttype.h
0 → 100644
View file @
233f8451
#ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H
#define __LINUX_BRIDGE_EBT_PKTTYPE_H
struct
ebt_pkttype_info
{
uint8_t
pkt_type
;
uint8_t
invert
;
};
#define EBT_PKTTYPE_MATCH "pkttype"
#endif
net/bridge/netfilter/Kconfig
View file @
233f8451
...
...
@@ -49,7 +49,7 @@ config BRIDGE_EBT_LOG
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_IP
F
config BRIDGE_EBT_IP
tristate "ebt: IP filter support"
depends on BRIDGE_NF_EBTABLES
help
...
...
@@ -59,7 +59,7 @@ config BRIDGE_EBT_IPF
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_ARP
F
config BRIDGE_EBT_ARP
tristate "ebt: ARP filter support"
depends on BRIDGE_NF_EBTABLES
help
...
...
@@ -69,7 +69,7 @@ config BRIDGE_EBT_ARPF
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_VLAN
F
config BRIDGE_EBT_VLAN
tristate "ebt: 802.1Q VLAN filter support"
depends on BRIDGE_NF_EBTABLES
help
...
...
@@ -79,7 +79,7 @@ config BRIDGE_EBT_VLANF
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_MARK
F
config BRIDGE_EBT_MARK
tristate "ebt: mark filter support"
depends on BRIDGE_NF_EBTABLES
help
...
...
@@ -91,6 +91,18 @@ config BRIDGE_EBT_MARKF
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_PKTTYPE
tristate "ebt: packet type filter support"
depends on BRIDGE_NF_EBTABLES
help
This option adds the packet type match, which allows matching on the
type of packet based on its Ethernet "class" (as determined by
the generic networking code): broadcast, multicast,
for this host alone or for another host.
If you want to compile it as a module, say M here and read
<file:Documentation/modules.txt>. If unsure, say `N'.
config BRIDGE_EBT_SNAT
tristate "ebt: snat target support"
depends on BRIDGE_NF_EBTABLES
...
...
net/bridge/netfilter/Makefile
View file @
233f8451
...
...
@@ -6,10 +6,11 @@ obj-$(CONFIG_BRIDGE_NF_EBTABLES) += ebtables.o
obj-$(CONFIG_BRIDGE_EBT_T_FILTER)
+=
ebtable_filter.o
obj-$(CONFIG_BRIDGE_EBT_T_NAT)
+=
ebtable_nat.o
obj-$(CONFIG_BRIDGE_EBT_BROUTE)
+=
ebtable_broute.o
obj-$(CONFIG_BRIDGE_EBT_IPF)
+=
ebt_ip.o
obj-$(CONFIG_BRIDGE_EBT_ARPF)
+=
ebt_arp.o
obj-$(CONFIG_BRIDGE_EBT_VLANF)
+=
ebt_vlan.o
obj-$(CONFIG_BRIDGE_EBT_MARKF)
+=
ebt_mark_m.o
obj-$(CONFIG_BRIDGE_EBT_IP)
+=
ebt_ip.o
obj-$(CONFIG_BRIDGE_EBT_ARP)
+=
ebt_arp.o
obj-$(CONFIG_BRIDGE_EBT_VLAN)
+=
ebt_vlan.o
obj-$(CONFIG_BRIDGE_EBT_MARK)
+=
ebt_mark_m.o
obj-$(CONFIG_BRIDGE_EBT_PKTTYPE)
+=
ebt_pkttype.o
obj-$(CONFIG_BRIDGE_EBT_LOG)
+=
ebt_log.o
obj-$(CONFIG_BRIDGE_EBT_SNAT)
+=
ebt_snat.o
obj-$(CONFIG_BRIDGE_EBT_DNAT)
+=
ebt_dnat.o
...
...
net/bridge/netfilter/ebt_pkttype.c
0 → 100644
View file @
233f8451
/*
* ebt_pkttype
*
* Authors:
* Bart De Schuymer <bdschuym@pandora.be>
*
* April, 2003
*
*/
#include <linux/netfilter_bridge/ebtables.h>
#include <linux/netfilter_bridge/ebt_pkttype.h>
#include <linux/module.h>
static
int
ebt_filter_pkttype
(
const
struct
sk_buff
*
skb
,
const
struct
net_device
*
in
,
const
struct
net_device
*
out
,
const
void
*
data
,
unsigned
int
datalen
)
{
struct
ebt_pkttype_info
*
info
=
(
struct
ebt_pkttype_info
*
)
data
;
return
(
skb
->
pkt_type
!=
info
->
pkt_type
)
^
info
->
invert
;
}
static
int
ebt_pkttype_check
(
const
char
*
tablename
,
unsigned
int
hookmask
,
const
struct
ebt_entry
*
e
,
void
*
data
,
unsigned
int
datalen
)
{
struct
ebt_pkttype_info
*
info
=
(
struct
ebt_pkttype_info
*
)
data
;
if
(
datalen
!=
sizeof
(
struct
ebt_pkttype_info
))
return
-
EINVAL
;
if
(
info
->
invert
!=
0
&&
info
->
invert
!=
1
)
return
-
EINVAL
;
/* Allow any pkt_type value */
return
0
;
}
static
struct
ebt_match
filter_pkttype
=
{
.
name
=
EBT_PKTTYPE_MATCH
,
.
match
=
ebt_filter_pkttype
,
.
check
=
ebt_pkttype_check
,
.
me
=
THIS_MODULE
,
};
static
int
__init
init
(
void
)
{
return
ebt_register_match
(
&
filter_pkttype
);
}
static
void
__exit
fini
(
void
)
{
ebt_unregister_match
(
&
filter_pkttype
);
}
module_init
(
init
);
module_exit
(
fini
);
MODULE_LICENSE
(
"GPL"
);
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