Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
95d16cbf
Commit
95d16cbf
authored
Jan 06, 2005
by
Mike Hibler
Browse files
Return some firewall variables/values which can be used in firewall rules.
Bump version # to 22 as a result.
parent
f6e353a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
tmcd/decls.h
View file @
95d16cbf
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-200
4
University of Utah and the Flux Group.
* Copyright (c) 2000-200
5
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -25,4 +25,4 @@
* NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
*/
#define DEFAULT_VERSION 2
#define CURRENT_VERSION 2
1
#define CURRENT_VERSION 2
2
tmcd/tmcd.c
View file @
95d16cbf
/*
* EMULAB-COPYRIGHT
* Copyright (c) 2000-200
4
University of Utah and the Flux Group.
* Copyright (c) 2000-200
5
University of Utah and the Flux Group.
* All rights reserved.
*/
...
...
@@ -5188,6 +5188,8 @@ COMMAND_PROTOTYPE(dofwinfo)
/*
* See if this node's experiment has an associated firewall
*
* XXX will only work if there is one firewall per experiment.
*/
res
=
mydb_query
(
"select r.node_id,f.type,f.style,f.fwname,i.IP,i.mac,f.vlan "
"from firewalls as f "
...
...
@@ -5276,6 +5278,38 @@ COMMAND_PROTOTYPE(dofwinfo)
strncpy
(
fwname
,
row
[
3
],
sizeof
(
fwname
));
mysql_free_result
(
res
);
/*
* Return firewall variables
* XXX these could come out of the database
*/
if
(
vers
>
21
)
{
OUTPUT
(
buf
,
sizeof
(
buf
),
"VAR=%s VALUE=
\"
%s
\"\n
"
,
"EMULAB_BOSS"
,
"boss"
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
OUTPUT
(
buf
,
sizeof
(
buf
),
"VAR=%s VALUE=
\"
%s
\"\n
"
,
"EMULAB_FS"
,
"fs"
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
OUTPUT
(
buf
,
sizeof
(
buf
),
"VAR=%s VALUE=
\"
%s
\"\n
"
,
"EMULAB_USERS"
,
"users"
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
#ifdef CONTROL_NETWORK
{
unsigned
addr
,
bits
=
32
;
struct
in_addr
mask
;
inet_aton
(
CONTROL_NETMASK
,
&
mask
);
addr
=
~
ntohl
(
mask
.
s_addr
);
while
(
addr
&&
(
addr
&
1
))
{
addr
>>=
1
;
bits
--
;
}
OUTPUT
(
buf
,
sizeof
(
buf
),
"VAR=%s VALUE=
\"
%s/%d
\"\n
"
,
"EMULAB_CNET"
,
CONTROL_NETWORK
,
bits
);
client_writeback
(
sock
,
buf
,
strlen
(
buf
),
tcp
);
}
#endif
}
/*
* Get the user firewall rules from the DB and return them.
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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