[Nfd-dev] Custom LP packet
Adhy Satya
adhysatya820 at gmail.com
Sun Aug 27 17:17:15 PDT 2017
Hi,
I want to create a new LP packet to exchange geographical information
between nodes in order to control the forwarding, but I have difficulties.
As I described in this thread (
http://www.lists.cs.ucla.edu/pipermail/nfd-dev/2017-July/002545.html), I
modified the "lp/fields.hpp", "lp/tags.hpp", and "lp/tlv.hpp" to define the
field and tag in the LP packet.
It compiles without a problem with "./waf" and "sudo ./waf install".
Then, I go on to encode and decode the Tag in to a LpHeaderField in
"NFD/daemon/face/generic-link-service.cpp". When I compile with "./waf" I
get the error at the bottom of this email that I don't know how to solve.
Can you help please?
I'm using NFD and ndn-cxx 0.5.1.
Thank you
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error message:
[ 89/158] Compiling daemon/face/generic-link-service.cpp
In file included from /usr/local/include/ndn-cxx/lp/packet.hpp:25:0,
from ../daemon/face/lp-fragmenter.hpp:31,
from ../daemon/face/generic-link-service.hpp:30,
from ../daemon/face/generic-link-service.cpp:26:
/usr/local/include/ndn-cxx/lp/fields.hpp:96:19: error: ‘GeoTag’ is not a
member of ‘ndn::lp::tlv’
tlv::GeoTag> GeoTagField;
^
/usr/local/include/ndn-cxx/lp/fields.hpp:96:19: error: ‘GeoTag’ is not a
member of ‘ndn::lp::tlv’
/usr/local/include/ndn-cxx/lp/fields.hpp:96:30: error: template argument 3
is invalid
tlv::GeoTag> GeoTagField;
^
In file included from /usr/local/include/ndn-cxx/lp/field-decl.hpp:25:0,
from /usr/local/include/ndn-cxx/lp/fields.hpp:25,
from /usr/local/include/ndn-cxx/lp/packet.hpp:25,
from ../daemon/face/lp-fragmenter.hpp:31,
from ../daemon/face/generic-link-service.hpp:30,
from ../daemon/face/generic-link-service.cpp:26:
/usr/local/include/ndn-cxx/lp/field.hpp: In instantiation of ‘struct
ndn::lp::Field<int>’:
/usr/include/boost/concept/detail/has_constraints.hpp:32:62: required by
substitution of ‘template<class Model> boost::concepts::detail::yes
boost::concepts::detail::has_constraints_(Model*,
boost::concepts::detail::wrap_constraints<Model, (& Model:: constraints)>*)
[with Model = ndn::lp::Field<int>]’
/usr/include/boost/concept/detail/has_constraints.hpp:42:5: required from
‘const bool boost::concepts::not_satisfied<ndn::lp::Field<int> >::value’
/usr/include/boost/concept/detail/has_constraints.hpp:45:31: required
from ‘struct boost::concepts::not_satisfied<ndn::lp::Field<int> >’
/usr/include/boost/mpl/if.hpp:67:11: required from ‘struct
boost::mpl::if_<boost::concepts::not_satisfied<ndn::lp::Field<int> >,
boost::concepts::constraint<ndn::lp::Field<int> >,
boost::concepts::requirement<boost::concepts::failed************
ndn::lp::Field<int>::************> >’
/usr/include/boost/concept/detail/general.hpp:50:8: required from ‘struct
boost::concepts::requirement_<void (*)(ndn::lp::Field<int>)>’
/usr/local/include/ndn-cxx/lp/fields.hpp:97:1: required from here
/usr/local/include/ndn-cxx/lp/field.hpp:62:1: error: ‘int’ is not a class,
struct, or union type
{
^
/usr/local/include/ndn-cxx/lp/field.hpp:62:1: error: ‘int’ is not a class,
struct, or union type
/usr/local/include/ndn-cxx/lp/field.hpp:62:1: error: ‘int’ is not a class,
struct, or union type
/usr/local/include/ndn-cxx/lp/field.hpp:62:1: error: ‘int’ is not a class,
struct, or union type
In file included from /usr/include/boost/concept/assert.hpp:35:0,
from /usr/include/boost/concept_check.hpp:20,
from /usr/local/include/ndn-cxx/common.hpp:124,
from /usr/local/include/ndn-cxx/meta-info.hpp:25,
from /usr/local/include/ndn-cxx/data.hpp:25,
from ./../core/common.hpp:59,
from <command-line>:0:
/usr/local/include/ndn-cxx/lp/field.hpp:66:3: error: ‘int’ is not a class,
struct, or union type
NDN_CXX_ASSERT_DEFAULT_CONSTRUCTIBLE(typename X::ValueType);
^
/usr/local/include/ndn-cxx/lp/field.hpp:67:3: error: ‘int’ is not a class,
struct, or union type
BOOST_CONCEPT_ASSERT((boost::CopyConstructible<typename X::ValueType>));
^
../daemon/face/generic-link-service.cpp: In member function ‘void
nfd::face::GenericLinkService::encodeLpFields(const ndn::TagHost&,
ndn::lp::Packet&)’:
../daemon/face/generic-link-service.cpp:134:42: error: no matching function
for call to ‘ndn::lp::Packet::add(ndn::SimpleTag<long unsigned int,
1610612737>&)’
lpPacket.add<lp::GeoTagField>(*geoTag);
^
In file included from ../daemon/face/lp-fragmenter.hpp:31:0,
from ../daemon/face/generic-link-service.hpp:30,
from ../daemon/face/generic-link-service.cpp:26:
/usr/local/include/ndn-cxx/lp/packet.hpp:153:3: note: candidate:
template<class FIELD> ndn::lp::Packet& ndn::lp::Packet::add(const typename
FIELD::ValueType&)
add(const typename FIELD::ValueType& value)
^
/usr/local/include/ndn-cxx/lp/packet.hpp:153:3: note: template argument
deduction/substitution failed:
/usr/local/include/ndn-cxx/lp/packet.hpp: In substitution of
‘template<class FIELD> ndn::lp::Packet& ndn::lp::Packet::add(const typename
FIELD::ValueType&) [with FIELD = int]’:
../daemon/face/generic-link-service.cpp:134:42: required from here
/usr/local/include/ndn-cxx/lp/packet.hpp:153:3: error: ‘int’ is not a
class, struct, or union type
In file included from /usr/local/include/ndn-cxx/lp/field-decl.hpp:25:0,
from /usr/local/include/ndn-cxx/lp/fields.hpp:25,
from /usr/local/include/ndn-cxx/lp/packet.hpp:25,
from ../daemon/face/lp-fragmenter.hpp:31,
from ../daemon/face/generic-link-service.hpp:30,
from ../daemon/face/generic-link-service.cpp:26:
/usr/local/include/ndn-cxx/lp/field.hpp: In instantiation of
‘ndn::lp::Field<X>::~Field() [with X = int]’:
/usr/include/boost/concept/detail/general.hpp:38:28: required from
‘static void
boost::concepts::requirement<boost::concepts::failed************
Model::************>::failed() [with Model = ndn::lp::Field<int>]’
/usr/local/include/ndn-cxx/lp/fields.hpp:97:1: required from here
/usr/local/include/ndn-cxx/lp/field.hpp:72:27: error: ‘int’ is not a class,
struct, or union type
typename X::ValueType decoded = j.decode(wire);
^
/usr/local/include/ndn-cxx/lp/field.hpp:74:5: error: request for member
‘encode’ in ‘j’, which is of non-class type ‘int’
j.encode(enc, decoded);
^
/usr/local/include/ndn-cxx/lp/field.hpp:72:27: error: ‘int’ is not a class,
struct, or union type
typename X::ValueType decoded = j.decode(wire);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.lists.cs.ucla.edu/pipermail/nfd-dev/attachments/20170827/d2d37a37/attachment.html>
More information about the Nfd-dev
mailing list