diff --git a/ndn-traffic-client.conf.sample b/ndn-traffic-client.conf.sample index 0fa0528..6ceed63 100644 --- a/ndn-traffic-client.conf.sample +++ b/ndn-traffic-client.conf.sample @@ -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 # # diff --git a/src/ndn-traffic-client.cpp b/src/ndn-traffic-client.cpp index f173a26..ca22e1b 100644 --- a/src/ndn-traffic-client.cpp +++ b/src/ndn-traffic-client.cpp @@ -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::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( + m_trafficPatterns[patternId].m_nextHopFaceId)); + } + try { m_nInterestsSent++; m_trafficPatterns[patternId].m_nInterestsSent++;