LEFT | RIGHT |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2007 Georgia Tech Research Corporation | 3 * Copyright (c) 2007 Georgia Tech Research Corporation |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 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 | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 62 |
63 void SetNode (Ptr<Node> node); | 63 void SetNode (Ptr<Node> node); |
64 | 64 |
65 virtual int GetProtocolNumber (void) const; | 65 virtual int GetProtocolNumber (void) const; |
66 | 66 |
67 /** | 67 /** |
68 * \return A smart Socket pointer to a TcpSocketImpl, allocated by this instan
ce | 68 * \return A smart Socket pointer to a TcpSocketImpl, allocated by this instan
ce |
69 * of the TCP protocol | 69 * of the TCP protocol |
70 */ | 70 */ |
71 Ptr<Socket> CreateSocket (void); | 71 Ptr<Socket> CreateSocket (void); |
| 72 Ptr<Socket> CreateSocket (TypeId socketTypeId); |
72 | 73 |
73 Ipv4EndPoint *Allocate (void); | 74 Ipv4EndPoint *Allocate (void); |
74 Ipv4EndPoint *Allocate (Ipv4Address address); | 75 Ipv4EndPoint *Allocate (Ipv4Address address); |
75 Ipv4EndPoint *Allocate (uint16_t port); | 76 Ipv4EndPoint *Allocate (uint16_t port); |
76 Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port); | 77 Ipv4EndPoint *Allocate (Ipv4Address address, uint16_t port); |
77 Ipv4EndPoint *Allocate (Ipv4Address localAddress, uint16_t localPort, | 78 Ipv4EndPoint *Allocate (Ipv4Address localAddress, uint16_t localPort, |
78 Ipv4Address peerAddress, uint16_t peerPort); | 79 Ipv4Address peerAddress, uint16_t peerPort); |
79 | 80 |
80 void DeAllocate (Ipv4EndPoint *endPoint); | 81 void DeAllocate (Ipv4EndPoint *endPoint); |
81 | 82 |
82 // // called by TcpSocketImpl. | 83 // // called by TcpSocketImpl. |
83 // bool Connect (const Ipv4Address& saddr, const Ipv4Address& daddr, | 84 // bool Connect (const Ipv4Address& saddr, const Ipv4Address& daddr, |
84 // uint16_t sport, uint16_t dport); | 85 // uint16_t sport, uint16_t dport); |
85 | 86 |
86 /** | 87 /** |
87 * \brief Send a packet via TCP | 88 * \brief Send a packet via TCP |
88 * \param packet The packet to send | 89 * \param packet The packet to send |
89 * \param saddr The source Ipv4Address | 90 * \param saddr The source Ipv4Address |
90 * \param daddr The destination Ipv4Address | 91 * \param daddr The destination Ipv4Address |
91 * \param sport The source port number | 92 * \param sport The source port number |
92 * \param dport The destination port number | 93 * \param dport The destination port number |
93 * \param oif The output interface bound. Defaults to null (unspecified). | 94 * \param oif The output interface bound. Defaults to null (unspecified). |
94 */ | 95 */ |
95 void Send (Ptr<Packet> packet, | 96 void Send (Ptr<Packet> packet, |
96 Ipv4Address saddr, Ipv4Address daddr,· | 97 Ipv4Address saddr, Ipv4Address daddr,· |
97 uint16_t sport, uint16_t dport, Ptr<NetDevice> oif = 0); | 98 uint16_t sport, uint16_t dport, Ptr<NetDevice> oif = 0); |
98 /** | 99 /** |
99 * \brief Receive a packet up the protocol stack | 100 * \brief Receive a packet up the protocol stack |
100 * \param p The Packet to dump the contents into | 101 * \param p The Packet to dump the contents into |
101 * \param source The source's Ipv4Address | 102 * \param header IPv4 Header information |
102 * \param destination The destinations Ipv4Address | |
103 * \param incomingInterface The Ipv4Interface it was received on | 103 * \param incomingInterface The Ipv4Interface it was received on |
104 */ | 104 */ |
105 virtual enum Ipv4L4Protocol::RxStatus Receive (Ptr<Packet> p, | 105 virtual enum Ipv4L4Protocol::RxStatus Receive (Ptr<Packet> p, |
106 Ipv4Address const &source, | 106 Ipv4Header const &header, |
107 Ipv4Address const &destination, | |
108 Ptr<Ipv4Interface> incomingInte
rface); | 107 Ptr<Ipv4Interface> incomingInte
rface); |
109 | 108 |
110 protected: | 109 protected: |
111 virtual void DoDispose (void); | 110 virtual void DoDispose (void); |
112 /*· | 111 /*· |
113 * This function will notify other components connected to the node that a new
stack member is now connected | 112 * This function will notify other components connected to the node that a new
stack member is now connected |
114 * This will be used to notify Layer 3 protocol of layer 4 protocol stack to c
onnect them together. | 113 * This will be used to notify Layer 3 protocol of layer 4 protocol stack to c
onnect them together. |
115 */ | 114 */ |
116 virtual void NotifyNewAggregate (); | 115 virtual void NotifyNewAggregate (); |
117 private: | 116 private: |
118 Ptr<Node> m_node; | 117 Ptr<Node> m_node; |
119 Ipv4EndPointDemux *m_endPoints; | 118 Ipv4EndPointDemux *m_endPoints; |
120 TypeId m_rttTypeId; | 119 TypeId m_rttTypeId; |
121 TypeId m_socketTypeId; | 120 TypeId m_socketTypeId; |
122 private: | 121 private: |
123 friend class TcpSocketBase; | 122 friend class TcpSocketBase; |
124 void SendPacket (Ptr<Packet>, const TcpHeader &, | 123 void SendPacket (Ptr<Packet>, const TcpHeader &, |
125 Ipv4Address, Ipv4Address, Ptr<NetDevice> oif = 0); | 124 Ipv4Address, Ipv4Address, Ptr<NetDevice> oif = 0); |
126 TcpL4Protocol (const TcpL4Protocol &o); | 125 TcpL4Protocol (const TcpL4Protocol &o); |
127 TcpL4Protocol &operator = (const TcpL4Protocol &o); | 126 TcpL4Protocol &operator = (const TcpL4Protocol &o); |
128 | 127 |
129 std::vector<Ptr<TcpSocketBase> > m_sockets; | 128 std::vector<Ptr<TcpSocketBase> > m_sockets; |
130 }; | 129 }; |
131 | 130 |
132 }; // namespace ns3 | 131 }; // namespace ns3 |
133 | 132 |
134 #endif /* TCP_L4_PROTOCOL_H */ | 133 #endif /* TCP_L4_PROTOCOL_H */ |
LEFT | RIGHT |