Lines Matching refs:dsmp

84 	dhcp_smach_t *dsmp = dlp->dl_smach;  in dhcp_renew()  local
88 dsmp->dsm_name); in dhcp_renew()
92 if (dsmp->dsm_state == RENEWING || dsmp->dsm_state == REBINDING) { in dhcp_renew()
103 t2 = dsmp->dsm_curstart_monosec + dlp->dl_t2.dt_start; in dhcp_renew()
106 monosec() > t2 ? "" : "almost ", dsmp->dsm_name); in dhcp_renew()
116 if (!async_cancel(dsmp) || !async_start(dsmp, DHCP_EXTEND, B_FALSE) || in dhcp_renew()
117 !dhcp_extending(dsmp)) { in dhcp_renew()
124 (void) set_smach_state(dsmp, BOUND); in dhcp_renew()
130 dsmp->dsm_name); in dhcp_renew()
134 "wait for rebind", dsmp->dsm_name); in dhcp_renew()
157 dhcp_smach_t *dsmp = dlp->dl_smach; in dhcp_rebind() local
165 dsmp->dsm_name); in dhcp_rebind()
169 if ((oldstate = dsmp->dsm_state) == REBINDING) { in dhcp_rebind()
188 expire = dsmp->dsm_curstart_monosec + lif->lif_expire.dt_start; in dhcp_rebind()
196 dsmp->dsm_name); in dhcp_rebind()
206 if (dsmp->dsm_isv6) { in dhcp_rebind()
207 dsmp->dsm_server = ipv6_all_dhcp_relay_and_servers; in dhcp_rebind()
210 &dsmp->dsm_server); in dhcp_rebind()
214 (void) set_smach_state(dsmp, REBINDING); in dhcp_rebind()
221 if (!async_cancel(dsmp) || !async_start(dsmp, DHCP_EXTEND, B_FALSE) || in dhcp_rebind()
222 !dhcp_extending(dsmp)) { in dhcp_rebind()
229 (void) set_smach_state(dsmp, oldstate); in dhcp_rebind()
234 "%s; lease may expire", dsmp->dsm_name); in dhcp_rebind()
238 "will expire", dsmp->dsm_name); in dhcp_rebind()
256 dhcp_finish_expire(dhcp_smach_t *dsmp, void *arg) in dhcp_finish_expire() argument
270 if (dsmp->dsm_leases != NULL) { in dhcp_finish_expire()
273 dsmp->dsm_name); in dhcp_finish_expire()
277 (void) remove_hostconf(dsmp->dsm_name, dsmp->dsm_isv6); in dhcp_finish_expire()
280 dsmp->dsm_name); in dhcp_finish_expire()
288 if (dsmp->dsm_state == BOUND) { in dhcp_finish_expire()
289 dsmp->dsm_bad_offers = 0; in dhcp_finish_expire()
290 dsmp->dsm_sent = 0; in dhcp_finish_expire()
291 dsmp->dsm_received = 0; in dhcp_finish_expire()
294 deprecate_leases(dsmp); in dhcp_finish_expire()
297 dhcp_selecting(dsmp); in dhcp_finish_expire()
335 dhcp_smach_t *dsmp; in dhcp_expire() local
349 dsmp = lif->lif_lease->dl_smach; in dhcp_expire()
351 if (!async_cancel(dsmp)) { in dhcp_expire()
355 "on %s", dsmp->dsm_name); in dhcp_expire()
370 if (!async_start(dsmp, DHCP_START, B_FALSE)) in dhcp_expire()
372 "transaction on %s, continuing...", dsmp->dsm_name); in dhcp_expire()
380 if (expired_lif_state(dsmp) == DHCP_EXP_SOMEEXP) in dhcp_expire()
382 else if (dsmp->dsm_isv6) in dhcp_expire()
393 (void) script_start(dsmp, event, dhcp_finish_expire, lif, NULL); in dhcp_expire()
405 dhcp_extending(dhcp_smach_t *dsmp) in dhcp_extending() argument
409 stop_pkt_retransmission(dsmp); in dhcp_extending()
415 if (dsmp->dsm_state == BOUND) { in dhcp_extending()
416 dsmp->dsm_neg_hrtime = gethrtime(); in dhcp_extending()
417 dsmp->dsm_bad_offers = 0; in dhcp_extending()
418 dsmp->dsm_sent = 0; in dhcp_extending()
419 dsmp->dsm_received = 0; in dhcp_extending()
421 (void) set_smach_state(dsmp, RENEWING); in dhcp_extending()
425 dsmp->dsm_name); in dhcp_extending()
427 if (dsmp->dsm_isv6) { in dhcp_extending()
438 if (dsmp->dsm_state == RENEWING) { in dhcp_extending()
439 dpkt = init_pkt(dsmp, DHCPV6_MSG_RENEW); in dhcp_extending()
441 dsmp->dsm_serverid, dsmp->dsm_serveridlen); in dhcp_extending()
445 dpkt = init_pkt(dsmp, DHCPV6_MSG_REBIND); in dhcp_extending()
454 for (dlp = dsmp->dsm_leases; dlp != NULL; dlp = dlp->dl_next) { in dhcp_extending()
464 (void) add_pkt_prl(dpkt, dsmp); in dhcp_extending()
466 return (send_pkt_v6(dsmp, dpkt, dsmp->dsm_server, in dhcp_extending()
469 dhcp_lif_t *lif = dsmp->dsm_lif; in dhcp_extending()
473 dpkt = init_pkt(dsmp, REQUEST); in dhcp_extending()
488 (void) add_pkt_prl(dpkt, dsmp); in dhcp_extending()
494 if (!dhcp_add_fqdn_opt(dpkt, dsmp) && in dhcp_extending()
495 dsmp->dsm_reqhost != NULL) { in dhcp_extending()
496 (void) add_pkt_opt(dpkt, CD_HOSTNAME, dsmp->dsm_reqhost, in dhcp_extending()
497 strlen(dsmp->dsm_reqhost)); in dhcp_extending()
501 IN6_V4MAPPED_TO_IPADDR(&dsmp->dsm_server, server); in dhcp_extending()
502 return (send_pkt(dsmp, dpkt, server, stop_extending)); in dhcp_extending()
518 stop_extending(dhcp_smach_t *dsmp, unsigned int n_requests) in stop_extending() argument
526 if (dsmp->dsm_state == RENEWING) { in stop_extending()
530 for (dlp = dsmp->dsm_leases; dlp != NULL; dlp = dlp->dl_next) { in stop_extending()
534 t2 += dsmp->dsm_curstart_monosec; in stop_extending()
537 monosec() > t2 ? "" : "almost ", dsmp->dsm_name); in stop_extending()
548 if (!dsmp->dsm_isv6 && in stop_extending()
549 dsmp->dsm_send_timeout < DHCP_REBIND_MIN * MILLISEC / 2) { in stop_extending()
551 "%d.%03d; stopping", dsmp->dsm_send_timeout / MILLISEC, in stop_extending()
552 dsmp->dsm_send_timeout % MILLISEC); in stop_extending()