blob: cdf9576b3bf28a023bafb474b7db257256acb490 [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/*
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -07003 * Copyright (c) 2011 University of California, Los Angeles
Alexander Afanasyev98256102011-08-14 01:00:02 -07004 *
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 *
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -070018 * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 * Ilya Moiseenko <iliamo@cs.ucla.edu>
Alexander Afanasyev98256102011-08-14 01:00:02 -070020 */
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070021#ifndef CCNX_FORWARDING_STRATEGY_H
22#define CCNX_FORWARDING_STRATEGY_H
Alexander Afanasyev98256102011-08-14 01:00:02 -070023
24#include "ns3/packet.h"
25#include "ns3/callback.h"
26#include "ns3/object.h"
Alexander Afanasyev98256102011-08-14 01:00:02 -070027
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070028#include "ccnx.h"
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070029#include "ccnx-fib.h"
Ilya Moiseenkoea27f4e2011-10-28 13:19:07 -070030#include "ccnx-pit.h"
31#include "ccnx-pit-entry.h"
Alexander Afanasyev45b92d42011-08-14 23:11:38 -070032
Alexander Afanasyev98256102011-08-14 01:00:02 -070033namespace ns3 {
34
Alexander Afanasyev98256102011-08-14 01:00:02 -070035class CcnxFace;
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070036class CcnxInterestHeader;
Alexander Afanasyev98256102011-08-14 01:00:02 -070037
38/**
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070039 * \ingroup ccnx
40 * \brief Abstract base class for Ccnx forwarding protocols
Alexander Afanasyev98256102011-08-14 01:00:02 -070041 */
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070042class CcnxForwardingStrategy : public Object
Alexander Afanasyev98256102011-08-14 01:00:02 -070043{
44public:
45 static TypeId GetTypeId (void);
46
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -070047 CcnxForwardingStrategy ();
Alexander Afanasyev4fa5e842011-11-21 13:38:39 -080048 virtual ~CcnxForwardingStrategy ();
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -070049
Alexander Afanasyev4fa5e842011-11-21 13:38:39 -080050 void
51 SetPit (Ptr<CcnxPit> pit);
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -070052
Alexander Afanasyevcf133f02011-09-06 12:13:48 -070053 typedef
54 Callback<void, const Ptr<CcnxFace> &, const Ptr<CcnxInterestHeader> &, const Ptr<Packet> &>
55 SendCallback;
Alexander Afanasyev98256102011-08-14 01:00:02 -070056
Alexander Afanasyev4fa5e842011-11-21 13:38:39 -080057 virtual bool
58 PropagateInterest (CcnxPitEntryContainer::type::iterator pitEntry,
59 CcnxFibEntryContainer::type::iterator fibEntry,
60 const Ptr<CcnxFace> &incomingFace,
61 Ptr<CcnxInterestHeader> &header,
62 const Ptr<const Packet> &packet,
63 SendCallback ucb) = 0;
Ilya Moiseenkoea27f4e2011-10-28 13:19:07 -070064 Ptr<CcnxPit> GetPit();
Ilya Moiseenko25f7d4d2011-09-29 18:41:06 -070065
66private:
Ilya Moiseenkoea27f4e2011-10-28 13:19:07 -070067 Ptr<CcnxPit> m_pit;
Alexander Afanasyev98256102011-08-14 01:00:02 -070068};
69
70} //namespace ns3
71
Alexander Afanasyevc74a6022011-08-15 20:01:35 -070072#endif /* CCNX_FORWARDING_STRATEGY_H */