OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2009 IITP RAS |
| 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: Kirill Andreev <andreev@iitp.ru> |
| 19 */ |
| 20 |
| 21 #ifndef FLAME_HEADER_H |
| 22 #define FLAME_HEADER_H |
| 23 |
| 24 #include "ns3/header.h" |
| 25 #include "ns3/mac48-address.h" |
| 26 |
| 27 namespace ns3 { |
| 28 namespace flame { |
| 29 /** |
| 30 * \ingroup flame |
| 31 * |
| 32 * \brief Flame header |
| 33 * |
| 34 * Header format: | Reserved: 1 | cost: 1 | Sequence number: 2 | OrigDst: 6 | Or
igSrc: 6 | Flame port : 2 | |
| 35 */ |
| 36 |
| 37 class FlameHeader : public Header |
| 38 { |
| 39 public: |
| 40 |
| 41 FlameHeader (); |
| 42 ~FlameHeader (); |
| 43 /** |
| 44 * \name Inherited from Header class: |
| 45 * \{ |
| 46 */ |
| 47 static TypeId GetTypeId (void); |
| 48 virtual TypeId GetInstanceTypeId (void) const; |
| 49 virtual void Print (std::ostream &os) const; |
| 50 virtual uint32_t GetSerializedSize (void) const; |
| 51 virtual void Serialize (Buffer::Iterator start) const; |
| 52 virtual uint32_t Deserialize (Buffer::Iterator start); |
| 53 ///\} |
| 54 /** |
| 55 * \name Seeters/Getters for fields: |
| 56 * \{ |
| 57 */ |
| 58 void AddCost (uint8_t cost); |
| 59 uint8_t GetCost () const; |
| 60 void SetSeqno (uint16_t seqno); |
| 61 uint16_t GetSeqno () const; |
| 62 void SetOrigDst (Mac48Address dst); |
| 63 Mac48Address GetOrigDst () const; |
| 64 void SetOrigSrc (Mac48Address OrigSrc); |
| 65 Mac48Address GetOrigSrc () const; |
| 66 void SetProtocol (uint16_t protocol); |
| 67 uint16_t GetProtocol () const; |
| 68 ///\} |
| 69 private: |
| 70 uint8_t m_cost; |
| 71 uint16_t m_seqno; |
| 72 Mac48Address m_origDst; |
| 73 Mac48Address m_origSrc; |
| 74 uint16_t m_protocol; |
| 75 friend bool operator== (const FlameHeader & a, const FlameHeader & b); |
| 76 }; |
| 77 bool operator== (const FlameHeader & a, const FlameHeader & b); |
| 78 } //namespace flame |
| 79 } //namespace ns3 |
| 80 #endif /* FLAME_HEADER_H */ |
OLD | NEW |