Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Thomas Vachuska
2014-10-21 00:51:07 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
d03a56e02d2f26ac9a7e819d5aeffef5cbe978ed
d03a56e0
1 parent
4926c1b0
Added normalization of HostToHost id fingerprint to allow host one/two to come in either order.
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java
View file @
d03a56e
...
...
@@ -17,26 +17,33 @@ public final class HostToHostIntent extends ConnectivityIntent {
private
final
HostId
two
;
/**
* Creates a new point-to-point intent with the supplied ingress/egress
* ports.
* Creates a new host-to-host intent with the supplied host pair.
*
* @param appId application identifier
* @param one first host
* @param two second host
* @param selector action
* @param treatment ingress port
* @throws NullPointerException if {@code ingressPort} or {@code egressPort}
* is null.
* @throws NullPointerException if {@code one} or {@code two} is null.
*/
public
HostToHostIntent
(
ApplicationId
appId
,
HostId
one
,
HostId
two
,
TrafficSelector
selector
,
TrafficTreatment
treatment
)
{
super
(
id
(
HostToHostIntent
.
class
,
one
,
two
,
selector
,
treatment
),
super
(
id
(
HostToHostIntent
.
class
,
min
(
one
,
two
),
max
(
one
,
two
),
selector
,
treatment
),
appId
,
null
,
selector
,
treatment
);
this
.
one
=
checkNotNull
(
one
);
this
.
two
=
checkNotNull
(
two
);
}
private
static
HostId
min
(
HostId
one
,
HostId
two
)
{
return
one
.
hashCode
()
<
two
.
hashCode
()
?
one
:
two
;
}
private
static
HostId
max
(
HostId
one
,
HostId
two
)
{
return
one
.
hashCode
()
>
two
.
hashCode
()
?
one
:
two
;
}
/**
* Returns identifier of the first host.
*
...
...
Please
register
or
login
to post a comment