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) 2011 UPB | 3 * Copyright (c) 2011 UPB |
4 * Copyright (c) 2017 NITK Surathkal | 4 * Copyright (c) 2017 NITK Surathkal |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 */ | 115 */ |
116 void NetHandler (Ptr<Socket> socket); | 116 void NetHandler (Ptr<Socket> socket); |
117 | 117 |
118 /* | 118 /* |
119 * \brief Sends DHCP DISCOVER and changes the client state to WAIT_OFFER | 119 * \brief Sends DHCP DISCOVER and changes the client state to WAIT_OFFER |
120 */ | 120 */ |
121 void Boot (void); | 121 void Boot (void); |
122 | 122 |
123 /* | 123 /* |
124 * \brief Stores DHCP offers in m_offerList | 124 * \brief Stores DHCP offers in m_offerList |
125 * \param header Header of the DHCP OFFER message | 125 * \param header DhcpHeader of the DHCP OFFER message |
126 */ | 126 */ |
127 void OfferHandler (DhcpHeader header); | 127 void OfferHandler (DhcpHeader header); |
128 | 128 |
129 /* | 129 /* |
130 * \brief Selects an OFFER from m_offerList | 130 * \brief Selects an OFFER from m_offerList |
131 */ | 131 */ |
132 void Select (void); | 132 void Select (void); |
133 | 133 |
134 /* | 134 /* |
135 * \brief Sends the DHCP REQUEST message and changes the client state to WAIT_
ACK | 135 * \brief Sends the DHCP REQUEST message and changes the client state to WAIT_
ACK |
136 */ | 136 */ |
137 void Request (void); | 137 void Request (void); |
138 | 138 |
139 /* | 139 /* |
140 * \brief Receives the DHCP ACK and configures IP address of the client. | 140 * \brief Receives the DHCP ACK and configures IP address of the client. |
141 * It also triggers the timeout, renew and rebind events. | 141 * It also triggers the timeout, renew and rebind events. |
142 * \param header Header of the DHCP ACK message | 142 * \param header DhcpHeader of the DHCP ACK message |
143 * \param from IP address of DHCP server that sent the DHCP ACK | 143 * \param from Address of DHCP server that sent the DHCP ACK |
144 */ | 144 */ |
145 void AcceptAck (DhcpHeader header, Address from); | 145 void AcceptAck (DhcpHeader header, Address from); |
| 146 |
| 147 /* |
| 148 * \brief Remove the current DHCP information and restart the process |
| 149 */ |
| 150 void RemoveAndStart (); |
146 | 151 |
147 uint8_t m_state; //!< State of the DHCP client | 152 uint8_t m_state; //!< State of the DHCP client |
148 uint32_t device; //!< Device identifier | 153 uint32_t device; //!< Device identifier |
149 Ptr<Socket> m_socket; //!< Socket for remote communication | 154 Ptr<Socket> m_socket; //!< Socket for remote communication |
150 Ipv4Address m_remoteAddress; //!< Initially set to 255.255.255.255 t
o start DHCP | 155 Ipv4Address m_remoteAddress; //!< Initially set to 255.255.255.255 t
o start DHCP |
151 Ipv4Address m_offeredAddress; //!< Address offered to the client | 156 Ipv4Address m_offeredAddress; //!< Address offered to the client |
152 Ipv4Address m_myAddress; //!< Address assigned to the client | 157 Ipv4Address m_myAddress; //!< Address assigned to the client |
153 Ipv4Mask m_myMask; //!< Mask of the address assigned | 158 Ipv4Mask m_myMask; //!< Mask of the address assigned |
154 Ipv4Address m_server; //!< Address of the DHCP server | 159 Ipv4Address m_server; //!< Address of the DHCP server |
155 Ipv4Address m_gateway; //!< Address of the gateway | 160 Ipv4Address m_gateway; //!< Address of the gateway |
(...skipping 13 matching lines...) Expand all Loading... |
169 bool m_offered; //!< Specify if the client has got any
offer | 174 bool m_offered; //!< Specify if the client has got any
offer |
170 std::list<DhcpHeader> m_offerList; //!< Stores all the offers given to the
client | 175 std::list<DhcpHeader> m_offerList; //!< Stores all the offers given to the
client |
171 uint32_t m_tran; //!< Stores the current transaction num
ber to be used | 176 uint32_t m_tran; //!< Stores the current transaction num
ber to be used |
172 TracedCallback<const Ipv4Address&> m_newLease;//!< Trace of new lease | 177 TracedCallback<const Ipv4Address&> m_newLease;//!< Trace of new lease |
173 TracedCallback<const Ipv4Address&> m_expiry; //!< Trace of expiry | 178 TracedCallback<const Ipv4Address&> m_expiry; //!< Trace of expiry |
174 }; | 179 }; |
175 | 180 |
176 } // namespace ns3 | 181 } // namespace ns3 |
177 | 182 |
178 #endif /* DHCP_CLIENT_H */ | 183 #endif /* DHCP_CLIENT_H */ |
LEFT | RIGHT |