|
57 |
NS_OBJECT_ENSURE_REGISTERED (EmuNetDevice); |
57 |
NS_OBJECT_ENSURE_REGISTERED (EmuNetDevice); |
58 |
|
58 |
|
59 |
#define EMU_MAGIC 65867 |
59 |
#define EMU_MAGIC 65867 |
60 |
#define MAX_PENDING_READS 8 |
|
|
61 |
|
60 |
|
62 |
|
61 |
|
63 |
TypeId |
62 |
TypeId |
|
109 |
MakePointerAccessor (&EmuNetDevice::m_queue), |
108 |
MakePointerAccessor (&EmuNetDevice::m_queue), |
110 |
MakePointerChecker<Queue> ()) |
109 |
MakePointerChecker<Queue> ()) |
111 |
|
110 |
|
|
|
111 |
.AddAttribute ("RxQueueSize", "Maximum size of the read queue. " |
112 |
"This value limits number of packets that have been read " |
113 |
"from the network into a memory buffer but have not yet " |
114 |
"been processed by the simulator.", |
115 |
UintegerValue (1000), |
116 |
MakeUintegerAccessor (&EmuNetDevice::m_maxPendingReads), |
117 |
MakeUintegerChecker<uint32_t> ()) |
118 |
|
112 |
// |
119 |
// |
113 |
// Trace sources at the "top" of the net device, where packets transition |
120 |
// Trace sources at the "top" of the net device, where packets transition |
114 |
// to/from higher layers. These points do not really correspond to the |
121 |
// to/from higher layers. These points do not really correspond to the |
|
772 |
{ |
779 |
{ |
773 |
CriticalSection cs (m_pendingReadMutex); |
780 |
CriticalSection cs (m_pendingReadMutex); |
774 |
//std::cerr << std::endl << "EmuNetDevice read thread: m_pendingReadCount is " << m_pendingReadCount << std::endl; |
781 |
//std::cerr << std::endl << "EmuNetDevice read thread: m_pendingReadCount is " << m_pendingReadCount << std::endl; |
775 |
if (m_pendingReadCount >= MAX_PENDING_READS) |
782 |
if (m_pendingReadCount >= m_maxPendingReads) |
776 |
{ |
783 |
{ |
777 |
skip = true; |
784 |
skip = true; |
778 |
} |
785 |
} |