View | Details | Raw Unified | Return to bug 2622
Collapse All | Expand All

(-)a/src/internet/test/error-channel.cc (-153 lines)
 Lines 1-153    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2011 Universita' di Firenze, Italy
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
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
 */
20
#include "error-channel.h"
21
#include "ns3/simple-net-device.h"
22
#include "ns3/simulator.h"
23
#include "ns3/packet.h"
24
#include "ns3/node.h"
25
#include "ns3/log.h"
26
27
namespace ns3 {
28
29
NS_LOG_COMPONENT_DEFINE ("ErrorChannel");
30
31
NS_OBJECT_ENSURE_REGISTERED (ErrorChannel);
32
33
TypeId 
34
ErrorChannel::GetTypeId (void)
35
{
36
  static TypeId tid = TypeId ("ns3::ErrorChannel")
37
    .SetParent<Channel> ()
38
    .AddConstructor<ErrorChannel> ()
39
    ;
40
  return tid;
41
}
42
43
ErrorChannel::ErrorChannel ()
44
{
45
  jumping = false;
46
  jumpingState = 0;
47
}
48
49
void
50
ErrorChannel::SetJumpingTime(Time delay)
51
{
52
  jumpingTime = delay;
53
}
54
55
void
56
ErrorChannel::SetJumpingMode(bool mode)
57
{
58
  jumping = mode;
59
  jumpingState = 0;
60
}
61
62
void
63
ErrorChannel::Send (Ptr<Packet> p, uint16_t protocol,
64
                    Mac48Address to, Mac48Address from,
65
                    Ptr<SimpleNetDevice> sender)
66
{
67
  NS_LOG_FUNCTION (p << protocol << to << from << sender);
68
  for (std::vector<Ptr<SimpleNetDevice> >::const_iterator i = m_devices.begin (); i != m_devices.end (); ++i)
69
    {
70
      Ptr<SimpleNetDevice> tmp = *i;
71
      if (tmp == sender)
72
        {
73
          continue;
74
        }
75
      if( !jumping || jumpingState%2 )
76
        {
77
          Simulator::ScheduleWithContext (tmp->GetNode ()->GetId (), Seconds (0),
78
                                      &SimpleNetDevice::Receive, tmp, p->Copy (), protocol, to, from);
79
          jumpingState++;
80
        }
81
      else
82
        {
83
          Simulator::ScheduleWithContext (tmp->GetNode ()->GetId (), jumpingTime,
84
                                      &SimpleNetDevice::Receive, tmp, p->Copy (), protocol, to, from);
85
          jumpingState++;
86
        }
87
    }
88
}
89
90
void 
91
ErrorChannel::Add (Ptr<SimpleNetDevice> device)
92
{
93
  m_devices.push_back (device);
94
}
95
96
uint32_t 
97
ErrorChannel::GetNDevices (void) const
98
{
99
  return m_devices.size ();
100
}
101
Ptr<NetDevice> 
102
ErrorChannel::GetDevice (uint32_t i) const
103
{
104
  return m_devices[i];
105
}
106
107
NS_OBJECT_ENSURE_REGISTERED (BinaryErrorModel);
108
109
TypeId BinaryErrorModel::GetTypeId (void)
110
{
111
  static TypeId tid = TypeId ("ns3::BinaryErrorModel")
112
    .SetParent<ErrorModel> ()
113
    .AddConstructor<BinaryErrorModel> ()
114
    ;
115
  return tid;
116
}
117
118
BinaryErrorModel::BinaryErrorModel ()
119
{
120
  counter = 0;
121
}
122
123
BinaryErrorModel::~BinaryErrorModel ()
124
{
125
}
126
127
128
bool
129
BinaryErrorModel::DoCorrupt (Ptr<Packet> p)
130
{
131
  if (!IsEnabled ())
132
    {
133
      return false;
134
    }
135
  bool ret = counter%2;
136
  counter++;
137
  return ret;
138
}
139
140
void
141
BinaryErrorModel::Reset (void)
142
{
143
  DoReset();
144
}
145
146
void
147
BinaryErrorModel::DoReset (void)
148
{
149
  counter = 0;
150
}
151
152
153
} // namespace ns3
(-)a/src/internet/test/error-channel.h (-92 lines)
 Lines 1-92    Link Here 
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
 * Copyright (c) 2011 Universita' di Firenze, Italy
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
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
 */
