<div dir="ltr">Thanks for the reply Spyridon!<div><br></div><div>Yes that is correct, I can retrieve different parts of the prefix as you suggested but I see that I was a bit unclear. </div><div><br></div><div>I was really asking if this is how it should be done. That is, when an application has to deal with multiple actions, it should break down the Uri and use multiple "if" statements (like in my example).</div><div>Or is there a more "correct" way of handling this?</div><div><br></div><div>Another thing ... when an application receives an Interest, is it possible to extract some kind of ID from the interest that identifies who sent it?</div><div><br></div><div>Best regards,</div><div>Hafsteinn</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Oct 28, 2020 at 2:11 AM Spyridon Mastorakis <<a href="mailto:smastorakis@unomaha.edu">smastorakis@unomaha.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div style="overflow-wrap: break-word;">
Hi,
<div><br>
</div>
<div>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.</div>
<div><br>
</div>
<div>Thanks,</div>
<div><br>
<div>
<div dir="auto" style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">
<div>Spyridon (Spyros) Mastorakis<br>
Assistant Professor<br>
Computer Science Department<br>
University of Nebraska, Omaha<br>
Peter Kiewit Institute Room 175A<br>
<a href="https://sites.google.com/site/spyridonmastorakis" target="_blank">https://sites.google.com/site/spyridonmastorakis</a></div>
</div>
</div>
<div><br>
<blockquote type="cite">
<div>On Oct 25, 2020, at 6:31 AM, Hafsteinn Hjartarson via ndnSIM <<a href="mailto:ndnsim@lists.cs.ucla.edu" target="_blank">ndnsim@lists.cs.ucla.edu</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Hi everyone!
<div><br>
</div>
<div>I have a question regarding how applications can deal with different interest names.</div>
<div><br>
</div>
<div>Take for example the custom application ndn-custom-app-producer.cpp</div>
<div><br>
</div>
<div>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:</div>
<div><br>
</div>
<div>"/prefix/sub/<b>add</b>/{some hash}"</div>
<div>"/prefix/sub/<b>delete</b>/{some hash}"</div>
<div>"/prefix/sub/<b>get</b>/{some hash}"</div>
<div><br>
</div>
<div>So another application (a consumer) can send the above interests but how should my producer application handle this?</div>
<div><br>
</div>
<div>Currently I am doing this:</div>
<div><br>
</div>
<div>I add "/prefix/sub" to the FIB so that my producer listens to everything coming in on that prefix. </div>
<div><br>
</div>
<div>Then I have this logic:</div>
<div><br>
</div>
<div>onInterest(){</div>
<div>  if(interest -> getName().get(3).value() == "add")</div>
<div>  {</div>
<div>     //add the data</div>
<div>  }</div>
<div>  else if (interest -> getName().get(3).value() == "delete")</div>
<div>  {</div>
<div>      //delete the data</div>
<div>   }<br>
   else if (interest -> getName().get(3).value() == "get")</div>
<div>   {</div>
<div>      //create a data packet and send the data to the consumer</div>
<div>   }</div>
<div>}</div>
<div><br>
</div>
<div>Is this the correct way ?</div>
<div><br>
</div>
<div>Best regards,</div>
<div>Hafsteinn</div>
</div>
_______________________________________________<br>
ndnSIM mailing list<br>
<a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br>
<a href="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=" target="_blank">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=</a>
<br>
</div>
</blockquote>
</div>
<br>
</div>
</div>

</blockquote></div>