A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
packet-socket-address.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007 INRIA
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: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
19  */
20 #ifndef PACKET_SOCKET_ADDRESS_H
21 #define PACKET_SOCKET_ADDRESS_H
22 
23 #include "ns3/ptr.h"
24 #include "ns3/address.h"
25 #include "mac48-address.h"
26 #include "mac64-address.h"
27 #include "ns3/net-device.h"
28 
29 namespace ns3 {
30 
31 class NetDevice;
32 
39 {
40 public:
42  void SetProtocol (uint16_t protocol);
43 
44  void SetAllDevices (void);
45  void SetSingleDevice (uint32_t device);
46  void SetPhysicalAddress (const Address address);
47 
48  uint16_t GetProtocol (void) const;
49  uint32_t GetSingleDevice (void) const;
50  bool IsSingleDevice (void) const;
51  Address GetPhysicalAddress (void) const;
52 
58  operator Address () const;
65  static PacketSocketAddress ConvertFrom (const Address &address);
70  static bool IsMatchingType (const Address &address);
71 private:
72  static uint8_t GetType (void);
73  Address ConvertTo (void) const;
74  uint16_t m_protocol;
76  uint32_t m_device;
78 };
79 
80 
81 } // namespace ns3
82 
83 #endif /* PACKET_SOCKET_ADDRESS_H */
uint16_t GetProtocol(void) const
an address for a packet socket
static bool IsMatchingType(const Address &address)
uint32_t GetSingleDevice(void) const
void SetSingleDevice(uint32_t device)
a polymophic address class
Definition: address.h:86
void SetPhysicalAddress(const Address address)
Address GetPhysicalAddress(void) const
void SetProtocol(uint16_t protocol)
static PacketSocketAddress ConvertFrom(const Address &address)
Address ConvertTo(void) const
tuple address
Definition: first.py:37