Skip to content

Commit 71a169f

Browse files
committed
Split IcmpErrorTag.msg into Icmpv4ErrorTag.msg and Icmpv6ErrorTag.msg
Separate the combined IcmpErrorTag.msg into protocol-specific files: - Icmpv4ErrorTag.msg: Icmpv4ErrorInd, Icmpv4SendErrorReq - Icmpv6ErrorTag.msg: Icmpv6ErrorInd, Icmpv6SendErrorReq Update #include directives to use the specific header(s): - v4 only: Icmp.cc, Ipv4.cc - v6 only: Icmpv6.cc, Ipv6.cc - both: Udp.cc, Tcp.cc, Quic.cc
1 parent 2608165 commit 71a169f

9 files changed

Lines changed: 47 additions & 32 deletions

File tree

src/inet/networklayer/common/IcmpErrorTag.msg renamed to src/inet/networklayer/common/Icmpv4ErrorTag.msg

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import inet.common.TagBase;
99
import inet.common.packet.chunk.Chunk;
1010
import inet.common.packet.Packet;
1111
import inet.networklayer.ipv4.IcmpHeader;
12-
import inet.networklayer.icmpv6.Icmpv6Header;
1312

1413
namespace inet;
1514

@@ -26,19 +25,6 @@ class Icmpv4ErrorInd extends TagBase
2625
Packet *originalPacket @owned; // progressively unwrapped quoted packet
2726
}
2827

