blob: 0e6134ece28fb5fe9d5306266c6cead8654fdb0e [file] [log] [blame]
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Alexander Afanasyev98256102011-08-14 01:00:02 -07002/*
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
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070017 *
18 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
Alexander Afanasyev98256102011-08-14 01:00:02 -070019 */
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070020#ifndef CCNX_FORWARDING_STRATEGY_H
21#define CCNX_FORWARDING_STRATEGY_H
Alexander Afanasyev98256102011-08-14 01:00:02 -070022
23#include "ns3/packet.h"
24#include "ns3/callback.h"
25#include "ns3/object.h"
Alexander Afanasyev98256102011-08-14 01:00:02 -070026
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070027#include "ccnx.h"
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070028#include "ccnx-fib.h"
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070029
Alexander Afanasyev98256102011-08-14 01:00:02 -070030namespace ns3 {
31
Alexander Afanasyev98256102011-08-14 01:00:02 -070032class CcnxFace;
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070033class CcnxInterestHeader;
Alexander Afanasyev98256102011-08-14 01:00:02 -070034
35/**
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070036 * \ingroup ccnx
37 * \brief Abstract base class for Ccnx forwarding protocols
Alexander Afanasyev98256102011-08-14 01:00:02 -070038 */
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070039class CcnxForwardingStrategy : public Object
Alexander Afanasyev98256102011-08-14 01:00:02 -070040{
41public:
42 static TypeId GetTypeId (void);
43
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070044 CcnxForwardingStrategy (Ptr<CcnxFib> fib);
Alexander Afanasyev98256102011-08-14 01:00:02 -070045
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070046 typedef
47 Callback<void, const Ptr<CcnxFace> &, const Ptr<CcnxInterestHeader> &, const Ptr<Packet> &>
48 SendCallback;
Alexander Afanasyev98256102011-08-14 01:00:02 -070049
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070050 virtual bool PropagateInterest (const Ptr<CcnxFace> &incomingFace,
51 Ptr<CcnxInterestHeader> &header,
52 const Ptr<const Packet> &packet,
53 SendCallback ucb) = 0;
Alexander Afanasyev98256102011-08-14 01:00:02 -070054
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070055private:
56 Ptr<CcnxFib> m_fib; ///< \brief FIB
Alexander Afanasyev98256102011-08-14 01:00:02 -070057};
58
59} //namespace ns3
60
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070061#endif /* CCNX_FORWARDING_STRATEGY_H */