---
name: "libugidfw"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/libugidfw"
---

# libugidfw(3)

library interface to the file system firewall MAC policy

## NAME

**libugidfw** – library interface to the file system firewall MAC policy

## LIBRARY

library “libugidfw”

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/mac\_bsdextended/mac\_bsdextended.h\>**

**#include \<ugidfw.h\>**

## DESCRIPTION

The **libugidfw** library routines provide an interface to the [mac\_bsdextended(4)](/mac_bsdextended/4.md) file system firewall MAC policy.

The **libugidfw** library defines the following functions:

- **bsde\_rule\_to\_string**()

  Converts the internal representation of a rule (*struct mac\_bsdextended\_rule*) into its text representation; see [bsde\_rule\_to\_string(3)](/bsde_rule_to_string/3.md).

- **bsde\_parse\_rule**()

  Parses an entire rule (in argument array form); see [bsde\_parse\_rule(3)](/bsde_parse_rule/3.md).

- **bsde\_parse\_rule\_string**()

  Parses an entire rule string; see [bsde\_parse\_rule\_string(3)](/bsde_parse_rule_string/3.md).

- **bsde\_get\_rule\_count**()

  Returns the total number of ugidfw rules being enforced in the system; see [bsde\_get\_rule\_count(3)](/bsde_get_rule_count/3.md).

- **bsde\_get\_rule\_slots**()

  Returns the total number of used rule slots; see [bsde\_get\_rule\_slots(3)](/bsde_get_rule_slots/3.md).

- **bsde\_get\_rule**()

  Returns a rule by its rule number; see [bsde\_get\_rule(3)](/bsde_get_rule/3.md).

- **bsde\_delete\_rule**()

  Deletes a rule by its rule number; see [bsde\_delete\_rule(3)](/bsde_delete_rule/3.md).

- **bsde\_set\_rule**()

  Uploads the rule to the [mac\_bsdextended(4)](/mac_bsdextended/4.md) module and applies it; see [bsde\_set\_rule(3)](/bsde_set_rule/3.md).

- **bsde\_add\_rule**()

  Upload the rule to the module, automatically selecting the next available rule number; see [bsde\_add\_rule(3)](/bsde_add_rule/3.md).

## SEE ALSO

[bsde\_delete\_rule(3)](/bsde_delete_rule/3.md), [bsde\_get\_rule(3)](/bsde_get_rule/3.md), [bsde\_get\_rule\_count(3)](/bsde_get_rule_count/3.md), [bsde\_get\_rule\_slots(3)](/bsde_get_rule_slots/3.md), [bsde\_parse\_rule(3)](/bsde_parse_rule/3.md), [bsde\_parse\_rule\_string(3)](/bsde_parse_rule_string/3.md), [bsde\_rule\_to\_string(3)](/bsde_rule_to_string/3.md), [bsde\_set\_rule(3)](/bsde_set_rule/3.md)

## AUTHORS

This software was contributed to the FreeBSD Project by Network Associates Labs, the Security Research Division of Network Associates Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.
