blob: c9d13577ef1cf115bcb19d730b37e3e1477e0a80 [file] [log] [blame]
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil -*- */
2/*
3 * Copyright (c) 2011 University of California, Los Angeles
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 */
20
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070021#ifndef _NDN_PIT_ENTRY_OUTGOING_FACE_H_
22#define _NDN_PIT_ENTRY_OUTGOING_FACE_H_
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070023
24#include "ns3/nstime.h"
25#include "ns3/ptr.h"
26
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070027#include "ns3/ndn-face.h"
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070028
29namespace ns3 {
30
31/**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070032 * \ingroup ndn
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070033 * \brief PIT state component for each outgoing interest
34 */
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070035struct NdnPitEntryOutgoingFace
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070036{
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070037 Ptr<NdnFace> m_face; ///< \brief face of the outgoing Interest
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070038 Time m_sendTime; ///< \brief time when the first outgoing interest is sent (for RTT measurements)
39 ///< \todo handle problem of retransmitted interests... Probably, we should include something similar
40 ///< to TimeStamp TCP option for retransmitted (i.e., only lost interests will suffer)
Alexander Afanasyev0a61c342011-12-06 12:48:55 -080041 uint32_t m_retxCount; ///< \brief number of retransmission
Alexander Afanasyev5a595072011-11-25 14:49:07 -080042 bool m_waitingInVain; ///< \brief when flag is set, we do not expect data for this interest, only a small hope that it will happen
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070043
44public:
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070045 /**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070046 * @brief Constructor to create NdnPitEntryOutgoingFace
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070047 * \param face face of the outgoing interest
48 */
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070049 NdnPitEntryOutgoingFace (Ptr<NdnFace> face);
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070050
Alexander Afanasyev0a61c342011-12-06 12:48:55 -080051 /**
52 * @brief Update outgoing entry upon retransmission
53 */
54 void
55 UpdateOnRetransmit ();
56
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070057 /**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070058 * @brief Compare to NdnPitEntryOutgoingFace
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070059 */
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070060 bool operator== (const NdnPitEntryOutgoingFace &dst) { return *m_face==*dst.m_face; }
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070061
62 /**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070063 * @brief Compare NdnPitEntryOutgoingFace with NdnFace
Alexander Afanasyevb4fee8b2012-06-06 12:54:26 -070064 */
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070065 bool operator== (Ptr<NdnFace> face) { return *m_face==*face; }
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070066
67 /**
68 * \brief Comparison operator used by boost::multi_index::identity<>
69 */
70 bool
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070071 operator< (const NdnPitEntryOutgoingFace &m) const { return *m_face < *(m.m_face); } // return identity of the face
Alexander Afanasyeva98cdd22011-08-29 17:32:37 -070072};
73
74
75} // namespace ns3
76
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070077#endif /* NDN_PIT_ENTRY_OUTGOING_FACE_H */