Project

General

Profile

Actions

Task #2310

closed

LSA string literals should be replaced with static variables

Added by Vince Lehman over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
Start date:
12/18/2014
Due date:
% Done:

100%

Estimated time:

Description

There are many places in the code where LSA types are set or compared using string literals:

In lsdb.cpp:

if (interestedLsType == "name") {
  processInterestForNameLsa(interest, originRouter.append(interestedLsType), seqNo);
}
else if (interestedLsType == "adjacency") {
  processInterestForAdjacencyLsa(interest, originRouter.append(interestedLsType), seqNo);
}
else if (interestedLsType == "coordinate") {
  processInterestForCoordinateLsa(interest, originRouter.append(interestedLsType), seqNo);
}

Code like this is prone to typos that cannot be caught by the compiler.

Instead, LSA types should be static member variables of their respective class and these static variables should be used in the
code in place of string literals.


Related issues 1 (0 open1 closed)

Related to NLSR - Bug #2322: NamePrefixTable::removeEntry appends LSA components incorrectlyClosedVince Lehman12/23/2014

Actions
Actions #1

Updated by Vince Lehman over 9 years ago

  • Assignee set to Muktadir Chowdhury
Actions #2

Updated by Vince Lehman over 9 years ago

  • Related to Bug #2322: NamePrefixTable::removeEntry appends LSA components incorrectly added
Actions #3

Updated by Vince Lehman over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF