2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# Shorewall -- /usr/share/shorewall/action.Broadcast
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# This program is under GPL [http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt]
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# (c) 2011-2016 Tom Eastep (teastep@shorewall.net)
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# Complete documentation is available at http://shorewall.net
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of Version 2 of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation.
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# Broadcast[([<action>|-[,{audit|-}])]
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
# Default action is DROP
|
2011-07-03 17:58:30 +02:00
|
|
|
#
|
2016-04-05 19:13:55 +02:00
|
|
|
###############################################################################
|
2011-07-03 17:58:30 +02:00
|
|
|
|
|
|
|
DEFAULTS DROP,-
|
|
|
|
|
2016-03-14 23:57:32 +01:00
|
|
|
?if __ADDRTYPE
|
|
|
|
@1 - - - ;; -m addrtype --dst-type BROADCAST
|
|
|
|
@1 - - - ;; -m addrtype --dst-type MULTICAST
|
|
|
|
@1 - - - ;; -m addrtype --dst-type ANYCAST
|
|
|
|
?else
|
2013-06-20 19:39:39 +02:00
|
|
|
?begin perl;
|
2011-07-03 17:58:30 +02:00
|
|
|
|
|
|
|
use Shorewall::IPAddrs;
|
|
|
|
use Shorewall::Config;
|
|
|
|
use Shorewall::Chains;
|
|
|
|
|
2016-03-14 23:57:32 +01:00
|
|
|
my ( $action ) = get_action_params( 1 );
|
2011-07-24 20:46:57 +02:00
|
|
|
my $chainref = get_action_chain;
|
2011-07-04 16:49:38 +02:00
|
|
|
my ( $level, $tag ) = get_action_logging;
|
2011-07-03 17:58:30 +02:00
|
|
|
|
2016-03-14 23:57:32 +01:00
|
|
|
add_commands $chainref, 'for address in $ALL_BCASTS; do';
|
|
|
|
incr_cmd_level $chainref;
|
|
|
|
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d $address ' if $level ne '';
|
|
|
|
add_jump $chainref, $action, 0, "-d \$address ";
|
|
|
|
decr_cmd_level $chainref;
|
|
|
|
add_commands $chainref, 'done';
|
2012-04-24 23:52:57 +02:00
|
|
|
|
2016-03-14 23:57:32 +01:00
|
|
|
log_rule_limit $level, $chainref, 'Broadcast' , $action, '', $tag, 'add', ' -d 224.0.0.0/4 ' if $level ne '';
|
|
|
|
add_jump $chainref, $action, 0, '-d 224.0.0.0/4 ';
|
2011-07-03 17:58:30 +02:00
|
|
|
|
|
|
|
1;
|
|
|
|
|
2013-06-20 19:39:39 +02:00
|
|
|
?end perl;
|
2016-03-14 23:57:32 +01:00
|
|
|
?endif
|