blob: c3d7e5e2f2ff0eca17fc684af53ec3fac1fae930 [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"
Alexander Afanasyev98256102011-08-14 01:00:02 -070027#include "ns3/name-components.h"
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070028
29namespace ns3 {
30
Alexander Afanasyev98256102011-08-14 01:00:02 -070031class CcnxFace;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070032
33/**
34 * \ingroup ccnxRouting
35 *
36 *\brief Ccnx route cache entry (similar to Linux struct rtable)
37 *
38 * This is a reference counted object. In the future, we will add other
39 * entries from struct dst_entry, struct rtable, and struct dst_ops as needed.
40 */
41class CcnxRoute : public SimpleRefCount<CcnxRoute>
42{
43public:
44 CcnxRoute ();
45
46 /**
47 * \param dest Destination CcnxAddress
48 */
49 void SetPrefix (const Ptr<Name::Components> &dest);
50 /**
51 * \return Destination CcnxAddress of the route
52 */
53 const Name::Components& GetPrefix (void) const;
54
55 /**
56 * Equivalent in Linux to dst_entry.dev
57 *
58 * \param outputDevice pointer to NetDevice for outgoing packets
59 */
Alexander Afanasyev98256102011-08-14 01:00:02 -070060 void SetOutputFace (Ptr<CcnxFace> outputDevice);
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070061 /**
62 * \return pointer to NetDevice for outgoing packets
63 */
Alexander Afanasyev98256102011-08-14 01:00:02 -070064 Ptr<CcnxFace> GetOutputFace (void) const;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070065
66private:
67 Name::Components m_prefix;
Alexander Afanasyev98256102011-08-14 01:00:02 -070068 Ptr<CcnxFace> m_outputFace;
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070069};
70
71std::ostream& operator<< (std::ostream& os, CcnxRoute const& route);
72
Alexander Afanasyev08d984e2011-08-13 19:20:22 -070073} //namespace ns3
74
75#endif /* CCNX_ROUTE_H */