aboutsummaryrefslogtreecommitdiffstats
path: root/libtransport/src/io_modules/loopback/local_face.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libtransport/src/io_modules/loopback/local_face.cc')
-rw-r--r--libtransport/src/io_modules/loopback/local_face.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/libtransport/src/io_modules/loopback/local_face.cc b/libtransport/src/io_modules/loopback/local_face.cc
index 7ef3f1a59..30a46c93b 100644
--- a/libtransport/src/io_modules/loopback/local_face.cc
+++ b/libtransport/src/io_modules/loopback/local_face.cc
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2021 Cisco and/or its affiliates.
+ * Copyright (c) 2021-2022 Cisco and/or its affiliates.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
@@ -57,12 +57,18 @@ Face &Face::operator=(Face &&other) {
void Face::onPacket(const Packet &packet) {
DLOG_IF(INFO, VLOG_IS_ON(3)) << "Sending content to local socket.";
- if (Packet::isInterest(packet.data())) {
- rescheduleOnIoService<Interest>(packet);
- } else {
- rescheduleOnIoService<ContentObject>(packet);
+ switch (packet->getFormat()) {
+ case HICN_PACKET_FORMAT_INTEREST:
+ rescheduleOnIoService<Interest>(packet);
+ break;
+ case HICN_PACKET_FORMAT_DATA:
+ rescheduleOnIoService<ContentObject>(packet);
+ break;
+ default:
+ /* Should not occur */
+ break;
}
}
} // namespace core
-} // namespace transport \ No newline at end of file
+} // namespace transport