A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ipv6-end-point.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007-2009 Strasbourg University
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: Sebastien Vincent <vincent@clarinet.u-strasbg.fr>
19  */
20 
21 #ifndef IPV6_END_POINT_H
22 #define IPV6_END_POINT_H
23 
24 #include <stdint.h>
25 
26 #include "ns3/ipv6-address.h"
27 #include "ns3/callback.h"
28 #include "ns3/ipv6-header.h"
29 #include "ns3/net-device.h"
30 #include "ns3/ipv6-interface.h"
31 
32 namespace ns3
33 {
34 
35 class Header;
36 class Packet;
37 
49 {
50 public:
56  Ipv6EndPoint (Ipv6Address addr, uint16_t port);
57 
58  ~Ipv6EndPoint ();
59 
65 
70  void SetLocalAddress (Ipv6Address addr);
71 
76  uint16_t GetLocalPort ();
77 
82  void SetLocalPort (uint16_t port);
83 
89 
94  uint16_t GetPeerPort ();
95 
101  void SetPeer (Ipv6Address addr, uint16_t port);
102 
121  void BindToNetDevice (Ptr<NetDevice> netdevice);
122 
133 
138  void SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Header, uint16_t, Ptr<Ipv6Interface> > callback);
139 
145 
150  void SetDestroyCallback (Callback<void> callback);
151 
163  void ForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t port, Ptr<Ipv6Interface> incomingInterface);
164 
177  void ForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
178  uint8_t code, uint32_t info);
179 
180 private:
188  void DoForwardUp (Ptr<Packet> p, Ipv6Header header, uint16_t sport, Ptr<Ipv6Interface> incomingInterface);
189 
198  void DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
199  uint8_t code, uint32_t info);
200 
205 
209  uint16_t m_localPort;
210 
215 
219  uint16_t m_peerPort;
220 
225 
230 
235 
240 };
241 
242 } /* namespace ns3 */
243 
244 #endif /* IPV6_END_POINT_H */
245 
Ipv6Address GetLocalAddress()
Get the local address.
Ptr< NetDevice > m_boundnetdevice
The NetDevice the EndPoint is bound to (if any).
Doxygen introspection did not find any typical Config paths.
Definition: ipv6-header.h:33
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
Callback template class.
Definition: callback.h:920
Ipv6Address m_peerAddr
The peer address.
void ForwardUp(Ptr< Packet > p, Ipv6Header header, uint16_t port, Ptr< Ipv6Interface > incomingInterface)
Forward the packet to the upper level.
void DoForwardUp(Ptr< Packet > p, Ipv6Header header, uint16_t sport, Ptr< Ipv6Interface > incomingInterface)
ForwardUp wrapper.
uint16_t port
Definition: dsdv-manet.cc:44
void SetDestroyCallback(Callback< void > callback)
Set the default destroy callback.
uint16_t GetPeerPort()
Get the peer port.
void SetLocalAddress(Ipv6Address addr)
Set the local address.
void BindToNetDevice(Ptr< NetDevice > netdevice)
Bind a socket to specific device.
uint16_t GetLocalPort()
Get the local port.
Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > m_icmpCallback
The ICMPv6 callback.
Ipv6Address m_localAddr
The local address.
void DoForwardIcmp(Ipv6Address src, uint8_t ttl, uint8_t type, uint8_t code, uint32_t info)
ForwardIcmp wrapper.
Ipv6EndPoint(Ipv6Address addr, uint16_t port)
Constructor.
Callback< void > m_destroyCallback
The destroy callback.
uint16_t m_peerPort
The peer port.
void SetIcmpCallback(Callback< void, Ipv6Address, uint8_t, uint8_t, uint8_t, uint32_t > callback)
Set the ICMP callback.
Describes an IPv6 address.
Definition: ipv6-address.h:46
Callback< void, Ptr< Packet >, Ipv6Header, uint16_t, Ptr< Ipv6Interface > > m_rxCallback
The RX callback.
Ipv6Address GetPeerAddress()
Get the peer address.
A representation of an internet IPv6 endpoint/connection.
void SetRxCallback(Callback< void, Ptr< Packet >, Ipv6Header, uint16_t, Ptr< Ipv6Interface > > callback)
Set the reception callback.
void ForwardIcmp(Ipv6Address src, uint8_t ttl, uint8_t type, uint8_t code, uint32_t info)
Forward the ICMP packet to the upper level.
void SetLocalPort(uint16_t port)
Set the local port.
Ptr< NetDevice > GetBoundNetDevice(void)
Returns socket's bound netdevice, if any.
uint16_t m_localPort
The local port.
void SetPeer(Ipv6Address addr, uint16_t port)
Set the peer informations (address and port).