author | Lalith Suresh <suresh.lalith@gmail.com> |
Sun, 18 Jul 2010 13:29:13 +0530 | |
changeset 6339 | 366418369bda |
parent 3311 | e7abba228145 |
permissions | -rw-r--r-- |
3311
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
2 |
/* |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
3 |
* Copyright (c) 2008 INRIA |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
4 |
* |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
7 |
* published by the Free Software Foundation; |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
8 |
* |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
12 |
* GNU General Public License for more details. |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
13 |
* |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
17 |
* |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
18 |
* Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
19 |
*/ |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
20 |
#ifndef SIMPLE_CHANNEL_H |
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
21 |
#define SIMPLE_CHANNEL_H |
2673
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
#include "channel.h" |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "mac48-address.h" |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
25 |
#include <vector> |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
29 |
class SimpleNetDevice; |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
30 |
class Packet; |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
31 |
|
3183 | 32 |
/** |
33 |
* \ingroup channel |
|
34 |
* \brief A simple channel, for simple things and testing |
|
35 |
*/ |
|
2673
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
36 |
class SimpleChannel : public Channel |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
37 |
{ |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
public: |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
static TypeId GetTypeId (void); |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
40 |
SimpleChannel (); |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
41 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
42 |
void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from, |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
43 |
Ptr<SimpleNetDevice> sender); |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
45 |
void Add (Ptr<SimpleNetDevice> device); |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
|
3311
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
47 |
// inherited from ns3::Channel |
2673
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
virtual uint32_t GetNDevices (void) const; |
2720
3c7d9f8c9034
make ns3::Channel wholy pure.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2673
diff
changeset
|
49 |
virtual Ptr<NetDevice> GetDevice (uint32_t i) const; |
2673
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
private: |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
std::vector<Ptr<SimpleNetDevice> > m_devices; |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
}; |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
54 |
|
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
55 |
} // namespace ns3 |
a70e0c7aaf56
SimpleChannel/SimpleNetDevice. Use them where needed.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
56 |
|
3311
e7abba228145
add small comment, fix typo, add missing copyright statement
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
3183
diff
changeset
|
57 |
#endif /* SIMPLE_CHANNEL_H */ |