Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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,2009 IITP RAS | 3 * Copyright (c) 2008,2009 IITP RAS |
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
82 ///\name Protocols | 82 ///\name Protocols |
83 //\{ | 83 //\{ |
84 /// Register routing protocol to be used. Protocol must be alredy installed on this mesh point. | 84 /// Register routing protocol to be used. Protocol must be alredy installed on this mesh point. |
85 void SetRoutingProtocol (Ptr<MeshL2RoutingProtocol> protocol); | 85 void SetRoutingProtocol (Ptr<MeshL2RoutingProtocol> protocol); |
86 /// Access current routing protocol | 86 /// Access current routing protocol |
87 Ptr<MeshL2RoutingProtocol> GetRoutingProtocol () const; | 87 Ptr<MeshL2RoutingProtocol> GetRoutingProtocol () const; |
88 //\} | 88 //\} |
89 | 89 |
90 ///\name NetDevice interface for upper layers | 90 ///\name NetDevice interface for upper layers |
91 //\{ | 91 //\{ |
92 virtual void SetName (const std::string name); | |
Mathieu Lacage
2009/08/21 14:09:30
kill SetName and GetName
and.kirill
2009/08/21 19:33:33
On 2009/08/21 14:09:30, Mathieu Lacage wrote:
Don
| |
93 virtual std::string GetName () const; | |
94 virtual void SetIfIndex (const uint32_t index); | 92 virtual void SetIfIndex (const uint32_t index); |
95 virtual uint32_t GetIfIndex () const; | 93 virtual uint32_t GetIfIndex () const; |
96 virtual Ptr<Channel> GetChannel () const; | 94 virtual Ptr<Channel> GetChannel () const; |
97 virtual Address GetAddress () const; | 95 virtual Address GetAddress () const; |
98 virtual void SetAddress (Address a); | 96 virtual void SetAddress (Address a); |
99 virtual bool SetMtu (const uint16_t mtu); | 97 virtual bool SetMtu (const uint16_t mtu); |
100 virtual uint16_t GetMtu () const; | 98 virtual uint16_t GetMtu () const; |
101 virtual bool IsLinkUp () const; | 99 virtual bool IsLinkUp () const; |
102 virtual void SetLinkChangeCallback (Callback<void> callback); | 100 virtual void AddLinkChangeCallback (Callback<void> callback); |
103 virtual bool IsBroadcast () const; | 101 virtual bool IsBroadcast () const; |
104 virtual Address GetBroadcast () const; | 102 virtual Address GetBroadcast () const; |
105 virtual bool IsMulticast () const; | 103 virtual bool IsMulticast () const; |
106 virtual Address GetMulticast (Ipv4Address multicastGroup) const; | 104 virtual Address GetMulticast (Ipv4Address multicastGroup) const; |
107 virtual bool IsPointToPoint () const; | 105 virtual bool IsPointToPoint () const; |
108 virtual bool IsBridge () const; | 106 virtual bool IsBridge () const; |
109 virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolN umber); | 107 virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolN umber); |
110 virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Addres s& dest, uint16_t protocolNumber); | 108 virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Addres s& dest, uint16_t protocolNumber); |
111 virtual Ptr<Node> GetNode () const; | 109 virtual Ptr<Node> GetNode () const; |
112 virtual void SetNode (Ptr<Node> node); | 110 virtual void SetNode (Ptr<Node> node); |
(...skipping 15 matching lines...) Expand all Loading... | |
128 | 126 |
129 private: | 127 private: |
130 /// Receive packet from interface | 128 /// Receive packet from interface |
131 void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint1 6_t protocol, | 129 void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint1 6_t protocol, |
132 Address const &source, Address const &destination, Pac ketType packetType); | 130 Address const &source, Address const &destination, Pac ketType packetType); |
133 /// Forward packet down to interfaces | 131 /// Forward packet down to interfaces |
134 void Forward (Ptr<NetDevice> incomingPort, Ptr<const Packet> packet, | 132 void Forward (Ptr<NetDevice> incomingPort, Ptr<const Packet> packet, |
135 uint16_t protocol, const Mac48Address src, | 133 uint16_t protocol, const Mac48Address src, |
136 const Mac48Address dst); | 134 const Mac48Address dst); |
137 /** | 135 /** |
138 * Response callback for L2 routing protocol. This will be executed when routi ng information is ready. | 136 * \brief Response callback for L2 routing protocol. This will be executed whe n routing information is ready. |
139 * | 137 * |
140 * \param success True is route found. TODO: diagnose routing errors | 138 * \param success True is route found. TODO: diagnose routing errors |
141 * \param packet Packet to send | 139 * \param packet Packet to send |
142 * \param src Source MAC address | 140 * \param src Source MAC address |
143 * \param dst Destination MAC address | 141 * \param dst Destination MAC address |
144 * \param protocol Protocol ID | 142 * \param protocol Protocol ID |
145 * \param outIface Interface to use (ID) for send (decided by routing proto col). All interfaces will be used if outIface = 0xffffffff | 143 * \param iface Interface to use (ID) for send (decided by routing proto col). All interfaces will be used if outIface = 0xffffffff |
146 */ | 144 */ |
147 void | 145 void |
148 DoSend (bool success, Ptr<Packet> packet, Mac48Address src, Mac48Address dst, uint16_t protocol, | 146 DoSend (bool success, Ptr<Packet> packet, Mac48Address src, Mac48Address dst, uint16_t protocol, |
149 uint32_t iface); | 147 uint32_t iface); |
150 | 148 |
151 private: | 149 private: |
152 /// Receive action | 150 /// Receive action |
153 NetDevice::ReceiveCallback m_rxCallback; | 151 NetDevice::ReceiveCallback m_rxCallback; |
154 /// Promisc receive action | 152 /// Promisc receive action |
155 NetDevice::PromiscReceiveCallback m_promiscRxCallback; | 153 NetDevice::PromiscReceiveCallback m_promiscRxCallback; |
156 /// Mesh point MAC address, supposed to be the address of the first added inte rface | 154 /// Mesh point MAC address, supposed to be the address of the first added inte rface |
157 Mac48Address m_address; | 155 Mac48Address m_address; |
158 /// Parent node | 156 /// Parent node |
159 Ptr<Node> m_node; | 157 Ptr<Node> m_node; |
160 /// Station name | |
161 std::string m_name; | |
162 /// List of interfaces | 158 /// List of interfaces |
163 std::vector< Ptr<NetDevice> > m_ifaces; | 159 std::vector< Ptr<NetDevice> > m_ifaces; |
164 /// If index | 160 /// If index |
165 uint32_t m_ifIndex; | 161 uint32_t m_ifIndex; |
166 /// MTU in bytes | 162 /// MTU in bytes |
167 uint16_t m_mtu; | 163 uint16_t m_mtu; |
168 /// Virtual channel for upper layers | 164 /// Virtual channel for upper layers |
169 Ptr<BridgeChannel> m_channel; | 165 Ptr<BridgeChannel> m_channel; |
170 | |
171 /// Routing request callback | |
172 Callback<bool, | |
173 uint32_t, | |
174 Mac48Address, | |
175 Mac48Address, | |
176 Ptr<const Packet>, | |
177 uint16_t, | |
178 MeshL2RoutingProtocol::RouteReplyCallback> m_requestRoute; | |
179 Callback<bool, uint32_t, Mac48Address, Mac48Address, Ptr<Packet>, uint16_t&> m _removeRoutingStuff; | |
180 /// Routing response callback, this is supplied to mesh routing protocol | |
181 MeshL2RoutingProtocol::RouteReplyCallback m_myResponse; | |
182 /// Current routing protocol, used mainly by GetRoutingProtocol | 166 /// Current routing protocol, used mainly by GetRoutingProtocol |
183 Ptr<MeshL2RoutingProtocol> m_routingProtocol; | 167 Ptr<MeshL2RoutingProtocol> m_routingProtocol; |
184 | 168 |
185 /// Device statistics counters | 169 ///\name Device statistics counters |
170 ///\{ | |
186 struct Statistics | 171 struct Statistics |
187 { | 172 { |
188 uint32_t unicastData; | 173 uint32_t unicastData; |
189 uint32_t unicastDataBytes; | 174 uint32_t unicastDataBytes; |
190 uint32_t broadcastData; | 175 uint32_t broadcastData; |
191 uint32_t broadcastDataBytes; | 176 uint32_t broadcastDataBytes; |
192 | 177 |
193 Statistics (); | 178 Statistics (); |
194 }; | 179 }; |
195 /// Counters | 180 /// Counters |
196 Statistics m_rxStats, m_txStats, m_fwdStats; | 181 Statistics m_rxStats, m_txStats, m_fwdStats; |
182 ///\} | |
197 }; | 183 }; |
198 } //namespace ns3 | 184 } //namespace ns3 |
199 #endif | 185 #endif |
LEFT | RIGHT |