|
1 #include "csma-helper.h" |
|
2 |
|
3 namespace ns3 { |
|
4 |
|
5 CsmaHelper::CsmaHelper () |
|
6 { |
|
7 m_queueFactory.SetTypeId ("DropTailQueue"); |
|
8 m_deviceFactory.SetTypeId ("CsmaNetDevice"); |
|
9 m_deviceChannel.SetTypeId ("CsmaChannel"); |
|
10 } |
|
11 |
|
12 void |
|
13 CsmaHelper::SetQueue (std::string type, |
|
14 std::string n1, PValue v1, |
|
15 std::string n2, PValue v2, |
|
16 std::string n3, PValue v3, |
|
17 std::string n4, PValue v4) |
|
18 { |
|
19 m_queueFactory.SetTypeId (type); |
|
20 m_queueFactory.Set (n1, v1); |
|
21 m_queueFactory.Set (n2, v2); |
|
22 m_queueFactory.Set (n3, v3); |
|
23 m_queueFactory.Set (n4, v4); |
|
24 } |
|
25 |
|
26 /** |
|
27 * Set these parameters on each PointToPointNetDevice created |
|
28 * by this helper. |
|
29 */ |
|
30 void |
|
31 CsmaHelper::SetDeviceParameter (std::string n1, PValue v1) |
|
32 { |
|
33 m_deviceFactory.Set (n1, v1); |
|
34 } |
|
35 |
|
36 void |
|
37 CsmaHelper::SetChannelParameter (std::string n1, PValue v1) |
|
38 { |
|
39 m_csmaFactory.Set (n1, v1); |
|
40 } |
|
41 |
|
42 NetDeviceContainer |
|
43 CsmaHelper::Build (const NodeContainer &c) |
|
44 { |
|
45 Ptr<CsmaChannel> channel = m_channelFactory.Create ()->GetObject<CsmaChannel> (); |
|
46 return Build (c, channel); |
|
47 } |
|
48 |
|
49 NetDeviceContainer |
|
50 CsmaHelper::Build (const NodeContainer &c, Ptr<CsmaChannel> channel) |
|
51 { |
|
52 for (NodeContainer::Iterator i = c.Begin (); i != c.End (); i++) |
|
53 { |
|
54 |
|
55 } |
|
56 } |
|
57 |
|
58 |
|
59 } // namespace ns3 |