A Discrete-Event Network Simulator
API
vendor-specific-action.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 Dalian University of Technology
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 as
5 * published by the Free Software Foundation;
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program; if not, write to the Free Software
14 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15 *
16 * Author: Junling Bu <linlinjavaer@gmail.com>
17 */
18#ifndef Vendor_Specific_Action_H
19#define Vendor_Specific_Action_H
20
21#include "ns3/address.h"
22#include "ns3/attribute-helper.h"
23#include "ns3/attribute.h"
24#include "ns3/header.h"
25#include "ns3/packet.h"
26#include "ns3/pointer.h"
27
28#include <map>
29#include <ostream>
30
31namespace ns3
32{
33
34class WifiMac;
35class VendorSpecificContentManager;
36
55{
56 public:
64 OrganizationIdentifier(const uint8_t* str, uint32_t length);
72
75 {
76 OUI24 = 3, // 3 bytes
77 OUI36 = 5, // 5 bytes
79 };
80
84 uint8_t GetManagementId() const;
88 bool IsNull() const;
97
98 // below methods will be called by VendorSpecificActionHeader
108 void Serialize(Buffer::Iterator start) const;
115
116 private:
117 friend bool operator==(const OrganizationIdentifier& a, const OrganizationIdentifier& b);
118 friend bool operator!=(const OrganizationIdentifier& a, const OrganizationIdentifier& b);
119 friend bool operator<(const OrganizationIdentifier& a, const OrganizationIdentifier& b);
120 friend std::ostream& operator<<(std::ostream& os, const OrganizationIdentifier& oi);
121 friend std::istream& operator>>(std::istream& is, const OrganizationIdentifier& oi);
122
124 uint8_t m_oi[5];
125};
126
128
132
133std::ostream& operator<<(std::ostream& os, const OrganizationIdentifier& oi);
134std::istream& operator>>(std::istream& is, const OrganizationIdentifier& oi);
135
140const static uint8_t CATEGORY_OF_VSA = 127;
141
161{
162 public:
165
181 uint8_t GetCategory() const;
182
187 static TypeId GetTypeId();
188 TypeId GetInstanceTypeId() const override;
189 void Print(std::ostream& os) const override;
190 uint32_t GetSerializedSize() const override;
191 void Serialize(Buffer::Iterator start) const override;
193
194 private:
196 uint8_t m_category;
197};
198
207typedef Callback<bool,
211 const Address&>
213
220{
221 public:
247
248 private:
250 typedef std::map<OrganizationIdentifier, VscCallback> VscCallbacks;
252 typedef std::map<OrganizationIdentifier, VscCallback>::iterator VscCallbacksI;
253
255};
256
257static std::vector<OrganizationIdentifier> OrganizationIdentifiers;
258} // namespace ns3
259
260#endif /* Vendor_Specific_Action_H */
a polymophic address class
Definition: address.h:92
iterator in a Buffer instance
Definition: buffer.h:100
Callback template class.
Definition: callback.h:443
Protocol header serialization and deserialization.
Definition: header.h:44
the organization identifier is a public organizationally unique identifier assigned by the IEEE.
friend bool operator!=(const OrganizationIdentifier &a, const OrganizationIdentifier &b)
inequality operator
OrganizationIdentifierType
OrganizationIdentifierType enumeration.
OrganizationIdentifier & operator=(const OrganizationIdentifier &oi)
Assignment operator.
friend std::ostream & operator<<(std::ostream &os, const OrganizationIdentifier &oi)
output operator
uint32_t GetSerializedSize() const
Get serialized size.
enum OrganizationIdentifierType m_type
OI type.
void Serialize(Buffer::Iterator start) const
Serialize to buffer.
friend bool operator<(const OrganizationIdentifier &a, const OrganizationIdentifier &b)
less than operator
uint32_t Deserialize(Buffer::Iterator start)
Deserialize from buffer.
enum OrganizationIdentifierType GetType() const
uint8_t m_oi[5]
organization identifier
friend bool operator==(const OrganizationIdentifier &a, const OrganizationIdentifier &b)
equality operator
friend std::istream & operator>>(std::istream &is, const OrganizationIdentifier &oi)
input operator
void SetType(enum OrganizationIdentifierType type)
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
a unique identifier for an interface.
Definition: type-id.h:60
See IEEE 802.11-2007 chapter 7.3.1.11 and 7.4.5 also IEEE 802.11p-2010 chapter 7.4....
uint32_t GetSerializedSize() const override
uint32_t Deserialize(Buffer::Iterator start) override
void Serialize(Buffer::Iterator start) const override
void SetOrganizationIdentifier(OrganizationIdentifier oi)
uint8_t GetCategory() const
Get the category field.
void Print(std::ostream &os) const override
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
OrganizationIdentifier GetOrganizationIdentifier() const
static TypeId GetTypeId()
Get the type ID.
VendorSpecificContentManager class.
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
bool IsVscCallbackRegistered(OrganizationIdentifier &oi)
VscCallback FindVscCallback(OrganizationIdentifier &oi)
std::map< OrganizationIdentifier, VscCallback >::iterator VscCallbacksI
VSC callback iterator typedef.
void DeregisterVscCallback(OrganizationIdentifier &oi)
std::map< OrganizationIdentifier, VscCallback > VscCallbacks
VSC callback typedef.
VscCallbacks m_callbacks
VSC callbacks.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
static std::vector< OrganizationIdentifier > OrganizationIdentifiers
the OIs
bool operator!=(Callback< R, Args... > a, Callback< R, Args... > b)
Inequality test.
Definition: callback.h:665
bool operator==(const EventId &a, const EventId &b)
Definition: event-id.h:157
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:129
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:153
bool operator<(const EventId &a, const EventId &b)
Definition: event-id.h:170
Callback< bool, Ptr< WifiMac >, const OrganizationIdentifier &, Ptr< const Packet >, const Address & > VscCallback
static const uint8_t CATEGORY_OF_VSA
see IEEE 802.11-2007 chapter 7.3.1.11 Table 7-24—Category values
def start()
Definition: core.py:1861