Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 1 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2011 UCLA |
| 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 | |
| 21 | #ifndef CCNX_PATH_WEIGHT_TRACER_H |
| 22 | #define CCNX_PATH_WEIGHT_TRACER_H |
| 23 | |
| 24 | #include "ns3/ptr.h" |
| 25 | #include "ns3/simple-ref-count.h" |
| 26 | #include "ns3/ccnx-path-stretch-tag.h" |
| 27 | #include <list> |
| 28 | |
| 29 | namespace ns3 { |
| 30 | |
| 31 | class Node; |
| 32 | class Packet; |
| 33 | class CcnxApp; |
| 34 | |
| 35 | class CcnxPathWeightTracer : public SimpleRefCount<CcnxPathWeightTracer> |
| 36 | { |
| 37 | public: |
Alexander Afanasyev | 8e0d281 | 2012-01-19 22:38:14 -0800 | [diff] [blame] | 38 | CcnxPathWeightTracer (std::ostream &os, Ptr<Node> node); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 39 | virtual ~CcnxPathWeightTracer () { }; |
| 40 | |
| 41 | void |
| 42 | Connect (); |
| 43 | |
Alexander Afanasyev | 6bff0df | 2012-01-19 17:51:52 -0800 | [diff] [blame] | 44 | static void |
| 45 | PrintHeader (std::ostream &os); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * \brief Process packet weight upon reception of packet on a local face |
| 49 | */ |
| 50 | virtual void |
| 51 | InLocalFace (std::string context, |
Alexander Afanasyev | 6bff0df | 2012-01-19 17:51:52 -0800 | [diff] [blame] | 52 | Ptr<Node> src, Ptr<Node> dst, uint32_t seqno, uint32_t weight); |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 53 | |
| 54 | protected: |
| 55 | std::ostream &m_os; |
| 56 | std::string m_node; |
| 57 | Ptr<Node> m_nodePtr; |
Alexander Afanasyev | e9c9d72 | 2012-01-19 16:59:30 -0800 | [diff] [blame] | 58 | }; |
| 59 | |
| 60 | } // namespace ns3 |
| 61 | |
| 62 | #endif // CCNX_PATH_WEIGHT_TRACER_H |