Added NextHopFaceId to client

refs #1942

Change-Id: Id0d64d89bb8a596f88ef252cc89eb2d0c0e60594
This commit is contained in:
Eric Newberry committed 2016-04-04 19:45:31 -07:00
1 parent ef56143e6f
commit eab462b8dc
2 files changed
+13 -1

No files matched your search

+2 -1
View File
@@ -14,7 +14,7 @@
# * PLEASE ENSURE THAT THE SUM OF TRAFFIC PERCENTAGE FOR ALL PATTERNS
# PROVIDED DOES NOT EXCEED 100 IN ORDER TO MAINTAIN CORRECT BEHAVIOR
# * NNI STANDS FOR NON-NEGATIVE INTEGER
# * RANGE OF POSSIBLE VALUES IS SPECIFIED IN []
# * RANGE OF POSSIBLE VALUES IS SPECIFIED IN []
#
#
#(Mandatory)
@@ -34,6 +34,7 @@
#MustBeFresh=NNI [0-1]
#NonceDuplicationPercentage=NNI [0-100]
#InterestLifetime=NNI [Milliseconds]
#NextHopFaceId=NNI
#ExpectedContent=String
#
#
+11
View File
@@ -76,6 +76,7 @@ public:
, m_mustBeFresh(-1)
, m_nonceDuplicationPercentage(-1)
, m_interestLifetime(getDefaultInterestLifetime())
, m_nextHopFaceId(0)
, m_nInterestsSent(0)
, m_nInterestsReceived(0)
, m_minimumInterestRoundTripTime(std::numeric_limits<double>::max())
@@ -124,6 +125,8 @@ public:
detail += "NonceDuplicationPercentage=" + to_string(m_nonceDuplicationPercentage) + ", ";
if (m_interestLifetime >= time::milliseconds(0))
detail += "InterestLifetime=" + to_string(m_interestLifetime.count()) + ", ";
if (m_nextHopFaceId > 0)
detail += "NextHopFaceId=" + to_string(m_nextHopFaceId) + ", ";
if (!m_expectedContent.empty())
detail += "ExpectedContent=" + m_expectedContent + ", ";
if (detail.length() >= 2)
@@ -195,6 +198,8 @@ public:
m_nonceDuplicationPercentage = std::stoi(value);
else if (parameter == "InterestLifetime")
m_interestLifetime = time::milliseconds(std::stoi(value));
else if (parameter == "NextHopFaceId")
m_nextHopFaceId = std::stoi(value);
else if (parameter == "ExpectedContent")
m_expectedContent = value;
else
@@ -231,6 +236,7 @@ public:
int m_mustBeFresh;
int m_nonceDuplicationPercentage;
time::milliseconds m_interestLifetime;
uint64_t m_nextHopFaceId;
int m_nInterestsSent;
int m_nInterestsReceived;
@@ -692,6 +698,11 @@ public:
if (m_trafficPatterns[patternId].m_interestLifetime >= time::milliseconds(0))
interest.setInterestLifetime(m_trafficPatterns[patternId].m_interestLifetime);
if (m_trafficPatterns[patternId].m_nextHopFaceId > 0) {
interest.setTag(make_shared<lp::NextHopFaceIdTag>(
m_trafficPatterns[patternId].m_nextHopFaceId));
}
try {
m_nInterestsSent++;
m_trafficPatterns[patternId].m_nInterestsSent++;