20
#ifndef ERROR_CHANNEL_H
21
#define ERROR_CHANNEL_H
22
23
#include "ns3/simple-channel.h"
24
#include "ns3/error-model.h"
25
#include "ns3/mac48-address.h"
26
#include "ns3/nstime.h"
27
#include <vector>
28
29
namespace ns3 {
30
31
class SimpleNetDevice;
32
class Packet;
33
34
/**
35
 * \ingroup channel
36
 * \brief A Error channel, introducing deterministic delays on even/odd packets. Used for testing
37
 */
38
class ErrorChannel : public SimpleChannel
39
{
40
public:
41
  static TypeId GetTypeId (void);
42
  ErrorChannel ();
43
44
  virtual void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
45
                     Ptr<SimpleNetDevice> sender);
46
47
  virtual void Add (Ptr<SimpleNetDevice> device);
48
49
  // inherited from ns3::Channel
50
  virtual uint32_t GetNDevices (void) const;
51
  virtual Ptr<NetDevice> GetDevice (uint32_t i) const;
52
53
  /**
54
   * \brief Set the delay for the odd packets (even ones are not delayed)
55
   * \param delay Delay for the odd packets.
56
   */
57
  void SetJumpingTime(Time delay);
58
59
  /**
60
   * \brief Set if the odd packets are delayed (even ones are not delayed ever)
61
   * \param mode true if the odd packets should be delayed.
62
   */
63
void SetJumpingMode(bool mode);
64
65
private:
66
  std::vector<Ptr<SimpleNetDevice> > m_devices;
67
  Time jumpingTime;
68
  uint8_t jumpingState;
69
  bool jumping;
70
71
};
72
73
class BinaryErrorModel : public ErrorModel
74
{
75
public:
76
  static TypeId GetTypeId (void);
77
78
  BinaryErrorModel ();
79
  virtual ~BinaryErrorModel ();
80
  void Reset (void);
81
82
private:
83
  virtual bool DoCorrupt (Ptr<Packet> p);
84
  virtual void DoReset (void);
85
86
  uint8_t counter;
87
88
};
89
90
} // namespace ns3
91
92
#endif /* ERROR_CHANNEL_H */
(-)a/src/internet/test/ipv4-fragmentation-test.cc (-1 / +1 lines)
 Lines 28-34    Link Here 
28
#include "ns3/ipv4-raw-socket-factory.h"
28
#include "ns3/ipv4-raw-socket-factory.h"
29
#include "ns3/udp-socket-factory.h"
29
#include "ns3/udp-socket-factory.h"
30
#include "ns3/simulator.h"
30
#include "ns3/simulator.h"
31
#include "error-channel.h"
32
#include "ns3/simple-net-device.h"
31
#include "ns3/simple-net-device.h"
33
#include "ns3/simple-net-device-helper.h"
32
#include "ns3/simple-net-device-helper.h"
34
#include "ns3/socket.h"
33
#include "ns3/socket.h"
 Lines 46-51    Link Here 
46
#include "ns3/ipv4-static-routing.h"
45
#include "ns3/ipv4-static-routing.h"
47
#include "ns3/udp-l4-protocol.h"
46
#include "ns3/udp-l4-protocol.h"
48
#include "ns3/internet-stack-helper.h"
47
#include "ns3/internet-stack-helper.h"
48
#include "ns3/error-channel.h"
49
49
50
#include <string>
50
#include <string>
51
#include <limits>
51
#include <limits>
(-)a/src/internet/test/ipv6-fragmentation-test.cc (-1 / +1 lines)
 Lines 31-37    Link Here 
