[ndnSIM] SINR packet tag in ndnSIM 2.5

Junxiao Shi shijunxiao at email.arizona.edu
Sat Aug 4 05:08:07 PDT 2018


Hi Rajvardhan


Code Snippet:
>
> BlockHeader header;
> packet->RemoveHeader(header);
> auto nfdPacket = Packet(std::move(header.getBlock()));
>
> ::ndn::lp::Packet lpPacket = ::ndn::lp::Packet(nfdPacket.packet);
> if (sinrValue){
>   lpPacket.add<lp::SinrTagField>(sinrValue);
> }
>
> this->receive(std::move(nfdPacket));
>
> -----------------------------------------------------------------------------
> Error: (gdb trace attached)
>
> terminate called after throwing an instance of
> 'boost::exception_detail::clone_impl<boost::exception_detail:
> :error_info_injector<std::length_error> >'
>   what():  Field cannot be repeated
>
> ----------------------------------------------------------------------------
>

This error is thrown by lpPacket.add<lp::SinrTagField> function. It
indicates that the field is declared as non-repeatable (i.e. each LpPacket
can only have one such field), but you are trying to add a second
SinrTagField.

In your protocol design, is this field meant to be repeatable?
If yes, declare it as repeatable.
If no, use lpPacket.set<lp::SinrTagField> instead so that the old field
gets replaced.

Yours, Junxiao

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


More information about the ndnSIM mailing list