173 * The dispose method. Subclasses must override this method |
174 * The dispose method. Subclasses must override this method |
174 * and must chain up to it by calling Node::DoDispose at the |
175 * and must chain up to it by calling Node::DoDispose at the |
175 * end of their own DoDispose method. |
176 * end of their own DoDispose method. |
176 */ |
177 */ |
177 virtual void DoDispose (void); |
178 virtual void DoDispose (void); |
|
179 /** |
|
180 * \param resolver the resolver to store trace sources in. |
|
181 * |
|
182 * If a subclass wants to add new traces to a Node, it needs |
|
183 * to override this method and record the new trace sources |
|
184 * in the input resolver. Subclasses also _must_ chain up to |
|
185 * their parent's DoFillTraceResolver method prior |
|
186 * to recording they own trace sources. |
|
187 */ |
|
188 virtual void DoFillTraceResolver (CompositeTraceResolver &resolver); |
178 private: |
189 private: |
179 /** |
|
180 * \param context the trace context |
|
181 * \returns a trace resolver to the user. The user must delete it. |
|
182 * |
|
183 * Subclasses must implement this method. |
|
184 */ |
|
185 virtual TraceResolver *DoCreateTraceResolver (TraceContext const &context); |
|
186 /** |
190 /** |
187 * \param device the device added to this Node. |
191 * \param device the device added to this Node. |
188 * |
192 * |
189 * This method is invoked whenever a user calls Node::AddDevice. |
193 * This method is invoked whenever a user calls Node::AddDevice. |
190 * Subclasses are expected to call NetDevice::SetReceiveCallback |
194 * Subclasses are expected to call NetDevice::SetReceiveCallback |
194 virtual void NotifyDeviceAdded (Ptr<NetDevice> device); |
198 virtual void NotifyDeviceAdded (Ptr<NetDevice> device); |
195 |
199 |
196 bool ReceiveFromDevice (Ptr<NetDevice> device, const Packet &packet, |
200 bool ReceiveFromDevice (Ptr<NetDevice> device, const Packet &packet, |
197 uint16_t protocol, const Address &from); |
201 uint16_t protocol, const Address &from); |
198 void Construct (void); |
202 void Construct (void); |
199 |
203 TraceResolver *CreateDevicesTraceResolver (const TraceContext &context); |
|
204 |
|
205 enum TraceSource { |
|
206 DEVICES |
|
207 }; |
200 struct ProtocolHandlerEntry { |
208 struct ProtocolHandlerEntry { |
201 ProtocolHandler handler; |
209 ProtocolHandler handler; |
202 uint16_t protocol; |
210 uint16_t protocol; |
203 Ptr<NetDevice> device; |
211 Ptr<NetDevice> device; |
204 }; |
212 }; |