31
#include "ns3/ipv6-raw-socket-factory.h"
31
#include "ns3/ipv6-raw-socket-factory.h"
32
#include "ns3/udp-socket-factory.h"
32
#include "ns3/udp-socket-factory.h"
33
#include "ns3/simulator.h"
33
#include "ns3/simulator.h"
34
#include "error-channel.h"
35
#include "ns3/simple-net-device.h"
34
#include "ns3/simple-net-device.h"
36
#include "ns3/socket.h"
35
#include "ns3/socket.h"
37
#include "ns3/udp-socket.h"
36
#include "ns3/udp-socket.h"
 Lines 55-60    Link Here 
55
#include "ns3/ipv6-l3-protocol.h"
54
#include "ns3/ipv6-l3-protocol.h"
56
#include "ns3/icmpv6-l4-protocol.h"
55
#include "ns3/icmpv6-l4-protocol.h"
57
#include "ns3/traffic-control-layer.h"
56
#include "ns3/traffic-control-layer.h"
57
#include "ns3/error-channel.h"
58
58
59
#include <string>
59
#include <string>
60
#include <limits>
60
#include <limits>
(-)a/src/internet/wscript (-1 lines)
 Lines 232-238    Link Here 
232
        'test/ipv4-header-test.cc',
232
        'test/ipv4-header-test.cc',
233
        'test/ipv4-fragmentation-test.cc',
233
        'test/ipv4-fragmentation-test.cc',
234
        'test/ipv4-forwarding-test.cc',
234
        'test/ipv4-forwarding-test.cc',
235
        'test/error-channel.cc',
236
        'test/ipv4-test.cc',
235
        'test/ipv4-test.cc',
237
        'test/ipv4-static-routing-test-suite.cc',
236
        'test/ipv4-static-routing-test-suite.cc',
238
        'test/ipv4-global-routing-test-suite.cc',
237
        'test/ipv4-global-routing-test-suite.cc',
(-)a/src/sixlowpan/test/error-channel-sixlow.cc (-63 / +19 lines)
 Lines 17-84    Link Here 
17
 *
17
 *
18
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
 */
19
 */
