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 
29 namespace ns3
30 {
31 
32 class Header;
33 class Packet;
34 
40 {
41 public:
47  Ipv6EndPoint (Ipv6Address addr, uint16_t port);
48 
52  ~Ipv6EndPoint ();
53 
59 
64  void SetLocalAddress (Ipv6Address addr);
65 
70  uint16_t GetLocalPort ();
71 
76  void SetLocalPort (uint16_t port);
77 
83 
88  uint16_t GetPeerPort ();
89 
95  void SetPeer (Ipv6Address addr, uint16_t port);
96 
101  void SetRxCallback (Callback<void, Ptr<Packet>, Ipv6Address, Ipv6Address, uint16_t> callback);
102 
108 
113  void SetDestroyCallback (Callback<void> callback);
114 
122  void ForwardUp (Ptr<Packet> p, Ipv6Address srcAddr, Ipv6Address dstAddr, uint16_t port);
123 
133  void ForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
134  uint8_t code, uint32_t info);
135 
136 private:
144  void DoForwardUp (Ptr<Packet> p, Ipv6Address saddr, Ipv6Address daddr, uint16_t sport);
145 
154  void DoForwardIcmp (Ipv6Address src, uint8_t ttl, uint8_t type,
155  uint8_t code, uint32_t info);
156 
161 
165  uint16_t m_localPort;
166 
171 
175  uint16_t m_peerPort;
176 
181 
186 
191 };
192 
193 } /* namespace ns3 */
194 
195 #endif /* IPV6_END_POINT_H */
196