---
name: "bsde_rule_to_string"
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/bsde_rule_to_string"
---

# bsde\_rule\_to\_string(3)

convert a ugidfw rule into its text representation

## NAME

**bsde\_rule\_to\_string** – convert a ugidfw rule into its text representation

## LIBRARY

library “libugidfw”

## SYNOPSIS

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

*int*\

**bsde\_rule\_to\_string**(*struct mac\_bsdextended\_rule \*rule*, *char \*buf*, *size\_t buflen*);

## DESCRIPTION

The **bsde\_rule\_to\_string**() function converts a rule in its internal representation (*struct mac\_bsdextended\_rule*) into its text representation, and writes up to *buflen* bytes of it to *buf* (including the terminating NUL).

## RETURN VALUES

The **bsde\_rule\_to\_string**() function returns -1 if the conversion was truncated; otherwise the value 0 is returned.

## 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\_set\_rule(3)](/bsde_set_rule/3.md), [libugidfw(3)](/libugidfw/3.md), [mac\_bsdextended(4)](/mac_bsdextended/4.md), [ugidfw(8)](/ugidfw/8.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.
