4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 */
25
26 #ifndef STATES_H
27 #define STATES_H
28
29 #include <sys/types.h>
30 #include <netinet/in.h>
31 #include <netinet/dhcp.h>
32 #include <libinetutil.h>
33
34 #include "common.h"
35 #include "ipc_action.h"
36 #include "async.h"
37 #include "packet.h"
38 #include "util.h"
39
40 /*
41 * interfaces for state transition/action functions. these functions
42 * can be found in suitably named .c files, such as inform.c, select.c,
43 * renew.c, etc.
184 * milliseconds (4000, 8000, 16000, 32000, 64000), and dsm_send_timeout
185 * is that value plus the +/- 1000 millisecond fuzz.
186 *
187 * For v6, dsm_send_tcenter is the MRT (maximum retransmit timer)
188 * value, and dsm_send_timeout must be set to the IRT (initial
189 * retransmit timer) value by the sender.
190 */
191 uint_t dsm_send_timeout;
192 uint_t dsm_send_tcenter;
193 stop_func_t *dsm_send_stop_func;
194 uint32_t dsm_packet_sent;
195 iu_timer_id_t dsm_retrans_timer;
196
197 /*
198 * The host name we've been asked to request is remembered
199 * here between the DISCOVER and the REQUEST. (v4 only)
200 */
201 char *dsm_reqhost;
202
203 /*
204 * V4 and V6 use slightly different timers. For v4, we must count
205 * seconds from the point where we first try to configure the
206 * interface. For v6, only seconds while performing a transaction
207 * matter.
208 *
209 * In v4, `dsm_neg_hrtime' represents the time since DHCP started
210 * configuring the interface, and is used for computing the pkt->secs
211 * field in v4. In v6, it represents the time since the current
212 * transaction (if any) was started, and is used for the ELAPSED_TIME
213 * option.
214 *
215 * `dsm_newstart_monosec' represents the time the ACKed REQUEST was
216 * sent, which represents the start time of a new batch of leases.
217 * When the lease time actually begins (and thus becomes current),
218 * `dsm_curstart_monosec' is set to `dsm_newstart_monosec'.
219 */
220 hrtime_t dsm_neg_hrtime;
221 monosec_t dsm_newstart_monosec;
222 monosec_t dsm_curstart_monosec;
223
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21 /*
22 * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
24 * Copyright (c) 2016, Chris Fraire <cfraire@me.com>.
25 */
26
27 #ifndef STATES_H
28 #define STATES_H
29
30 #include <sys/types.h>
31 #include <netinet/in.h>
32 #include <netinet/dhcp.h>
33 #include <libinetutil.h>
34
35 #include "common.h"
36 #include "ipc_action.h"
37 #include "async.h"
38 #include "packet.h"
39 #include "util.h"
40
41 /*
42 * interfaces for state transition/action functions. these functions
43 * can be found in suitably named .c files, such as inform.c, select.c,
44 * renew.c, etc.
185 * milliseconds (4000, 8000, 16000, 32000, 64000), and dsm_send_timeout
186 * is that value plus the +/- 1000 millisecond fuzz.
187 *
188 * For v6, dsm_send_tcenter is the MRT (maximum retransmit timer)
189 * value, and dsm_send_timeout must be set to the IRT (initial
190 * retransmit timer) value by the sender.
191 */
192 uint_t dsm_send_timeout;
193 uint_t dsm_send_tcenter;
194 stop_func_t *dsm_send_stop_func;
195 uint32_t dsm_packet_sent;
196 iu_timer_id_t dsm_retrans_timer;
197
198 /*
199 * The host name we've been asked to request is remembered
200 * here between the DISCOVER and the REQUEST. (v4 only)
201 */
202 char *dsm_reqhost;
203
204 /*
205 * The host name we've been asked by IPC message (e.g.,
206 * `ipadm -T dhcp -h ...') to request is remembered here until it is
207 * reset by another external message.
208 */
209 char *dsm_msg_reqhost;
210
211 /*
212 * The determined FQDN is remembered here between the DISCOVER/SOLICIT
213 * and the REQUEST.
214 */
215 char *dsm_reqfqdn;
216
217 /*
218 * V4 and V6 use slightly different timers. For v4, we must count
219 * seconds from the point where we first try to configure the
220 * interface. For v6, only seconds while performing a transaction
221 * matter.
222 *
223 * In v4, `dsm_neg_hrtime' represents the time since DHCP started
224 * configuring the interface, and is used for computing the pkt->secs
225 * field in v4. In v6, it represents the time since the current
226 * transaction (if any) was started, and is used for the ELAPSED_TIME
227 * option.
228 *
229 * `dsm_newstart_monosec' represents the time the ACKed REQUEST was
230 * sent, which represents the start time of a new batch of leases.
231 * When the lease time actually begins (and thus becomes current),
232 * `dsm_curstart_monosec' is set to `dsm_newstart_monosec'.
233 */
234 hrtime_t dsm_neg_hrtime;
235 monosec_t dsm_newstart_monosec;
236 monosec_t dsm_curstart_monosec;
237
|