A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
ip-l4-protocol.h
Go to the documentation of this file.
1
// -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*-
2
//
3
// Copyright (c) 2006 Georgia Tech Research Corporation
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: George F. Riley<riley@ece.gatech.edu>
19
//
20
21
// NS3 - Layer 4 Protocol base class
22
// George F. Riley, Georgia Tech, Spring 2007
23
24
#ifndef IP_L4_PROTOCOL_H
25
#define IP_L4_PROTOCOL_H
26
27
#include "ns3/object.h"
28
#include "ns3/callback.h"
29
#include "ns3/ipv4-header.h"
30
#include "ns3/ipv6-header.h"
31
#include "ns3/ipv6-interface.h"
32
33
namespace
ns3 {
34
35
class
Packet;
36
class
Ipv4Address;
37
class
Ipv4Interface;
38
class
Ipv4Route;
39
class
Ipv6Route;
40
47
class
IpL4Protocol
:
public
Object
48
{
49
public
:
50
enum
RxStatus
{
51
RX_OK
,
52
RX_CSUM_FAILED
,
53
RX_ENDPOINT_CLOSED
,
54
RX_ENDPOINT_UNREACH
55
};
56
57
static
TypeId
GetTypeId
(
void
);
58
59
virtual
~IpL4Protocol
();
60
64
virtual
int
GetProtocolNumber
(
void
)
const
= 0;
65
74
virtual
enum
RxStatus
Receive
(
Ptr<Packet>
p,
75
Ipv4Header
const
&header,
76
Ptr<Ipv4Interface>
incomingInterface) = 0;
77
virtual
enum
RxStatus
Receive
(
Ptr<Packet>
p,
78
Ipv6Header
const
&header,
79
Ptr<Ipv6Interface>
incomingInterface) = 0;
80
95
virtual
void
ReceiveIcmp
(
Ipv4Address
icmpSource, uint8_t icmpTtl,
96
uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
97
Ipv4Address
payloadSource,
Ipv4Address
payloadDestination,
98
const
uint8_t payload[8]);
99
virtual
void
ReceiveIcmp
(
Ipv6Address
icmpSource, uint8_t icmpTtl,
100
uint8_t icmpType, uint8_t icmpCode, uint32_t icmpInfo,
101
Ipv6Address
payloadSource,
Ipv6Address
payloadDestination,
102
const
uint8_t payload[8]);
103
104
typedef
Callback<void,Ptr<Packet>
,
Ipv4Address
,
Ipv4Address
, uint8_t,
Ptr<Ipv4Route>
>
DownTargetCallback
;
105
typedef
Callback<void,Ptr<Packet>
,
Ipv6Address
,
Ipv6Address
, uint8_t,
Ptr<Ipv6Route>
>
DownTargetCallback6
;
112
virtual
void
SetDownTarget
(
DownTargetCallback
cb) = 0;
113
virtual
void
SetDownTarget6
(
DownTargetCallback6
cb) = 0;
120
virtual
DownTargetCallback
GetDownTarget
(
void
)
const
= 0;
121
virtual
DownTargetCallback6
GetDownTarget6
(
void
)
const
= 0;
122
};
123
124
}
// Namespace ns3
125
126
#endif
src
internet
model
ip-l4-protocol.h
Generated on Fri Dec 21 2012 19:00:36 for ns-3 by
1.8.1.2