20
#include "error-channel-sixlow.h"
20
21
#include "ns3/simple-net-device.h"
21
#include "ns3/simple-net-device.h"
22
#include "ns3/simulator.h"
22
#include "ns3/simulator.h"
23
#include "ns3/packet.h"
23
#include "ns3/packet.h"
24
#include "ns3/node.h"
24
#include "ns3/node.h"
25
#include "ns3/log.h"
25
#include "ns3/log.h"
26
#include "error-channel.h"
26
27
27
namespace ns3 {
28
namespace ns3 {
28
29
29
NS_LOG_COMPONENT_DEFINE ("ErrorChannelSixlow");
30
NS_LOG_COMPONENT_DEFINE ("ErrorChannel");
30
31
31
NS_OBJECT_ENSURE_REGISTERED (ErrorChannelSixlow);
32
NS_OBJECT_ENSURE_REGISTERED (ErrorChannel);
32
33
33
TypeId
34
TypeId
34
ErrorChannelSixlow::GetTypeId (void)
35
ErrorChannel::GetTypeId (void)
35
{
36
{
36
  static TypeId tid = TypeId ("ns3::ErrorChannelSixlow")
37
  static TypeId tid = TypeId ("ns3::ErrorChannel")
37
    .SetParent<SimpleChannel> ()
38
    .SetParent<SimpleChannel> ()
38
    .SetGroupName ("SixLowPan")
39
    .SetGroupName ("Network")
39
    .AddConstructor<ErrorChannelSixlow> ()
40
    .AddConstructor<ErrorChannel> ()
40
  ;
41
  ;
41
  return tid;
42
  return tid;
42
}
43
}
43
44
44
ErrorChannelSixlow::ErrorChannelSixlow ()
45
ErrorChannel::ErrorChannel ()
45
{
46
{
46
  m_jumpingTime = Seconds (0.5);
47
  m_jumpingTime = Seconds (0.5);
47
  m_jumping = false;
48
  m_jumping = false;
48
  m_jumpingState = 0;
49
  m_jumpingState = 0;
49
  m_duplicateTime = Seconds (0.1);
50
  m_duplicateTime = Seconds (0.1);
50
  m_duplicate = false;
51
  m_duplicate = false;
52
  m_duplicateState = 0;
51
}
53
}
52
54
53
void
55
void
54
ErrorChannelSixlow::SetJumpingTime (Time delay)
56
ErrorChannel::SetJumpingTime (Time delay)
55
{
57
{
56
  m_jumpingTime = delay;
58
  m_jumpingTime = delay;
57
}
59
}
58
60
59
void
61
void
60
ErrorChannelSixlow::SetJumpingMode (bool mode)
62
ErrorChannel::SetJumpingMode (bool mode)
61
{
63
{
62
  m_jumping = mode;
64
  m_jumping = mode;
63
  m_jumpingState = 0;
65
  m_jumpingState = 0;
64
}
66
}
65
67
66
void
68
void
67
ErrorChannelSixlow::SetDuplicateTime (Time delay)
69
ErrorChannel::SetDuplicateTime (Time delay)
68
{
70
{
69
  m_duplicateTime = delay;
71
  m_duplicateTime = delay;
70
}
72
}
71
73
72
void
74
void
73
ErrorChannelSixlow::SetDuplicateMode (bool mode)
75
ErrorChannel::SetDuplicateMode (bool mode)
74
{
76
{
75
  m_duplicate = mode;
77
  m_duplicate = mode;
76
  m_duplicateState = 0;
78
  m_duplicateState = 0;
77
}
79
}
78
80
79
80
void
81
void
81
ErrorChannelSixlow::Send (Ptr<Packet> p, uint16_t protocol,
82
ErrorChannel::Send (Ptr<Packet> p, uint16_t protocol,
82
                          Mac48Address to, Mac48Address from,
83
                          Mac48Address to, Mac48Address from,
83
                          Ptr<SimpleNetDevice> sender)
84
                          Ptr<SimpleNetDevice> sender)
84
{
85
{
 Lines 129-195    Link Here 
129
}
130
}
130
131
131
void
132
void
132
ErrorChannelSixlow::Add (Ptr<SimpleNetDevice> device)
133
ErrorChannel::Add (Ptr<SimpleNetDevice> device)
133
{
134
{
134
  m_devices.push_back (device);
135
  m_devices.push_back (device);
135
}
136
}
136
137
137
uint32_t
138
uint32_t
138
ErrorChannelSixlow::GetNDevices (void) const
139
ErrorChannel::GetNDevices (void) const
139
{
140
{
140
  return m_devices.size ();
141
  return m_devices.size ();
141
}
142
}
143
142
Ptr<NetDevice>
144
Ptr<NetDevice>
143
ErrorChannelSixlow::GetDevice (uint32_t i) const
145
ErrorChannel::GetDevice (uint32_t i) const
144
{
146
{
145
  return m_devices[i];
147
  return m_devices[i];
146
}
148
}
147
149
148
NS_OBJECT_ENSURE_REGISTERED (BinaryErrorSixlowModel);
149
150
TypeId BinaryErrorSixlowModel::GetTypeId (void)
151
{
152
  static TypeId tid = TypeId ("ns3::BinaryErrorSixlowModel")
153
    .SetParent<ErrorModel> ()
154
    .SetGroupName ("SixLowPan")
155
    .AddConstructor<BinaryErrorSixlowModel> ()
156
  ;
157
  return tid;
158
}
159
160
BinaryErrorSixlowModel::BinaryErrorSixlowModel ()
161
{
162
  m_counter = 0;
163
}
164
165
BinaryErrorSixlowModel::~BinaryErrorSixlowModel ()
166
{
167
}
168
169
170
bool
171
BinaryErrorSixlowModel::DoCorrupt (Ptr<Packet> p)
172
{
173
  if (!IsEnabled ())
174
    {
175
      return false;
176
    }
177
  bool ret = m_counter % 2;
178
  m_counter++;
179
  return ret;
180
}
181
182
void
183
BinaryErrorSixlowModel::Reset (void)
184
{
185
  DoReset ();
186
}
187
188
void
189
BinaryErrorSixlowModel::DoReset (void)
190
{
191
  m_counter = 0;
192
}
193
194
150
195
} // namespace ns3
151
} // namespace ns3
(-)a/src/sixlowpan/test/error-channel-sixlow.h (-29 / +17 lines)
 Lines 17-24    Link Here 
