Lines Matching defs:hand

484  * Delete the handle instance referenced by hand. Frees hand if the close
517 * Searches hand container for records that match the query described by
534 lookup_dd(dsvc_handle_t hand, boolean_t partial, uint_t query,
542 if (targetp == NULL || nrecordsp == NULL || DSVC_HANDLE_INVAL(hand))
545 if (hand->d_type == DSVC_DHCPTAB) {
547 lookup = hand->d_api.lookup_dt;
550 lookup = hand->d_api.lookup_dn;
562 if (hand->d_synch != NULL) {
563 error = DSVC_SYNCH_RDLOCK(hand->d_synch, &unlock_cookie);
568 error = lookup(hand->d_hand, partial, query, count, targetp, recordsp,
571 if (hand->d_synch != NULL)
572 (void) DSVC_SYNCH_UNLOCK(hand->d_synch, unlock_cookie);
581 free_dd(dsvc_handle_t hand, void *entryp)
583 if (DSVC_HANDLE_INVAL(hand) || entryp == NULL)
586 if (hand->d_type == DSVC_DHCPTAB)
596 free_dd_list(dsvc_handle_t hand, void *listp)
598 if (DSVC_HANDLE_INVAL(hand) || listp == NULL)
601 if (hand->d_type == DSVC_DHCPTAB)
608 * Add the record newp to the DHCP container hand. newp's update signature
613 add_dd_entry(dsvc_handle_t hand, void *newp)
618 if (DSVC_HANDLE_INVAL(hand))
621 if (!validate_dd_entry(hand, newp, B_FALSE))
624 if (hand->d_synch != NULL) {
625 error = DSVC_SYNCH_WRLOCK(hand->d_synch, &unlock_cookie);
630 if (hand->d_type == DSVC_DHCPTAB)
631 error = hand->d_api.add_dt(hand->d_hand, newp);
633 error = hand->d_api.add_dn(hand->d_hand, newp);
635 if (hand->d_synch != NULL)
636 (void) DSVC_SYNCH_UNLOCK(hand->d_synch, unlock_cookie);
642 * Modify the record origp with the record newp in the DHCP container hand.
648 modify_dd_entry(dsvc_handle_t hand, const void *origp, void *newp)
653 if (DSVC_HANDLE_INVAL(hand))
656 if (!validate_dd_entry(hand, origp, B_TRUE))
659 if (!validate_dd_entry(hand, newp, B_FALSE))
662 if (hand->d_synch != NULL) {
663 error = DSVC_SYNCH_WRLOCK(hand->d_synch, &unlock_cookie);
668 if (hand->d_type == DSVC_DHCPTAB)
669 error = hand->d_api.modify_dt(hand->d_hand, origp, newp);
671 error = hand->d_api.modify_dn(hand->d_hand, origp, newp);
673 if (hand->d_synch != NULL)
674 (void) DSVC_SYNCH_UNLOCK(hand->d_synch, unlock_cookie);
680 * Deletes the record referred to by entryp from the DHCP container hand.
685 delete_dd_entry(dsvc_handle_t hand, void *entryp)
690 if (DSVC_HANDLE_INVAL(hand))
693 if (!validate_dd_entry(hand, entryp, B_TRUE))
696 if (hand->d_synch != NULL) {
697 error = DSVC_SYNCH_WRLOCK(hand->d_synch, &unlock_cookie);
702 if (hand->d_type == DSVC_DHCPTAB)
703 error = hand->d_api.delete_dt(hand->d_hand, entryp);
705 error = hand->d_api.delete_dn(hand->d_hand, entryp);
707 if (hand->d_synch != NULL)
708 (void) DSVC_SYNCH_UNLOCK(hand->d_synch, unlock_cookie);
719 validate_dnrec(dsvc_handle_t hand, const dn_rec_t *dn, boolean_t justkey)
722 if (hand->d_conid.c_net.s_addr !=
723 (dn->dn_cip.s_addr & hand->d_conid.c_mask.s_addr))
745 validate_dtrec(dsvc_handle_t hand, const dt_rec_t *dt, boolean_t justkey)
751 * Validate that a DHCP record of type `hand->d_type' is correctly formed;
756 validate_dd_entry(dsvc_handle_t hand, const void *entryp, boolean_t justkey)
761 if (hand->d_type == DSVC_DHCPTAB)
762 return (validate_dtrec(hand, (dt_rec_t *)entryp, justkey));
763 else if (hand->d_type == DSVC_DHCPNETWORK)
764 return (validate_dnrec(hand, (dn_rec_t *)entryp, justkey));
796 * Initialize private-layer synchronization on handle `hand' for container
801 synch_init(dsvc_handle_t hand, const char *conname, uint_t flags)
808 error = module_synchtype(&hand->d_desc, &synchtype);
825 sp->s_datastore = &hand->d_desc;
827 mkloctoken = (int (*)())dlsym(hand->d_instance, "mkloctoken");
855 hand->d_synch = sp;
860 * Finish using private-layer synchronization on handle `hand'.
863 synch_fini(dsvc_handle_t hand)
865 DSVC_SYNCH_FINI(hand->d_synch);
866 free(hand->d_synch->s_conname);
867 free(hand->d_synch);
868 hand->d_synch = NULL;