|
|
| 108 |
device->SetNode (this); |
108 |
device->SetNode (this); |
| 109 |
device->SetIfIndex(index); |
109 |
device->SetIfIndex(index); |
| 110 |
device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice, this)); |
110 |
device->SetReceiveCallback (MakeCallback (&Node::NonPromiscReceiveFromDevice, this)); |
|
|
111 |
Simulator::ScheduleWithContext (GetId (), Seconds (0.0), |
| 112 |
&NetDevice::Start, device); |
| 111 |
NotifyDeviceAdded (device); |
113 |
NotifyDeviceAdded (device); |
| 112 |
return index; |
114 |
return index; |
| 113 |
} |
115 |
} |
|
|
| 130 |
uint32_t index = m_applications.size (); |
132 |
uint32_t index = m_applications.size (); |
| 131 |
m_applications.push_back (application); |
133 |
m_applications.push_back (application); |
| 132 |
application->SetNode (this); |
134 |
application->SetNode (this); |
|
|
135 |
Simulator::ScheduleWithContext (GetId (), Seconds (0.0), |
| 136 |
&Application::Start, application); |
| 133 |
return index; |
137 |
return index; |
| 134 |
} |
138 |
} |
| 135 |
Ptr<Application> |
139 |
Ptr<Application> |
|
|
| 167 |
m_applications.clear (); |
171 |
m_applications.clear (); |
| 168 |
Object::DoDispose (); |
172 |
Object::DoDispose (); |
| 169 |
} |
173 |
} |
| 170 |
void |
|
|
| 171 |
Node::DoStart (void) |
| 172 |
{ |
| 173 |
for (std::vector<Ptr<NetDevice> >::iterator i = m_devices.begin (); |
| 174 |
i != m_devices.end (); i++) |
| 175 |
{ |
| 176 |
Ptr<NetDevice> device = *i; |
| 177 |
device->Start (); |
| 178 |
} |
| 179 |
for (std::vector<Ptr<Application> >::iterator i = m_applications.begin (); |
| 180 |
i != m_applications.end (); i++) |
| 181 |
{ |
| 182 |
Ptr<Application> application = *i; |
| 183 |
application->Start (); |
| 184 |
} |
| 185 |
|
| 186 |
Object::DoStart (); |
| 187 |
} |
| 188 |
|
174 |
|
| 189 |
void |
175 |
void |
| 190 |
Node::NotifyDeviceAdded (Ptr<NetDevice> device) |
176 |
Node::NotifyDeviceAdded (Ptr<NetDevice> device) |