author | Tommaso Pecorella <tommaso.pecorella@unifi.it> |
Sat, 25 Jul 2015 23:55:40 +0200 | |
changeset 11540 | 29d2c2f5c2cf |
parent 11086 | 65914b1ed5b3 |
child 11606 | 98fa74311b21 |
permissions | -rw-r--r-- |
10479 | 1 |
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2013 Universita' di Firenze, Italy |
|
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Tommaso Pecorella <tommaso.pecorella@unifi.it> |
|
19 |
* Michele Muccio <michelemuccio@virgilio.it> |
|
20 |
*/ |
|
21 |
||
22 |
#ifndef SIXLOWPAN_NET_DEVICE_H |
|
23 |
#define SIXLOWPAN_NET_DEVICE_H |
|
24 |
||
25 |
#include <stdint.h> |
|
26 |
#include <string> |
|
27 |
#include <map> |
|
28 |
#include "ns3/traced-callback.h" |
|
29 |
#include "ns3/event-id.h" |
|
30 |
#include "ns3/nstime.h" |
|
31 |
#include "ns3/net-device.h" |
|
32 |
#include "ns3/packet.h" |
|
33 |
#include "sixlowpan-header.h" |
|
34 |
#include "ns3/random-variable-stream.h" |
|
35 |
||
36 |
namespace ns3 { |
|
37 |
||
38 |
class Node; |
|
39 |
||
40 |
/** |
|
41 |
* \defgroup sixlowpan 6LoWPAN |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
42 |
* \brief Performs 6LoWPAN compression of IPv6 packets as specified by \RFC{4944} and \RFC{6282} |
10479 | 43 |
* |
44 |
* This module acts as a shim between IPv6 and a generic NetDevice. |
|
45 |
* |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
46 |
* The module implements \RFC{4944} and \RFC{6282}, with the following exceptions: |
10479 | 47 |
* <ul> |
48 |
* <li> MESH and LOWPAN_BC0 dispatch types are not supported </li> |
|
49 |
* <li> HC2 encoding is not supported </li> |
|
50 |
* <li> IPHC's SAC and DAC are not supported </li> |
|
51 |
*</ul> |
|
52 |
*/ |
|
53 |
||
54 |
/** |
|
55 |
* \ingroup sixlowpan |
|
56 |
* |
|
57 |
* \brief Shim performing 6LoWPAN compression, decompression and fragmentation. |
|
58 |
* |
|
59 |
* This class implements the shim between IPv6 and a generic NetDevice, |
|
60 |
* performing packet compression, decompression and fragmentation in a transparent way. |
|
61 |
* To this end, the class pretend to be a normal NetDevice, masquerading some functions |
|
62 |
* of the underlying NetDevice. |
|
63 |
*/ |
|
64 |
class SixLowPanNetDevice : public NetDevice |
|
65 |
{ |
|
66 |
public: |
|
67 |
/** |
|
68 |
* Enumeration of the dropping reasons in SixLoWPAN. |
|
69 |
*/ |
|
70 |
enum DropReason |
|
71 |
{ |
|
72 |
DROP_FRAGMENT_TIMEOUT = 1, /**< Fragment timeout exceeded */ |
|
73 |
DROP_FRAGMENT_BUFFER_FULL, /**< Fragment buffer size exceeded */ |
|
74 |
DROP_UNKNOWN_EXTENSION /**< Unsupported compression kind */ |
|
75 |
}; |
|
76 |
||
77 |
/** |
|
78 |
* \brief Get the type ID. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
79 |
* \return The object TypeId. |
10479 | 80 |
*/ |
81 |
static TypeId GetTypeId (void); |
|
82 |
||
83 |
/** |
|
84 |
* Constructor for the SixLowPanNetDevice. |
|
85 |
*/ |
|
86 |
SixLowPanNetDevice (); |
|
87 |
||
88 |
// inherited from NetDevice base class |
|
89 |
virtual void SetIfIndex (const uint32_t index); |
|
90 |
virtual uint32_t GetIfIndex (void) const; |
|
91 |
virtual Ptr<Channel> GetChannel (void) const; |
|
92 |
virtual void SetAddress (Address address); |
|
93 |
virtual Address GetAddress (void) const; |
|
94 |
virtual bool SetMtu (const uint16_t mtu); |
|
95 |
||
96 |
/** |
|
97 |
* \brief Returns the link-layer MTU for this interface. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
98 |
* If the link-layer MTU is smaller than IPv6's minimum MTU (\RFC{4944}), |
10479 | 99 |
* 1280 will be returned. |
100 |
* |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
101 |
* \return The link-level MTU in bytes for this interface. |
10479 | 102 |
*/ |
103 |
virtual uint16_t GetMtu (void) const; |
|
104 |
virtual bool IsLinkUp (void) const; |
|
105 |
virtual void AddLinkChangeCallback (Callback<void> callback); |
|
106 |
virtual bool IsBroadcast (void) const; |
|
107 |
virtual Address GetBroadcast (void) const; |
|
108 |
virtual bool IsMulticast (void) const; |
|
109 |
virtual Address GetMulticast (Ipv4Address multicastGroup) const; |
|
110 |
virtual bool IsPointToPoint (void) const; |
|
111 |
virtual bool IsBridge (void) const; |
|
112 |
virtual bool Send (Ptr<Packet> packet, const Address& dest, uint16_t protocolNumber); |
|
113 |
virtual bool SendFrom (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber); |
|
114 |
virtual Ptr<Node> GetNode (void) const; |
|
115 |
virtual void SetNode (Ptr<Node> node); |
|
116 |
virtual bool NeedsArp (void) const; |
|
117 |
virtual void SetReceiveCallback (NetDevice::ReceiveCallback cb); |
|
118 |
virtual void SetPromiscReceiveCallback (NetDevice::PromiscReceiveCallback cb); |
|
119 |
virtual bool SupportsSendFrom () const; |
|
120 |
virtual Address GetMulticast (Ipv6Address addr) const; |
|
121 |
||
122 |
/** |
|
123 |
* \brief Returns a smart pointer to the underlying NetDevice. |
|
124 |
* |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
125 |
* \return A smart pointer to the underlying NetDevice. |
10479 | 126 |
*/ |
127 |
Ptr<NetDevice> GetNetDevice () const; |
|
128 |
||
129 |
/** |
|
130 |
* \brief Setup SixLowPan to be a proxy for the specified NetDevice. |
|
131 |
* All the packets incoming and outgoing from the NetDevice will be |
|
132 |
* processed by SixLowPanNetDevice. |
|
133 |
* |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
134 |
* \param [in] device A smart pointer to the NetDevice to be proxied. |
10479 | 135 |
*/ |
136 |
void SetNetDevice (Ptr<NetDevice> device); |
|
137 |
||
138 |
/** |
|
139 |
* Assign a fixed random variable stream number to the random variables |
|
140 |
* used by this model. Return the number of streams (possibly zero) that |
|
141 |
* have been assigned. |
|
142 |
* |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
143 |
* \param [in] stream First stream index to use. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
144 |
* \return the number of stream indices assigned by this model. |
10479 | 145 |
*/ |
146 |
int64_t AssignStreams (int64_t stream); |
|
147 |
||
11086
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
148 |
/** |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
149 |
* TracedCallback signature for packet send/receive events. |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
150 |
* |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
151 |
* \param [in] packet The packet. |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
152 |
* \param [in] sixNetDevice The SixLowPanNetDevice. |
11086
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
153 |
* \param [in] ifindex The ifindex of the device. |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
154 |
*/ |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
155 |
typedef void (* RxTxTracedCallback) |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
156 |
(const Ptr<const Packet> packet, |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
157 |
const Ptr<const SixLowPanNetDevice> sixNetDevice, |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
158 |
const uint32_t ifindex); |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
159 |
|
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
160 |
/** |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
161 |
* TracedCallback signature for |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
162 |
* |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
163 |
* \param [in] reason The reason for the drop. |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
164 |
* \param [in] packet The packet. |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
165 |
* \param [in] sixNetDevice The SixLowPanNetDevice. |
11086
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
166 |
* \param [in] ifindex The ifindex of the device. |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
167 |
*/ |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
168 |
typedef void (* DropTracedCallback) |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
169 |
(const DropReason reason, const Ptr<const Packet> packet, |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
170 |
const Ptr<const SixLowPanNetDevice> sixNetDevice, |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
171 |
const uint32_t ifindex); |
65914b1ed5b3
TracedCallback function signatures, the rest.
Peter D. Barnes, Jr. <barnes26@llnl.gov>
parents:
10665
diff
changeset
|
172 |
|
10479 | 173 |
protected: |
174 |
virtual void DoDispose (void); |
|
175 |
||
176 |
private: |
|
177 |
/** |
|
10481
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
178 |
* \brief Copy constructor |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
179 |
* |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
180 |
* Defined and unimplemented to avoid misuse. |
10481
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
181 |
*/ |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
182 |
SixLowPanNetDevice (SixLowPanNetDevice const &); |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
183 |
/** |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
184 |
* \brief Copy constructor |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
185 |
* |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
186 |
* Defined and unimplemented to avoid misuse. |
10505
03c1ce391a43
Fix sixlowpan module documentation (thanks Peter)
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10481
diff
changeset
|
187 |
* \returns |
10481
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
188 |
*/ |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
189 |
SixLowPanNetDevice& operator= (SixLowPanNetDevice const &); |
1636f0d5c9e2
make copy constructors implicit, for bindings generation
Tom Henderson <tomh@tomh.org>
parents:
10479
diff
changeset
|
190 |
/** |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
191 |
* \brief Receives all the packets from a NetDevice for further processing. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
192 |
* \param [in] device The NetDevice the packet ws received from. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
193 |
* \param [in] packet The received packet. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
194 |
* \param [in] protocol The protocol (if known). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
195 |
* \param [in] source The source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
196 |
* \param [in] destination The destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
197 |
* \param [in] packetType The packet kind (e.g., HOST, BROADCAST, etc.). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
198 |
* \return The IPv6 link-local address. |
10479 | 199 |
*/ |
200 |
void ReceiveFromDevice (Ptr<NetDevice> device, Ptr<const Packet> packet, uint16_t protocol, |
|
201 |
Address const &source, Address const &destination, PacketType packetType); |
|
202 |
||
10665
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
203 |
|
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
204 |
/** |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
205 |
* \param [in] packet Packet sent from above down to Network Device. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
206 |
* \param [in] source Source mac address (only used if doSendFrom is true, i.e., "MAC spoofing"). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
207 |
* \param [in] dest Mac address of the destination (already resolved). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
208 |
* \param [in] protocolNumber Identifies the type of payload contained in |
10665
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
209 |
* this packet. Used to call the right L3Protocol when the packet |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
210 |
* is received. |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
211 |
* \param [in] doSendFrom Perform a SendFrom instead of a Send. |
10665
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
212 |
* |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
213 |
* Called from higher layer to send packet into Network Device |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
214 |
* with the specified source and destination Addresses. |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
215 |
* |
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
216 |
* \return Whether the Send operation succeeded. |
10665
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
217 |
*/ |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
218 |
bool DoSend (Ptr<Packet> packet, const Address& source, const Address& dest, uint16_t protocolNumber, bool doSendFrom); |
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
219 |
|
10479 | 220 |
/** |
221 |
* The callback used to notify higher layers that a packet has been received. |
|
222 |
*/ |
|
223 |
NetDevice::ReceiveCallback m_rxCallback; |
|
224 |
||
225 |
/** |
|
226 |
* The callback used to notify higher layers that a packet has been received in promiscuous mode. |
|
227 |
*/ |
|
228 |
NetDevice::PromiscReceiveCallback m_promiscRxCallback; |
|
229 |
||
230 |
/** |
|
231 |
* \brief Callback to trace TX (transmission) packets. |
|
232 |
* |
|
233 |
* Data passed: |
|
234 |
* \li Packet received (including 6LoWPAN header) |
|
235 |
* \li Ptr to SixLowPanNetDevice |
|
236 |
* \li interface index |
|
237 |
*/ |
|
238 |
TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_txTrace; |
|
239 |
||
240 |
/** |
|
241 |
* \brief Callback to trace RX (reception) packets. |
|
242 |
* |
|
243 |
* Data passed: |
|
244 |
* \li Packet received (including 6LoWPAN header) |
|
245 |
* \li Ptr to SixLowPanNetDevice |
|
246 |
* \li interface index |
|
247 |
*/ |
|
248 |
TracedCallback<Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_rxTrace; |
|
249 |
||
250 |
/** |
|
251 |
* \brief Callback to trace drop packets. |
|
252 |
* |
|
253 |
* Data passed: |
|
254 |
* \li DropReason |
|
255 |
* \li Packet dropped (including 6LoWPAN header) |
|
256 |
* \li Ptr to SixLowPanNetDevice |
|
257 |
* \li interface index |
|
258 |
*/ |
|
259 |
TracedCallback<DropReason, Ptr<const Packet>, Ptr<SixLowPanNetDevice>, uint32_t> m_dropTrace; |
|
260 |
||
261 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
262 |
* \brief Make a link-local address from a MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
263 |
* \param [in] addr The MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
264 |
* \return The IPv6 link-local address. |
10479 | 265 |
*/ |
266 |
Ipv6Address MakeLinkLocalAddressFromMac (Address const &addr); |
|
267 |
||
268 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
269 |
* \brief Make a global address from a MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
270 |
* \param [in] addr the MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
271 |
* \param [in] prefix The address prefix. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
272 |
* \return The IPv6 address. |
10479 | 273 |
*/ |
274 |
Ipv6Address MakeGlobalAddressFromMac (Address const &addr, Ipv6Address prefix); |
|
275 |
||
276 |
/** |
|
277 |
* \brief Compress the headers according to HC1 compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
278 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
279 |
* \param [in] src The MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
280 |
* \param [in] dst The MAC destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
281 |
* \return The size of the removed headers. |
10479 | 282 |
*/ |
283 |
uint32_t CompressLowPanHc1 (Ptr<Packet> packet, Address const &src, Address const &dst); |
|
284 |
||
285 |
/** |
|
286 |
* \brief Decompress the headers according to HC1 compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
287 |
* \param [in] packet the packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
288 |
* \param [in] src the MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
289 |
* \param [in] dst the MAC destination address. |
10479 | 290 |
*/ |
291 |
void DecompressLowPanHc1 (Ptr<Packet> packet, Address const &src, Address const &dst); |
|
292 |
||
293 |
/** |
|
294 |
* \brief Compress the headers according to IPHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
295 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
296 |
* \param [in] src The MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
297 |
* \param [in] dst The MAC destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
298 |
* \return The size of the removed headers. |
10479 | 299 |
*/ |
300 |
uint32_t CompressLowPanIphc (Ptr<Packet> packet, Address const &src, Address const &dst); |
|
301 |
||
302 |
/** |
|
303 |
* \brief Checks if the next header can be compressed using NHC. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
304 |
* \param [in] headerType The header kind to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
305 |
* \return True if the header can be compressed. |
10479 | 306 |
*/ |
307 |
bool CanCompressLowPanNhc (uint8_t headerType); |
|
308 |
||
309 |
/** |
|
310 |
* \brief Decompress the headers according to IPHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
311 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
312 |
* \param [in] src The MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
313 |
* \param [in] dst The MAC destination address. |
10479 | 314 |
*/ |
315 |
void DecompressLowPanIphc (Ptr<Packet> packet, Address const &src, Address const &dst); |
|
316 |
||
317 |
/** |
|
318 |
* \brief Compress the headers according to NHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
319 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
320 |
* \param [in] headerType The header type. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
321 |
* \param [in] src The MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
322 |
* \param [in] dst The MAC destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
323 |
* \return The size of the removed headers. |
10479 | 324 |
*/ |
325 |
uint32_t CompressLowPanNhc (Ptr<Packet> packet, uint8_t headerType, Address const &src, Address const &dst); |
|
326 |
||
327 |
/** |
|
328 |
* \brief Decompress the headers according to NHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
329 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
330 |
* \param [in] src The MAC source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
331 |
* \param [in] dst The MAC destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
332 |
* \param [in] srcAddress The IPv6 source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
333 |
* \param [in] dstAddress The IPv6 destination address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
334 |
* \return The decompressed header type. |
10479 | 335 |
*/ |
336 |
uint8_t DecompressLowPanNhc (Ptr<Packet> packet, Address const &src, Address const &dst, Ipv6Address srcAddress, Ipv6Address dstAddress); |
|
337 |
||
338 |
/** |
|
339 |
* \brief Compress the headers according to NHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
340 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
341 |
* \param [in] omitChecksum Omit UDP checksum (if true). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
342 |
* \return The size of the removed headers. |
10479 | 343 |
*/ |
344 |
uint32_t CompressLowPanUdpNhc (Ptr<Packet> packet, bool omitChecksum); |
|
345 |
||
346 |
/** |
|
347 |
* \brief Decompress the headers according to NHC compression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
348 |
* \param [in] packet The packet to be compressed. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
349 |
* \param [in] saddr The IPv6 source address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
350 |
* \param [in] daddr The IPv6 destination address. |
10479 | 351 |
*/ |
352 |
void DecompressLowPanUdpNhc (Ptr<Packet> packet, Ipv6Address saddr, Ipv6Address daddr); |
|
353 |
||
354 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
355 |
* Fragment identifier type: src/dst address src/dst port. |
10479 | 356 |
*/ |
357 |
typedef std::pair< std::pair<Address, Address>, std::pair<uint16_t, uint16_t> > FragmentKey; |
|
358 |
||
359 |
/** |
|
360 |
* \class Fragments |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
361 |
* \brief A Set of Fragment. |
10479 | 362 |
*/ |
363 |
class Fragments : public SimpleRefCount<Fragments> |
|
364 |
{ |
|
365 |
public: |
|
366 |
/** |
|
367 |
* \brief Constructor. |
|
368 |
*/ |
|
369 |
Fragments (); |
|
370 |
||
371 |
/** |
|
372 |
* \brief Destructor. |
|
373 |
*/ |
|
374 |
~Fragments (); |
|
375 |
||
376 |
/** |
|
377 |
* \brief Add a fragment to the pool. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
378 |
* \param [in] fragment the fragment. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
379 |
* \param [in] fragmentOffset the offset of the fragment. |
10479 | 380 |
*/ |
381 |
void AddFragment (Ptr<Packet> fragment, uint16_t fragmentOffset); |
|
382 |
||
383 |
/** |
|
384 |
* \brief Add the first packet fragment. The first fragment is needed to |
|
385 |
* allow the post-defragmentation decompression. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
386 |
* \param [in] fragment The fragment. |
10479 | 387 |
*/ |
388 |
void AddFirstFragment (Ptr<Packet> fragment); |
|
389 |
||
390 |
/** |
|
391 |
* \brief If all fragments have been added. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
392 |
* \returns True if the packet is entire. |
10479 | 393 |
*/ |
394 |
bool IsEntire () const; |
|
395 |
||
396 |
/** |
|
397 |
* \brief Get the entire packet. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
398 |
* \return The entire packet. |
10479 | 399 |
*/ |
400 |
Ptr<Packet> GetPacket () const; |
|
401 |
||
402 |
/** |
|
403 |
* \brief Set the packet-to-be-defragmented size. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
404 |
* \param [in] packetSize The packet size (bytes). |
10479 | 405 |
*/ |
406 |
void SetPacketSize (uint32_t packetSize); |
|
407 |
||
408 |
/** |
|
409 |
* \brief Get a list of the current stored fragments. |
|
410 |
*/ |
|
411 |
std::list< Ptr<Packet> > GetFraments () const; |
|
412 |
||
413 |
private: |
|
414 |
/** |
|
415 |
* \brief The size of the reconstructed packet (bytes). |
|
416 |
*/ |
|
417 |
uint32_t m_packetSize; |
|
418 |
||
419 |
/** |
|
420 |
* \brief The current fragments. |
|
421 |
*/ |
|
422 |
std::list<std::pair<Ptr<Packet>, uint16_t> > m_fragments; |
|
423 |
||
424 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
425 |
* \brief The very first fragment. |
10479 | 426 |
*/ |
427 |
Ptr<Packet> m_firstFragment; |
|
428 |
||
429 |
}; |
|
430 |
||
431 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
432 |
* \brief Performs a packet fragmentation. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
433 |
* \param [in] packet the packet to be fragmented (with headers already compressed with 6LoWPAN). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
434 |
* \param [in] origPacketSize the size of the IP packet before the 6LoWPAN header compression, including the IP/L4 headers. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
435 |
* \param [in] origHdrSize the size of the IP header before the 6LoWPAN header compression. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
436 |
* \param [out] listFragments A reference to the list of the resulting packets, all with the proper headers in place. |
10479 | 437 |
*/ |
438 |
void DoFragmentation (Ptr<Packet> packet, uint32_t origPacketSize, uint32_t origHdrSize, |
|
439 |
std::list<Ptr<Packet> >& listFragments); |
|
440 |
||
441 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
442 |
* \brief Process a packet fragment. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
443 |
* \param [in] packet The packet. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
444 |
* \param [in] src The source MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
445 |
* \param [in] dst The destination MAC address. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
446 |
* \param [in] isFirst True if it is the first fragment, false otherwise. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
447 |
* \return True is the fragment completed the packet. |
10479 | 448 |
*/ |
449 |
bool ProcessFragment (Ptr<Packet>& packet, Address const &src, Address const &dst, bool isFirst); |
|
450 |
||
451 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
452 |
* \brief Process the timeout for packet fragments. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
453 |
* \param [in] key A key representing the packet fragments. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
454 |
* \param [in] iif Input Interface. |
10479 | 455 |
*/ |
456 |
void HandleFragmentsTimeout ( FragmentKey key, uint32_t iif); |
|
457 |
||
458 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
459 |
* \brief Drops the oldest fragment set. |
10479 | 460 |
*/ |
461 |
void DropOldestFragmentSet (); |
|
462 |
||
463 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
464 |
* Container for fragment key -> fragments. |
10479 | 465 |
*/ |
466 |
typedef std::map< FragmentKey, Ptr<Fragments> > MapFragments_t; |
|
467 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
468 |
* Container Iterator for fragment key -> fragments. |
10479 | 469 |
*/ |
470 |
typedef std::map< FragmentKey, Ptr<Fragments> >::iterator MapFragmentsI_t; |
|
471 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
472 |
* Container for fragment key -> expiration event. |
10479 | 473 |
*/ |
474 |
typedef std::map< FragmentKey, EventId > MapFragmentsTimers_t; |
|
475 |
/** |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
476 |
* Container Iterator for fragment key -> expiration event. |
10479 | 477 |
*/ |
478 |
typedef std::map< FragmentKey, EventId >::iterator MapFragmentsTimersI_t; |
|
479 |
||
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
480 |
MapFragments_t m_fragments; //!< Fragments hold to be rebuilt. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
481 |
MapFragmentsTimers_t m_fragmentsTimers; //!< Timers related to fragment rebuilding. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
482 |
Time m_fragmentExpirationTimeout; //!< Time limit for fragment rebuilding. |
10479 | 483 |
|
484 |
/** |
|
485 |
* \brief How many packets can be rebuilt at the same time. |
|
486 |
* Some real implementation do limit this. Zero means no limit. |
|
487 |
*/ |
|
488 |
uint16_t m_fragmentReassemblyListSize; |
|
489 |
||
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
490 |
bool m_useIphc; //!< Use IPHC or HC1. |
10479 | 491 |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
492 |
Ptr<Node> m_node; //!< Smart pointer to the Node. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
493 |
Ptr<NetDevice> m_netDevice; //!< Smart pointer to the underlying NetDevice. |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
494 |
uint32_t m_ifIndex; //!< Interface index. |
10479 | 495 |
|
496 |
/** |
|
497 |
* \brief Force the EtherType number. |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
498 |
* Also implying that the underlying NetDevice is using 48-bit Addresses, e.g., Ethernet, Wi-Fi, etc. |
10479 | 499 |
*/ |
500 |
bool m_forceEtherType; |
|
501 |
||
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
502 |
uint16_t m_etherType; //!< EtherType number (used only if m_forceEtherType is true). |
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
503 |
bool m_omitUdpChecksum; //!< Omit UDP checksum in NC1 encoding. |
10479 | 504 |
|
11540
29d2c2f5c2cf
[Doxygen] update sixlowpan in/out params
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
11086
diff
changeset
|
505 |
uint32_t m_compressionThreshold; //!< Minimum L2 payload size. |
10665
57dd71d4886e
Add 6LoWPAN uncompressed IPv6 header support
Tommaso Pecorella <tommaso.pecorella@unifi.it>
parents:
10506
diff
changeset
|
506 |
|
10479 | 507 |
Ptr<UniformRandomVariable> m_rng; //!< Rng for the fragments tag. |
508 |
}; |
|
509 |
||
510 |
} // namespace ns3 |
|
511 |
||
512 |
#endif /* SIXLOWPAN_NET_DEVICE_H */ |