A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
llc-snap-header.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2005 INRIA
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
7 */
8
9#ifndef LLC_SNAP_HEADER_H
10#define LLC_SNAP_HEADER_H
11
12#include "ns3/header.h"
13
14#include <stdint.h>
15#include <string>
16
17namespace ns3
18{
19
20/**
21 * The length in octets of the LLC/SNAP header
22 */
23static const uint16_t LLC_SNAP_HEADER_LENGTH = 8;
24
25/**
26 * @ingroup network
27 *
28 * @brief Header for the LLC/SNAP encapsulation
29 *
30 * For a list of EtherTypes, see
31 * http://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml
32 */
33class LlcSnapHeader : public Header
34{
35 public:
37
38 /**
39 * @brief Set the Ethertype.
40 * @param type the Ethertype
41 */
42 void SetType(uint16_t type);
43 /**
44 * @brief Return the Ethertype.
45 * @return Ethertype
46 */
47 uint16_t GetType();
48
49 /**
50 * @brief Get the type ID.
51 * @return the object TypeId
52 */
53 static TypeId GetTypeId();
54 TypeId GetInstanceTypeId() const override;
55 void Print(std::ostream& os) const override;
56 uint32_t GetSerializedSize() const override;
57 void Serialize(Buffer::Iterator start) const override;
59
60 private:
61 uint16_t m_etherType; //!< the Ethertype
62};
63
64} // namespace ns3
65
66#endif /* LLC_SNAP_HEADER_H */
iterator in a Buffer instance
Definition buffer.h:89
Protocol header serialization and deserialization.
Definition header.h:33
Header for the LLC/SNAP encapsulation.
uint32_t Deserialize(Buffer::Iterator start) override
uint16_t m_etherType
the Ethertype
void Print(std::ostream &os) const override
static TypeId GetTypeId()
Get the type ID.
uint16_t GetType()
Return the Ethertype.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
uint32_t GetSerializedSize() const override
void Serialize(Buffer::Iterator start) const override
void SetType(uint16_t type)
Set the Ethertype.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static const uint16_t LLC_SNAP_HEADER_LENGTH
The length in octets of the LLC/SNAP header.