A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
uan-header-common.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2009 University of Washington
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: Leonard Tracy <lentracy@gmail.com>
19  */
20 
21 #ifndef UAN_HEADER_COMMON_H
22 #define UAN_HEADER_COMMON_H
23 
24 #include "ns3/header.h"
25 #include "ns3/nstime.h"
26 #include "ns3/simulator.h"
27 #include "uan-address.h"
28 
29 namespace ns3 {
30 
37 class UanHeaderCommon : public Header
38 {
39 public:
40  UanHeaderCommon ();
47  UanHeaderCommon (const UanAddress src, const UanAddress dest, uint8_t type);
48  virtual ~UanHeaderCommon ();
49 
50  static TypeId GetTypeId (void);
51 
55  void SetDest (UanAddress dest);
59  void SetSrc (UanAddress src);
63  void SetType (uint8_t type);
64 
68  UanAddress GetDest (void) const;
72  UanAddress GetSrc (void) const;
76  uint8_t GetType (void) const;
77 
78 
79 
80  // Inherrited methods
81  virtual uint32_t GetSerializedSize (void) const;
82  virtual void Serialize (Buffer::Iterator start) const;
83  virtual uint32_t Deserialize (Buffer::Iterator start);
84  virtual void Print (std::ostream &os) const;
85  virtual TypeId GetInstanceTypeId (void) const;
86 private:
87  UanAddress m_dest;
88  UanAddress m_src;
89  uint8_t m_type;
90 
91 
92 };
93 
94 }
95 
96 #endif /* UAN_HEADER_COMMON_H */
Protocol header serialization and deserialization.
Definition: header.h:42
virtual uint32_t Deserialize(Buffer::Iterator start)
uint8_t GetType(void) const
iterator in a Buffer instance
Definition: buffer.h:98
virtual void Print(std::ostream &os) const
virtual uint32_t GetSerializedSize(void) const
void SetSrc(UanAddress src)
void SetDest(UanAddress dest)
virtual void Serialize(Buffer::Iterator start) const
UanAddress GetDest(void) const
virtual TypeId GetInstanceTypeId(void) const
void SetType(uint8_t type)
UanAddress GetSrc(void) const
a unique identifier for an interface.
Definition: type-id.h:44