A Discrete-Event Network Simulator
API
vendor-specific-action.h
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Dalian University of Technology
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 * Author: Junling Bu <linlinjavaer@gmail.com>
18 */
19#ifndef Vendor_Specific_Action_H
20#define Vendor_Specific_Action_H
21
22#include <ostream>
23#include <map>
24#include "ns3/header.h"
25#include "ns3/packet.h"
26#include "ns3/pointer.h"
27#include "ns3/attribute.h"
28#include "ns3/attribute-helper.h"
29#include "ns3/address.h"
30
31namespace ns3 {
32
33class WifiMac;
34class VendorSpecificContentManager;
35
54{
55public:
63 OrganizationIdentifier (const uint8_t *str, uint32_t length);
70 virtual ~OrganizationIdentifier (void);
71
74 {
75 OUI24 = 3, // 3 bytes
76 OUI36 = 5, // 5 bytes
78 };
79
83 uint8_t GetManagementId (void) const;
87 bool IsNull (void) const;
91 void SetType (enum OrganizationIdentifierType type);
95 enum OrganizationIdentifierType GetType (void) const;
96
97 // below methods will be called by VendorSpecificActionHeader
102 uint32_t GetSerializedSize (void) const;
107 void Serialize (Buffer::Iterator start) const;
114
115private:
116 friend bool operator == (const OrganizationIdentifier& a, const OrganizationIdentifier& b);
117 friend bool operator != (const OrganizationIdentifier& a, const OrganizationIdentifier& b);
118 friend bool operator < (const OrganizationIdentifier& a, const OrganizationIdentifier& b);
119 friend std::ostream& operator << (std::ostream& os, const OrganizationIdentifier& oi);
120 friend std::istream& operator >> (std::istream& is, const OrganizationIdentifier& oi);
121
123 uint8_t m_oi[5];
124};
125
127
131
132std::ostream& operator << (std::ostream& os, const OrganizationIdentifier& oi);
133std::istream& operator >> (std::istream& is, const OrganizationIdentifier& oi);
134
139const static uint8_t CATEGORY_OF_VSA = 127;
140
160{
161public:
163 virtual ~VendorSpecificActionHeader (void);
164
180 uint8_t GetCategory (void) const;
181
186 static TypeId GetTypeId (void);
187 virtual TypeId GetInstanceTypeId (void) const;
188 virtual void Print (std::ostream &os) const;
189 virtual uint32_t GetSerializedSize (void) const;
190 virtual void Serialize (Buffer::Iterator start) const;
192
193private:
195 uint8_t m_category;
196};
197
207
214{
215public:
217 virtual ~VendorSpecificContentManager (void);
241
242private:
244 typedef std::map<OrganizationIdentifier,VscCallback> VscCallbacks;
246 typedef std::map<OrganizationIdentifier,VscCallback>::iterator VscCallbacksI;
247
249};
250
251static std::vector<OrganizationIdentifier> OrganizationIdentifiers;
252}
253
254#endif /* Vendor_Specific_Action_H */
a polymophic address class
Definition: address.h:91
iterator in a Buffer instance
Definition: buffer.h:99
Callback template class.
Definition: callback.h:1279
Protocol header serialization and deserialization.
Definition: header.h:43
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.
uint32_t GetSerializedSize(void) const
Get serialized size.
OrganizationIdentifier & operator=(const OrganizationIdentifier &oi)
Assignment operator.
friend std::ostream & operator<<(std::ostream &os, const OrganizationIdentifier &oi)
output operator
enum OrganizationIdentifierType m_type
OI type.
enum OrganizationIdentifierType GetType(void) const
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.
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)
a unique identifier for an interface.
Definition: type-id.h:59
See IEEE 802.11-2007 chapter 7.3.1.11 and 7.4.5 also IEEE 802.11p-2010 chapter 7.4....
virtual void Print(std::ostream &os) const
static TypeId GetTypeId(void)
Get the type ID.
uint8_t GetCategory(void) const
Get the category field.
virtual uint32_t GetSerializedSize(void) const
virtual uint32_t Deserialize(Buffer::Iterator start)
virtual void Serialize(Buffer::Iterator start) const
void SetOrganizationIdentifier(OrganizationIdentifier oi)
OrganizationIdentifier GetOrganizationIdentifier(void) const
virtual TypeId GetInstanceTypeId(void) const
Get the most derived TypeId for this Object.
VendorSpecificContentManager class.
void RegisterVscCallback(OrganizationIdentifier oi, VscCallback cb)
std::map< OrganizationIdentifier, VscCallback > VscCallbacks
VSC callback typedef.
bool IsVscCallbackRegistered(OrganizationIdentifier &oi)
VscCallback FindVscCallback(OrganizationIdentifier &oi)
std::map< OrganizationIdentifier, VscCallback >::iterator VscCallbacksI
VSC callback iterator typedef.
void DeregisterVscCallback(OrganizationIdentifier &oi)
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==(const EventId &a, const EventId &b)
Definition: event-id.h:158
ATTRIBUTE_HELPER_HEADER(ValueClassTest)
std::ostream & operator<<(std::ostream &os, const Angles &a)
Definition: angles.cc:139
std::istream & operator>>(std::istream &is, Angles &a)
Definition: angles.cc:162
bool operator<(const EventId &a, const EventId &b)
Definition: event-id.h:176
bool operator!=(Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > a, Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 > b)
Inequality test.
Definition: callback.h:1612
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:1853