aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport')
-rw-r--r--libtransport/src/hicn/transport/core/content_object.cc6
-rw-r--r--libtransport/src/hicn/transport/core/interest.cc5
-rw-r--r--libtransport/src/hicn/transport/core/packet.cc5
3 files changed, 14 insertions, 2 deletions
diff --git a/libtransport/src/hicn/transport/core/content_object.cc b/libtransport/src/hicn/transport/core/content_object.cc
index 107ab8567..764d753cd 100644
--- a/libtransport/src/hicn/transport/core/content_object.cc
+++ b/libtransport/src/hicn/transport/core/content_object.cc
@@ -33,6 +33,7 @@ namespace core {
ContentObject::ContentObject(const Name &name, Packet::Format format)
: Packet(format) {
+
if (TRANSPORT_EXPECT_FALSE(
hicn_data_set_name(format, packet_start_, name.getStructReference()) <
0)) {
@@ -46,8 +47,13 @@ ContentObject::ContentObject(const Name &name, Packet::Format format)
}
}
+#ifdef __ANDROID__
+ContentObject::ContentObject(hicn_format_t format)
+ : ContentObject(Name("0::0|0"), format) {}
+#else
ContentObject::ContentObject(hicn_format_t format)
: ContentObject(Packet::base_name, format) {}
+#endif
ContentObject::ContentObject(const Name &name, hicn_format_t format,
const uint8_t *payload, std::size_t size)
diff --git a/libtransport/src/hicn/transport/core/interest.cc b/libtransport/src/hicn/transport/core/interest.cc
index bd7b57422..e7d47d565 100644
--- a/libtransport/src/hicn/transport/core/interest.cc
+++ b/libtransport/src/hicn/transport/core/interest.cc
@@ -44,7 +44,12 @@ Interest::Interest(const Name &interest_name, Packet::Format format)
}
}
+
+#ifdef __ANDROID__
+Interest::Interest(hicn_format_t format) : Interest(Name("0::0|0"), format) {}
+#else
Interest::Interest(hicn_format_t format) : Interest(base_name, format) {}
+#endif
Interest::Interest(const uint8_t *buffer, std::size_t size)
: Packet(buffer, size) {
diff --git a/libtransport/src/hicn/transport/core/packet.cc b/libtransport/src/hicn/transport/core/packet.cc
index 954266664..04ec74660 100644
--- a/libtransport/src/hicn/transport/core/packet.cc
+++ b/libtransport/src/hicn/transport/core/packet.cc
@@ -29,7 +29,7 @@ namespace transport {
namespace core {
-const core::Name Packet::base_name("0::0|0");
+ const core::Name Packet::base_name("0::0|0");
Packet::Packet(Format format)
: packet_(utils::MemBuf::create(getHeaderSizeFromFormat(format, 256))
@@ -37,7 +37,8 @@ Packet::Packet(Format format)
packet_start_(reinterpret_cast<hicn_header_t *>(packet_->writableData())),
header_head_(packet_.get()),
payload_head_(nullptr),
- format_(format) {
+ format_(format){
+
if (hicn_packet_init_header(format, packet_start_) < 0) {
throw errors::RuntimeException("Unexpected error initializing the packet.");
}