17
 *
17
 *
18
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
18
 * Author: Tommaso Pecorella <tommaso.pecorella@unifi.it>
19
 */
19
 */
20
#ifndef ERROR_CHANNEL_SIXLOW_H
20
#ifndef ERROR_CHANNEL_H
21
#define ERROR_CHANNEL_SIXLOW_H
21
#define ERROR_CHANNEL_H
22
22
23
#include "ns3/channel.h"
23
#include "ns3/channel.h"
24
#include "ns3/simple-channel.h"
24
#include "ns3/simple-channel.h"
 Lines 36-47    Link Here 
36
 * \ingroup channel
36
 * \ingroup channel
37
 * \brief A Error channel, introducing deterministic delays on even/odd packets. Used for testing
37
 * \brief A Error channel, introducing deterministic delays on even/odd packets. Used for testing
38
 */
38
 */
39
class ErrorChannelSixlow : public SimpleChannel
39
class ErrorChannel : public SimpleChannel
40
{
40
{
41
public:
41
public:
42
  /**
43
   * \brief Get the type ID.
44
   * \return the object TypeId
45
   */
42
  static TypeId GetTypeId (void);
46
  static TypeId GetTypeId (void);
43
  ErrorChannelSixlow ();
47
  ErrorChannel ();
44
48
49
  // inherited from ns3::SimpleChannel
45
  virtual void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
50
  virtual void Send (Ptr<Packet> p, uint16_t protocol, Mac48Address to, Mac48Address from,
46
                     Ptr<SimpleNetDevice> sender);
51
                     Ptr<SimpleNetDevice> sender);
47
52
 Lines 76-107    Link Here 
76
  void SetDuplicateMode (bool mode);
81
  void SetDuplicateMode (bool mode);
77
82
78
private:
83
private:
79
  std::vector<Ptr<SimpleNetDevice> > m_devices;
84
  std::vector<Ptr<SimpleNetDevice> > m_devices; //!< devices connected by the channel
80
  Time m_jumpingTime;
85
  Time m_jumpingTime;       //!< Delay time in Jumping mode.
81
  uint8_t m_jumpingState;
86
  uint8_t m_jumpingState;   //!< Counter for even/odd packets in Jumping mode.
82
  bool m_jumping;
87
  bool m_jumping;           //!< Flag for Jumping mode.
83
  Time m_duplicateTime;
88
  Time m_duplicateTime;     //!< Duplicate time in Duplicate mode.
84
  bool m_duplicate;
89
  bool m_duplicate;         //!< Flag for Duplicate mode.
85
  uint8_t m_duplicateState;
90
  uint8_t m_duplicateState; //!< Counter for even/odd packets in Duplicate mode.
86
};
87
88
class BinaryErrorSixlowModel : public ErrorModel
89
{
90
public:
91
  static TypeId GetTypeId (void);
92
93
  BinaryErrorSixlowModel ();
94
  virtual ~BinaryErrorSixlowModel ();
95
  void Reset (void);
96
97
private:
98
  virtual bool DoCorrupt (Ptr<Packet> p);
99
  virtual void DoReset (void);
100
101
  uint8_t m_counter;
102
103
};
91
};
104
92
105
} // namespace ns3
93
} // namespace ns3
106
94
107
#endif /* ERROR_CHANNEL_SIXLOW_H */
95
#endif /* ERROR_CHANNEL_H */
(-)a/src/network/utils/error-model.cc (+45 lines)
 Lines 551-555    Link Here 
