NullConvergenceLayer.cc

Go to the documentation of this file.
00001 /*
00002  *    Copyright 2006 Intel Corporation
00003  * 
00004  *    Licensed under the Apache License, Version 2.0 (the "License");
00005  *    you may not use this file except in compliance with the License.
00006  *    You may obtain a copy of the License at
00007  * 
00008  *        http://www.apache.org/licenses/LICENSE-2.0
00009  * 
00010  *    Unless required by applicable law or agreed to in writing, software
00011  *    distributed under the License is distributed on an "AS IS" BASIS,
00012  *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  *    See the License for the specific language governing permissions and
00014  *    limitations under the License.
00015  */
00016 
00017 
00018 #include "NullConvergenceLayer.h"
00019 #include "bundling/BundleDaemon.h"
00020 
00021 namespace dtn {
00022 
00026 bool
00027 NullConvergenceLayer::open_contact(const ContactRef& contact)
00028 {
00029     BundleDaemon::post(new ContactUpEvent(contact));
00030     return true;
00031 }
00032 
00033 void
00034 NullConvergenceLayer::send_bundle(const ContactRef& contact, Bundle* bundle)
00035 {
00036     BlockInfoVec* blocks = bundle->xmit_blocks_.find_blocks(contact->link());
00037     ASSERT(blocks != NULL);
00038     size_t total_len = BundleProtocol::total_length(blocks);
00039     
00040     log_debug("send_bundle *%p to *%p (total len %zu)",
00041               bundle, contact.object(), total_len);
00042     
00043     BundleDaemon::post(
00044         new BundleTransmittedEvent(bundle, contact,contact->link(),
00045                                    total_len, 0));
00046 }
00047 
00048 } // namespace dtn

Generated on Sat Sep 8 08:36:17 2007 for DTN Reference Implementation by  doxygen 1.5.3