A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
icmpv4-l4-protocol.h
Go to the documentation of this file.
1 #ifndef ICMPV4_L4_PROTOCOL_H
2 #define ICMPV4_L4_PROTOCOL_H
3 
4 #include "ip-l4-protocol.h"
5 #include "icmpv4.h"
6 #include "ns3/ipv4-address.h"
7 
8 namespace ns3 {
9 
10 class Node;
11 class Ipv4Interface;
12 class Ipv4Route;
13 
15 {
16 public:
17  static TypeId GetTypeId (void);
18  static const uint8_t PROT_NUMBER;
19 
21  virtual ~Icmpv4L4Protocol ();
22 
23  void SetNode (Ptr<Node> node);
24 
25  static uint16_t GetStaticProtocolNumber (void);
26  virtual int GetProtocolNumber (void) const;
28  Ipv4Header const &header,
29  Ptr<Ipv4Interface> incomingInterface);
31  Ipv6Address &src,
32  Ipv6Address &dst,
33  Ptr<Ipv6Interface> incomingInterface);
34 
35  void SendDestUnreachFragNeeded (Ipv4Header header, Ptr<const Packet> orgData, uint16_t nextHopMtu);
36  void SendTimeExceededTtl (Ipv4Header header, Ptr<const Packet> orgData);
37  void SendDestUnreachPort (Ipv4Header header, Ptr<const Packet> orgData);
38 
39  // From IpL4Protocol
42  // From IpL4Protocol
45 protected:
46  /*
47  * This function will notify other components connected to the node that a new stack member is now connected
48  * This will be used to notify Layer 3 protocol of layer 4 protocol stack to connect them together.
49  */
50  virtual void NotifyNewAggregate ();
51 private:
52  void HandleEcho (Ptr<Packet> p,
53  Icmpv4Header header,
54  Ipv4Address source,
55  Ipv4Address destination);
57  Icmpv4Header header,
58  Ipv4Address source,
59  Ipv4Address destination);
61  Icmpv4Header icmp,
62  Ipv4Address source,
63  Ipv4Address destination);
64  void SendDestUnreach (Ipv4Header header, Ptr<const Packet> orgData,
65  uint8_t code, uint16_t nextHopMtu);
66  void SendMessage (Ptr<Packet> packet, Ipv4Address dest, uint8_t type, uint8_t code);
67  void SendMessage (Ptr<Packet> packet, Ipv4Address source, Ipv4Address dest, uint8_t type, uint8_t code, Ptr<Ipv4Route> route);
68  void Forward (Ipv4Address source, Icmpv4Header icmp,
69  uint32_t info, Ipv4Header ipHeader,
70  const uint8_t payload[8]);
71 
72  virtual void DoDispose (void);
73 
76 };
77 
78 } // namespace ns3
79 
80 #endif /* ICMPV4_L4_PROTOCOL_H */