Lines Matching refs:txn

368 insert_dhcpv4_pending_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn)  in insert_dhcpv4_pending_txn()  argument
373 if (avl_find(&mcip->mci_v4_pending_txn, txn, &where) != NULL) in insert_dhcpv4_pending_txn()
380 avl_insert(&mcip->mci_v4_pending_txn, txn, where); in insert_dhcpv4_pending_txn()
385 remove_dhcpv4_pending_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in remove_dhcpv4_pending_txn() argument
388 avl_remove(&mcip->mci_v4_pending_txn, txn); in remove_dhcpv4_pending_txn()
411 insert_dhcpv4_completed_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in insert_dhcpv4_completed_txn() argument
416 if (avl_find(&mcip->mci_v4_completed_txn, txn, &where) != NULL) in insert_dhcpv4_completed_txn()
425 avl_insert(&mcip->mci_v4_completed_txn, txn, where); in insert_dhcpv4_completed_txn()
426 if (avl_find(&mcip->mci_v4_dyn_ip, txn, &where) != NULL) { in insert_dhcpv4_completed_txn()
427 avl_remove(&mcip->mci_v4_completed_txn, txn); in insert_dhcpv4_completed_txn()
430 avl_insert(&mcip->mci_v4_dyn_ip, txn, where); in insert_dhcpv4_completed_txn()
435 remove_dhcpv4_completed_txn(mac_client_impl_t *mcip, dhcpv4_txn_t *txn) in remove_dhcpv4_completed_txn() argument
440 if ((ctxn = avl_find(&mcip->mci_v4_dyn_ip, txn, NULL)) != NULL && in remove_dhcpv4_completed_txn()
441 ctxn == txn) in remove_dhcpv4_completed_txn()
442 avl_remove(&mcip->mci_v4_dyn_ip, txn); in remove_dhcpv4_completed_txn()
444 avl_remove(&mcip->mci_v4_completed_txn, txn); in remove_dhcpv4_completed_txn()
453 dhcpv4_txn_t tmp_txn, *txn; in check_dhcpv4_dyn_ip() local
457 txn = avl_find(&mcip->mci_v4_dyn_ip, &tmp_txn, NULL); in check_dhcpv4_dyn_ip()
459 return (txn != NULL); in check_dhcpv4_dyn_ip()
468 dhcpv4_txn_t *txn; in create_dhcpv4_txn() local
470 if ((txn = kmem_zalloc(sizeof (*txn), KM_NOSLEEP)) == NULL) in create_dhcpv4_txn()
473 txn->dt_xid = xid; in create_dhcpv4_txn()
474 txn->dt_timestamp = gethrtime(); in create_dhcpv4_txn()
476 bcopy(cid, &txn->dt_cid, cid_len); in create_dhcpv4_txn()
477 txn->dt_cid_len = cid_len; in create_dhcpv4_txn()
478 txn->dt_ipaddr = ipaddr; in create_dhcpv4_txn()
479 return (txn); in create_dhcpv4_txn()
483 free_dhcpv4_txn(dhcpv4_txn_t *txn) in free_dhcpv4_txn() argument
485 kmem_free(txn, sizeof (*txn)); in free_dhcpv4_txn()
495 dhcpv4_txn_t *txn; in flush_dhcpv4() local
498 while ((txn = avl_destroy_nodes(&mcip->mci_v4_dyn_ip, in flush_dhcpv4()
506 while ((txn = avl_destroy_nodes(&mcip->mci_v4_completed_txn, in flush_dhcpv4()
508 free_dhcpv4_txn(txn); in flush_dhcpv4()
511 while ((txn = avl_destroy_nodes(&mcip->mci_v4_pending_txn, in flush_dhcpv4()
513 free_dhcpv4_txn(txn); in flush_dhcpv4()
523 dhcpv4_txn_t *txn, *ctxn, *next, *txn_list = NULL; in txn_cleanup_v4() local
529 for (txn = avl_first(&mcip->mci_v4_pending_txn); txn != NULL; in txn_cleanup_v4()
530 txn = avl_walk(&mcip->mci_v4_pending_txn, txn, AVL_AFTER)) { in txn_cleanup_v4()
531 if (gethrtime() - txn->dt_timestamp > txn_cleanup_interval) { in txn_cleanup_v4()
534 dhcpv4_txn_t *, txn); in txn_cleanup_v4()
536 txn->dt_next = txn_list; in txn_cleanup_v4()
537 txn_list = txn; in txn_cleanup_v4()
545 for (txn = txn_list; txn != NULL; txn = next) { in txn_cleanup_v4()
546 avl_remove(&mcip->mci_v4_pending_txn, txn); in txn_cleanup_v4()
548 ctxn = find_dhcpv4_completed_txn(mcip, txn->dt_cid, in txn_cleanup_v4()
549 txn->dt_cid_len); in txn_cleanup_v4()
558 next = txn->dt_next; in txn_cleanup_v4()
559 txn->dt_next = NULL; in txn_cleanup_v4()
562 dhcpv4_txn_t *, txn); in txn_cleanup_v4()
563 free_dhcpv4_txn(txn); in txn_cleanup_v4()
575 dhcpv4_txn_t *txn, *ctxn; in intercept_dhcpv4_outbound() local
632 if ((txn = find_dhcpv4_pending_txn(mcip, dh4->xid)) != NULL) { in intercept_dhcpv4_outbound()
634 dhcpv4_txn_t *, txn); in intercept_dhcpv4_outbound()
635 txn->dt_timestamp = gethrtime(); in intercept_dhcpv4_outbound()
646 if ((txn = create_dhcpv4_txn(dh4->xid, cid, cid_len, ipaddr)) == NULL) in intercept_dhcpv4_outbound()
649 if (insert_dhcpv4_pending_txn(mcip, txn) != 0) { in intercept_dhcpv4_outbound()
651 dhcpv4_txn_t *, txn); in intercept_dhcpv4_outbound()
652 free_dhcpv4_txn(txn); in intercept_dhcpv4_outbound()
658 dhcpv4_txn_t *, txn); in intercept_dhcpv4_outbound()
673 dhcpv4_txn_t *txn, *ctxn; in intercept_dhcpv4_inbound() local
690 if ((txn = find_dhcpv4_pending_txn(mcip, dh4->xid)) == NULL) { in intercept_dhcpv4_inbound()
695 remove_dhcpv4_pending_txn(mcip, txn); in intercept_dhcpv4_inbound()
702 ctxn = find_dhcpv4_completed_txn(mcip, txn->dt_cid, txn->dt_cid_len); in intercept_dhcpv4_inbound()
711 dhcpv4_txn_t *, txn); in intercept_dhcpv4_inbound()
712 free_dhcpv4_txn(txn); in intercept_dhcpv4_inbound()
715 if (insert_dhcpv4_completed_txn(mcip, txn) != 0) { in intercept_dhcpv4_inbound()
717 dhcpv4_txn_t *, txn); in intercept_dhcpv4_inbound()
718 free_dhcpv4_txn(txn); in intercept_dhcpv4_inbound()
722 dhcpv4_txn_t *, txn); in intercept_dhcpv4_inbound()
1175 remove_dhcpv6_pending_txn(mac_client_impl_t *mcip, dhcpv6_txn_t *txn) in remove_dhcpv6_pending_txn() argument
1178 avl_remove(&mcip->mci_v6_pending_txn, txn); in remove_dhcpv6_pending_txn()
1184 dhcpv6_txn_t *txn; in create_dhcpv6_txn() local
1186 if ((txn = kmem_zalloc(sizeof (dhcpv6_txn_t), KM_NOSLEEP)) == NULL) in create_dhcpv6_txn()
1189 txn->dt_xid = xid; in create_dhcpv6_txn()
1190 txn->dt_cid = cid; in create_dhcpv6_txn()
1191 txn->dt_timestamp = gethrtime(); in create_dhcpv6_txn()
1192 return (txn); in create_dhcpv6_txn()
1196 free_dhcpv6_txn(dhcpv6_txn_t *txn) in free_dhcpv6_txn() argument
1198 if (txn->dt_cid != NULL) in free_dhcpv6_txn()
1199 free_dhcpv6_cid(txn->dt_cid); in free_dhcpv6_txn()
1200 kmem_free(txn, sizeof (dhcpv6_txn_t)); in free_dhcpv6_txn()
1204 insert_dhcpv6_pending_txn(mac_client_impl_t *mcip, dhcpv6_txn_t *txn) in insert_dhcpv6_pending_txn() argument
1209 if (avl_find(&mcip->mci_v6_pending_txn, txn, &where) != NULL) in insert_dhcpv6_pending_txn()
1216 avl_insert(&mcip->mci_v6_pending_txn, txn, where); in insert_dhcpv6_pending_txn()
1228 dhcpv6_txn_t *txn; in flush_dhcpv6() local
1238 while ((txn = avl_destroy_nodes(&mcip->mci_v6_pending_txn, in flush_dhcpv6()
1240 free_dhcpv6_txn(txn); in flush_dhcpv6()
1262 dhcpv6_txn_t *txn, *next, *txn_list = NULL; in txn_cleanup_v6() local
1268 for (txn = avl_first(&mcip->mci_v6_pending_txn); txn != NULL; in txn_cleanup_v6()
1269 txn = avl_walk(&mcip->mci_v6_pending_txn, txn, AVL_AFTER)) { in txn_cleanup_v6()
1270 if (gethrtime() - txn->dt_timestamp > txn_cleanup_interval) { in txn_cleanup_v6()
1273 dhcpv6_txn_t *, txn); in txn_cleanup_v6()
1275 txn->dt_next = txn_list; in txn_cleanup_v6()
1276 txn_list = txn; in txn_cleanup_v6()
1284 for (txn = txn_list; txn != NULL; txn = next) { in txn_cleanup_v6()
1285 avl_remove(&mcip->mci_v6_pending_txn, txn); in txn_cleanup_v6()
1286 release_dhcpv6_cid(mcip, txn->dt_cid); in txn_cleanup_v6()
1287 next = txn->dt_next; in txn_cleanup_v6()
1288 txn->dt_next = NULL; in txn_cleanup_v6()
1291 dhcpv6_txn_t *, txn); in txn_cleanup_v6()
1292 free_dhcpv6_txn(txn); in txn_cleanup_v6()
1304 dhcpv6_txn_t *txn; in intercept_dhcpv6_outbound() local
1338 if ((txn = find_dhcpv6_pending_txn(mcip, xid)) != NULL) { in intercept_dhcpv6_outbound()
1340 dhcpv6_txn_t *, txn); in intercept_dhcpv6_outbound()
1341 txn->dt_timestamp = gethrtime(); in intercept_dhcpv6_outbound()
1344 if ((txn = create_dhcpv6_txn(xid, cid)) == NULL) in intercept_dhcpv6_outbound()
1348 if (insert_dhcpv6_pending_txn(mcip, txn) != 0) { in intercept_dhcpv6_outbound()
1350 dhcpv6_txn_t *, txn); in intercept_dhcpv6_outbound()
1351 free_dhcpv6_txn(txn); in intercept_dhcpv6_outbound()
1357 dhcpv6_txn_t *, txn); in intercept_dhcpv6_outbound()
1374 dhcpv6_txn_t *txn; in intercept_dhcpv6_inbound() local
1385 if ((txn = find_dhcpv6_pending_txn(mcip, xid)) == NULL) { in intercept_dhcpv6_inbound()
1390 remove_dhcpv6_pending_txn(mcip, txn); in intercept_dhcpv6_inbound()
1391 release_dhcpv6_cid(mcip, txn->dt_cid); in intercept_dhcpv6_inbound()
1396 dhcpv6_txn_t *, txn); in intercept_dhcpv6_inbound()
1399 if (get_dhcpv6_addrs(dh6, end, txn->dt_cid) != 0) { in intercept_dhcpv6_inbound()
1401 dhcpv6_txn_t *, txn); in intercept_dhcpv6_inbound()
1404 if (insert_dhcpv6_cid(mcip, txn->dt_cid) != 0) { in intercept_dhcpv6_inbound()
1406 dhcpv6_txn_t *, txn); in intercept_dhcpv6_inbound()
1410 dhcpv6_txn_t *, txn); in intercept_dhcpv6_inbound()
1412 txn->dt_cid = NULL; in intercept_dhcpv6_inbound()
1415 if (txn != NULL) in intercept_dhcpv6_inbound()
1416 free_dhcpv6_txn(txn); in intercept_dhcpv6_inbound()