Lines Matching refs:dsmp

83 	dhcp_smach_t *dsmp = dlp->dl_smach;  in dhcp_renew()  local
87 dsmp->dsm_name); in dhcp_renew()
91 if (dsmp->dsm_state == RENEWING || dsmp->dsm_state == REBINDING) { in dhcp_renew()
102 t2 = dsmp->dsm_curstart_monosec + dlp->dl_t2.dt_start; in dhcp_renew()
105 monosec() > t2 ? "" : "almost ", dsmp->dsm_name); in dhcp_renew()
115 if (!async_cancel(dsmp) || !async_start(dsmp, DHCP_EXTEND, B_FALSE) || in dhcp_renew()
116 !dhcp_extending(dsmp)) { in dhcp_renew()
123 (void) set_smach_state(dsmp, BOUND); in dhcp_renew()
129 dsmp->dsm_name); in dhcp_renew()
133 "wait for rebind", dsmp->dsm_name); in dhcp_renew()
156 dhcp_smach_t *dsmp = dlp->dl_smach; in dhcp_rebind() local
164 dsmp->dsm_name); in dhcp_rebind()
168 if ((oldstate = dsmp->dsm_state) == REBINDING) { in dhcp_rebind()
187 expire = dsmp->dsm_curstart_monosec + lif->lif_expire.dt_start; in dhcp_rebind()
195 dsmp->dsm_name); in dhcp_rebind()
205 if (dsmp->dsm_isv6) { in dhcp_rebind()
206 dsmp->dsm_server = ipv6_all_dhcp_relay_and_servers; in dhcp_rebind()
209 &dsmp->dsm_server); in dhcp_rebind()
213 (void) set_smach_state(dsmp, REBINDING); in dhcp_rebind()
220 if (!async_cancel(dsmp) || !async_start(dsmp, DHCP_EXTEND, B_FALSE) || in dhcp_rebind()
221 !dhcp_extending(dsmp)) { in dhcp_rebind()
228 (void) set_smach_state(dsmp, oldstate); in dhcp_rebind()
233 "%s; lease may expire", dsmp->dsm_name); in dhcp_rebind()
237 "will expire", dsmp->dsm_name); in dhcp_rebind()
255 dhcp_finish_expire(dhcp_smach_t *dsmp, void *arg) in dhcp_finish_expire() argument
269 if (dsmp->dsm_leases != NULL) { in dhcp_finish_expire()
272 dsmp->dsm_name); in dhcp_finish_expire()
276 (void) remove_hostconf(dsmp->dsm_name, dsmp->dsm_isv6); in dhcp_finish_expire()
279 dsmp->dsm_name); in dhcp_finish_expire()
287 if (dsmp->dsm_state == BOUND) { in dhcp_finish_expire()
288 dsmp->dsm_bad_offers = 0; in dhcp_finish_expire()
289 dsmp->dsm_sent = 0; in dhcp_finish_expire()
290 dsmp->dsm_received = 0; in dhcp_finish_expire()
293 deprecate_leases(dsmp); in dhcp_finish_expire()
296 dhcp_selecting(dsmp); in dhcp_finish_expire()
334 dhcp_smach_t *dsmp; in dhcp_expire() local
348 dsmp = lif->lif_lease->dl_smach; in dhcp_expire()
350 if (!async_cancel(dsmp)) { in dhcp_expire()
354 "on %s", dsmp->dsm_name); in dhcp_expire()
369 if (!async_start(dsmp, DHCP_START, B_FALSE)) in dhcp_expire()
371 "transaction on %s, continuing...", dsmp->dsm_name); in dhcp_expire()
379 if (expired_lif_state(dsmp) == DHCP_EXP_SOMEEXP) in dhcp_expire()
381 else if (dsmp->dsm_isv6) in dhcp_expire()
392 (void) script_start(dsmp, event, dhcp_finish_expire, lif, NULL); in dhcp_expire()
404 dhcp_extending(dhcp_smach_t *dsmp) in dhcp_extending() argument
408 stop_pkt_retransmission(dsmp); in dhcp_extending()
414 if (dsmp->dsm_state == BOUND) { in dhcp_extending()
415 dsmp->dsm_neg_hrtime = gethrtime(); in dhcp_extending()
416 dsmp->dsm_bad_offers = 0; in dhcp_extending()
417 dsmp->dsm_sent = 0; in dhcp_extending()
418 dsmp->dsm_received = 0; in dhcp_extending()
420 (void) set_smach_state(dsmp, RENEWING); in dhcp_extending()
424 dsmp->dsm_name); in dhcp_extending()
426 if (dsmp->dsm_isv6) { in dhcp_extending()
437 if (dsmp->dsm_state == RENEWING) { in dhcp_extending()
438 dpkt = init_pkt(dsmp, DHCPV6_MSG_RENEW); in dhcp_extending()
440 dsmp->dsm_serverid, dsmp->dsm_serveridlen); in dhcp_extending()
444 dpkt = init_pkt(dsmp, DHCPV6_MSG_REBIND); in dhcp_extending()
453 for (dlp = dsmp->dsm_leases; dlp != NULL; dlp = dlp->dl_next) { in dhcp_extending()
463 (void) add_pkt_prl(dpkt, dsmp); in dhcp_extending()
465 return (send_pkt_v6(dsmp, dpkt, dsmp->dsm_server, in dhcp_extending()
468 dhcp_lif_t *lif = dsmp->dsm_lif; in dhcp_extending()
472 dpkt = init_pkt(dsmp, REQUEST); in dhcp_extending()
487 (void) add_pkt_prl(dpkt, dsmp); in dhcp_extending()
493 if (dsmp->dsm_reqhost != NULL) { in dhcp_extending()
494 (void) add_pkt_opt(dpkt, CD_HOSTNAME, dsmp->dsm_reqhost, in dhcp_extending()
495 strlen(dsmp->dsm_reqhost)); in dhcp_extending()
499 IN6_V4MAPPED_TO_IPADDR(&dsmp->dsm_server, server); in dhcp_extending()
500 return (send_pkt(dsmp, dpkt, server, stop_extending)); in dhcp_extending()
516 stop_extending(dhcp_smach_t *dsmp, unsigned int n_requests) in stop_extending() argument
524 if (dsmp->dsm_state == RENEWING) { in stop_extending()
528 for (dlp = dsmp->dsm_leases; dlp != NULL; dlp = dlp->dl_next) { in stop_extending()
532 t2 += dsmp->dsm_curstart_monosec; in stop_extending()
535 monosec() > t2 ? "" : "almost ", dsmp->dsm_name); in stop_extending()
546 if (!dsmp->dsm_isv6 && in stop_extending()
547 dsmp->dsm_send_timeout < DHCP_REBIND_MIN * MILLISEC / 2) { in stop_extending()
549 "%d.%03d; stopping", dsmp->dsm_send_timeout / MILLISEC, in stop_extending()
550 dsmp->dsm_send_timeout % MILLISEC); in stop_extending()