OLD | NEW |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2005,2006,2007 INRIA | 3 * Copyright (c) 2005,2006,2007 INRIA |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 NS_LOG_FUNCTION (this << node); | 92 NS_LOG_FUNCTION (this << node); |
93 m_node = node; | 93 m_node = node; |
94 DoSetup (); | 94 DoSetup (); |
95 } | 95 } |
96 | 96 |
97 void· | 97 void· |
98 Ipv4Interface::SetDevice (Ptr<NetDevice> device) | 98 Ipv4Interface::SetDevice (Ptr<NetDevice> device) |
99 { | 99 { |
100 NS_LOG_FUNCTION (this << device); | 100 NS_LOG_FUNCTION (this << device); |
101 m_device = device; | 101 m_device = device; |
102 m_device->SetDeviceReadyCallback (MakeCallback (&Ipv4Interface::DeviceReady, t
his)); | 102 m_device->SetWakeCallback (MakeCallback (&Ipv4Interface::Wake, this)); |
103 DoSetup (); | 103 DoSetup (); |
104 } | 104 } |
105 | 105 |
106 void | 106 void |
107 Ipv4Interface::DeviceReady (Ptr<NetDevice> nd) | 107 Ipv4Interface::Wake (uint8_t queue) |
108 { | 108 { |
109 NS_LOG_FUNCTION (this << nd); | 109 NS_LOG_FUNCTION (this << queue); |
| 110 m_prioQueue->SetLastWake(queue); |
110 struct PriorityQueue::QueueElement q; | 111 struct PriorityQueue::QueueElement q; |
111 q = m_prioQueue->Dequeue (); | 112 q = m_prioQueue->Dequeue (); |
112 if (!q.p) | 113 if (!q.p) |
113 { | 114 { |
114 NS_LOG_LOGIC ("No packet to send"); | 115 NS_LOG_LOGIC ("No packet to send"); |
115 return; | 116 return; |
116 } | 117 } |
117 do | 118 do |
118 { | 119 { |
119 m_device->Send (q.p, q.dest, Ipv4L3Protocol::PROT_NUMBER); | 120 m_device->Send (q.p, q.dest, Ipv4L3Protocol::PROT_NUMBER); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 Ipv4InterfaceAddress ifAddr = *it; | 418 Ipv4InterfaceAddress ifAddr = *it; |
418 m_ifaddrs.erase(it); | 419 m_ifaddrs.erase(it); |
419 return ifAddr; | 420 return ifAddr; |
420 } | 421 } |
421 } | 422 } |
422 return Ipv4InterfaceAddress(); | 423 return Ipv4InterfaceAddress(); |
423 } | 424 } |
424 | 425 |
425 } // namespace ns3 | 426 } // namespace ns3 |
426 | 427 |
OLD | NEW |