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) 2008 INRIA | 3 * Copyright (c) 2008 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 18 matching lines...) Expand all Loading... |
29 #include "ns3/event-id.h" | 29 #include "ns3/event-id.h" |
30 | 30 |
31 #include "mac48-address.h" | 31 #include "mac48-address.h" |
32 | 32 |
33 namespace ns3 { | 33 namespace ns3 { |
34 | 34 |
35 template <typename Item> class Queue; | 35 template <typename Item> class Queue; |
36 class SimpleChannel; | 36 class SimpleChannel; |
37 class Node; | 37 class Node; |
38 class ErrorModel; | 38 class ErrorModel; |
| 39 class NetDeviceQueueInterface; |
39 | 40 |
40 /** | 41 /** |
41 * \ingroup netdevice | 42 * \ingroup netdevice |
42 * | 43 * |
43 * This device assumes 48-bit mac addressing; there is also the possibility to | 44 * This device assumes 48-bit mac addressing; there is also the possibility to |
44 * add an ErrorModel if you want to force losses on the device. | 45 * add an ErrorModel if you want to force losses on the device. |
45 *· | 46 *· |
46 * The device can be installed on a node through the SimpleNetDeviceHelper. | 47 * The device can be installed on a node through the SimpleNetDeviceHelper. |
47 * In case of manual creation, the user is responsible for assigning an unique | 48 * In case of manual creation, the user is responsible for assigning an unique |
48 * address to the device. | 49 * address to the device. |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 virtual bool NeedsArp (void) const; | 131 virtual bool NeedsArp (void) const; |
131 virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); | 132 virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); |
132 | 133 |
133 virtual Address GetMulticast (Ipv6Address addr) const; | 134 virtual Address GetMulticast (Ipv6Address addr) const; |
134 | 135 |
135 virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb); | 136 virtual void SetPromiscReceiveCallback (PromiscReceiveCallback cb); |
136 virtual bool SupportsSendFrom (void) const; | 137 virtual bool SupportsSendFrom (void) const; |
137 | 138 |
138 protected: | 139 protected: |
139 virtual void DoDispose (void); | 140 virtual void DoDispose (void); |
| 141 virtual void DoInitialize (void); |
| 142 virtual void NotifyNewAggregate (void); |
| 143 |
140 private: | 144 private: |
141 Ptr<SimpleChannel> m_channel; //!< the channel the device is connected to | 145 Ptr<SimpleChannel> m_channel; //!< the channel the device is connected to |
142 NetDevice::ReceiveCallback m_rxCallback; //!< Receive callback | 146 NetDevice::ReceiveCallback m_rxCallback; //!< Receive callback |
143 NetDevice::PromiscReceiveCallback m_promiscCallback; //!< Promiscuous receive
callback | 147 NetDevice::PromiscReceiveCallback m_promiscCallback; //!< Promiscuous receive
callback |
144 Ptr<Node> m_node; //!< Node this netDevice is associated to | 148 Ptr<Node> m_node; //!< Node this netDevice is associated to |
| 149 Ptr<NetDeviceQueueInterface> m_queueInterface; //!< NetDevice queue interfac
e |
145 uint16_t m_mtu; //!< MTU | 150 uint16_t m_mtu; //!< MTU |
146 uint32_t m_ifIndex; //!< Interface index | 151 uint32_t m_ifIndex; //!< Interface index |
147 Mac48Address m_address; //!< MAC address | 152 Mac48Address m_address; //!< MAC address |
148 Ptr<ErrorModel> m_receiveErrorModel; //!< Receive error model. | 153 Ptr<ErrorModel> m_receiveErrorModel; //!< Receive error model. |
149 | 154 |
150 /** | 155 /** |
151 * The trace source fired when the phy layer drops a packet it has received | 156 * The trace source fired when the phy layer drops a packet it has received |
152 * due to the error model being active. Although SimpleNetDevice doesn't· | 157 * due to the error model being active. Although SimpleNetDevice doesn't· |
153 * really have a Phy model, we choose this trace source name for alignment | 158 * really have a Phy model, we choose this trace source name for alignment |
154 * with other trace sources. | 159 * with other trace sources. |
(...skipping 22 matching lines...) Expand all Loading... |
177 | 182 |
178 /** | 183 /** |
179 * List of callbacks to fire if the link changes state (up or down). | 184 * List of callbacks to fire if the link changes state (up or down). |
180 */ | 185 */ |
181 TracedCallback<> m_linkChangeCallbacks; | 186 TracedCallback<> m_linkChangeCallbacks; |
182 }; | 187 }; |
183 | 188 |
184 } // namespace ns3 | 189 } // namespace ns3 |
185 | 190 |
186 #endif /* SIMPLE_NET_DEVICE_H */ | 191 #endif /* SIMPLE_NET_DEVICE_H */ |
OLD | NEW |