blob: 950233075b5bb3b92657a0bdb9b873a1ef9481d4 [file] [log] [blame]
Alexander Afanasyev08d984e2011-08-13 19:20:22 -07001/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2009 University of Washington
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 */
19#ifndef CCNX_ROUTE_H
20#define CCNX_ROUTE_H
21
22#include <list>
23#include <map>
24#include <ostream>
25
26#include "ns3/simple-ref-count.h"
27
28namespace ns3 {
29
30class NetDevice;
31
32/**
33 * \ingroup ccnxRouting
34 *
35 *\brief Ccnx route cache entry (similar to Linux struct rtable)
36 *
37 * This is a reference counted object. In the future, we will add other
38 * entries from struct dst_entry, struct rtable, and struct dst_ops as needed.
39 */
40class CcnxRoute : public SimpleRefCount<CcnxRoute>
41{
42public:
43 CcnxRoute ();
44
45 /**
46 * \param dest Destination CcnxAddress
47 */
48 void SetPrefix (const Ptr<Name::Components> &dest);
49 /**
50 * \return Destination CcnxAddress of the route
51 */
52 const Name::Components& GetPrefix (void) const;
53
54 /**
55 * Equivalent in Linux to dst_entry.dev
56 *
57 * \param outputDevice pointer to NetDevice for outgoing packets
58 */
59 void SetOutputDevice (Ptr<NetDevice> outputDevice);
60 /**
61 * \return pointer to NetDevice for outgoing packets
62 */
63 Ptr<NetDevice> GetOutputDevice (void) const;
64
65private:
66 Name::Components m_prefix;
67 Ptr<NetDevice> m_outputDevice;
68};
69
70std::ostream& operator<< (std::ostream& os, CcnxRoute const& route);
71
72} //namespace NDNabstraction
73} //namespace ns3
74
75#endif /* CCNX_ROUTE_H */