Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
ae36dc5f
Commit
ae36dc5f
authored
Aug 26, 2004
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
show firewall info
parent
7bd1b0b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
5 deletions
+53
-5
tbsetup/tbreport.in
tbsetup/tbreport.in
+51
-3
www/shownsfile.php3
www/shownsfile.php3
+2
-2
No files found.
tbsetup/tbreport.in
View file @
ae36dc5f
...
...
@@ -14,13 +14,14 @@
#
sub
usage
{
print
"
Usage: $0 [-h] [-n] [-l] [-m] [-e] [-d] [-r] [-v] pid eid
\n
";
print
"
Usage: $0 [-h] [-n] [-l] [-m] [-e]
[-f]
[-d] [-r] [-v] pid eid
\n
";
print
"
-h Shows this message
\n
";
print
"
-n Show node info
\n
";
print
"
-m Show node mapping
\n
";
print
"
-l Show link info
\n
";
print
"
-d Show traffic shapping info
\n
";
print
"
-e Show event listing
\n
";
print
"
-f Show firewall rules
\n
";
print
"
-r Show routes
\n
";
print
"
-b Show most things
\n
";
print
"
-v Show everything!
\n
";
...
...
@@ -52,6 +53,7 @@ my $showlinks = 0;
my
$showdelays
=
0
;
my
$showevents
=
0
;
my
$showroutes
=
0
;
my
$showfwinfo
=
0
;
my
%v2pmap
;
my
%p2type
;
my
%p2osid
;
...
...
@@ -62,7 +64,7 @@ my %ipmap;
my
%macmap
;
my
%membermap
;
getopts
('
hnmdlevbr
',
\
%opt
);
getopts
('
hnmdlevbr
f
',
\
%opt
);
if
(
$opt
{
h
})
{
exit
&usage
;
...
...
@@ -75,6 +77,7 @@ if ($opt{v}) {
$showlinks
=
1
;
$showevents
=
1
;
$showroutes
=
1
;
$showfwinfo
=
1
;
}
if
(
$opt
{
b
})
{
$shownodes
=
1
;
...
...
@@ -100,6 +103,9 @@ if ($opt{e}) {
if
(
$opt
{
r
})
{
$showroutes
=
1
;
}
if
(
$opt
{
f
})
{
$showfwinfo
=
1
;
}
if
(
@ARGV
!=
2
)
{
exit
&usage
;
}
...
...
@@ -725,7 +731,6 @@ if ($showevents) {
if
(
$result
->
numrows
)
{
my
%egroups
=
();
while
((
$group_name
,
$agent_name
)
=
$result
->
fetchrow_array
())
{
if
(
!
exists
(
$egroups
{
$group_name
}))
{
$egroups
{
$group_name
}
=
[]
;
...
...
@@ -806,4 +811,47 @@ if ($showevents) {
}
}
#
# Print firewall information
#
if
(
$showfwinfo
)
{
my
$result_fw
=
DBQueryFatal
("
select fwname,type,style from firewalls
"
.
"
where pid='
$pid
' and eid='
$eid
'
");
if
(
$result_fw
->
numrows
)
{
print
"
Firewall information:
\n
";
printf
("
%-15s %-8s %-8s %-5s %s
\n
",
"
Firewall
",
"
Type
",
"
Style
",
"
Rule#
",
"
Rule
");
print
("
--------------- -------- -------- -----
"
.
"
-----------------------------------
\n
");
while
(
my
(
$fwname
,
$fwtype
,
$fwstyle
)
=
$result_fw
->
fetchrow_array
())
{
printf
("
%-15s %-8s %-8s
",
$fwname
,
$fwtype
,
$fwstyle
);
my
$result
=
DBQueryFatal
("
select ruleno,rule from firewall_rules
"
.
"
where pid='
$pid
' and eid='
$eid
'
"
.
"
and fwname='
$fwname
'
");
my
%rules
=
();
if
(
$result
->
numrows
)
{
while
((
my
$ruleno
,
$rule
)
=
$result
->
fetchrow_array
())
{
$rules
{
$ruleno
}
=
$rule
;
}
}
$result
=
DBQueryFatal
("
select ruleno,rule from default_firewall_rules
"
.
"
where type='
$fwtype
' and style='
$fwstyle
'
"
.
"
and enabled!=0
");
if
(
$result
->
numrows
)
{
while
((
my
$ruleno
,
$rule
)
=
$result
->
fetchrow_array
())
{
$rules
{
$ruleno
}
=
$rule
;
}
}
my
$leader
=
"
";
foreach
my
$ruleno
(
sort
keys
(
%rules
))
{
printf
("
%s%5d %s
\n
",
$leader
,
$ruleno
,
$rules
{
$ruleno
});
$leader
=
"
";
}
print
"
\n
";
}
}
}
exit
(
0
);
www/shownsfile.php3
View file @
ae36dc5f
...
...
@@ -219,8 +219,8 @@ if ($showevents) {
$flags
=
"-v"
;
}
else
{
# Show event summary
.
$flags
=
"-b -e"
;
# Show event summary
and firewall info.
$flags
=
"-b -e
-f
"
;
}
$result
=
exec
(
"
$TBSUEXEC_PATH
$uid
$TBADMINGROUP
webreport
$flags
$pid
$eid
"
,
...
...
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