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

# lib80211(3)

manage net80211 configuration and regulatory database

## NAME

**lib80211\_alloc\_regdata**, **lib80211\_free\_regdata**, **lib80211\_regdomain\_readconfig**, **lib80211\_regdomain\_cleanup**, **lib80211\_regdomain\_findbysku**, **lib80211\_regdomain\_findbyname**, **lib80211\_country\_findbycc**, **lib80211\_country\_findbyname** – manage net80211 configuration and regulatory database

## LIBRARY

library “lib80211”

## SYNOPSIS

**#include \<lib80211/lib80211\_regdomain.h\>**

**#include \<lib80211/lib80211\_ioctl.h\>**

*struct* *regdata* *\**\

**lib80211\_alloc\_regdata**(*void*);

*void*\

**lib80211\_free\_regdata**(*struct regdata \*reg*);

*int*\

**lib80211\_regdomain\_readconfig**(*struct regdata \*reg*, *const void \*config*, *size\_t size*);

*void*\

**lib80211\_regdomain\_cleanup**(*struct regdata \*reg*);

*const* *struct* *regdomain* *\**\

**lib80211\_regdomain\_findbysku**(*const struct regdata \*reg*, *enumRegDomainCode*);

*const* *struct* *regdomain* *\**\

**lib80211\_regdomain\_findbyname**(*const struct regdata \*reg*, *const char \*sku*);

*const* *struct* *country* *\**\

**lib80211\_country\_findbycc**(*const struct regdata \*reg*, *enum ISOCountryCode*);

*const* *struct* *country* *\**\

**lib80211\_country\_findbyname**(*const struct regdata \*reg*, *const char \*cc*);

## DESCRIPTION

The **lib80211** library is an interface to the [net80211(4)](/net80211/4.md) infrastructure. It implements wrappers around the [net80211(4)](/net80211/4.md) ioctl command, as well as providing a convenient API to access the regulatory database.

The **lib80211\_alloc\_regdata**() and **lib80211\_free\_regdata**() function allocates / frees a regdata structure to store regulatory domain information in.

The **lib80211\_regdomain\_readconfig**() and **lib80211\_regdomain\_cleanup**() functions read in the regulatory database XML configuration and free it when finished.

The **lib80211\_regdomain\_findbysku**() and **lib80211\_regdomain\_findbyname**() functions look up a regulatory domain entry by SKU enum and SKU name respectively.

The **lib80211\_country\_findbycc**() and **lib80211\_country\_findbyname**() functions look up a country information entry by ISO country enum and ISO country code string respectively.

## RETURN VALUES

The **lib80211\_alloc\_regdata**(), **lib80211\_regdomain\_readconfig**(), **lib80211\_regdomain\_findbysku**(), **lib80211\_regdomain\_findbyname**(), **lib80211\_country\_findbycc**(), **lib80211\_country\_findbyname**() return NULL upon error.

## SEE ALSO

[net80211(4)](/net80211/4.md), [ifconfig(8)](/ifconfig/8.md)

## HISTORY

The **lib80211** library first appeared in FreeBSD 11.0.

## AUTHORS

Adrian Chadd