551
}
551
}
552
552
553
553
554
NS_OBJECT_ENSURE_REGISTERED (BinaryErrorModel);
555
556
TypeId BinaryErrorModel::GetTypeId (void)
557
{
558
  static TypeId tid = TypeId ("ns3::BinaryErrorModel")
559
    .SetParent<ErrorModel> ()
560
    .AddConstructor<BinaryErrorModel> ()
561
    ;
562
  return tid;
563
}
564
565
BinaryErrorModel::BinaryErrorModel ()
566
{
567
  NS_LOG_FUNCTION (this);
568
  m_counter = 0;
569
}
570
571
BinaryErrorModel::~BinaryErrorModel ()
572
{
573
  NS_LOG_FUNCTION (this);
574
}
575
576
bool
577
BinaryErrorModel::DoCorrupt (Ptr<Packet> p)
578
{
579
  NS_LOG_FUNCTION (this);
580
  if (!IsEnabled ())
581
    {
582
      return false;
583
    }
584
  bool ret = m_counter%2;
585
  m_counter++;
586
  return ret;
587
}
588
589
void
590
BinaryErrorModel::DoReset (void)
591
{
592
  NS_LOG_FUNCTION (this);
593
  m_counter = 0;
594
}
595
596
597
598
554
} // namespace ns3
599
} // namespace ns3
555
600
(-)a/src/network/utils/error-model.h (+18 lines)
 Lines 459-464    Link Here 
459
459
460
};
460
};
461
461
462
/**
463
 * \brief The simplest error model, corrupts even packets and does not corrupt odd ones.
464
 */
465
class BinaryErrorModel : public ErrorModel
466
{
467
public:
468
  static TypeId GetTypeId (void);
469
470
  BinaryErrorModel ();
471
  virtual ~BinaryErrorModel ();
472
473
private:
474
  virtual bool DoCorrupt (Ptr<Packet> p);
475
  virtual void DoReset (void);
476
477
  uint8_t m_counter; //!< internal state counter.
478
479
};
462
480
463
} // namespace ns3
481
} // namespace ns3
464
#endif
482
#endif
(-)a/src/network/wscript (+2 lines)
 Lines 29-34    Link Here 
29
        'utils/data-rate.cc',
29
        'utils/data-rate.cc',
30
        'utils/drop-tail-queue.cc',
30
        'utils/drop-tail-queue.cc',
31
        'utils/dynamic-queue-limits.cc',
31
        'utils/dynamic-queue-limits.cc',
32
        'utils/error-channel.cc',
32
        'utils/error-model.cc',
33
        'utils/error-model.cc',
33
        'utils/ethernet-header.cc',
34
        'utils/ethernet-header.cc',
34
        'utils/ethernet-trailer.cc',
35
        'utils/ethernet-trailer.cc',
 Lines 112-117    Link Here 
112
        'utils/data-rate.h',
113
        'utils/data-rate.h',
113
        'utils/drop-tail-queue.h',
114
        'utils/drop-tail-queue.h',
114
        'utils/dynamic-queue-limits.h',
115
        'utils/dynamic-queue-limits.h',
116
        'utils/error-channel.h',
115
        'utils/error-model.h',
117
        'utils/error-model.h',
116
        'utils/ethernet-header.h',
118
        'utils/ethernet-header.h',
117
        'utils/ethernet-trailer.h',
119
        'utils/ethernet-trailer.h',
(-)a/src/sixlowpan/test/sixlowpan-fragmentation-test.cc (-4 / +4 lines)
 Lines 24-30    Link Here 
24
#include "ns3/ipv6-raw-socket-factory.h"
24
#include "ns3/ipv6-raw-socket-factory.h"
25
#include "ns3/udp-socket-factory.h"
25
#include "ns3/udp-socket-factory.h"
26
#include "ns3/simulator.h"
26
#include "ns3/simulator.h"
27
#include "error-channel-sixlow.h"
28
#include "ns3/simple-net-device.h"
27
#include "ns3/simple-net-device.h"
29
#include "ns3/socket.h"
28
#include "ns3/socket.h"
30
#include "ns3/udp-socket.h"
29
#include "ns3/udp-socket.h"
 Lines 37-42    Link Here 
