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 |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 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 | 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 | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Kirill Andreev <andreev@iitp.ru> | 18 * Author: Kirill Andreev <andreev@iitp.ru> |
19 */ | 19 */ |
20 | 20 |
21 | |
22 #ifndef WIFI_PREP_INFORMATION_ELEMENT_H | 21 #ifndef WIFI_PREP_INFORMATION_ELEMENT_H |
23 #define WIFI_PREP_INFORMATION_ELEMENT_H | 22 #define WIFI_PREP_INFORMATION_ELEMENT_H |
24 | 23 |
25 | |
26 #include "ns3/mac48-address.h" | 24 #include "ns3/mac48-address.h" |
27 #include "ns3/wifi-information-element.h" | 25 #include "ns3/wifi-information-element-vector.h" |
28 | 26 |
29 namespace ns3 { | 27 namespace ns3 { |
30 namespace dot11s { | 28 namespace dot11s { |
31 /** | 29 /** |
32 * \ingroup dot11s | 30 * \ingroup dot11s |
33 * \brief See 7.3.2.97 of 802.11s draft 2.07 | 31 * \brief See 7.3.2.97 of 802.11s draft 2.07 |
34 */ | 32 */ |
35 class IePrep : public WifiInformationElement | 33 class IePrep : public WifiInformationElement |
36 { | 34 { |
37 public: | 35 public: |
38 IePrep (); | 36 IePrep (); |
39 ~IePrep (); | 37 ~IePrep (); |
40 void SetFlags (uint8_t flags); | 38 void SetFlags (uint8_t flags); |
41 void SetHopcount (uint8_t hopcount); | 39 void SetHopcount (uint8_t hopcount); |
42 void SetTtl (uint8_t ttl); | 40 void SetTtl (uint8_t ttl); |
43 void SetDestinationAddress (Mac48Address dest_address); | 41 void SetDestinationAddress (Mac48Address dest_address); |
44 void SetDestinationSeqNumber (uint32_t dest_seq_number); | 42 void SetDestinationSeqNumber (uint32_t dest_seq_number); |
45 void SetLifetime (uint32_t lifetime); | 43 void SetLifetime (uint32_t lifetime); |
46 void SetMetric (uint32_t metric); | 44 void SetMetric (uint32_t metric); |
47 void SetOriginatorAddress (Mac48Address originator_address); | 45 void SetOriginatorAddress (Mac48Address originator_address); |
48 void SetOriginatorSeqNumber (uint32_t originator_seq_number); | 46 void SetOriginatorSeqNumber (uint32_t originator_seq_number); |
49 | 47 |
50 uint8_t GetFlags () const; | 48 uint8_t GetFlags () const; |
51 uint8_t GetHopcount () const; | 49 uint8_t GetHopcount () const; |
52 uint32_t GetTtl () const; | 50 uint32_t GetTtl () const; |
53 Mac48Address GetDestinationAddress () const; | 51 Mac48Address GetDestinationAddress () const; |
54 uint32_t GetDestinationSeqNumber () const; | 52 uint32_t GetDestinationSeqNumber () const; |
55 uint32_t GetLifetime () const; | 53 uint32_t GetLifetime () const; |
56 uint32_t GetMetric () const; | 54 uint32_t GetMetric () const; |
57 Mac48Address GetOriginatorAddress () const; | 55 Mac48Address GetOriginatorAddress () const; |
58 uint32_t GetOriginatorSeqNumber ()const ; | 56 uint32_t GetOriginatorSeqNumber ()const ; |
59 | 57 |
60 void DecrementTtl (); | 58 void DecrementTtl (); |
61 void IncrementMetric (uint32_t metric); | 59 void IncrementMetric (uint32_t metric); |
62 private: | 60 /** |
63 WifiElementId ElementId () const{ | 61 * \name Inherited from WifiInformationElement |
64 return IE11S_PREP; | 62 * \{ |
65 } | 63 */ |
66 void SerializeInformation (Buffer::Iterator i) const; | 64 virtual WifiElementId ElementId () const; |
67 uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length); | 65 virtual void SerializeInformation (Buffer::Iterator i) const; |
68 uint8_t GetInformationSize () const; | 66 virtual uint8_t DeserializeInformation (Buffer::Iterator start, uint8_t length
); |
69 void PrintInformation (std::ostream& os) const; | 67 virtual uint8_t GetInformationSize () const; |
| 68 virtual void Print (std::ostream& os) const; |
| 69 ///\} |
70 private: | 70 private: |
71 uint8_t m_flags; | 71 uint8_t m_flags; |
72 uint8_t m_hopcount; | 72 uint8_t m_hopcount; |
73 uint8_t m_ttl; | 73 uint8_t m_ttl; |
74 Mac48Address m_destinationAddress; | 74 Mac48Address m_destinationAddress; |
75 uint32_t m_destSeqNumber; | 75 uint32_t m_destSeqNumber; |
76 uint32_t m_lifetime; | 76 uint32_t m_lifetime; |
77 uint32_t m_metric; | 77 uint32_t m_metric; |
78 Mac48Address m_originatorAddress; | 78 Mac48Address m_originatorAddress; |
79 uint32_t m_originatorSeqNumber; | 79 uint32_t m_originatorSeqNumber; |
80 friend bool operator== (const IePrep & a, const IePrep & b); | 80 friend bool operator== (const IePrep & a, const IePrep & b); |
81 }; | 81 }; |
82 bool operator== (const IePrep & a, const IePrep & b); | 82 bool operator== (const IePrep & a, const IePrep & b); |
| 83 std::ostream &operator << (std::ostream &os, const IePrep &prep); |
83 } // namespace dot11s | 84 } // namespace dot11s |
84 } //namespace ns3 | 85 } //namespace ns3 |
85 #endif | 86 #endif |
86 | 87 |
LEFT | RIGHT |