Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
e955ae3d
Commit
e955ae3d
authored
Aug 05, 2010
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git-public.flux.utah.edu:/flux/git/users/tarunp/emulab-devel into rspec
parents
023101a7
fb827d0a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
15 deletions
+17
-15
assign/parse_advertisement_rspec.cc
assign/parse_advertisement_rspec.cc
+1
-1
assign/parse_request_rspec.cc
assign/parse_request_rspec.cc
+10
-7
assign/rspec_parser.cc
assign/rspec_parser.cc
+1
-1
assign/rspec_parser_v2.cc
assign/rspec_parser_v2.cc
+5
-6
No files found.
assign/parse_advertisement_rspec.cc
View file @
e955ae3d
...
...
@@ -195,7 +195,7 @@ int parse_advertisement(tb_pgraph &pg, tb_sgraph &sg, char *filename) {
* All done, clean up memory
*/
// XMLPlatformUtils::Terminate();
free
(
rspecParser
)
;
delete
rspecParser
;
return
0
;
}
...
...
assign/parse_request_rspec.cc
View file @
e955ae3d
...
...
@@ -201,7 +201,7 @@ int parse_request(tb_vgraph &vg, char *filename) {
* All done, clean up memory
*/
// XMLPlatformUtils::Terminate();
free
(
rspecParser
)
;
delete
rspecParser
;
return
0
;
}
...
...
@@ -710,7 +710,10 @@ bool populate_link (DOMElement* elt,
/*
* Pull the links from the vtop file, and populate assign's own data sturctures
*/
bool
populate_links
(
DOMElement
*
root
,
tb_vgraph
&
vg
,
map
<
pair
<
string
,
string
>
,
pair
<
string
,
string
>
>*
fixed_interfaces
)
{
bool
populate_links
(
DOMElement
*
root
,
tb_vgraph
&
vg
,
map
<
pair
<
string
,
string
>
,
pair
<
string
,
string
>
>*
fixed_interfaces
)
{
bool
is_ok
=
true
;
/*
...
...
@@ -720,7 +723,7 @@ bool populate_links(DOMElement *root, tb_vgraph &vg, map< pair<string, string>,
DOMNodeList
*
links
=
root
->
getElementsByTagName
(
XStr
(
"link"
).
x
());
int
linkCount
=
links
->
getLength
();
XMLDEBUG
(
"Found "
<<
links
->
getLength
()
<<
" links in rspec"
<<
endl
);
for
(
size_
t
i
=
0
;
i
<
linkCount
;
i
++
)
{
for
(
in
t
i
=
0
;
i
<
linkCount
;
i
++
)
{
DOMNode
*
link
=
links
->
item
(
i
);
DOMElement
*
elt
=
dynamic_cast
<
DOMElement
*>
(
link
);
is_ok
&=
populate_link
(
elt
,
vg
,
fixed_interfaces
);
...
...
@@ -742,7 +745,7 @@ bool populate_vclass (struct vclass vclass, tb_vgraph& vg)
vclass_map
[
name
]
=
v
;
}
for
(
int
i
=
0
;
i
<
vclass
.
physicalTypes
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
vclass
.
physicalTypes
.
size
();
i
++
)
{
fstring
physType
=
XStr
(
vclass
.
physicalTypes
[
i
].
c_str
()).
f
();
v
->
add_type
(
physType
);
vclasses
[
name
].
push_back
(
physType
);
...
...
@@ -758,7 +761,7 @@ bool populate_vclasses (DOMElement* root, tb_vgraph& vg)
bool
isOk
=
true
;
vector
<
struct
vclass
>
vclasses
=
rspecParser
->
readVClasses
(
root
);
cerr
<<
"Found "
<<
vclasses
.
size
()
<<
" vclasses."
<<
endl
;
for
(
int
i
=
0
;
i
<
vclasses
.
size
();
i
++
)
{
for
(
unsigned
int
i
=
0
;
i
<
vclasses
.
size
();
i
++
)
{
isOk
&=
populate_vclass
(
vclasses
[
i
],
vg
);
}
return
isOk
;
...
...
@@ -777,7 +780,7 @@ DOMElement* appendChildTagWithData (DOMElement* parent,
string
generate_virtualNodeId
(
string
virtual_id
)
{
std
:
ostringstream
oss
;
std
:
:
ostringstream
oss
;
struct
timeval
tv
;
struct
timezone
tz
;
gettimeofday
(
&
tv
,
&
tz
);
...
...
@@ -787,7 +790,7 @@ string generate_virtualNodeId (string virtual_id)
string
generate_virtualIfaceId
(
string
lan_name
,
int
interface_number
)
{
std
:
ostringstream
oss
;
std
:
:
ostringstream
oss
;
oss
<<
lan_name
<<
":"
<<
interface_number
;
return
oss
.
str
();
}
...
...
assign/rspec_parser.cc
View file @
e955ae3d
...
...
@@ -28,7 +28,7 @@ rspec_parser :: rspec_parser (int type)
rspec_parser
::
~
rspec_parser
()
{
free
(
this
->
emulabExtensions
)
;
delete
this
->
emulabExtensions
;
}
struct
link_interface
rspec_parser
::
getIface
(
const
DOMElement
*
tag
)
...
...
assign/rspec_parser_v2.cc
View file @
e955ae3d
...
...
@@ -99,12 +99,11 @@ rspec_parser_v2 :: readLinkCharacteristics (const DOMElement* link,
bool
hasBandwidth
,
hasLatency
,
hasPacketLoss
;
count
=
properties
->
getLength
();
// if (count == 1) {
DOMElement
*
property
=
dynamic_cast
<
DOMElement
*>
(
properties
->
item
(
0
));
strBw
=
this
->
getAttribute
(
property
,
"capacity"
,
hasBandwidth
);
strLat
=
this
->
getAttribute
(
property
,
"latency"
,
hasLatency
);
strLoss
=
this
->
getAttribute
(
property
,
"packet_loss"
,
hasPacketLoss
);
// }
// Read only from the first property and ignore the rest
DOMElement
*
property
=
dynamic_cast
<
DOMElement
*>
(
properties
->
item
(
0
));
strBw
=
this
->
getAttribute
(
property
,
"capacity"
,
hasBandwidth
);
strLat
=
this
->
getAttribute
(
property
,
"latency"
,
hasLatency
);
strLoss
=
this
->
getAttribute
(
property
,
"packet_loss"
,
hasPacketLoss
);
int
bandwidth
=
0
,
latency
=
0
;
float
packetLoss
=
0.0
;
...
...
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