Lines Matching defs:mpc
354 mac_policy_getlabeled(struct mac_policy_conf *mpc)
359 if (mpc->mpc_ops->mpo_ ## method != NULL) \
396 struct mac_policy_conf *mpc;
402 LIST_FOREACH(mpc, &mac_static_policy_list, mpc_list) {
403 mac_labeled |= mac_policy_getlabeled(mpc);
406 LIST_FOREACH(mpc, &mac_policy_list, mpc_list) {
407 mac_labeled |= mac_policy_getlabeled(mpc);
487 mac_policy_fastpath_register(struct mac_policy_conf *mpc)
495 ops = (uintptr_t **)mpc->mpc_ops;
504 mac_policy_fastpath_unregister(struct mac_policy_conf *mpc)
512 ops = (uintptr_t **)mpc->mpc_ops;
523 mac_policy_register(struct mac_policy_conf *mpc)
544 !(mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK));
551 if (strcmp(tmpc->mpc_name, mpc->mpc_name) == 0) {
556 if (mpc->mpc_field_off != NULL) {
564 *mpc->mpc_field_off = slot;
566 mpc->mpc_runtime_flags |= MPC_RUNTIME_FLAG_REGISTERED;
574 LIST_INSERT_HEAD(mpc_list, mpc, mpc_list);
576 LIST_INSERT_AFTER(last_mpc, mpc, mpc_list);
584 if (mpc->mpc_ops->mpo_init != NULL)
585 (*(mpc->mpc_ops->mpo_init))(mpc);
587 mac_policy_fastpath_register(mpc);
591 SDT_PROBE1(mac, , policy, register, mpc);
592 printf("Security policy loaded: %s (%s)\n", mpc->mpc_fullname,
593 mpc->mpc_name);
601 mac_policy_unregister(struct mac_policy_conf *mpc)
609 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED) == 0) {
617 if (mpc->mpc_field_off != NULL) {
626 if ((mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_UNLOADOK) == 0) {
631 mac_policy_fastpath_unregister(mpc);
633 if (mpc->mpc_ops->mpo_destroy != NULL)
634 (*(mpc->mpc_ops->mpo_destroy))(mpc);
636 LIST_REMOVE(mpc, mpc_list);
637 mpc->mpc_runtime_flags &= ~MPC_RUNTIME_FLAG_REGISTERED;
641 SDT_PROBE1(mac, , policy, unregister, mpc);
642 printf("Security policy unload: %s (%s)\n", mpc->mpc_fullname,
643 mpc->mpc_name);
654 struct mac_policy_conf *mpc;
658 mpc = (struct mac_policy_conf *) data;
667 SDT_PROBE2(mac, , policy, modevent, type, mpc);
670 if (mpc->mpc_loadtime_flags & MPC_LOADTIME_FLAG_NOTLATE &&
673 "after booting\n", mpc->mpc_name);
677 error = mac_policy_register(mpc);
681 if ((mpc->mpc_runtime_flags & MPC_RUNTIME_FLAG_REGISTERED)
683 error = mac_policy_unregister(mpc);