22 #ifndef IPV4_L3_CLICK_PROTOCOL_H
23 #define IPV4_L3_CLICK_PROTOCOL_H
26 #include "ns3/net-device.h"
27 #include "ns3/packet.h"
28 #include "ns3/ipv4-routing-protocol.h"
29 #include "ns3/traced-callback.h"
30 #include "ns3/ipv4-interface.h"
40 class Ipv4RoutingTableEntry;
44 class Ipv4RawSocketImpl;
46 class Icmpv4L4Protocol;
65 static TypeId GetTypeId (
void);
70 static const uint16_t PROT_NUMBER;
103 void SetDefaultTtl (uint8_t ttl);
186 void SetupLoopback (
void);
217 bool RemoveAddress (uint32_t interfaceIndex, uint32_t addressIndex);
219 Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope);
221 void SetMetric (uint32_t i, uint16_t metric);
223 uint16_t
GetMtu (uint32_t i)
const;
224 bool IsUp (uint32_t i)
const;
225 void SetUp (uint32_t i);
229 void SetPromisc (uint32_t i);
243 uint16_t payloadSize,
247 virtual void SetIpForward (
bool forward);
248 virtual bool GetIpForward (
void)
const;
249 virtual void SetWeakEsModel (
bool model);
250 virtual bool GetWeakEsModel (
void)
const;
252 typedef std::vector<Ptr<Ipv4Interface> > Ipv4InterfaceList;
253 typedef std::list<Ptr<Ipv4RawSocketImpl> > SocketList;
254 typedef std::list<Ptr<IpL4Protocol> > L4List_t;
259 L4List_t m_protocols;
260 Ipv4InterfaceList m_interfaces;
261 uint8_t m_defaultTtl;
262 uint16_t m_identification;
270 SocketList m_sockets;
272 std::vector<bool> m_promiscDeviceList;
virtual uint32_t AddInterface(Ptr< NetDevice > device)=0
virtual int32_t GetInterfaceForPrefix(Ipv4Address address, Ipv4Mask mask) const =0
Return the interface number of first interface found that has an Ipv4 address within the prefix speci...
a class to represent an Ipv4 address mask
forward calls to a chain of CallbackAn ns3::TracedCallback has almost exactly the same API as a norma...
virtual void DoDispose(void)
virtual Ptr< NetDevice > GetNetDevice(uint32_t interface)=0
virtual void SetForwarding(uint32_t interface, bool val)=0
virtual Ptr< Ipv4RoutingProtocol > GetRoutingProtocol(void) const =0
Get the routing protocol to be used by this Ipv4 stack.
a polymophic address class
virtual bool IsDestinationAddress(Ipv4Address address, uint32_t iif) const =0
Determine whether address and interface corresponding to received packet can be accepted for local de...
virtual void DeleteRawSocket(Ptr< Socket > socket)=0
Deletes a particular raw socket.
virtual Ptr< IpL4Protocol > GetProtocol(int protocolNumber) const =0
virtual void SetUp(uint32_t interface)=0
virtual uint16_t GetMetric(uint32_t interface) const =0
virtual void SendWithHeader(Ptr< Packet > packet, Ipv4Header ipHeader, Ptr< Ipv4Route > route)=0
virtual void NotifyNewAggregate(void)
Access to the Ipv4 forwarding table, interfaces, and configuration.
virtual bool IsForwarding(uint32_t interface) const =0
Implement the Ipv4 layer specifically for Click nodes to allow a clean integration of Click...
virtual uint16_t GetMtu(uint32_t interface) const =0
virtual void Send(Ptr< Packet > packet, Ipv4Address source, Ipv4Address destination, uint8_t protocol, Ptr< Ipv4Route > route)=0
virtual Ptr< Socket > CreateRawSocket(void)=0
Creates a raw socket.
virtual bool IsUp(uint32_t interface) const =0
Ipv4 addresses are stored in host order in this class.
virtual void Insert(Ptr< IpL4Protocol > protocol)=0
a class to store IPv4 address information on an interface
virtual Ipv4InterfaceAddress GetAddress(uint32_t interface, uint32_t addressIndex) const =0
virtual uint32_t GetNAddresses(uint32_t interface) const =0
virtual Ipv4Address SelectSourceAddress(Ptr< const NetDevice > device, Ipv4Address dst, Ipv4InterfaceAddress::InterfaceAddressScope_e scope)=0
Return the first primary source address with scope less than or equal to the requested scope...
virtual void SetMetric(uint32_t interface, uint16_t metric)=0
virtual int32_t GetInterfaceForDevice(Ptr< const NetDevice > device) const =0
virtual bool AddAddress(uint32_t interface, Ipv4InterfaceAddress address)=0
virtual int32_t GetInterfaceForAddress(Ipv4Address address) const =0
Return the interface number of the interface that has been assigned the specified IP address...
virtual void SetDown(uint32_t interface)=0
virtual bool RemoveAddress(uint32_t interface, uint32_t addressIndex)=0
a unique identifier for an interface.
virtual uint32_t GetNInterfaces(void) const =0
virtual void SetRoutingProtocol(Ptr< Ipv4RoutingProtocol > routingProtocol)=0
Register a new routing protocol to be used by this Ipv4 stack.