[ndnSIM] multiple names

Spyridon Mastorakis smastorakis at unomaha.edu
Tue Oct 27 19:11:05 PDT 2020


Hi,

Name.get(2).toUri() should return a string of the 3rd name component. I suppose the index of the get() method of the Name class starts from 0.

Thanks,

Spyridon (Spyros) Mastorakis
Assistant Professor
Computer Science Department
University of Nebraska, Omaha
Peter Kiewit Institute Room 175A
https://sites.google.com/site/spyridonmastorakis

On Oct 25, 2020, at 6:31 AM, Hafsteinn Hjartarson via ndnSIM <ndnsim at lists.cs.ucla.edu<mailto:ndnsim at lists.cs.ucla.edu>> wrote:

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
_______________________________________________
ndnSIM mailing list
ndnSIM at lists.cs.ucla.edu<mailto:ndnSIM at lists.cs.ucla.edu>
https://urldefense.proofpoint.com/v2/url?u=http-3A__www.lists.cs.ucla.edu_mailman_listinfo_ndnsim&d=DwICAg&c=Cu5g146wZdoqVuKpTNsYHeFX_rg6kWhlkLF8Eft-wwo&r=eI5Bh74ovG-uIXQ5ksQETSPgRFzmJXjIZXneCqw580E&m=ZJcrRLs3ctYEDgUU0ei0VorwcyfIQt4pWR7EG9NmK_o&s=JbkqAPn8-5Iqv29lB8xy6qQZNw5ExV5-SunKN12zUhA&e=

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/ndnsim/attachments/20201028/e61f9cca/attachment.html>


More information about the ndnSIM mailing list