56 |
57 |
57 Ipv4L3Protocol(); |
58 Ipv4L3Protocol(); |
58 virtual ~Ipv4L3Protocol (); |
59 virtual ~Ipv4L3Protocol (); |
59 |
60 |
60 void SetNode (Ptr<Node> node); |
61 void SetNode (Ptr<Node> node); |
|
62 |
|
63 /** |
|
64 * \param protocol a template for the protocol to add to this L4 Demux. |
|
65 * \returns the L4Protocol effectively added. |
|
66 * |
|
67 * Invoke Copy on the input template to get a copy of the input |
|
68 * protocol which can be used on the Node on which this L4 Demux |
|
69 * is running. The new L4Protocol is registered internally as |
|
70 * a working L4 Protocol and returned from this method. |
|
71 * The caller does not get ownership of the returned pointer. |
|
72 */ |
|
73 void Insert(Ptr<Ipv4L4Protocol> protocol); |
|
74 /** |
|
75 * \param protocolNumber number of protocol to lookup |
|
76 * in this L4 Demux |
|
77 * \returns a matching L4 Protocol |
|
78 * |
|
79 * This method is typically called by lower layers |
|
80 * to forward packets up the stack to the right protocol. |
|
81 * It is also called from NodeImpl::GetUdp for example. |
|
82 */ |
|
83 Ptr<Ipv4L4Protocol> GetProtocol(int protocolNumber); |
|
84 /** |
|
85 * \param protocol protocol to remove from this demux. |
|
86 * |
|
87 * The input value to this method should be the value |
|
88 * returned from the Ipv4L4Protocol::Insert method. |
|
89 */ |
|
90 void Remove (Ptr<Ipv4L4Protocol> protocol); |
61 |
91 |
62 /** |
92 /** |
63 * \param ttl default ttl to use |
93 * \param ttl default ttl to use |
64 * |
94 * |
65 * When we need to send an ipv4 packet, we use this default |
95 * When we need to send an ipv4 packet, we use this default |
185 Ipv4Header &ipHeader, |
215 Ipv4Header &ipHeader, |
186 Ptr<NetDevice> device); |
216 Ptr<NetDevice> device); |
187 void ForwardUp (Ptr<Packet> p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface); |
217 void ForwardUp (Ptr<Packet> p, Ipv4Header const&ip, Ptr<Ipv4Interface> incomingInterface); |
188 uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface); |
218 uint32_t AddIpv4Interface (Ptr<Ipv4Interface> interface); |
189 void SetupLoopback (void); |
219 void SetupLoopback (void); |
|
220 Ipv4L3Protocol(const Ipv4L3Protocol &); |
|
221 Ipv4L3Protocol &operator = (const Ipv4L3Protocol &); |
190 |
222 |
191 typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList; |
223 typedef std::list<Ptr<Ipv4Interface> > Ipv4InterfaceList; |
192 typedef std::list<std::pair<Ipv4Address, Ipv4Address> > |
224 typedef std::list<std::pair<Ipv4Address, Ipv4Address> > |
193 Ipv4MulticastGroupList; |
225 Ipv4MulticastGroupList; |
194 typedef std::list< std::pair< int, Ptr<Ipv4RoutingProtocol> > > Ipv4RoutingProtocolList; |
226 typedef std::list< std::pair< int, Ptr<Ipv4RoutingProtocol> > > Ipv4RoutingProtocolList; |
195 |
227 |
|
228 typedef std::list<Ptr<Ipv4L4Protocol> > L4List_t; |
|
229 L4List_t m_protocols; |
196 Ipv4InterfaceList m_interfaces; |
230 Ipv4InterfaceList m_interfaces; |
197 uint32_t m_nInterfaces; |
231 uint32_t m_nInterfaces; |
198 uint8_t m_defaultTtl; |
232 uint8_t m_defaultTtl; |
199 bool m_calcChecksum; |
233 bool m_calcChecksum; |
200 uint16_t m_identification; |
234 uint16_t m_identification; |