xref: /freebsd/lib/lib80211/lib80211.3 (revision e0c4386e)
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.Dd December 15, 2015
26.Dt 80211 3
27.Os
28.Sh NAME
29.Nm lib80211_alloc_regdata ,
30.Nm lib80211_free_regdata ,
31.Nm lib80211_regdomain_readconfig ,
32.Nm lib80211_regdomain_cleanup ,
33.Nm lib80211_regdomain_findbysku ,
34.Nm lib80211_regdomain_findbyname ,
35.Nm lib80211_country_findbycc ,
36.Nm lib80211_country_findbyname
37.Nd manage net80211 configuration and regulatory database
38.Sh LIBRARY
39.Lb lib80211
40.Sh SYNOPSIS
41.In lib80211/lib80211_regdomain.h
42.In lib80211/lib80211_ioctl.h
43.Ft struct regdata *
44.Fn lib80211_alloc_regdata void
45.Ft void
46.Fn lib80211_free_regdata "struct regdata *reg"
47.Ft int
48.Fn lib80211_regdomain_readconfig "struct regdata *reg" "const void *config" "size_t size"
49.Ft void
50.Fn lib80211_regdomain_cleanup "struct regdata *reg"
51.Ft const struct regdomain *
52.Fn lib80211_regdomain_findbysku "const struct regdata *reg" "enumRegDomainCode"
53.Ft const struct regdomain *
54.Fn lib80211_regdomain_findbyname "const struct regdata *reg" "const char *sku"
55.Ft const struct country *
56.Fn lib80211_country_findbycc "const struct regdata *reg" "enum ISOCountryCode"
57.Ft const struct country *
58.Fn lib80211_country_findbyname "const struct regdata *reg" "const char *cc"
59.Sh DESCRIPTION
60The
61.Nm lib80211
62library is an interface to the
63.Xr net80211 4
64infrastructure.
65It implements wrappers around the
66.Xr net80211 4
67ioctl command, as well as providing a convenient API to access the regulatory
68database.
69.Pp
70The
71.Fn lib80211_alloc_regdata
72and
73.Fn lib80211_free_regdata
74function allocates / frees a regdata structure to store regulatory domain
75information in.
76.Pp
77The
78.Fn lib80211_regdomain_readconfig
79and
80.Fn lib80211_regdomain_cleanup
81functions read in the regulatory database XML configuration and free it when
82finished.
83.Pp
84The
85.Fn lib80211_regdomain_findbysku
86and
87.Fn lib80211_regdomain_findbyname
88functions look up a regulatory domain entry by SKU enum and SKU name
89respectively.
90.Pp
91The
92.Fn lib80211_country_findbycc
93and
94.Fn lib80211_country_findbyname
95functions look up a country information entry by ISO country enum and
96ISO country code string respectively.
97.Sh RETURN VALUES
98The
99.Fn lib80211_alloc_regdata ,
100.Fn lib80211_regdomain_readconfig ,
101.Fn lib80211_regdomain_findbysku ,
102.Fn lib80211_regdomain_findbyname ,
103.Fn lib80211_country_findbycc ,
104.Fn lib80211_country_findbyname
105return
106.Dv NULL
107upon error.
108.Sh SEE ALSO
109.Xr net80211 4 ,
110.Xr ifconfig 8
111.Sh HISTORY
112The
113.Nm lib80211
114library first appeared in
115.Fx 11.0 .
116.Sh AUTHORS
117.An Adrian Chadd
118