Hybrid ICN (hICN) plugin  v21.06-rc0-4-g18fa668
rtc_reassembly.h
1 /*
2  * Copyright (c) 2017-2019 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include <glog/logging.h>
19 #include <protocols/datagram_reassembly.h>
20 #include <protocols/rtc/rtc_consts.h>
21 
22 namespace transport {
23 
24 namespace protocol {
25 
26 namespace rtc {
27 
29  public:
31  TransportProtocol *transport_protocol)
32  : DatagramReassembly(icn_socket, transport_protocol) {}
33 
34  void reassemble(core::ContentObject &content_object) override {
35  auto read_buffer = content_object.getPayload();
36  DLOG_IF(INFO, VLOG_IS_ON(3))
37  << "Size of payload: " << read_buffer->length();
38  read_buffer->trimStart(transport_protocol_->transportHeaderLength());
39  Reassembly::read_buffer_ = std::move(read_buffer);
41  }
42 };
43 
44 } // namespace rtc
45 } // namespace protocol
46 } // end namespace transport
transport::interface::ConsumerSocket
Main interface for consumer applications.
Definition: socket_consumer.h:48
transport::protocol::Reassembly::notifyApplication
virtual void notifyApplication()
transport::core::ContentObject
Definition: content_object.h:29
transport::protocol::DatagramReassembly
Definition: datagram_reassembly.h:24
transport
Definition: forwarder_config.h:32
transport::protocol::rtc::RtcReassembly
Definition: rtc_reassembly.h:28
transport::protocol::TransportProtocol
Definition: transport_protocol.h:41
transport::protocol::rtc::RtcReassembly::reassemble
void reassemble(core::ContentObject &content_object) override
Definition: rtc_reassembly.h:34
transport::protocol::TransportProtocol::transportHeaderLength
virtual std::size_t transportHeaderLength()
Get the size of any additional header added by the specific transport implementation.
Definition: transport_protocol.h:67