37
#include "ns3/sixlowpan-net-device.h"
36
#include "ns3/sixlowpan-net-device.h"
38
#include "ns3/internet-stack-helper.h"
37
#include "ns3/internet-stack-helper.h"
39
#include "ns3/icmpv6-l4-protocol.h"
38
#include "ns3/icmpv6-l4-protocol.h"
39
#include "ns3/error-channel.h"
40
40
41
#include <string>
41
#include <string>
42
#include <limits>
42
#include <limits>
 Lines 271-277    Link Here 
271
  Ptr<Node> serverNode = CreateObject<Node> ();
271
  Ptr<Node> serverNode = CreateObject<Node> ();
272
  internet.Install (serverNode);
272
  internet.Install (serverNode);
273
  Ptr<SimpleNetDevice> serverDev;
273
  Ptr<SimpleNetDevice> serverDev;
274
  Ptr<BinaryErrorSixlowModel> serverDevErrorModel = CreateObject<BinaryErrorSixlowModel> ();
274
  Ptr<BinaryErrorModel> serverDevErrorModel = CreateObject<BinaryErrorModel> ();
275
  {
275
  {
276
    Ptr<Icmpv6L4Protocol> icmpv6l4 = serverNode->GetObject<Icmpv6L4Protocol> ();
276
    Ptr<Icmpv6L4Protocol> icmpv6l4 = serverNode->GetObject<Icmpv6L4Protocol> ();
277
    icmpv6l4->SetAttribute ("DAD", BooleanValue (false));
277
    icmpv6l4->SetAttribute ("DAD", BooleanValue (false));
 Lines 302-308    Link Here 
302
  Ptr<Node> clientNode = CreateObject<Node> ();
302
  Ptr<Node> clientNode = CreateObject<Node> ();
303
  internet.Install (clientNode);
303
  internet.Install (clientNode);
304
  Ptr<SimpleNetDevice> clientDev;
304
  Ptr<SimpleNetDevice> clientDev;
305
  Ptr<BinaryErrorSixlowModel> clientDevErrorModel = CreateObject<BinaryErrorSixlowModel> ();
305
  Ptr<BinaryErrorModel> clientDevErrorModel = CreateObject<BinaryErrorModel> ();
306
  {
306
  {
307
    Ptr<Icmpv6L4Protocol> icmpv6l4 = clientNode->GetObject<Icmpv6L4Protocol> ();
307
    Ptr<Icmpv6L4Protocol> icmpv6l4 = clientNode->GetObject<Icmpv6L4Protocol> ();
308
    icmpv6l4->SetAttribute ("DAD", BooleanValue (false));
308
    icmpv6l4->SetAttribute ("DAD", BooleanValue (false));
 Lines 329-335    Link Here 
329
  StartClient (clientNode);
329
  StartClient (clientNode);
330
330
331
  // link the two nodes
331
  // link the two nodes
332
  Ptr<ErrorChannelSixlow> channel = CreateObject<ErrorChannelSixlow> ();
332
  Ptr<ErrorChannel> channel = CreateObject<ErrorChannel> ();
333
  serverDev->SetChannel (channel);
333
  serverDev->SetChannel (channel);
334
  clientDev->SetChannel (channel);
334
  clientDev->SetChannel (channel);
335
335
(-)a/src/sixlowpan/wscript (-1 lines)
 Lines 13-19    Link Here 
13
    module_test.source = [
13
    module_test.source = [
14
        'test/sixlowpan-hc1-test.cc',
14
        'test/sixlowpan-hc1-test.cc',
15
        'test/sixlowpan-iphc-test.cc',
15
        'test/sixlowpan-iphc-test.cc',
16
        'test/error-channel-sixlow.cc',
17
        'test/sixlowpan-fragmentation-test.cc',
16
        'test/sixlowpan-fragmentation-test.cc',
18
        
17
        
19
        ]
18
        ]

Return to bug 2622