Lines Matching refs:dsmp

155 init_pkt(dhcp_smach_t *dsmp, uchar_t type)
157 dhcp_pkt_t *dpkt = &dsmp->dsm_send_pkt;
158 dhcp_lif_t *lif = dsmp->dsm_lif;
206 if (dsmp->dsm_cidlen > 0 &&
207 add_pkt_opt(dpkt, DHCPV6_OPT_CLIENTID, dsmp->dsm_cid,
208 dsmp->dsm_cidlen) == NULL) {
215 dsmp->dsm_neg_hrtime = gethrtime();
216 dsmp->dsm_newstart_monosec = monosec();
254 !is_bound_state(dsmp->dsm_state)))
268 if (dsmp->dsm_cidlen > 0 &&
269 add_pkt_opt(dpkt, CD_CLIENT_ID, dsmp->dsm_cid,
270 dsmp->dsm_cidlen) == NULL) {
589 add_pkt_prl(dhcp_pkt_t *dpkt, dhcp_smach_t *dsmp)
593 if (dsmp->dsm_prllen == 0)
603 if (dsmp->dsm_prllen == 0)
606 prl = alloca(dsmp->dsm_prllen * sizeof (uint16_t));
608 for (len = 0; len < dsmp->dsm_prllen; len++)
609 prl[len] = htons(dsmp->dsm_prl[len]);
613 uint8_t *prl = alloca(dsmp->dsm_prllen);
615 for (len = 0; len < dsmp->dsm_prllen; len++)
616 prl[len] = dsmp->dsm_prl[len];
636 dhcp_smach_t *dsmp;
649 dsmp = lif->lif_lease->dl_smach;
650 iaid = dsmp->dsm_lif->lif_iaid;
797 send_pkt_internal(dhcp_smach_t *dsmp)
800 dhcp_lif_t *lif = dsmp->dsm_lif;
801 dhcp_pkt_t *dpkt = &dsmp->dsm_send_pkt;
814 if (dsmp->dsm_retrans_timer != -1) {
816 "timer on %s", dsmp->dsm_name);
817 stop_pkt_retransmission(dsmp);
830 if (dsmp->dsm_send_timeout != 0) {
831 if ((dsmp->dsm_retrans_timer = iu_schedule_timer_ms(tq,
832 dsmp->dsm_send_timeout, retransmit, dsmp)) == -1)
837 hold_smach(dsmp);
848 delta = (gethrtime() - dsmp->dsm_neg_hrtime) /
878 dsmp->dsm_newstart_monosec = monosec();
879 dsmp->dsm_disc_secs = dsmp->dsm_newstart_monosec -
880 hrtime_to_monosec(dsmp->dsm_neg_hrtime);
881 dpkt->pkt->secs = htons(dsmp->dsm_disc_secs);
886 hrtime_to_monosec(dsmp->dsm_neg_hrtime));
890 dsmp->dsm_newstart_monosec = monosec();
892 if (dsmp->dsm_state == REQUESTING) {
893 dpkt->pkt->secs = htons(dsmp->dsm_disc_secs);
898 hrtime_to_monosec(dsmp->dsm_neg_hrtime));
915 msg.msg_name = &dsmp->dsm_send_dest.v6;
924 if (IN6_IS_ADDR_MULTICAST(&dsmp->dsm_send_dest.v6.sin6_addr)) {
932 dinfo.dir_daddr = dsmp->dsm_send_dest.v6.sin6_addr;
947 sin6 = dsmp->dsm_send_dest.v6;
987 (struct sockaddr *)&dsmp->dsm_send_dest.v4,
993 if (dsmp->dsm_retrans_timer == -1)
999 pkt_name, dsmp->dsm_send_timeout / MILLISEC);
1004 pkt_get_xid(dpkt->pkt, dpkt->pkt_isv6), dsmp->dsm_name);
1006 dsmp->dsm_packet_sent++;
1007 dsmp->dsm_sent++;
1024 send_pkt(dhcp_smach_t *dsmp, dhcp_pkt_t *dpkt, in_addr_t dest,
1034 dsmp->dsm_packet_sent = 0;
1036 (void) memset(&dsmp->dsm_send_dest.v4, 0,
1037 sizeof (dsmp->dsm_send_dest.v4));
1038 dsmp->dsm_send_dest.v4.sin_addr.s_addr = dest;
1039 dsmp->dsm_send_dest.v4.sin_family = AF_INET;
1040 dsmp->dsm_send_dest.v4.sin_port = htons(IPPORT_BOOTPS);
1041 dsmp->dsm_send_stop_func = stop;
1048 assert(dpkt == &dsmp->dsm_send_pkt);
1055 free_pkt_list(&dsmp->dsm_recv_pkt_list);
1058 dsmp->dsm_send_timeout = 0; /* prevents retransmissions */
1060 next_retransmission(dsmp, B_TRUE, B_FALSE);
1062 return (send_pkt_internal(dsmp));
1080 send_pkt_v6(dhcp_smach_t *dsmp, dhcp_pkt_t *dpkt, in6_addr_t dest,
1083 dsmp->dsm_packet_sent = 0;
1085 (void) memset(&dsmp->dsm_send_dest.v6, 0,
1086 sizeof (dsmp->dsm_send_dest.v6));
1087 dsmp->dsm_send_dest.v6.sin6_addr = dest;
1088 dsmp->dsm_send_dest.v6.sin6_family = AF_INET6;
1089 dsmp->dsm_send_dest.v6.sin6_port = htons(IPPORT_DHCPV6S);
1090 dsmp->dsm_send_stop_func = stop;
1097 assert(dpkt == &dsmp->dsm_send_pkt);
1104 free_pkt_list(&dsmp->dsm_recv_pkt_list);
1107 dsmp->dsm_send_timeout = 0; /* prevents retransmissions */
1109 dsmp->dsm_send_timeout = irt;
1110 dsmp->dsm_send_tcenter = mrt;
1116 next_retransmission(dsmp, B_TRUE,
1120 return (send_pkt_internal(dsmp));
1135 dhcp_smach_t *dsmp = arg;
1137 dsmp->dsm_retrans_timer = -1;
1139 if (!verify_smach(dsmp))
1154 next_retransmission(dsmp, B_FALSE, B_FALSE);
1155 hold_smach(dsmp);
1156 if (dsmp->dsm_send_stop_func(dsmp, dsmp->dsm_packet_sent)) {
1158 dsmp->dsm_name);
1161 dsmp->dsm_name);
1162 (void) send_pkt_internal(dsmp);
1164 release_smach(dsmp);
1175 stop_pkt_retransmission(dhcp_smach_t *dsmp)
1177 if (dsmp->dsm_retrans_timer != -1 &&
1178 iu_cancel_timer(tq, dsmp->dsm_retrans_timer, NULL) == 1) {
1180 dsmp->dsm_name);
1181 dsmp->dsm_retrans_timer = -1;
1182 release_smach(dsmp);
1196 retransmit_now(dhcp_smach_t *dsmp)
1198 stop_pkt_retransmission(dsmp);
1199 (void) send_pkt_internal(dsmp);
1413 pkt_smach_enqueue(dhcp_smach_t *dsmp, PKT_LIST *plp)
1416 pkt_type_to_string(pkt_recv_type(plp), dsmp->dsm_isv6),
1417 dsmp->dsm_isv6 ? "v6" : "v4", dsmp->dsm_name);
1420 insque(plp, &dsmp->dsm_recv_pkt_list);
1435 next_retransmission(dhcp_smach_t *dsmp, boolean_t first_send,
1440 if (dsmp->dsm_isv6) {
1455 timeout_ms = dsmp->dsm_send_timeout;
1458 timeout_ms += (int)(randval * dsmp->dsm_send_timeout);
1461 if (dsmp->dsm_send_tcenter != 0 &&
1462 timeout_ms > dsmp->dsm_send_tcenter) {
1463 timeout_ms = dsmp->dsm_send_tcenter +
1464 (uint_t)(randval * dsmp->dsm_send_tcenter);
1467 dsmp->dsm_send_timeout = timeout_ms;
1469 if (dsmp->dsm_state == RENEWING ||
1470 dsmp->dsm_state == REBINDING) {
1473 timeout_ms = dsmp->dsm_state == RENEWING ?
1474 dsmp->dsm_leases->dl_t2.dt_start :
1475 dsmp->dsm_leases->dl_lifs->lif_expire.dt_start;
1476 timeout_ms += dsmp->dsm_curstart_monosec;
1490 timeout_ms = MIN(dsmp->dsm_send_tcenter << 1,
1495 dsmp->dsm_send_tcenter = timeout_ms;
1501 dsmp->dsm_send_timeout = timeout_ms +