summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Harpin <development@landsofshadow.co.uk>2015-06-23 21:14:27 +0100
committerAlex Harpin <development@landsofshadow.co.uk>2015-06-23 21:14:27 +0100
commitbb9bbe3b4074a21945c3d49238a75d44d6749045 (patch)
treeeaa00dc28a38b91c9c2f4a91ad1edcf899d8235e
parentd893e0c8e04b49826dbd444a70b728b6a0bfb5f1 (diff)
downloadvyatta-conntrack-bb9bbe3b4074a21945c3d49238a75d44d6749045.tar.gz
vyatta-conntrack-bb9bbe3b4074a21945c3d49238a75d44d6749045.zip
vyatta-conntrack: formatting changes for style consistency
Perltidy run on scripts/vyatta-cthelper.pl to have consistent identation levels and style throughout.
-rw-r--r--scripts/vyatta-cthelper.pl78
1 files changed, 39 insertions, 39 deletions
diff --git a/scripts/vyatta-cthelper.pl b/scripts/vyatta-cthelper.pl
index d19a1f4..2b9cc6a 100644
--- a/scripts/vyatta-cthelper.pl
+++ b/scripts/vyatta-cthelper.pl
@@ -10,68 +10,68 @@ use Vyatta::IpTables::Mgr;
use Getopt::Long;
use Sys::Syslog qw(:standard :macros);
-
-#for future
-my %cmd_hash = ( 'ipv4' => 'iptables',
- 'ipv6' => 'ip6tables');
+#for future
+my %cmd_hash = (
+ 'ipv4' => 'iptables',
+ 'ipv6' => 'ip6tables'
+);
my $nfct = "sudo /opt/vyatta/sbin/nfct";
my ($enable_sqlnet, $disable_sqlnet, $enable_nfs, $disable_nfs);
my $CTERROR = "Conntrack error:";
-GetOptions('enable_sqlnet=s' => \$enable_sqlnet,
- 'disable_sqlnet=s' => \$disable_sqlnet,
- 'disable_nfs=s' => \$disable_nfs,
- 'enable_nfs=s' => \$enable_nfs,
+GetOptions(
+ 'enable_sqlnet=s' => \$enable_sqlnet,
+ 'disable_sqlnet=s' => \$disable_sqlnet,
+ 'disable_nfs=s' => \$disable_nfs,
+ 'enable_nfs=s' => \$enable_nfs,
);
# subroutine to add helper rule to VYATTA_CT_HELPER chain.
-sub
-add_helper_to_chain {
- my ($module) = @_;
- my $iptables_cmd = $cmd_hash {'ipv4'};
- if ($module eq 'sqlnet') {
- run_cmd("$iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 1521 -j CT --helper tns");
- run_cmd("$iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 1525 -j CT --helper tns");
- } elsif ($module eq 'nfs') {
- run_cmd(" $iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 111 -j CT --helper rpc");
- run_cmd(" $iptables_cmd -I VYATTA_CT_HELPER -t raw -p udp --dport 111 -j CT --helper rpc");
- }
+sub add_helper_to_chain {
+ my ($module) = @_;
+ my $iptables_cmd = $cmd_hash{'ipv4'};
+ if ($module eq 'sqlnet') {
+ run_cmd("$iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 1521 -j CT --helper tns");
+ run_cmd("$iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 1525 -j CT --helper tns");
+ } elsif ($module eq 'nfs') {
+ run_cmd(" $iptables_cmd -I VYATTA_CT_HELPER -t raw -p tcp --dport 111 -j CT --helper rpc");
+ run_cmd(" $iptables_cmd -I VYATTA_CT_HELPER -t raw -p udp --dport 111 -j CT --helper rpc");
+ }
}
# subroutine to delete helper rule from VYATTA_CT_HELPER chain.
-sub
-delete_helper_from_chain {
- my ($module) = @_;
- my $iptables_cmd = $cmd_hash {'ipv4'};
- if ($module eq 'sqlnet') {
- run_cmd ("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 1521 -j CT --helper tns");
- run_cmd ("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 1525 -j CT --helper tns");
- } elsif ($module eq 'nfs') {
- run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 111 -j CT --helper rpc");
- run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p udp --dport 111 -j CT --helper rpc");
- }
+sub delete_helper_from_chain {
+ my ($module) = @_;
+ my $iptables_cmd = $cmd_hash{'ipv4'};
+ if ($module eq 'sqlnet') {
+ run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 1521 -j CT --helper tns");
+ run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 1525 -j CT --helper tns");
+ } elsif ($module eq 'nfs') {
+ run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p tcp --dport 111 -j CT --helper rpc");
+ run_cmd("$iptables_cmd -D VYATTA_CT_HELPER -t raw -p udp --dport 111 -j CT --helper rpc");
+ }
}
# should disable the required helper module
sub disable_helper_module {
- my ($module) = @_;
-
- delete_helper_from_chain($module);
+ my ($module) = @_;
+
+ delete_helper_from_chain($module);
}
# should enable the required helper module
sub enable_helper_module {
- my ($module) = @_;
- add_helper_to_chain($module);
+ my ($module) = @_;
+ add_helper_to_chain($module);
}
if (defined $enable_sqlnet){
- enable_helper_module("sqlnet");
+ enable_helper_module("sqlnet");
} elsif (defined $disable_sqlnet) {
- disable_helper_module("sqlnet");
+ disable_helper_module("sqlnet");
} elsif (defined $enable_nfs) {
- enable_helper_module("nfs");
+ enable_helper_module("nfs");
} elsif (defined $disable_nfs) {
- disable_helper_module("nfs");
+ disable_helper_module("nfs");
}