author | Mathieu Lacage <mathieu.lacage@sophia.inria.fr> |
Thu, 13 Mar 2008 12:56:49 -0700 | |
changeset 2602 | d9262bff6df2 |
parent 1845 | 836f0c983165 |
permissions | -rw-r--r-- |
1844 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2007 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 |
||
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
19 |
#ifndef IPV4_BUS_NETWORK_H |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
20 |
#define IPV4_BUS_NETWORK_H |
1844 | 21 |
|
22 |
#include <list> |
|
23 |
#include "ns3/ptr.h" |
|
24 |
#include "ns3/node.h" |
|
25 |
#include "ns3/ipv4-address.h" |
|
26 |
#include "ns3/data-rate.h" |
|
27 |
#include "ns3/csma-channel.h" |
|
28 |
||
29 |
namespace ns3 { |
|
30 |
||
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
31 |
class Ipv4Network |
1844 | 32 |
{ |
33 |
public: |
|
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
34 |
Ipv4Network (Ipv4Address network, Ipv4Mask mask, Ipv4Address address); |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
35 |
virtual ~Ipv4Network (); |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
36 |
|
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
37 |
Ipv4Address m_network; |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
38 |
Ipv4Mask m_mask; |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
39 |
Ipv4Address m_baseAddress; |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
40 |
}; |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
41 |
|
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
42 |
class Ipv4BusNetwork : public Ipv4Network |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
43 |
{ |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
44 |
public: |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
45 |
Ipv4BusNetwork ( |
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
46 |
Ipv4Address network, |
1844 | 47 |
Ipv4Mask mask, |
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
48 |
Ipv4Address baseAddress, |
1844 | 49 |
DataRate bps, |
50 |
Time delay, |
|
51 |
uint32_t n); |
|
52 |
||
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
53 |
virtual ~Ipv4BusNetwork (); |
1844 | 54 |
|
55 |
Ptr<Node> GetNode (uint32_t n); |
|
56 |
||
57 |
private: |
|
58 |
std::vector<Ptr<Node> > m_nodes; |
|
59 |
Ptr<CsmaChannel> m_channel; |
|
60 |
}; |
|
61 |
||
62 |
}; // namespace ns3 |
|
63 |
||
1845
836f0c983165
improve obj design example
Craig Dowell <craigdo@ee.washington.edu>
parents:
1844
diff
changeset
|
64 |
#endif /* IPV4_BUS_NETWORK_H */ |