xref: /freebsd/lib/lib80211/lib80211.3 (revision d4eeb02986980bf33dd56c41ceb9fc5f180c0d47)
1.\" Copyright (c) 2015 Adrian Chadd.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd December 15, 2015
28.Dt 80211 3
29.Os
30.Sh NAME
31.Nm lib80211_alloc_regdata ,
32.Nm lib80211_free_regdata ,
33.Nm lib80211_regdomain_readconfig ,
34.Nm lib80211_regdomain_cleanup ,
35.Nm lib80211_regdomain_findbysku ,
36.Nm lib80211_regdomain_findbyname ,
37.Nm lib80211_country_findbycc ,
38.Nm lib80211_country_findbyname
39.Nd manage net80211 configuration and regulatory database
40.Sh LIBRARY
41.Lb lib80211
42.Sh SYNOPSIS
43.In lib80211/lib80211_regdomain.h
44.In lib80211/lib80211_ioctl.h
45.Ft struct regdata *
46.Fn lib80211_alloc_regdata void
47.Ft void
48.Fn lib80211_free_regdata "struct regdata *reg"
49.Ft int
50.Fn lib80211_regdomain_readconfig "struct regdata *reg" "const void *config" "size_t size"
51.Ft void
52.Fn lib80211_regdomain_cleanup "struct regdata *reg"
53.Ft const struct regdomain *
54.Fn lib80211_regdomain_findbysku "const struct regdata *reg" "enumRegDomainCode"
55.Ft const struct regdomain *
56.Fn lib80211_regdomain_findbyname "const struct regdata *reg" "const char *sku"
57.Ft const struct country *
58.Fn lib80211_country_findbycc "const struct regdata *reg" "enum ISOCountryCode"
59.Ft const struct country *
60.Fn lib80211_country_findbyname "const struct regdata *reg" "const char *cc"
61.Sh DESCRIPTION
62The
63.Nm lib80211
64library is an interface to the
65.Xr net80211 4
66infrastructure.
67It implements wrappers around the
68.Xr net80211 4
69ioctl command, as well as providing a convenient API to access the regulatory
70database.
71.Pp
72The
73.Fn lib80211_alloc_regdata
74and
75.Fn lib80211_free_regdata
76function allocates / frees a regdata structure to store regulatory domain
77information in.
78.Pp
79The
80.Fn lib80211_regdomain_readconfig
81and
82.Fn lib80211_regdomain_cleanup
83functions read in the regulatory database XML configuration and free it when
84finished.
85.Pp
86The
87.Fn lib80211_regdomain_findbysku
88and
89.Fn lib80211_regdomain_findbyname
90functions look up a regulatory domain entry by SKU enum and SKU name
91respectively.
92.Pp
93The
94.Fn lib80211_country_findbycc
95and
96.Fn lib80211_country_findbyname
97functions look up a country information entry by ISO country enum and
98ISO country code string respectively.
99.Sh RETURN VALUES
100The
101.Fn lib80211_alloc_regdata ,
102.Fn lib80211_regdomain_readconfig ,
103.Fn lib80211_regdomain_findbysku ,
104.Fn lib80211_regdomain_findbyname ,
105.Fn lib80211_country_findbycc ,
106.Fn lib80211_country_findbyname
107return
108.Dv NULL
109upon error.
110.Sh SEE ALSO
111.Xr net80211 4 ,
112.Xr ifconfig 8
113.Sh HISTORY
114The
115.Nm lib80211
116library first appeared in
117.Fx 11.0 .
118.Sh AUTHORS
119.An Adrian Chadd
120