[ndnSIM] multiple names

Hafsteinn Hjartarson hafsteinn.hjartarson at gmail.com
Sun Oct 25 04:31:49 PDT 2020


Hi everyone!

I have a question regarding how applications can deal with different
interest names.

Take for example the custom application ndn-custom-app-producer.cpp

Let's say that I want the producer application to handle different
operations such as adding a hash to a list, deleting a has from a list and
returning some data regarding a certain hash:

"/prefix/sub/*add*/{some hash}"
"/prefix/sub/*delete*/{some hash}"
"/prefix/sub/*get*/{some hash}"

So another application (a consumer) can send the above interests but how
should my producer application handle this?

Currently I am doing this:

I add "/prefix/sub" to the FIB so that my producer listens to everything
coming in on that prefix.

Then I have this logic:

onInterest(){
  if(interest -> getName().get(3).value() == "add")
  {
     //add the data
  }
  else if (interest -> getName().get(3).value() == "delete")
  {
      //delete the data
   }
   else if (interest -> getName().get(3).value() == "get")
   {
      //create a data packet and send the data to the consumer
   }
}

Is this the correct way ?

Best regards,
Hafsteinn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20201025/13b2bca2/attachment.html>


More information about the ndnSIM mailing list