A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ppp-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2008 University of Washington
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17
18#ifndef PPP_HEADER_H
19#define PPP_HEADER_H
20
21#include "ns3/header.h"
22
23namespace ns3
24{
25
48class PppHeader : public Header
49{
50 public:
54 PppHeader();
55
59 ~PppHeader() override;
60
66 static TypeId GetTypeId();
67
73 TypeId GetInstanceTypeId() const override;
74
75 void Print(std::ostream& os) const override;
76 void Serialize(Buffer::Iterator start) const override;
78 uint32_t GetSerializedSize() const override;
79
87 void SetProtocol(uint16_t protocol);
88
96 uint16_t GetProtocol() const;
97
98 private:
102 uint16_t m_protocol;
103};
104
105} // namespace ns3
106
107#endif /* PPP_HEADER_H */
iterator in a Buffer instance
Definition: buffer.h:100
Protocol header serialization and deserialization.
Definition: header.h:44
Packet header for PPP.
Definition: ppp-header.h:49
uint16_t m_protocol
The PPP protocol type of the payload packet.
Definition: ppp-header.h:102
void SetProtocol(uint16_t protocol)
Set the protocol type carried by this PPP packet.
Definition: ppp-header.cc:97
uint32_t Deserialize(Buffer::Iterator start) override
Definition: ppp-header.cc:90
TypeId GetInstanceTypeId() const override
Get the TypeId of the instance.
Definition: ppp-header.cc:53
static TypeId GetTypeId()
Get the TypeId.
Definition: ppp-header.cc:43
~PppHeader() override
Destroy a PPP header.
Definition: ppp-header.cc:38
uint32_t GetSerializedSize() const override
Definition: ppp-header.cc:78
void Serialize(Buffer::Iterator start) const override
Definition: ppp-header.cc:84
uint16_t GetProtocol() const
Get the protocol type carried by this PPP packet.
Definition: ppp-header.cc:103
PppHeader()
Construct a PPP header.
Definition: ppp-header.cc:34
void Print(std::ostream &os) const override
Definition: ppp-header.cc:59
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.