author | Gustavo J. A. M. Carneiro <gjc@inescporto.pt> |
Fri, 11 Jul 2008 18:39:19 +0100 | |
changeset 3416 | 926ccb845111 |
parent 3260 | 8c0ab08144e6 |
permissions | -rw-r--r-- |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
2 |
/* |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
3 |
* Copyright (c) 2007 INRIA |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
4 |
* |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
8 |
* |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
13 |
* |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
17 |
* |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
18 |
* Authors: |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
19 |
* Mathieu Lacage <mathieu.lacage@sophia.inria.fr>, |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
20 |
*/ |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
21 |
#ifndef IPV4_LOOPBACK_INTERFACE_H |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
22 |
#define IPV4_LOOPBACK_INTERFACE_H |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
23 |
|
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
24 |
#include "ipv4-interface.h" |
553
eb9d614accf0
convert more code to use Ptr<Node> instead of Node *
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
524
diff
changeset
|
25 |
#include "ns3/ptr.h" |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
26 |
|
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
27 |
namespace ns3 { |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
28 |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
632
diff
changeset
|
29 |
class Node; |
632
1e419ebb4012
Internet-node module dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
607
diff
changeset
|
30 |
/** |
1e419ebb4012
Internet-node module dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
607
diff
changeset
|
31 |
* \brief An IPv4 loopback interface |
1e419ebb4012
Internet-node module dox
Raj Bhattacharjea <raj.b@gatech.edu>
parents:
607
diff
changeset
|
32 |
*/ |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
33 |
class Ipv4LoopbackInterface : public Ipv4Interface |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
34 |
{ |
3147
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
35 |
public: |
e0c2a7c2eb5f
re-organize the ARP code to expose arp cache attributes.
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
2834
diff
changeset
|
36 |
static TypeId GetTypeId (void); |
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
37 |
Ipv4LoopbackInterface (); |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
38 |
virtual ~Ipv4LoopbackInterface (); |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
39 |
|
2592
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
40 |
virtual Ptr<NetDevice> GetDevice (void) const; |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
41 |
|
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
42 |
void SetNode (Ptr<Node> node); |
3ebf97150166
get rid of CreateObjectWith
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1866
diff
changeset
|
43 |
|
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
44 |
private: |
1866
e7dbcc4df546
do not use Packet objects directly. Use Ptr<Packet> instead
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
1341
diff
changeset
|
45 |
virtual void SendTo (Ptr<Packet> p, Ipv4Address dest); |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
46 |
|
728
95c426b1cb60
rename INode to Node
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
632
diff
changeset
|
47 |
Ptr<Node> m_node; |
246
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
48 |
}; |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
49 |
|
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
50 |
}//namespace ns3 |
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
51 |
|
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
52 |
|
612b3c16b24e
implement ipv4 loopback for testing
Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
parents:
diff
changeset
|
53 |
#endif /* IPV4_LOOPBACK_INTERFACE_H */ |