/usr/include/ns3.26/ns3/uan-header-rc.h is in libns3-dev 3.26+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 University of Washington
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Leonard Tracy <lentracy@gmail.com>
*/
#ifndef UAN_HEADER_RC_H
#define UAN_HEADER_RC_H
#include "ns3/header.h"
#include "ns3/nstime.h"
#include "ns3/uan-address.h"
#include <set>
namespace ns3 {
/**
* \ingroup uan
*
* Extra data header information.
*
* Adds propagation delay measure, and frame number info to
* transmitted data packet.
*/
class UanHeaderRcData : public Header
{
public:
/** Default constructor */
UanHeaderRcData ();
/**
* Constructor.
*
* \param frameNum Data frame # of reservation being transmitted.
* \param propDelay Measured propagation delay found in handshaking.
* \note Prop. delay is transmitted with 16 bits and ms accuracy.
*/
UanHeaderRcData (uint8_t frameNum, Time propDelay);
/** Destructor */
virtual ~UanHeaderRcData ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
/**
* Set the frame number of the reservation being transmitted.
*
* \param frameNum The data frame number.
*/
void SetFrameNo (uint8_t frameNum);
/**
* Set the propagation delay as found in handshaking.
*
* \param propDelay The measured propagation delay.
* \note Prop. delay is transmitted with 16 bits and ms accuracy.
*/
void SetPropDelay (Time propDelay);
/**
* Get the frame number of the reservation being transmitted.
*
* \return The data frame number.
*/
uint8_t GetFrameNo (void) const;
/**
* Get the propagation delay found in handshaking.
*
* \return The measured propagation delay.
* \note Prop. delay is transmitted with 16 bits and ms accuracy
*/
Time GetPropDelay (void) const;
// Inherrited methods
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
virtual TypeId GetInstanceTypeId (void) const;
private:
uint8_t m_frameNo; //!< Data frame number.
Time m_propDelay; //!< Propagation delay.
}; // class UanHeaderRcData
/**
* \ingroup uan
*
* RTS header.
*
* Contains frame number, retry number, number of frames, length, and timestamp.
*/
class UanHeaderRcRts : public Header
{
public:
/** Default constructor */
UanHeaderRcRts ();
/**
* Constructor.
*
* \param frameNo Reservation frame number.
* \param retryNo Retry number of RTS packet.
* \param noFrames Number of data frames in reservation.
* \param length Number of bytes (including headers) in data.
* \param ts RTS TX timestamp.
* \note Timestamp is serialized into 32 bits with ms accuracy.
*/
UanHeaderRcRts (uint8_t frameNo, uint8_t retryNo, uint8_t noFrames, uint16_t length, Time ts);
/** Destructor */
virtual ~UanHeaderRcRts ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
/**
* Set the frame number.
*
* \param fno TX frame number
*/
void SetFrameNo (uint8_t fno);
/**
* Set the number of data frames included in this reservation request.
*
* \param no Number of frames.
*/
void SetNoFrames (uint8_t no);
/**
* Set RTS transmission time.
*
* \param timeStamp The RTS transmission time.
*/
void SetTimeStamp (Time timeStamp);
/**
* Set the number of data bytes in the reservation.
*
* \param length Total number of data bytes in reservation (including headers).
* \note Timestamp is serialized with 32 bits in ms precision.
*/
void SetLength (uint16_t length);
/**
* Set the retry number of this RTS packet.
*
* This is used to match timestamp to correctly received RTS.
*
* \param no Retry number.
*/
void SetRetryNo (uint8_t no);
/**
* Get the frame number.
*
* \return The frame number.
*/
uint8_t GetFrameNo (void) const;
/**
* Get the number of data frames in the reservation.
*
* \return The number of data frames.
*/
uint8_t GetNoFrames (void) const;
/**
* Get the transmit timestamp of this RTS packet.
*
* \return The TX time.
* \note Timestamp is serialized with 32 bits in ms precision.
*/
Time GetTimeStamp (void) const;
/**
* Get the total number of bytes in the reservation, including headers.
*
* \return Total number of bytes in data packets for reservation.
*/
uint16_t GetLength (void) const;
/**
* Get the retry number of this RTS packet.
*
* \return The retry number.
*/
uint8_t GetRetryNo (void) const;
// Inherrited methods
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
virtual TypeId GetInstanceTypeId (void) const;
private:
uint8_t m_frameNo; //!< Reservation frame number.
uint8_t m_noFrames; //!< Number of data frames in reservation.
uint16_t m_length; //!< Number of bytes (including headers) in data.
Time m_timeStamp; //!< RTS TX timestamp.
uint8_t m_retryNo; //!< Retry number of RTS packet.
}; // class UanHeaderRcRts
/**
* \ingroup uan
*
* Cycle broadcast information.
*
* This includes the rate number, retry rate and window time.
*/
class UanHeaderRcCtsGlobal : public Header
{
public:
/** Default constructor */
UanHeaderRcCtsGlobal ();
/**
* Constructor
*
* \param wt Window time.
* \param ts Timestamp.
* \param rate Rate number.
* \param retryRate Retry rate value.
*/
UanHeaderRcCtsGlobal (Time wt, Time ts, uint16_t rate, uint16_t retryRate);
/** Destructor */
~UanHeaderRcCtsGlobal ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
/**
* Set the rate number corresponding to data rate of current cycle.
* \param rate The rate number.
*/
void SetRateNum (uint16_t rate);
/**
* Set the retry rate number for the current cycle.
* \param rate The retry rate number
*/
void SetRetryRate (uint16_t rate);
/**
* Set the window time (time duration following blocking time
* to allow RTS transmissions).
*
* \param t The window time.
*/
void SetWindowTime (Time t);
/**
* Set the CTS timestamp.
*
* \param timeStamp The time of CTS transmission.
*/
void SetTxTimeStamp (Time timeStamp);
/**
* Get the data rate number.
*
* \return The rate number.
*/
uint16_t GetRateNum (void) const;
/**
* Get the retry rate number.
*
* \return The retry rate number.
*/
uint16_t GetRetryRate (void) const;
/**
* Get the window time (time duration following blocking time
* to allow RTS transmissions).
*
* \return The window time.
*/
Time GetWindowTime (void) const;
/**
* Get the CTS transmit timestamp.
*
* \return The timestamp.
*/
Time GetTxTimeStamp (void) const;
// Inherrited methods
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
virtual TypeId GetInstanceTypeId (void) const;
private:
Time m_timeStampTx; //!< Timestamp.
Time m_winTime; //!< Window time.
uint16_t m_retryRate; //!< Retry rate.
uint16_t m_rateNum; //!< Rate number.
}; // class UanHeaderRcCtsGlobal
/**
* \ingroup uan
*
* CTS header
*
* Includes RTS RX time, CTS TX time, delay until TX, RTS blocking period,
* RTS tx period, rate #, and retry rate #
*/
class UanHeaderRcCts : public Header
{
public:
/** Default constructor */
UanHeaderRcCts ();
/**
* Constructor
*
* \param frameNo Reservation frame # being cleared.
* \param retryNo Retry # of received RTS packet.
* \param rtsTs RX time of RTS packet at gateway.
* \param delay Delay until transmission.
* \param addr Destination of CTS packet.
* \note Times are serialized, with ms precission, into 32 bit fields.
*/
UanHeaderRcCts (uint8_t frameNo, uint8_t retryNo, Time rtsTs, Time delay, UanAddress addr);
/** Destructor */
virtual ~UanHeaderRcCts ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
/**
* Set the RTS frame number being cleared.
*
* \param frameNo The frame number.
*/
void SetFrameNo (uint8_t frameNo);
/**
* Set the timestamp for RTS reception.
*
* \param timeStamp The timestamp.
*/
void SetRtsTimeStamp (Time timeStamp);
/**
* Set the time delay from CTS transmission to first data frame arrival.
*
* \param delay The delay time.
*/
void SetDelayToTx (Time delay);
/**
* Set the retry number of the RTS frame being cleared.
*
* \param no The retry number.
*/
void SetRetryNo (uint8_t no);
/**
* Set the destination address, for scheduling info.
*
* \param addr The destination address.
*/
void SetAddress (UanAddress addr);
/**
* Get the frame number of the RTS being cleared.
*
* \return The frame number.
*/
uint8_t GetFrameNo (void) const;
/**
* Get the receive time of the RTS being cleared.
*
* \return The RX time.
*/
Time GetRtsTimeStamp (void) const;
/**
* Get the time delay from TX time of CTS packet until
* arrival of first data frame.
*
* \return The delay time.
*/
Time GetDelayToTx (void) const;
/**
* Get the retry number of the RTS packet being cleared.
*
* \return The retry number
*/
uint8_t GetRetryNo (void) const;
/**
* Get the destination address, for scheduling info.
*
* \return The destination address.
*/
UanAddress GetAddress (void) const;
// Inherrited methods
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
virtual TypeId GetInstanceTypeId (void) const;
private:
uint8_t m_frameNo; //!< Reservation frame number being cleared.
Time m_timeStampRts; //!< RX time of RTS packet at gateway.
uint8_t m_retryNo; //!< Retry number of received RTS packet.
Time m_delay; //!< Delay until transmission.
UanAddress m_address; //!< Destination of CTS packet.
}; // class UanHeaderRcCts
/**
* \ingroup uan
*
* Header used for ACK packets by protocol UanMacRc
*/
class UanHeaderRcAck : public Header
{
public:
/** Default constructor */
UanHeaderRcAck ();
/** Destructor */
virtual ~UanHeaderRcAck ();
/**
* Register this type.
* \return The TypeId.
*/
static TypeId GetTypeId (void);
/**
* Set the frame number of the reservation being acknowledged.
*
* \param frameNo The frame number.
*/
void SetFrameNo (uint8_t frameNo);
/**
* NACK a frame.
*
* \param frame The data frame number being NACKed.
*/
void AddNackedFrame (uint8_t frame);
/**
* Get the set of NACK'ed frames.
*
* \return The set of NACK'ed frames.
*/
const std::set<uint8_t> &GetNackedFrames (void) const;
/**
* Get the reservation frame number being ACKed.
*
* \return The frame number.
*/
uint8_t GetFrameNo (void) const;
/**
* Get the number of data frames being NACKed.
*
* \return The number of NACKed frames.
*/
uint8_t GetNoNacks (void) const;
// Inherrited methods
virtual uint32_t GetSerializedSize (void) const;
virtual void Serialize (Buffer::Iterator start) const;
virtual uint32_t Deserialize (Buffer::Iterator start);
virtual void Print (std::ostream &os) const;
virtual TypeId GetInstanceTypeId (void) const;
private:
uint8_t m_frameNo; //!< Next frame number.
std::set<uint8_t> m_nackedFrames; //!< Marker for nacked frames.
}; // class UanHeaderRcAck
} // namespace ns3
#endif /* UAN_HEADER_RC_H */
|