29-
//
30-
// ICMPv6 error indication. Attached by the Icmpv6 module when an ICMPv6 error
31-
// message is received. Each layer pops its own header from the original
32-
// packet and converts it to tags before forwarding the indication upward.
33-
//
34-
class Icmpv6ErrorInd extends TagBase
35-
{
36-
Icmpv6Type type; // ICMPv6 type (e.g. ICMPv6_PACKET_TOO_BIG)
37-
int code; // ICMPv6 code
38-
int mtu = -1; // only relevant for Packet Too Big
39-
Packet *originalPacket @owned; // progressively unwrapped quoted packet
40-
}
41-
4228
//
4329
// Request tag: asks the ICMP module to send an ICMPv4 error message.
4430
// Attached to a Request sent to ICMP via the MessageDispatcher.
@@ -49,14 +35,3 @@ class Icmpv4SendErrorReq extends TagBase
4935
int code; // ICMPv4 code (e.g. ICMP_DU_PORT_UNREACHABLE)
5036
Packet *originalPacket @owned; // the packet that triggered the error
5137
}
52-
53-
//
54-
// Request tag: asks the ICMPv6 module to send an ICMPv6 error message.
55-
// Attached to a Request sent to ICMPv6 via the MessageDispatcher.
56-
//
57-
class Icmpv6SendErrorReq extends TagBase
58-
{
59-
Icmpv6Type type; // ICMPv6 type (e.g. ICMPv6_DESTINATION_UNREACHABLE)
60-
int code; // ICMPv6 code (e.g. PORT_UNREACHABLE)
61-
Packet *originalPacket @owned; // the packet that triggered the error
62-
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//
2+
// Copyright (C) 2020 OpenSim Ltd.
3+
//
4+
// SPDX-License-Identifier: LGPL-3.0-or-later
5+
//
6+
7+
import inet.common.INETDefs;
8+
import inet.common.TagBase;
9+
import inet.common.packet.chunk.Chunk;
10+
import inet.common.packet.Packet;
11+
import inet.networklayer.icmpv6.Icmpv6Header;
12+
13+
namespace inet;
14+
15+
//
16+
// ICMPv6 error indication. Attached by the Icmpv6 module when an ICMPv6 error
17+
// message is received. Each layer pops its own header from the original
18+
// packet and converts it to tags before forwarding the indication upward.
19+
//
20+
class Icmpv6ErrorInd extends TagBase
21+
{
22+
Icmpv6Type type; // ICMPv6 type (e.g. ICMPv6_PACKET_TOO_BIG)
23+
int code; // ICMPv6 code
24+
int mtu = -1; // only relevant for Packet Too Big
25+
Packet *originalPacket @owned; // progressively unwrapped quoted packet
26+
}
27+
28+
//
29+
// Request tag: asks the ICMPv6 module to send an ICMPv6 error message.
30+
// Attached to a Request sent to ICMPv6 via the MessageDispatcher.
31+
//
32+
class Icmpv6SendErrorReq extends TagBase
33+
{
34+
Icmpv6Type type; // ICMPv6 type (e.g. ICMPv6_DESTINATION_UNREACHABLE)
35+
int code; // ICMPv6 code (e.g. PORT_UNREACHABLE)
36+
Packet *originalPacket @owned; // the packet that triggered the error
37+
}

src/inet/networklayer/icmpv6/Icmpv6.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "inet/common/ProtocolGroup.h"
1313
#include "inet/common/ProtocolTag_m.h"
1414
#include "inet/common/packet/Message.h"
15-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
15+
#include "inet/networklayer/common/Icmpv6ErrorTag_m.h"
1616
#include "inet/common/checksum/Checksum.h"
1717
#include "inet/common/lifecycle/NodeStatus.h"
1818
#include "inet/linklayer/common/InterfaceTag_m.h"

src/inet/networklayer/ipv4/Icmp.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#include "inet/common/ProtocolGroup.h"
1717
#include "inet/common/ProtocolTag_m.h"
1818
#include "inet/common/packet/Message.h"
19-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
19+
#include "inet/networklayer/common/Icmpv4ErrorTag_m.h"
2020
#include "inet/common/checksum/Checksum.h"
2121
#include "inet/common/packet/dissector/ProtocolDissector.h"
2222
#include "inet/common/packet/dissector/ProtocolDissectorRegistry.h"

src/inet/networklayer/ipv4/Ipv4.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "inet/networklayer/common/EcnTag_m.h"
3030
#include "inet/networklayer/common/FragmentationTag_m.h"
3131
#include "inet/networklayer/common/HopLimitTag_m.h"
32-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
32+
#include "inet/networklayer/common/Icmpv4ErrorTag_m.h"
3333
#include "inet/networklayer/common/L3AddressTag_m.h"
3434
#include "inet/networklayer/common/L3Tools.h"
3535
#include "inet/networklayer/common/MulticastTag_m.h"

src/inet/networklayer/ipv6/Ipv6.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include "inet/networklayer/common/DscpTag_m.h"
2121
#include "inet/networklayer/common/EcnTag_m.h"
2222
#include "inet/networklayer/common/HopLimitTag_m.h"
23-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
23+
#include "inet/networklayer/common/Icmpv6ErrorTag_m.h"
2424
#include "inet/networklayer/common/L3AddressTag_m.h"
2525
#include "inet/networklayer/common/L3Tools.h"
2626
#include "inet/networklayer/common/TosTag_m.h"

src/inet/transportlayer/quic/Quic.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
#include "UdpSocket.h"
1515
#include "AppSocket.h"
1616
#include "inet/common/ModuleAccess.h"
17-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
17+
#include "inet/networklayer/common/Icmpv4ErrorTag_m.h"
18+
#include "inet/networklayer/common/Icmpv6ErrorTag_m.h"
1819
#include "inet/networklayer/ipv4/IcmpHeader_m.h"
1920
#include "inet/networklayer/icmpv6/Icmpv6Header_m.h"
2021
#include "exception/ConnectionDiedException.h"

src/inet/transportlayer/tcp/Tcp.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#include "inet/networklayer/common/IpProtocolId_m.h"
1919
#include "inet/networklayer/common/L3AddressTag_m.h"
2020

21-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
21+
#include "inet/networklayer/common/Icmpv4ErrorTag_m.h"
22+
#include "inet/networklayer/common/Icmpv6ErrorTag_m.h"
2223
#include "inet/transportlayer/common/TransportPseudoHeader_m.h"
2324
#include "inet/transportlayer/contract/tcp/TcpCommand_m.h"
2425
#include "inet/transportlayer/tcp/Tcp.h"

src/inet/transportlayer/udp/Udp.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
#include "inet/linklayer/common/InterfaceTag_m.h"
2222
#include "inet/networklayer/common/DscpTag_m.h"
2323
#include "inet/networklayer/common/HopLimitTag_m.h"
24-
#include "inet/networklayer/common/IcmpErrorTag_m.h"
24+
#include "inet/networklayer/common/Icmpv4ErrorTag_m.h"
25+
#include "inet/networklayer/common/Icmpv6ErrorTag_m.h"
2526
#include "inet/networklayer/common/IpProtocolId_m.h"
2627
#include "inet/networklayer/common/L3AddressTag_m.h"
2728
#include "inet/networklayer/common/L3Tools.h"

0 commit comments

Comments
 (0)