pax_global_header 0000666 0000000 0000000 00000000064 15142173343 0014515 g ustar 00root root 0000000 0000000 52 comment=fb158b047c39af62b6627fc7e6c16e5017681d8f
uoaerg-wavemon-fb158b0/ 0000775 0000000 0000000 00000000000 15142173343 0015062 5 ustar 00root root 0000000 0000000 uoaerg-wavemon-fb158b0/LICENSE 0000664 0000000 0000000 00000104515 15142173343 0016075 0 ustar 00root root 0000000 0000000 GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc.
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
Copyright (C)
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see .
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
Copyright (C)
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
.
uoaerg-wavemon-fb158b0/Makefile.in 0000664 0000000 0000000 00000003663 15142173343 0017137 0 ustar 00root root 0000000 0000000 prefix = @prefix@
exec_prefix = @exec_prefix@
bindir = @bindir@
datarootdir = $(prefix)/share
mandir = @mandir@
datadir = $(datarootdir)/@PACKAGE_NAME@
exec_perms = 0755
install-suid-root: exec_perms = 4755
# Allow overriding CC from the command-line.
CC_DEFAULT := @CC@
ifeq ($(origin CC), default)
CC := $(CC_DEFAULT)
else
CC ?= $(CC_DEFAULT)
endif
CFLAGS ?= @CFLAGS@ @LIBNL3_CLI_CFLAGS@
CPPFLAGS ?= @CPPFLAGS@
LDFLAGS ?= @LDFLAGS@
DEFS ?= @DEFS@
LDLIBS ?= @LIBS@ @LIBNL3_CLI_LIBS@
INSTALL = @INSTALL@
RM = rm -vf
MAIN = @PACKAGE_NAME@.c
HEADERS = $(wildcard *.h)
PURESRC = $(filter-out $(MAIN),$(sort $(wildcard *.c)))
OBJS = $(PURESRC:.c=.o)
DOCS = README.md LICENSE
%.o: %.c $(HEADERS)
@echo ' CC ' $<
@$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(DEFS) -c -o $@ $<
all: @PACKAGE_NAME@
@PACKAGE_NAME@: $(MAIN) $(OBJS)
$(MAIN): Makefile
Makefile: Makefile.in config.status
./config.status
config.status: configure
./config.status --recheck
configure: configure.ac
autoconf
tags: $(MAIN) $(PURESRC) $(HEADERS)
ctags $^ > $@
.PHONY: all install uninstall clean distclean
install: install-binaries install-docs
install-suid-root install-binaries: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(bindir)
$(INSTALL) -m $(exec_perms) @PACKAGE_NAME@ $(DESTDIR)$(bindir)
install-docs: @PACKAGE_NAME@.1 @PACKAGE_NAME@rc.5 $(DOCS)
$(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 0644 @PACKAGE_NAME@.1 $(DESTDIR)$(mandir)/man1
$(INSTALL) -m 0755 -d $(DESTDIR)$(mandir)/man5
$(INSTALL) -m 0644 @PACKAGE_NAME@rc.5 $(DESTDIR)$(mandir)/man5
$(INSTALL) -m 0755 -d $(DESTDIR)$(datadir)
$(INSTALL) -m 0644 $(DOCS) $(DESTDIR)$(datadir)
uninstall:
@$(RM) $(bindir)/@PACKAGE_NAME@
@$(RM) $(mandir)/man1/@PACKAGE_NAME@.1
@$(RM) $(mandir)/man5/@PACKAGE_NAME@rc.5
@$(RM) -r $(datadir)
clean:
@$(RM) *.o *~ tags @PACKAGE_NAME@
distclean: uninstall clean
@$(RM) config.status config.log config.cache Makefile
@$(RM) -r autom4te.cache
uoaerg-wavemon-fb158b0/README.md 0000664 0000000 0000000 00000004102 15142173343 0016336 0 ustar 00root root 0000000 0000000 
## Synopsis
`wavemon` is a wireless device monitoring application that allows you to watch
signal and noise levels, packet statistics, device configuration and network
parameters of your wireless network hardware. It should work (though with
varying features) with all devices supported by the Linux kernel.
See the man page for an in-depth description of operation and configuration.
### Where to obtain
Apart from debian/ubuntu packages (`apt-cache search wavemon`) and [slackbuild scripts for wavemon](https://slackbuilds.org/result/?search=wavemon&sv=), this repository contains the full source code.
### Dependencies
Minimally the following are required:
* the `pkg-config` package,
* netlink `libnl-cli-3-dev` at least version 3.2 (pulls in `libnl-3-dev`, `libnl-genl-3-dev`),
* ncurses development files (`libncursesw6`, `libtinfo6`, `libncurses-dev`).
On Debian/Ubuntu, this can be done using
```bash
apt-get -y install pkg-config libncursesw6 libtinfo6 libncurses-dev libnl-cli-3-dev
```
Please note the "w" in `libncursesw6`, which stands for the _wide-character_ variant of ncurses.
This is required for [proper rendering on UTF-8 terminals](https://github.com/uoaerg/wavemon/issues/70).
## How to build
wavemon uses `autoconf`, so that in most cases you can simply run
```bash
./configure && make && sudo make install
```
to build and install the package. Type `make uninstall` if not happy.
### Using custom `CFLAGS`
Pass additional `CFLAGS` to `configure`, like this:
```bash
CFLAGS="-O2 -pipe" ./configure
```
Passing `CFLAGS` to `make` is not encouraged, since that will replace the settings found by `configure`.
### Installation with privileges
To grant users access to _restricted networking operations_ (scanning), use
```bash
sudo make install-suid-root
```
### Resetting `autoconf` state
If you have changed some of the `autoconf` files or use a `git` version, run
```bash
./config/bootstrap
```
(This requires a recent installation of `autotools`.)
uoaerg-wavemon-fb158b0/about_scr.c 0000664 0000000 0000000 00000004100 15142173343 0017202 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
/* GLOBALS */
static WINDOW *w_about;
static char *about_lines[] = {
PACKAGE_NAME " - status monitor for wireless network devices",
"version " PACKAGE_VERSION,
"",
"original by jan morgenstern ",
"distributed under the GNU general public license v3",
"",
PACKAGE_URL
};
static int *linecd[ARRAY_SIZE(about_lines)];
void scr_about_init(void)
{
w_about = newwin_title(0, WAV_HEIGHT, "About", false);
for (size_t i = 0; i < ARRAY_SIZE(about_lines); i++) {
linecd[i] = malloc(strlen(about_lines[i]) * sizeof(int));
for (size_t j = 0; j < strlen(about_lines[i]); j++)
linecd[i][j] = (rand() / (float)RAND_MAX) * 120 + 60;
}
}
int scr_about_loop(WINDOW *w_menu)
{
char buf[0x100];
size_t i, j;
for (i = 0; i < ARRAY_SIZE(about_lines); i++) {
for (j = 0; j < strlen(about_lines[i]); j++) {
if (linecd[i][j] > 60) {
buf[j] = ' ';
linecd[i][j]--;
} else if (linecd[i][j]) {
buf[j] = (rand() / (float)RAND_MAX) * 54 + 65;
linecd[i][j]--;
} else {
buf[j] = about_lines[i][j];
}
}
buf[j] = '\0';
waddstr_center(w_about, (WAV_HEIGHT - ARRAY_SIZE(about_lines))/2 + i, buf);
}
wrefresh(w_about);
return wgetch(w_menu);
}
void scr_about_fini(void)
{
delwin(w_about);
for (size_t i = 0; i < ARRAY_SIZE(about_lines); i++)
free(linecd[i]);
}
uoaerg-wavemon-fb158b0/aclocal.m4 0000664 0000000 0000000 00000032132 15142173343 0016723 0 ustar 00root root 0000000 0000000 # generated automatically by aclocal 1.16.5 -*- Autoconf -*-
# Copyright (C) 1996-2021 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
# pkg.m4 - Macros to locate and use pkg-config. -*- Autoconf -*-
# serial 12 (pkg-config-0.29.2)
dnl Copyright © 2004 Scott James Remnant .
dnl Copyright © 2012-2015 Dan Nicholson
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful, but
dnl WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
dnl
dnl As a special exception to the GNU General Public License, if you
dnl distribute this file as part of a program that contains a
dnl configuration script generated by Autoconf, you may include it under
dnl the same distribution terms that you use for the rest of that
dnl program.
dnl PKG_PREREQ(MIN-VERSION)
dnl -----------------------
dnl Since: 0.29
dnl
dnl Verify that the version of the pkg-config macros are at least
dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
dnl installed version of pkg-config, this checks the developer's version
dnl of pkg.m4 when generating configure.
dnl
dnl To ensure that this macro is defined, also add:
dnl m4_ifndef([PKG_PREREQ],
dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
dnl
dnl See the "Since" comment for each macro you use to see what version
dnl of the macros you require.
m4_defun([PKG_PREREQ],
[m4_define([PKG_MACROS_VERSION], [0.29.2])
m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
[m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
])dnl PKG_PREREQ
dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
dnl ----------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$])
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])
AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path])
AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path])
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
PKG_CONFIG=""
fi
fi[]dnl
])dnl PKG_PROG_PKG_CONFIG
dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------------------------------
dnl Since: 0.18
dnl
dnl Check to see whether a particular set of modules exists. Similar to
dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
dnl
dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
dnl only at the first occurrence in configure.ac, so if the first place
dnl it's called might be skipped (such as if it is within an "if", you
dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_default([$2], [:])
m4_ifvaln([$3], [else
$3])dnl
fi])
dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
dnl ---------------------------------------------
dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
elif test -n "$PKG_CONFIG"; then
PKG_CHECK_EXISTS([$3],
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes ],
[pkg_failed=yes])
else
pkg_failed=untried
fi[]dnl
])dnl _PKG_CONFIG
dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl ---------------------------
dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi[]dnl
])dnl _PKG_SHORT_ERRORS_SUPPORTED
dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl --------------------------------------------------------------
dnl Since: 0.4.0
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
pkg_failed=no
AC_MSG_CHECKING([for $2])
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
AC_MSG_RESULT([no])
_PKG_SHORT_ERRORS_SUPPORTED
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
else
$1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
m4_default([$4], [AC_MSG_ERROR(
[Package requirements ($2) were not met:
$$1_PKG_ERRORS
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
_PKG_TEXT])[]dnl
])
elif test $pkg_failed = untried; then
AC_MSG_RESULT([no])
m4_default([$4], [AC_MSG_FAILURE(
[The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
_PKG_TEXT
To get pkg-config, see .])[]dnl
])
else
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
AC_MSG_RESULT([yes])
$3
fi[]dnl
])dnl PKG_CHECK_MODULES
dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
dnl [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------------------
dnl Since: 0.29
dnl
dnl Checks for existence of MODULES and gathers its build flags with
dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
dnl and VARIABLE-PREFIX_LIBS from --libs.
dnl
dnl Note that if there is a possibility the first call to
dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
dnl configure.ac.
AC_DEFUN([PKG_CHECK_MODULES_STATIC],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
_save_PKG_CONFIG=$PKG_CONFIG
PKG_CONFIG="$PKG_CONFIG --static"
PKG_CHECK_MODULES($@)
PKG_CONFIG=$_save_PKG_CONFIG[]dnl
])dnl PKG_CHECK_MODULES_STATIC
dnl PKG_INSTALLDIR([DIRECTORY])
dnl -------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable pkgconfigdir as the location where a module
dnl should install pkg-config .pc files. By default the directory is
dnl $libdir/pkgconfig, but the default can be changed by passing
dnl DIRECTORY. The user can override through the --with-pkgconfigdir
dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([pkgconfigdir],
[AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
[with_pkgconfigdir=]pkg_default)
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_INSTALLDIR
dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
dnl --------------------------------
dnl Since: 0.27
dnl
dnl Substitutes the variable noarch_pkgconfigdir as the location where a
dnl module should install arch-independent pkg-config .pc files. By
dnl default the directory is $datadir/pkgconfig, but the default can be
dnl changed by passing DIRECTORY. The user can override through the
dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
[pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
AC_ARG_WITH([noarch-pkgconfigdir],
[AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
[with_noarch_pkgconfigdir=]pkg_default)
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
])dnl PKG_NOARCH_INSTALLDIR
dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
dnl -------------------------------------------
dnl Since: 0.28
dnl
dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR
dnl PKG_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------
dnl
dnl Prepare a "--with-" configure option using the lowercase
dnl [VARIABLE-PREFIX] name, merging the behaviour of AC_ARG_WITH and
dnl PKG_CHECK_MODULES in a single macro.
AC_DEFUN([PKG_WITH_MODULES],
[
m4_pushdef([with_arg], m4_tolower([$1]))
m4_pushdef([description],
[m4_default([$5], [build with ]with_arg[ support])])
m4_pushdef([def_arg], [m4_default([$6], [auto])])
m4_pushdef([def_action_if_found], [AS_TR_SH([with_]with_arg)=yes])
m4_pushdef([def_action_if_not_found], [AS_TR_SH([with_]with_arg)=no])
m4_case(def_arg,
[yes],[m4_pushdef([with_without], [--without-]with_arg)],
[m4_pushdef([with_without],[--with-]with_arg)])
AC_ARG_WITH(with_arg,
AS_HELP_STRING(with_without, description[ @<:@default=]def_arg[@:>@]),,
[AS_TR_SH([with_]with_arg)=def_arg])
AS_CASE([$AS_TR_SH([with_]with_arg)],
[yes],[PKG_CHECK_MODULES([$1],[$2],$3,$4)],
[auto],[PKG_CHECK_MODULES([$1],[$2],
[m4_n([def_action_if_found]) $3],
[m4_n([def_action_if_not_found]) $4])])
m4_popdef([with_arg])
m4_popdef([description])
m4_popdef([def_arg])
])dnl PKG_WITH_MODULES
dnl PKG_HAVE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl -----------------------------------------------
dnl
dnl Convenience macro to trigger AM_CONDITIONAL after PKG_WITH_MODULES
dnl check._[VARIABLE-PREFIX] is exported as make variable.
AC_DEFUN([PKG_HAVE_WITH_MODULES],
[
PKG_WITH_MODULES([$1],[$2],,,[$3],[$4])
AM_CONDITIONAL([HAVE_][$1],
[test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"])
])dnl PKG_HAVE_WITH_MODULES
dnl PKG_HAVE_DEFINE_WITH_MODULES(VARIABLE-PREFIX, MODULES,
dnl [DESCRIPTION], [DEFAULT])
dnl ------------------------------------------------------
dnl
dnl Convenience macro to run AM_CONDITIONAL and AC_DEFINE after
dnl PKG_WITH_MODULES check. HAVE_[VARIABLE-PREFIX] is exported as make
dnl and preprocessor variable.
AC_DEFUN([PKG_HAVE_DEFINE_WITH_MODULES],
[
PKG_HAVE_WITH_MODULES([$1],[$2],[$3],[$4])
AS_IF([test "$AS_TR_SH([with_]m4_tolower([$1]))" = "yes"],
[AC_DEFINE([HAVE_][$1], 1, [Enable ]m4_tolower([$1])[ support])])
])dnl PKG_HAVE_DEFINE_WITH_MODULES
uoaerg-wavemon-fb158b0/conf.c 0000664 0000000 0000000 00000037210 15142173343 0016156 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "iw_if.h"
#include
#include
#include
/* GLOBALS */
static char **if_names = NULL; /* Array of WiFi interface names */
int conf_items; /* Index into array storing menu items */
static char *on_off_names[] = { [false] = "Off", [true] = "On", NULL };
static char *sort_order[] = {
[SO_CHAN] = "Channel",
[SO_SIGNAL] = "Signal",
[SO_MAC] = "MAC",
[SO_ESSID] = "Essid",
[SO_OPEN] = "Open",
[SO_CHAN_SIG] = "Chan/Sig",
[SO_OPEN_SIG] = "Open/Sig",
NULL
};
static char *scan_filter_bands[] = {
[SCAN_FILTER_BAND_BOTH] = "Both",
[SCAN_FILTER_BAND_2G] = "2.4GHz",
[SCAN_FILTER_BAND_5G] = "5GHz",
NULL
};
static char *screen_names[] = {
[SCR_INFO] = "Info screen",
[SCR_LHIST] = "Histogram",
[SCR_SCAN] = "Scan window",
NULL
};
struct wavemon_conf conf = {
.if_idx = 0,
.stat_iv = 100,
.info_iv = 10,
.slotsize = 4,
.meter_decay = 0,
.check_geometry = false,
.cisco_mac = false,
.transparent_bg = true,
.override_bounds = false,
.sig_min = -100,
.sig_max = -10,
.scan_sort_order = SO_CHAN_SIG,
.scan_sort_asc = false,
.scan_hidden_essids = true,
.scan_filter_band = SCAN_FILTER_BAND_BOTH,
.startup_scr = 0,
};
/**
* conf_get_interface_list - Initialize interface list.
* Ensures that if_names is non-empty and if_names[conf.if_idx] != NULL.
*/
void conf_get_interface_list(void)
{
struct interface_info *head = NULL, *cur;
int count, idx;
char *old_if = NULL;
iw_nl80211_get_interface_list(&head);
if (if_names) {
for (idx = 0; if_names[idx]; idx++) {
if (idx == conf.if_idx)
old_if = if_names[idx];
else
free(if_names[idx]);
}
}
count = count_interface_list(head);
if (!count)
err_quit("no supported wireless interfaces found! Check manpage for help.");
if_names = realloc(if_names, sizeof(if_names[0]) * (count + 1));
if (!if_names)
err_sys("failed to reallocate array of interface names");
if_names[count] = NULL;
for (cur = head; cur; cur = cur->next)
if_names[--count] = strdup(cur->ifname);
conf.if_idx = 0;
if (old_if) {
idx = argv_find(if_names, old_if);
if (idx > 0)
conf.if_idx = idx;
free(old_if);
}
free_interface_list(head);
}
/** Return current interface name. Relies on conf_get_interface_list guarantees. */
const char *conf_ifname(void)
{
return if_names[conf.if_idx];
}
/** Return $HOME directory of current user. */
static char *get_homedir(void)
{
char *homedir = getenv("HOME");
if (homedir == NULL) {
struct passwd *pw = getpwuid(getuid());
if (pw == NULL)
err_quit("can not determine $HOME");
homedir = pw->pw_dir;
}
return homedir;
}
/** Ensure that @dirpath is available as directory. */
static void ensure_is_directory(const char *dirpath)
{
struct stat sb;
if (stat(dirpath, &sb) == 0) {
if (!S_ISDIR(sb.st_mode))
err_quit("%s is not a directory", dirpath);
} else if (errno != ENOENT) {
err_sys("unable to access %s", dirpath);
} else if (mkdir(dirpath, 0755) != 0) {
err_sys("unable to create directory %s", dirpath);
}
}
/**
* get_config_path - Return full path of wavemon runtime configuration file.
* This is one of
* - $XDG_CONFIG_HOME/wavemon/wavemonrc, or
* - $HOME/.config/wavemon/wavemonrc (fallback).
* Returns allocated string, which caller needs to de-allocate.
*/
static char *get_config_path(void)
{
char *xdg_config_env = getenv("XDG_CONFIG_HOME"),
*xdg_config_home = NULL,
*config_dir,
*config_path;
struct stat sb;
// If $XDG_CONFIG_HOME is set, but unusable, fall back to ~/.config.
if (xdg_config_env && (stat(xdg_config_env, &sb) || !S_ISDIR(sb.st_mode))) {
xdg_config_env = NULL;
}
if (xdg_config_env == NULL) {
xdg_config_home = a_sprintf("%s/.config", get_homedir());
ensure_is_directory(xdg_config_home);
}
config_dir = a_sprintf("%s/%s", xdg_config_env ? xdg_config_env : xdg_config_home, PACKAGE_NAME);
ensure_is_directory(config_dir);
free(xdg_config_home);
config_path = a_sprintf("%s/%src", config_dir, PACKAGE_NAME);
free(config_dir);
return config_path;
}
static void write_cf(void)
{
char tmp[0x100], rv[0x40];
struct conf_item *ci = NULL;
char *lp, *cp;
bool add = false;
size_t i;
char *cfname = get_config_path();
int cfld = ll_create();
FILE *fd = fopen(cfname, "w");
if (fd == NULL)
err_sys("failed to open configuration file '%s'", cfname);
for (ll_reset(conf_items); (ci = ll_getall(conf_items)); ) {
if (ci->type != t_sep && ci->type != t_func &&
(!ci->dep || (ci->dep && *ci->dep))) {
switch (ci->type) {
case t_int:
sprintf(rv, "%d", *ci->v.i);
break;
case t_list:
if (!argv_count(ci->list))
continue;
sprintf(rv, "%s", ci->list[*ci->v.i]);
str_tolower(rv);
break;
case t_sep:
case t_func:
break;
}
add = true;
for (i = 0; i < ll_size(cfld); i++) {
lp = ll_get(cfld, i);
cp = lp += strspn(lp, " ");
if (!strncasecmp(cp, ci->cfname, strcspn(cp, " ="))
&& strlen(ci->cfname) == strcspn(cp, " =")) {
add = false;
cp += strcspn(cp, "=") + 1;
cp += strspn(cp, " ");
strncpy(tmp, cp, strcspn(cp, " #\n"));
if (strcasecmp(tmp, rv)) {
strncpy(tmp, lp, strcspn(lp, " ="));
tmp[strcspn(lp, " =")] = '\0';
strcat(tmp, " = ");
strcat(tmp, rv);
strcat(tmp, "\n");
ll_replace(cfld, i, "s", tmp);
}
}
}
if (add) {
strcpy(tmp, ci->cfname);
strcat(tmp, " = ");
strcat(tmp, rv);
strcat(tmp, "\n");
ll_push(cfld, "s", tmp);
}
}
}
for (ll_reset(cfld); (lp = ll_getall(cfld)); )
fputs(lp, fd);
fclose(fd);
ll_destroy(cfld);
free(cfname);
}
static void read_cf(void)
{
char tmp[0x100], lv[0x20], rv[0x20];
struct conf_item *ci = NULL;
FILE *fd;
size_t len;
int lnum, found, v_int;
char *lp, *conv_err, *cfname;
bool file_needs_update = false;
char *legacy_location = a_sprintf("%s/.%src", get_homedir(), PACKAGE_NAME);
// If a legacy configuration (~/.wavemonrc) exists, read it one last time.
if (access(legacy_location, F_OK) == 0) {
cfname = legacy_location;
} else {
cfname = get_config_path();
if (access(cfname, F_OK) != 0)
goto done;
}
fd = fopen(cfname, "r");
if (fd == NULL)
err_sys("can not read configuration file '%s'", cfname);
for (lnum = 1; fgets(tmp, sizeof(tmp), fd); lnum++) {
lp = tmp + strspn(tmp, " ");
if (*lp == '#' || *lp == '\n')
continue;
len = strcspn(lp, " =");
if (len > sizeof(lv))
err_quit("parse error in %s, line %d: identifier too long",
cfname, lnum);
strncpy(lv, lp, len);
lv[len] = '\0';
lp += len;
ll_reset(conf_items);
for (found = 0; !found && (ci = ll_getall(conf_items)); )
found = (ci->type != t_sep && ci->type != t_func &&
strcasecmp(ci->cfname, lv) == 0);
if (!found) {
err_msg("%s, line %d: ignoring unknown identifier '%s'",
cfname, lnum, lv);
file_needs_update = true;
continue;
}
lp += strspn(lp, " ");
if (*lp++ != '=')
err_quit("parse error in %s, line %d: missing '=' operator in assignment",
cfname, lnum);
lp += strspn(lp, " ");
len = strcspn(lp, " \n");
if (len > sizeof(rv))
err_quit("parse error in %s, line %d: argument too long", cfname, lnum);
else if (*lp == '\n')
err_quit("parse error in %s, line %d: argument expected", cfname, lnum);
strncpy(rv, lp, len);
rv[len] = '\0';
switch (ci->type) {
case t_int:
v_int = strtol(rv, &conv_err, 10);
if (*conv_err != '\0') {
err_quit("parse error in %s, line %d: integer value expected, '%s' found instead",
cfname, lnum, rv);
} else if (v_int > ci->max) {
err_msg("%s, line %d: value exceeds maximum of %d - using maximum",
cfname, lnum, (int)ci->max);
*ci->v.i = ci->max;
file_needs_update = true;
} else if (v_int < ci->min) {
err_msg("%s, line %d: value is below minimum of %d - using minimum",
cfname, lnum, (int)ci->min);
*ci->v.i = ci->min;
file_needs_update = true;
} else {
*ci->v.i = v_int;
}
break;
case t_list:
assert(ci->list != NULL);
if (!argv_count(ci->list))
err_quit("no usable %s candidates available for '%s'", ci->name, rv);
v_int = argv_find(ci->list, rv);
if (v_int < 0) {
err_msg("%s, line %d: '%s = %s' is not valid - using defaults",
cfname, lnum, lv, rv);
file_needs_update = true;
} else {
*ci->v.i = v_int;
}
case t_sep:
case t_func:
break;
}
}
fclose(fd);
done:
if (file_needs_update) {
write_cf();
}
if (cfname == legacy_location && unlink(legacy_location) != 0) {
err_sys("unable to remove %s", legacy_location);
}
free(cfname);
}
static void init_conf_items(void)
{
struct conf_item *item;
conf_items = ll_create();
item = calloc(1, sizeof(*item));
item->name = strdup("Input");
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Interface");
item->cfname = strdup("interface");
item->type = t_list;
item->v.i = &conf.if_idx;
item->list = if_names;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Cisco-style MAC addresses");
item->cfname = strdup("cisco_mac");
item->type = t_list;
item->v.i = &conf.cisco_mac;
item->list = on_off_names;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->type = t_sep;
ll_push(conf_items, "*", item);
/* Scan */
item = calloc(1, sizeof(*item));
item->name = strdup("Scan");
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Scan sort type");
item->cfname = strdup("sort_order");
item->type = t_list;
item->v.i = &conf.scan_sort_order;
item->list = sort_order;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Scan sort in ascending order");
item->cfname = strdup("sort_ascending");
item->type = t_list;
item->v.i = &conf.scan_sort_asc;
item->list = on_off_names;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Scan band selection");
item->cfname = strdup("scan_filter_band");
item->type = t_list;
item->v.i = &conf.scan_filter_band;
item->list = scan_filter_bands;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Scan hidden ESSIDs");
item->cfname = strdup("scan_hidden_essids");
item->type = t_list;
item->v.i = &conf.scan_hidden_essids;
item->list = on_off_names;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->type = t_sep;
ll_push(conf_items, "*", item);
/* Plot */
item = calloc(1, sizeof(*item));
item->name = strdup("Plot");
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Statistics updates");
item->cfname = strdup("stat_updates");
item->type = t_int;
item->v.i = &conf.stat_iv;
item->min = 10;
item->max = 4000;
item->inc = 10;
item->unit = strdup("ms");
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Histogram update cycles");
item->cfname = strdup("lhist_slot_size");
item->type = t_int;
item->v.i = &conf.slotsize;
item->min = 1;
item->max = 64;
item->inc = 1;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Level meter smoothness");
item->cfname = strdup("meter_smoothness");
item->type = t_int;
item->v.i = &conf.meter_decay;
item->min = 0;
item->max = 99;
item->inc = 1;
item->unit = strdup("%");
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Dynamic info updates");
item->cfname = strdup("info_updates");
item->type = t_int;
item->v.i = &conf.info_iv;
item->min = 1;
item->max = 60;
item->inc = 1;
item->unit = strdup("s");
ll_push(conf_items, "*", item);
/* level scale items */
item = calloc(1, sizeof(*item));
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Level scales");
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Override scale autodetect");
item->cfname = strdup("override_auto_scale");
item->type = t_list;
item->v.i = &conf.override_bounds;
item->list = on_off_names;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Minimum signal level");
item->cfname = strdup("min_signal_level");
item->type = t_int;
item->v.i = &conf.sig_min;
item->min = -100;
item->max = -39;
item->inc = 1;
item->unit = strdup("dBm");
item->dep = &conf.override_bounds;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Maximum signal level");
item->cfname = strdup("max_signal_level");
item->type = t_int;
item->v.i = &conf.sig_max;
item->min = -40;
item->max = -10;
item->inc = 1;
item->unit = strdup("dBm");
item->dep = &conf.override_bounds;
ll_push(conf_items, "*", item);
/* start-up items */
item = calloc(1, sizeof(*item));
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Startup");
item->type = t_sep;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Use transparent background");
item->cfname = strdup("transparent_bg");
item->type = t_list;
item->v.i = &conf.transparent_bg;
item->list = on_off_names;
item->hidden = true;
ll_push(conf_items, "*", item);
item = calloc(1, sizeof(*item));
item->name = strdup("Startup screen");
item->cfname = strdup("startup_screen");
item->type = t_list;
item->v.i = &conf.startup_scr;
item->list = screen_names;
ll_push(conf_items, "*", item);
/* separator (dummy entry) */
item = calloc(1, sizeof(*item));
item->type = t_sep;
ll_push(conf_items, "*", item);
/* functions */
item = calloc(1, sizeof(*item));
item->name = strdup("Save configuration");
item->type = t_func;
item->v.fp = write_cf;
ll_push(conf_items, "*", item);
}
/** getconf handles the initialization from commandline and rc file defaults. */
void getconf(int argc, char *argv[])
{
int arg, help = 0, version = 0;
const char *iface = NULL;
while ((arg = getopt(argc, argv, "ghi:v")) >= 0) {
switch (arg) {
case 'g':
conf.check_geometry = true;
break;
case 'h':
help++;
break;
case 'i':
iface = optarg;
break;
case 'v':
version++;
break;
default:
exit(EXIT_FAILURE);
}
}
if (version) {
printf("%s %s\n", PACKAGE_NAME, PACKAGE_VERSION);
printf("Distributed under the terms of the GPLv3.\n%s", help ? "\n" : "");
}
if (help) {
printf("usage: %s [ -hgv ] [ -i ifname ]\n", PACKAGE_NAME);
printf(" -g Ensure screen is sufficiently dimensioned\n");
printf(" -h This help screen\n");
printf(" -i Use specified network interface (default: auto)\n");
printf(" -v Print version details\n");
}
if (version || help) {
exit(EXIT_SUCCESS);
}
/* Actual initialization. */
conf_get_interface_list();
init_conf_items();
read_cf();
if (iface) {
conf.if_idx = argv_find(if_names, iface);
if (conf.if_idx < 0)
err_quit("%s is not a usable wireless interface", iface);
}
atexit(write_cf);
}
uoaerg-wavemon-fb158b0/conf_scr.c 0000664 0000000 0000000 00000013133 15142173343 0017023 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
/* Make configuration screen fit into half of minimum screen width */
#define CONF_SCREEN_WIDTH (MIN_SCREEN_COLS / 2)
/*
* Maximum number of rows in the configuration box. Due to the top
* border, this is one less than the maximum vertical number of rows.
*/
#define MAX_NUM_CONF_ROWS (MAXYLEN - 1)
/* GLOBALS */
extern int conf_items; /* index into array storing menu items */
static WINDOW *w_conf, *w_confpad;
static int first_item, active_item;
static int num_items, list_offset;
static void waddstr_item(WINDOW *w, int y, struct conf_item *item, char hilight)
{
char s[0x40];
wattrset(w, COLOR_PAIR(CP_STANDARD));
mvwhline(w, y, 0, ' ', CONF_SCREEN_WIDTH);
if (item->type != t_sep && item->type != t_func) {
mvwaddstr(w, y, item->dep ? 2 : 0, item->name);
switch (item->type) {
case t_int:
sprintf(s, "%d", *item->v.i);
break;
case t_list:
assert(item->list && item->list[*item->v.i]);
strncpy(s, item->list[*item->v.i], sizeof(s)-1);
/* Fall through, dummy statements to pacify gcc -Wall */
case t_sep:
case t_func:
break;
}
if (!item->unit) {
wmove(w, y, CONF_SCREEN_WIDTH - strlen(s));
if (hilight) {
wattron(w, A_REVERSE);
waddstr_b(w, s);
wattroff(w, A_REVERSE);
} else
waddstr_b(w, s);
} else {
wmove(w, y, CONF_SCREEN_WIDTH - strlen(s) - strlen(item->unit) - 1);
if (hilight) {
wattron(w, A_REVERSE);
waddstr_b(w, s);
wattroff(w, A_REVERSE);
} else
waddstr_b(w, s);
mvwaddstr(w, y, CONF_SCREEN_WIDTH - strlen(item->unit), item->unit);
}
} else if (item->type == t_sep && item->name) {
sprintf(s, "- %s -", item->name);
mvwaddstr(w, y, (CONF_SCREEN_WIDTH - strlen(s)) / 2, s);
} else if (item->type == t_func) {
wmove(w, y, (CONF_SCREEN_WIDTH - strlen(item->name)) / 2);
if (hilight) {
wattron(w, A_REVERSE);
waddstr(w, item->name);
wattroff(w, A_REVERSE);
} else
waddstr(w, item->name);
}
}
static void change_item(int inum, int sign)
{
struct conf_item *item = ll_get(conf_items, inum);
int tmp;
switch (item->type) {
case t_int:
if (*item->v.i + item->inc * sign <= item->max &&
*item->v.i + item->inc * sign >= item->min)
*item->v.i += item->inc * sign;
break;
case t_list:
*item->v.i = *item->v.i + sign;
tmp = argv_count(item->list);
if (*item->v.i >= tmp)
*item->v.i = 0;
else if (*item->v.i < 0)
*item->v.i = tmp - 1;
/* Fall through, dummy statements to pacify gcc -Wall */
case t_sep:
case t_func:
break;
}
}
static int select_item(int rv, int incr)
{
struct conf_item *item;
do {
rv += incr;
item = ll_get(conf_items, rv);
} while (item->type == t_sep || (item->dep && !*item->dep));
return rv;
}
/* Perform selection, return offset value to ensure pad fits inside window */
static int m_pref(WINDOW *w_conf, int list_offset, int active_item, int num_items)
{
int active_line, i, j;
werase(w_conf);
for (active_line = i = j = 0; i < num_items; i++) {
struct conf_item *item = ll_get(conf_items, i);
if (!item->hidden && (!item->dep || *item->dep)) {
if (i != active_item)
waddstr_item(w_conf, j++, item, 0);
else {
waddstr_item(w_conf, j, item, 1);
active_line = j++;
}
}
}
if (active_line - list_offset > MAX_NUM_CONF_ROWS)
return active_line - MAX_NUM_CONF_ROWS;
if (active_line < list_offset)
return active_line;
return list_offset;
}
void scr_conf_init(void)
{
struct conf_item *item;
conf_get_interface_list(); /* may have changed in the meantime */
num_items = ll_size(conf_items);
w_conf = newwin_title(0, WAV_HEIGHT, "Preferences", false);
w_confpad = newpad(num_items + 1, CONF_SCREEN_WIDTH);
if (first_item) /* already initialized */
return;
while ((item = ll_get(conf_items, first_item)) && item->type == t_sep)
first_item++;
active_item = first_item;
}
int scr_conf_loop(WINDOW *w_menu)
{
struct conf_item *item;
int key;
list_offset = m_pref(w_confpad, list_offset, active_item, num_items);
prefresh(w_confpad, list_offset, 0,
1, (WAV_WIDTH - CONF_SCREEN_WIDTH)/2,
MAXYLEN, (WAV_WIDTH + CONF_SCREEN_WIDTH)/2);
wrefresh(w_conf);
key = wgetch(w_menu);
switch (key) {
case KEY_HOME:
active_item = first_item;
break;
case KEY_END:
active_item = num_items - 1;
break;
case KEY_DOWN:
case KEY_NPAGE:
active_item = select_item(active_item, 1);
if (active_item >= num_items) {
active_item = first_item;
list_offset = 0;
}
break;
case KEY_UP:
case KEY_PPAGE:
active_item = select_item(active_item, -1);
if (active_item < first_item)
active_item = num_items - 1;
break;
case KEY_LEFT:
change_item(active_item, -1);
break;
case KEY_RIGHT:
change_item(active_item, 1);
break;
case '\r':
item = ll_get(conf_items, active_item);
if (item->type == t_func) {
flash();
(*item->v.fp)();
}
}
return key;
}
void scr_conf_fini(void)
{
delwin(w_conf);
delwin(w_confpad);
}
uoaerg-wavemon-fb158b0/config/ 0000775 0000000 0000000 00000000000 15142173343 0016327 5 ustar 00root root 0000000 0000000 uoaerg-wavemon-fb158b0/config/bootstrap 0000775 0000000 0000000 00000000040 15142173343 0020264 0 ustar 00root root 0000000 0000000 #!/bin/sh
exec autoreconf -fvim
uoaerg-wavemon-fb158b0/config/config.guess 0000775 0000000 0000000 00000126373 15142173343 0020663 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2018 Free Software Foundation, Inc.
timestamp='2018-02-24'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to .
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > "$dummy.c" ;
for c in cc gcc c89 c99 ; do
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
case "$UNAME_SYSTEM" in
Linux|GNU|GNU/*)
# If the system lacks a compiler, then just pick glibc.
# We could probably try harder.
LIBC=gnu
eval "$set_cc_for_build"
cat <<-EOF > "$dummy.c"
#include
#if defined(__UCLIBC__)
LIBC=uclibc
#elif defined(__dietlibc__)
LIBC=dietlibc
#else
LIBC=gnu
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`"
# If ldd exists, use it to detect musl libc.
if command -v ldd >/dev/null && \
ldd --version 2>&1 | grep -q ^musl
then
LIBC=musl
fi
;;
esac
# Note: order is significant - the case branches are not exclusive.
case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
"/sbin/$sysctl" 2>/dev/null || \
"/usr/sbin/$sysctl" 2>/dev/null || \
echo unknown)`
case "$UNAME_MACHINE_ARCH" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
earmv*)
arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
machine="${arch}${endian}"-unknown
;;
*) machine="$UNAME_MACHINE_ARCH"-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently (or will in the future) and ABI.
case "$UNAME_MACHINE_ARCH" in
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval "$set_cc_for_build"
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# Determine ABI tags.
case "$UNAME_MACHINE_ARCH" in
earm*)
expr='s/^earmv[0-9]/-eabi/;s/eb$//'
abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "$UNAME_VERSION" in
Debian*)
release='-gnu'
;;
*)
release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "$machine-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE"
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE"
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE"
exit ;;
*:MidnightBSD:*:*)
echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE"
exit ;;
*:ekkoBSD:*:*)
echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE"
exit ;;
*:SolidBSD:*:*)
echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE"
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:MirBSD:*:*)
echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE"
exit ;;
*:Sortix:*:*)
echo "$UNAME_MACHINE"-unknown-sortix
exit ;;
*:Redox:*:*)
echo "$UNAME_MACHINE"-unknown-redox
exit ;;
mips:OSF1:*.*)
echo mips-dec-osf1
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
UNAME_MACHINE=alpha ;;
"EV5 (21164)")
UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`"
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo "$UNAME_MACHINE"-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo "$UNAME_MACHINE"-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix"$UNAME_RELEASE"
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`"
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux"$UNAME_RELEASE"
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval "$set_cc_for_build"
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH=x86_64
fi
fi
echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`"
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos"$UNAME_RELEASE"
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos"$UNAME_RELEASE"
;;
sun4)
echo sparc-sun-sunos"$UNAME_RELEASE"
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos"$UNAME_RELEASE"
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint"$UNAME_RELEASE"
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint"$UNAME_RELEASE"
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint"$UNAME_RELEASE"
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint"$UNAME_RELEASE"
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten"$UNAME_RELEASE"
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten"$UNAME_RELEASE"
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix"$UNAME_RELEASE"
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix"$UNAME_RELEASE"
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix"$UNAME_RELEASE"
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval "$set_cc_for_build"
sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos"$UNAME_RELEASE"
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ]
then
if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \
[ "$TARGET_BINARY_INTERFACE"x = x ]
then
echo m88k-dg-dgux"$UNAME_RELEASE"
else
echo m88k-dg-dguxbcs"$UNAME_RELEASE"
fi
else
echo i586-dg-dgux"$UNAME_RELEASE"
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`"
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval "$set_cc_for_build"
sed 's/^ //' << EOF > "$dummy.c"
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/lslpp ] ; then
IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV="$UNAME_VERSION.$UNAME_RELEASE"
fi
echo "$IBM_ARCH"-ibm-aix"$IBM_REV"
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
case "$UNAME_MACHINE" in
9000/31?) HP_ARCH=m68000 ;;
9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "$sc_cpu_version" in
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "$sc_kernel_bits" in
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "$HP_ARCH" = "" ]; then
eval "$set_cc_for_build"
sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ "$HP_ARCH" = hppa2.0w ]
then
eval "$set_cc_for_build"
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH=hppa2.0w
else
HP_ARCH=hppa64
fi
fi
echo "$HP_ARCH"-hp-hpux"$HPUX_REV"
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux"$HPUX_REV"
exit ;;
3050*:HI-UX:*:*)
eval "$set_cc_for_build"
sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo "$UNAME_MACHINE"-unknown-osf1mk
else
echo "$UNAME_MACHINE"-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE"
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:BSD/OS:*:*)
echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE"
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case "$UNAME_PROCESSOR" in
amd64)
UNAME_PROCESSOR=x86_64 ;;
i386)
UNAME_PROCESSOR=i586 ;;
esac
echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
i*:CYGWIN*:*)
echo "$UNAME_MACHINE"-pc-cygwin
exit ;;
*:MINGW64*:*)
echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
*:MINGW*:*)
echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
*:MSYS*:*)
echo "$UNAME_MACHINE"-pc-msys
exit ;;
i*:PW*:*)
echo "$UNAME_MACHINE"-pc-pw32
exit ;;
*:Interix*:*)
case "$UNAME_MACHINE" in
x86)
echo i586-pc-interix"$UNAME_RELEASE"
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix"$UNAME_RELEASE"
exit ;;
IA64)
echo ia64-unknown-interix"$UNAME_RELEASE"
exit ;;
esac ;;
i*:UWIN*:*)
echo "$UNAME_MACHINE"-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`"
exit ;;
*:GNU:*:*)
# the GNU system
echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`"
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
exit ;;
i*86:Minix:*:*)
echo "$UNAME_MACHINE"-pc-minix
exit ;;
aarch64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
arm*:Linux:*:*)
eval "$set_cc_for_build"
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi
else
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
cris:Linux:*:*)
echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
crisv32:Linux:*:*)
echo "$UNAME_MACHINE"-axis-linux-"$LIBC"
exit ;;
e2k:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
frv:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
hexagon:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:Linux:*:*)
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
exit ;;
ia64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
k1om:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m32r*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
m68*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval "$set_cc_for_build"
sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`"
test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; }
;;
mips64el:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-"$LIBC"
exit ;;
or32:Linux:*:* | or1k*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-"$LIBC"
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-"$LIBC"
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;;
PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;;
*) echo hppa-unknown-linux-"$LIBC" ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-"$LIBC"
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-"$LIBC"
exit ;;
ppc64le:Linux:*:*)
echo powerpc64le-unknown-linux-"$LIBC"
exit ;;
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-"$LIBC"
exit ;;
riscv32:Linux:*:* | riscv64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo "$UNAME_MACHINE"-ibm-linux-"$LIBC"
exit ;;
sh64*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sh*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
tile*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
vax:Linux:*:*)
echo "$UNAME_MACHINE"-dec-linux-"$LIBC"
exit ;;
x86_64:Linux:*:*)
if objdump -f /bin/sh | grep -q elf32-x86-64; then
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"x32
else
echo "$UNAME_MACHINE"-pc-linux-"$LIBC"
fi
exit ;;
xtensa*:Linux:*:*)
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION"
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo "$UNAME_MACHINE"-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo "$UNAME_MACHINE"-unknown-stop
exit ;;
i*86:atheos:*:*)
echo "$UNAME_MACHINE"-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo "$UNAME_MACHINE"-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos"$UNAME_RELEASE"
exit ;;
i*86:*DOS:*:*)
echo "$UNAME_MACHINE"-pc-msdosdjgpp
exit ;;
i*86:*:4.*:*)
UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL"
else
echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL"
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}"
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL"
else
echo "$UNAME_MACHINE"-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos"$UNAME_RELEASE"
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos"$UNAME_RELEASE"
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos"$UNAME_RELEASE"
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv"$UNAME_RELEASE"
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo "$UNAME_MACHINE"-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo "$UNAME_MACHINE"-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux"$UNAME_RELEASE"
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv"$UNAME_RELEASE"
else
echo mips-unknown-sysv"$UNAME_RELEASE"
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux"$UNAME_RELEASE"
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux"$UNAME_RELEASE"
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux"$UNAME_RELEASE"
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux"$UNAME_RELEASE"
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux"$UNAME_RELEASE"
exit ;;
SX-ACE:SUPER-UX:*:*)
echo sxace-nec-superux"$UNAME_RELEASE"
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Rhapsody:*:*)
echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE"
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
eval "$set_cc_for_build"
if test "$UNAME_PROCESSOR" = unknown ; then
UNAME_PROCESSOR=powerpc
fi
if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
# On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_PPC >/dev/null
then
UNAME_PROCESSOR=powerpc
fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
# that puts up a graphical alert prompting to install
# developer tools. Any system running Mac OS X 10.7 or
# later (Darwin 11 and later) is required to have a 64-bit
# processor. This is not true of the ARM version of Darwin
# that Apple uses in portable devices.
UNAME_PROCESSOR=x86_64
fi
echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE"
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE"
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-*:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSR-*:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSV-*:NONSTOP_KERNEL:*:*)
echo nsv-tandem-nsk"$UNAME_RELEASE"
exit ;;
NSX-*:NONSTOP_KERNEL:*:*)
echo nsx-tandem-nsk"$UNAME_RELEASE"
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE"
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo "$UNAME_MACHINE"-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux"$UNAME_RELEASE"
exit ;;
*:DragonFly:*:*)
echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`"
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "$UNAME_MACHINE" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`"
exit ;;
i*86:rdos:*:*)
echo "$UNAME_MACHINE"-pc-rdos
exit ;;
i*86:AROS:*:*)
echo "$UNAME_MACHINE"-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo "$UNAME_MACHINE"-unknown-esx
exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
esac
echo "$0: unable to guess system type" >&2
case "$UNAME_MACHINE:$UNAME_SYSTEM" in
mips:Linux | mips64:Linux)
# If we got here on MIPS GNU/Linux, output extra information.
cat >&2 <&2 </dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = "$UNAME_MACHINE"
UNAME_RELEASE = "$UNAME_RELEASE"
UNAME_SYSTEM = "$UNAME_SYSTEM"
UNAME_VERSION = "$UNAME_VERSION"
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-functions 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
uoaerg-wavemon-fb158b0/config/config.sub 0000775 0000000 0000000 00000106450 15142173343 0020320 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2018 Free Software Foundation, Inc.
timestamp='2018-02-22'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
# If it is invalid, we print an error message on stderr and exit with code 1.
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
# that are meaningful with *any* GNU software.
# Each package is responsible for reporting which valid configurations
# it does not support. The user should be able to distinguish
# a failure to support a valid configuration from a meaningless
# configuration.
# The goal of this file is to map all the various variations of a given
# machine specification into a single specification in the form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
# or in some cases, the newer four-part form:
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo "$1"
exit ;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
basic_machine=`echo "$1" | sed 's/-[^-]*$//'`
if [ "$basic_machine" != "$1" ]
then os=`echo "$1" | sed 's/.*-/-/'`
else os=; fi
;;
esac
### Let's recognize common machines as not being operating systems so
### that things like config.sub decstation-3100 work. We also
### recognize some manufacturers as not being operating systems, so we
### can provide default operating systems below.
case $os in
-sun*os*)
# Prevent following clause from handling this invalid input.
;;
-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple | -axis | -knuth | -cray | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-sim | -cisco | -oki | -wec | -winbond)
os=
basic_machine=$1
;;
-scout)
;;
-wrs)
os=-vxworks
basic_machine=$1
;;
-chorusos*)
os=-chorusos
basic_machine=$1
;;
-chorusrdb)
os=-chorusrdb
basic_machine=$1
;;
-hiux*)
os=-hiuxwe2
;;
-sco6)
os=-sco5v6
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco5)
os=-sco3.2v5
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco4)
os=-sco3.2v4
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco5v6*)
# Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-sco*)
os=-sco3.2v2
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-udk*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-isc)
os=-isc2.2
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-clix*)
basic_machine=clipper-intergraph
;;
-isc*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'`
;;
-lynx*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-lynx*)
os=-lynxos
;;
-ptx*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'`
;;
-psos*)
os=-psos
;;
-mint | -mint[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
esac
# Decode aliases for certain CPU-COMPANY combinations.
case $basic_machine in
# Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below.
1750a | 580 \
| a29k \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
| e2k | epiphany \
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | mcore | mep | metag \
| mips | mipsbe | mipseb | mipsel | mipsle \
| mips16 \
| mips64 | mips64el \
| mips64octeon | mips64octeonel \
| mips64orion | mips64orionel \
| mips64r5900 | mips64r5900el \
| mips64vr | mips64vrel \
| mips64vr4100 | mips64vr4100el \
| mips64vr4300 | mips64vr4300el \
| mips64vr5000 | mips64vr5000el \
| mips64vr5900 | mips64vr5900el \
| mipsisa32 | mipsisa32el \
| mipsisa32r2 | mipsisa32r2el \
| mipsisa32r6 | mipsisa32r6el \
| mipsisa64 | mipsisa64el \
| mipsisa64r2 | mipsisa64r2el \
| mipsisa64r6 | mipsisa64r6el \
| mipsisa64sb1 | mipsisa64sb1el \
| mipsisa64sr71k | mipsisa64sr71kel \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 | or1k | or1knd | or32 \
| pdp10 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
| spu \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
| wasm32 \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
leon|leon[3-9])
basic_machine=sparc-$basic_machine
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-unknown
;;
# We use `pc' rather than `unknown'
# because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users.
i*86 | x86_64)
basic_machine=$basic_machine-pc
;;
# Object if more than one company name word.
*-*-*)
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1
;;
# Recognize the basic CPU types with company name.
580-* \
| a29k-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
| e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia16-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
| mips16-* \
| mips64-* | mips64el-* \
| mips64octeon-* | mips64octeonel-* \
| mips64orion-* | mips64orionel-* \
| mips64r5900-* | mips64r5900el-* \
| mips64vr-* | mips64vrel-* \
| mips64vr4100-* | mips64vr4100el-* \
| mips64vr4300-* | mips64vr4300el-* \
| mips64vr5000-* | mips64vr5000el-* \
| mips64vr5900-* | mips64vr5900el-* \
| mipsisa32-* | mipsisa32el-* \
| mipsisa32r2-* | mipsisa32r2el-* \
| mipsisa32r6-* | mipsisa32r6el-* \
| mipsisa64-* | mipsisa64el-* \
| mipsisa64r2-* | mipsisa64r2el-* \
| mipsisa64r6-* | mipsisa64r6el-* \
| mipsisa64sb1-* | mipsisa64sb1el-* \
| mipsisa64sr71k-* | mipsisa64sr71kel-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| or1k*-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
| wasm32-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
| ymp-* \
| z8k-* | z80-*)
;;
# Recognize the basic CPU types without company name, with glob match.
xtensa*)
basic_machine=$basic_machine-unknown
;;
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
386bsd)
basic_machine=i386-pc
os=-bsd
;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
basic_machine=m68000-att
;;
3b*)
basic_machine=we32k-att
;;
a29khif)
basic_machine=a29k-amd
os=-udi
;;
abacus)
basic_machine=abacus-unknown
;;
adobe68k)
basic_machine=m68010-adobe
os=-scout
;;
alliant | fx80)
basic_machine=fx80-alliant
;;
altos | altos3068)
basic_machine=m68k-altos
;;
am29k)
basic_machine=a29k-none
os=-bsd
;;
amd64)
basic_machine=x86_64-pc
;;
amd64-*)
basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
amdahl)
basic_machine=580-amdahl
os=-sysv
;;
amiga | amiga-*)
basic_machine=m68k-unknown
;;
amigaos | amigados)
basic_machine=m68k-unknown
os=-amigaos
;;
amigaunix | amix)
basic_machine=m68k-unknown
os=-sysv4
;;
apollo68)
basic_machine=m68k-apollo
os=-sysv
;;
apollo68bsd)
basic_machine=m68k-apollo
os=-bsd
;;
aros)
basic_machine=i386-pc
os=-aros
;;
asmjs)
basic_machine=asmjs-unknown
;;
aux)
basic_machine=m68k-apple
os=-aux
;;
balance)
basic_machine=ns32k-sequent
os=-dynix
;;
blackfin)
basic_machine=bfin-unknown
os=-linux
;;
blackfin-*)
basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
cegcc)
basic_machine=arm-unknown
os=-cegcc
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
;;
convex-c2)
basic_machine=c2-convex
os=-bsd
;;
convex-c32)
basic_machine=c32-convex
os=-bsd
;;
convex-c34)
basic_machine=c34-convex
os=-bsd
;;
convex-c38)
basic_machine=c38-convex
os=-bsd
;;
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
craynv)
basic_machine=craynv-cray
os=-unicosmp
;;
cr16 | cr16-*)
basic_machine=cr16-unknown
os=-elf
;;
crds | unos)
basic_machine=m68k-crds
;;
crisv32 | crisv32-* | etraxfs*)
basic_machine=crisv32-axis
;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
crx)
basic_machine=crx-unknown
os=-elf
;;
da30 | da30-*)
basic_machine=m68k-da30
;;
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
;;
delta88)
basic_machine=m88k-motorola
os=-sysv3
;;
dicos)
basic_machine=i686-pc
os=-dicos
;;
djgpp)
basic_machine=i586-pc
os=-msdosdjgpp
;;
dpx20 | dpx20-*)
basic_machine=rs6000-bull
os=-bosx
;;
dpx2*)
basic_machine=m68k-bull
os=-sysv3
;;
e500v[12])
basic_machine=powerpc-unknown
os=$os"spe"
;;
e500v[12]-*)
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=$os"spe"
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
;;
elxsi)
basic_machine=elxsi-elxsi
os=-bsd
;;
encore | umax | mmax)
basic_machine=ns32k-encore
;;
es1800 | OSE68k | ose68k | ose | OSE)
basic_machine=m68k-ericsson
os=-ose
;;
fx2800)
basic_machine=i860-alliant
;;
genix)
basic_machine=ns32k-ns
;;
gmicro)
basic_machine=tron-gmicro
os=-sysv
;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
h8300hms)
basic_machine=h8300-hitachi
os=-hms
;;
h8300xray)
basic_machine=h8300-hitachi
os=-xray
;;
h8500hms)
basic_machine=h8500-hitachi
os=-hms
;;
harris)
basic_machine=m88k-harris
os=-sysv3
;;
hp300-*)
basic_machine=m68k-hp
;;
hp300bsd)
basic_machine=m68k-hp
os=-bsd
;;
hp300hpux)
basic_machine=m68k-hp
os=-hpux
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
basic_machine=m68000-hp
;;
hp9k3[2-9][0-9])
basic_machine=m68k-hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
basic_machine=hppa1.1-hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
basic_machine=hppa1.1-hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp
;;
hppaosf)
basic_machine=hppa1.1-hp
os=-osf
;;
hppro)
basic_machine=hppa1.1-hp
os=-proelf
;;
i370-ibm* | ibm*)
basic_machine=i370-ibm
;;
i*86v32)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv32
;;
i*86v4*)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv4
;;
i*86v)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-sysv
;;
i*86sol2)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'`
os=-solaris2
;;
i386mach)
basic_machine=i386-mach
os=-mach
;;
vsta)
basic_machine=i386-unknown
os=-vsta
;;
iris | iris4d)
basic_machine=mips-sgi
case $os in
-irix*)
;;
*)
os=-irix4
;;
esac
;;
isi68 | isi)
basic_machine=m68k-isi
os=-sysv
;;
leon-*|leon[3-9]-*)
basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'`
;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
;;
m68knommu-*)
basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
magnum | m3230)
basic_machine=mips-mips
os=-sysv
;;
merlin)
basic_machine=ns32k-utek
os=-sysv
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
mingw32)
basic_machine=i686-pc
os=-mingw32
;;
mingw32ce)
basic_machine=arm-unknown
os=-mingw32ce
;;
miniframe)
basic_machine=m68000-convergent
;;
*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
basic_machine=m68k-atari
os=-mint
;;
mips3*-*)
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`
;;
mips3*)
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown
;;
monitor)
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
moxiebox)
basic_machine=moxie-unknown
os=-moxiebox
;;
msdos)
basic_machine=i386-pc
os=-msdos
;;
ms1-*)
basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'`
;;
msys)
basic_machine=i686-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
ncr3000)
basic_machine=i486-ncr
os=-sysv4
;;
netbsd386)
basic_machine=i386-unknown
os=-netbsd
;;
netwinder)
basic_machine=armv4l-rebel
os=-linux
;;
news | news700 | news800 | news900)
basic_machine=m68k-sony
os=-newsos
;;
news1000)
basic_machine=m68030-sony
os=-newsos
;;
news-3600 | risc-news)
basic_machine=mips-sony
os=-newsos
;;
necv70)
basic_machine=v70-nec
os=-sysv
;;
next | m*-next)
basic_machine=m68k-next
case $os in
-nextstep* )
;;
-ns2*)
os=-nextstep2
;;
*)
os=-nextstep3
;;
esac
;;
nh3000)
basic_machine=m68k-harris
os=-cxux
;;
nh[45]000)
basic_machine=m88k-harris
os=-cxux
;;
nindy960)
basic_machine=i960-intel
os=-nindy
;;
mon960)
basic_machine=i960-intel
os=-mon960
;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1)
basic_machine=np1-gould
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
nsr-tandem)
basic_machine=nsr-tandem
;;
nsv-tandem)
basic_machine=nsv-tandem
;;
nsx-tandem)
basic_machine=nsx-tandem
;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
;;
openrisc | openrisc-*)
basic_machine=or32-unknown
;;
os400)
basic_machine=powerpc-ibm
os=-os400
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
;;
os68k)
basic_machine=m68k-none
os=-os68k
;;
pa-hitachi)
basic_machine=hppa1.1-hitachi
os=-hiuxwe2
;;
paragon)
basic_machine=i860-intel
os=-osf
;;
parisc)
basic_machine=hppa-unknown
os=-linux
;;
parisc-*)
basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=-linux
;;
pbd)
basic_machine=sparc-tti
;;
pbb)
basic_machine=m68k-tti
;;
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pc98)
basic_machine=i386-pc
;;
pc98-*)
basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon | athlon_*)
basic_machine=i686-pc
;;
pentiumii | pentium2 | pentiumiii | pentium3)
basic_machine=i686-pc
;;
pentium4)
basic_machine=i786-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pentium4-*)
basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
pn)
basic_machine=pn-gould
;;
power) basic_machine=power-ibm
;;
ppc | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppc64) basic_machine=powerpc64-unknown
;;
ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
ps2)
basic_machine=i386-ibm
;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rdos | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
basic_machine=i386-pc
os=-rdos
;;
rom68k)
basic_machine=m68k-rom68k
os=-coff
;;
rm[46]00)
basic_machine=mips-siemens
;;
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
;;
sb1)
basic_machine=mipsisa64sb1-unknown
;;
sb1el)
basic_machine=mipsisa64sb1el-unknown
;;
sde)
basic_machine=mipsisa32-sde
os=-elf
;;
sei)
basic_machine=mips-sei
os=-seiux
;;
sequent)
basic_machine=i386-sequent
;;
sh5el)
basic_machine=sh5le-unknown
;;
simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
sps7)
basic_machine=m68k-bull
os=-sysv2
;;
spur)
basic_machine=spur-unknown
;;
st2000)
basic_machine=m68k-tandem
;;
stratus)
basic_machine=i860-stratus
os=-sysv4
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'`
;;
sun2)
basic_machine=m68000-sun
;;
sun2os3)
basic_machine=m68000-sun
os=-sunos3
;;
sun2os4)
basic_machine=m68000-sun
os=-sunos4
;;
sun3os3)
basic_machine=m68k-sun
os=-sunos3
;;
sun3os4)
basic_machine=m68k-sun
os=-sunos4
;;
sun4os3)
basic_machine=sparc-sun
os=-sunos3
;;
sun4os4)
basic_machine=sparc-sun
os=-sunos4
;;
sun4sol2)
basic_machine=sparc-sun
os=-solaris2
;;
sun3 | sun3-*)
basic_machine=m68k-sun
;;
sun4)
basic_machine=sparc-sun
;;
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry)
basic_machine=i386-sequent
os=-dynix
;;
t3e)
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tile*)
basic_machine=$basic_machine-unknown
os=-linux-gnu
;;
tx39)
basic_machine=mipstx39-unknown
;;
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
tpf)
basic_machine=s390x-ibm
os=-tpf
;;
udi29k)
basic_machine=a29k-amd
os=-udi
;;
ultra3)
basic_machine=a29k-nyu
os=-sym1
;;
v810 | necv810)
basic_machine=v810-nec
os=-none
;;
vaxv)
basic_machine=vax-dec
os=-sysv
;;
vms)
basic_machine=vax-dec
os=-vms
;;
vpp*|vx|vx-*)
basic_machine=f301-fujitsu
;;
vxworks960)
basic_machine=i960-wrs
os=-vxworks
;;
vxworks68)
basic_machine=m68k-wrs
os=-vxworks
;;
vxworks29k)
basic_machine=a29k-wrs
os=-vxworks
;;
w65*)
basic_machine=w65-wdc
os=-none
;;
w89k-*)
basic_machine=hppa1.1-winbond
os=-proelf
;;
x64)
basic_machine=x86_64-pc
;;
xbox)
basic_machine=i686-pc
os=-mingw32
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'`
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
none)
basic_machine=none-none
os=-none
;;
# Here we handle the default manufacturer of certain CPU types. It is in
# some cases the only manufacturer, in others, it is the most popular.
w89k)
basic_machine=hppa1.1-winbond
;;
op50n)
basic_machine=hppa1.1-oki
;;
op60c)
basic_machine=hppa1.1-oki
;;
romp)
basic_machine=romp-ibm
;;
mmix)
basic_machine=mmix-knuth
;;
rs6000)
basic_machine=rs6000-ibm
;;
vax)
basic_machine=vax-dec
;;
pdp11)
basic_machine=pdp11-dec
;;
we32k)
basic_machine=we32k-att
;;
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown
;;
cydra)
basic_machine=cydra-cydrome
;;
orion)
basic_machine=orion-highlevel
;;
orion105)
basic_machine=clipper-highlevel
;;
mac | mpw | mac-mpw)
basic_machine=m68k-apple
;;
pmac | pmac-mpw)
basic_machine=powerpc-apple
;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*)
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2
exit 1
;;
esac
# Here we canonicalize certain aliases for manufacturers.
case $basic_machine in
*-digital*)
basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'`
;;
*-commodore*)
basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'`
;;
*)
;;
esac
# Decode manufacturer-specific aliases for certain operating systems.
if [ x"$os" != x"" ]
then
case $os in
# First match some system type aliases that might get confused
# with valid system types.
# -solaris* is a basic system type, with this one exception.
-auroraux)
os=-auroraux
;;
-solaris1 | -solaris1.*)
os=`echo $os | sed -e 's|solaris1|sunos4|'`
;;
-solaris)
os=-solaris2
;;
-unixware*)
os=-sysv4.2uw
;;
-gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;;
# es1800 is here to avoid being matched by es* (a different OS)
-es1800*)
os=-ose
;;
# Now accept the basic system types.
# The portable systems comes first.
# Each alternative MUST end in a * to match a version number.
# -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
| -midnightbsd*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
case $basic_machine in
x86-* | i*86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto-qnx*)
;;
-nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'`
;;
-sim | -xray | -os68k* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;;
-mac*)
os=`echo "$os" | sed -e 's|mac|macos|'`
;;
-linux-dietlibc)
os=-linux-dietlibc
;;
-linux*)
os=`echo $os | sed -e 's|linux|linux-gnu|'`
;;
-sunos5*)
os=`echo "$os" | sed -e 's|sunos5|solaris2|'`
;;
-sunos6*)
os=`echo "$os" | sed -e 's|sunos6|solaris3|'`
;;
-opened*)
os=-openedition
;;
-os400*)
os=-os400
;;
-wince*)
os=-wince
;;
-utek*)
os=-bsd
;;
-dynix*)
os=-bsd
;;
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-syllable*)
os=-syllable
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2)
os=-nextstep2
;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5.
-sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'`
;;
-sinix*)
os=-sysv4
;;
-tpf*)
os=-tpf
;;
-triton*)
os=-sysv3
;;
-oss*)
os=-sysv3
;;
-svr4*)
os=-sysv4
;;
-svr3)
os=-sysv3
;;
-sysvr4)
os=-sysv4
;;
# This must come after -sysvr4.
-sysv*)
;;
-ose*)
os=-ose
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-pikeos*)
# Until real need of OS specific support for
# particular features comes up, bare metal
# configurations are quite functional.
case $basic_machine in
arm*)
os=-eabi
;;
*)
os=-elf
;;
esac
;;
-nacl*)
;;
-ios)
;;
-none)
;;
*)
# Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2
exit 1
;;
esac
else
# Here we handle the default operating systems that come with various machines.
# The value should be what the vendor currently ships out the door with their
# machine or put another way, the most popular os provided with the machine.
# Note that if you're going to try to match "-MANUFACTURER" here (say,
# "-sun"), then you have to tell the case statement up towards the top
# that MANUFACTURER isn't an operating system. Otherwise, code above
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
case $basic_machine in
score-*)
os=-elf
;;
spu-*)
os=-elf
;;
*-acorn)
os=-riscix1.2
;;
arm*-rebel)
os=-linux
;;
arm*-semi)
os=-aout
;;
c4x-* | tic4x-*)
os=-coff
;;
c8051-*)
os=-elf
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
os=-coff
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
pdp11-*)
os=-none
;;
*-dec | vax-*)
os=-ultrix4.2
;;
m68*-apollo)
os=-domain
;;
i386-sun)
os=-sunos4.0.2
;;
m68000-sun)
os=-sunos3
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
sparc-* | *-sun)
os=-sunos4.1.1
;;
pru-*)
os=-elf
;;
*-be)
os=-beos
;;
*-ibm)
os=-aix
;;
*-knuth)
os=-mmixware
;;
*-wec)
os=-proelf
;;
*-winbond)
os=-proelf
;;
*-oki)
os=-proelf
;;
*-hp)
os=-hpux
;;
*-hitachi)
os=-hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
os=-sysv
;;
*-cbm)
os=-amigaos
;;
*-dg)
os=-dgux
;;
*-dolphin)
os=-sysv3
;;
m68k-ccur)
os=-rtu
;;
m88k-omron*)
os=-luna
;;
*-next)
os=-nextstep
;;
*-sequent)
os=-ptx
;;
*-crds)
os=-unos
;;
*-ns)
os=-genix
;;
i370-*)
os=-mvs
;;
*-gould)
os=-sysv
;;
*-highlevel)
os=-bsd
;;
*-encore)
os=-bsd
;;
*-sgi)
os=-irix
;;
*-siemens)
os=-sysv4
;;
*-masscomp)
os=-rtu
;;
f30[01]-fujitsu | f700-fujitsu)
os=-uxpv
;;
*-rom68k)
os=-coff
;;
*-*bug)
os=-coff
;;
*-apple)
os=-macos
;;
*-atari*)
os=-mint
;;
*)
os=-none
;;
esac
fi
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
vendor=unknown
case $basic_machine in
*-unknown)
case $os in
-riscix*)
vendor=acorn
;;
-sunos*)
vendor=sun
;;
-cnk*|-aix*)
vendor=ibm
;;
-beos*)
vendor=be
;;
-hpux*)
vendor=hp
;;
-mpeix*)
vendor=hp
;;
-hiux*)
vendor=hitachi
;;
-unos*)
vendor=crds
;;
-dgux*)
vendor=dg
;;
-luna*)
vendor=omron
;;
-genix*)
vendor=ns
;;
-mvs* | -opened*)
vendor=ibm
;;
-os400*)
vendor=ibm
;;
-ptx*)
vendor=sequent
;;
-tpf*)
vendor=ibm
;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
-aux*)
vendor=apple
;;
-hms*)
vendor=hitachi
;;
-mpw* | -macos*)
vendor=apple
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari
;;
-vos*)
vendor=stratus
;;
esac
basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"`
;;
esac
echo "$basic_machine$os"
exit
# Local variables:
# eval: (add-hook 'write-file-functions 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
uoaerg-wavemon-fb158b0/config/install-sh 0000775 0000000 0000000 00000036010 15142173343 0020333 0 ustar 00root root 0000000 0000000 #!/bin/sh
# install - install a program, script, or datafile
scriptversion=2018-03-11.20; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# 'make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
tab=' '
nl='
'
IFS=" $tab$nl"
# Set DOITPROG to "echo" to test this script.
doit=${DOITPROG-}
doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t)
is_target_a_directory=always
dst_arg=$2
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
shift;;
-T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
# We allow the use of options -d and -T together, by making -d
# take the precedence; this is for compatibility with GNU install.
if test -n "$dir_arg"; then
if test -n "$dst_arg"; then
echo "$0: target directory not allowed when installing a directory." >&2
exit 1
fi
fi
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
# Protect names problematic for 'test' and other utilities.
case $dst_arg in
-* | [=\(\)!]) dst_arg=./$dst_arg;;
esac
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call 'install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
if test $# -gt 1 || test "$is_target_a_directory" = always; then
if test ! -d "$dst_arg"; then
echo "$0: $dst_arg: Is not a directory." >&2
exit 1
fi
fi
fi
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
trap "ret=130; $do_exit" 2
trap "ret=141; $do_exit" 13
trap "ret=143; $do_exit" 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names problematic for 'test' and other utilities.
case $src in
-* | [=\(\)!]) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# If destination is a directory, append the input filename.
if test -d "$dst"; then
if test "$is_target_a_directory" = never; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dstbase=`basename "$src"`
case $dst in
*/) dst=$dst$dstbase;;
*) dst=$dst/$dstbase;;
esac
dstdir_status=0
else
dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
case $dstdir in
*/) dstdirslash=$dstdir;;
*) dstdirslash=$dstdir/;;
esac
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
# Note that $RANDOM variable is not portable (e.g. dash); Use it
# here however when possible just to lower collision chance.
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
# Because "mkdir -p" follows existing symlinks and we likely work
# directly in world-writeable /tmp, make sure that the '$tmpdir'
# directory is successfully created first before we actually test
# 'mkdir -p' feature.
if (umask $mkdir_umask &&
$mkdirprog $mkdir_mode "$tmpdir" &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
test_tmpdir="$tmpdir/a"
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
[-=\(\)!]*) prefix='./';;
*) prefix='';;
esac
oIFS=$IFS
IFS=/
set -f
set fnord $dstdir
shift
set +f
IFS=$oIFS
prefixes=
for d
do
test X"$d" = X && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=${dstdirslash}_inst.$$_
rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
uoaerg-wavemon-fb158b0/configure 0000775 0000000 0000000 00000537213 15142173343 0017004 0 ustar 00root root 0000000 0000000 #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for wavemon 0.9.7.
#
# Report bugs to .
#
#
# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
# Inc.
#
#
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="as_nop=:
if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" )
then :
else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
blah=\$(echo \$(echo blah))
test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null
then :
as_have_required=yes
else $as_nop
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
then :
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$as_shell as_have_required=yes
if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
then :
break 2
fi
fi
done;;
esac
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi
fi
if test "x$CONFIG_SHELL" != x
then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno
then :
printf "%s\n" "$0: This script requires a shell more modern than all"
printf "%s\n" "$0: the shells that I found on your system."
if test ${ZSH_VERSION+y} ; then
printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and
$0: https://github.com/uoaerg/wavemon about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
#
# Initializations.
#
ac_default_prefix=/usr/local
ac_clean_files=
ac_config_libobj_dir=.
LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='wavemon'
PACKAGE_TARNAME='wavemon-current'
PACKAGE_VERSION='0.9.7'
PACKAGE_STRING='wavemon 0.9.7'
PACKAGE_BUGREPORT='https://github.com/uoaerg/wavemon'
PACKAGE_URL='https://github.com/uoaerg/wavemon'
# Factoring default headers for most tests.
ac_includes_default="\
#include
#ifdef HAVE_STDIO_H
# include
#endif
#ifdef HAVE_STDLIB_H
# include
#endif
#ifdef HAVE_STRING_H
# include
#endif
#ifdef HAVE_INTTYPES_H
# include
#endif
#ifdef HAVE_STDINT_H
# include
#endif
#ifdef HAVE_STRINGS_H
# include
#endif
#ifdef HAVE_SYS_TYPES_H
# include
#endif
#ifdef HAVE_SYS_STAT_H
# include
#endif
#ifdef HAVE_UNISTD_H
# include
#endif"
ac_header_c_list=
ac_subst_vars='LTLIBOBJS
LIBOBJS
EGREP
LIBNL3_CLI_LIBS
LIBNL3_CLI_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
GREP
INSTALL_DATA
INSTALL_SCRIPT
INSTALL_PROGRAM
CPP
OBJEXT
EXEEXT
ac_ct_CC
CPPFLAGS
LDFLAGS
CFLAGS
CC
host_os
host_vendor
host_cpu
host
build_os
build_vendor
build_cpu
build
target_alias
host_alias
build_alias
LIBS
ECHO_T
ECHO_N
ECHO_C
DEFS
mandir
localedir
libdir
psdir
pdfdir
dvidir
htmldir
infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
datadir
datarootdir
libexecdir
sbindir
bindir
program_transform_name
prefix
exec_prefix
PACKAGE_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_libcap
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
LIBNL3_CLI_CFLAGS
LIBNL3_CLI_LIBS'
# Initialize some variables set by options.
ac_init_help=
ac_init_version=false
ac_unrecognized_opts=
ac_unrecognized_sep=
# The variables have the same names as the options, with
# dashes changed to underlines.
cache_file=/dev/null
exec_prefix=NONE
no_create=
no_recursion=
prefix=NONE
program_prefix=NONE
program_suffix=NONE
program_transform_name=s,x,x,
silent=
site=
srcdir=
verbose=
x_includes=NONE
x_libraries=NONE
# Installation directory options.
# These are left unexpanded so users can "make install exec_prefix=/foo"
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
datarootdir='${prefix}/share'
datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
infodir='${datarootdir}/info'
htmldir='${docdir}'
dvidir='${docdir}'
pdfdir='${docdir}'
psdir='${docdir}'
libdir='${exec_prefix}/lib'
localedir='${datarootdir}/locale'
mandir='${datarootdir}/man'
ac_prev=
ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
eval $ac_prev=\$ac_option
ac_prev=
continue
fi
case $ac_option in
*=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
*=) ac_optarg= ;;
*) ac_optarg=yes ;;
esac
case $ac_dashdash$ac_option in
--)
ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
build_alias=$ac_optarg ;;
-cache-file | --cache-file | --cache-fil | --cache-fi \
| --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
ac_prev=cache_file ;;
-cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
| --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
cache_file=$ac_optarg ;;
--config-cache | -C)
cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
-datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
| --dataroo | --dataro | --datar)
ac_prev=datarootdir ;;
-datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
| --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
datarootdir=$ac_optarg ;;
-disable-* | --disable-*)
ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=no ;;
-docdir | --docdir | --docdi | --doc | --do)
ac_prev=docdir ;;
-docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
docdir=$ac_optarg ;;
-dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
ac_prev=dvidir ;;
-dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid feature name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"enable_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval enable_$ac_useropt=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
| --exec | --exe | --ex)
ac_prev=exec_prefix ;;
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
exec_prefix=$ac_optarg ;;
-gas | --gas | --ga | --g)
# Obsolete; use --with-gas.
with_gas=yes ;;
-help | --help | --hel | --he | -h)
ac_init_help=long ;;
-help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
ac_init_help=recursive ;;
-help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
ac_init_help=short ;;
-host | --host | --hos | --ho)
ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
-htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
ac_prev=htmldir ;;
-htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
| --ht=*)
htmldir=$ac_optarg ;;
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
-includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
| --includ=* | --inclu=* | --incl=* | --inc=*)
includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
libdir=$ac_optarg ;;
-libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
| --libexe | --libex | --libe)
ac_prev=libexecdir ;;
-libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
-localedir | --localedir | --localedi | --localed | --locale)
ac_prev=localedir ;;
-localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
localedir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
mandir=$ac_optarg ;;
-nfp | --nfp | --nf)
# Obsolete; use --without-fp.
with_fp=no ;;
-no-create | --no-create | --no-creat | --no-crea | --no-cre \
| --no-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
| --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
no_recursion=yes ;;
-oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
| --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
| --oldin | --oldi | --old | --ol | --o)
ac_prev=oldincludedir ;;
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
prefix=$ac_optarg ;;
-program-prefix | --program-prefix | --program-prefi | --program-pref \
| --program-pre | --program-pr | --program-p)
ac_prev=program_prefix ;;
-program-prefix=* | --program-prefix=* | --program-prefi=* \
| --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
program_prefix=$ac_optarg ;;
-program-suffix | --program-suffix | --program-suffi | --program-suff \
| --program-suf | --program-su | --program-s)
ac_prev=program_suffix ;;
-program-suffix=* | --program-suffix=* | --program-suffi=* \
| --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
program_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
| --program-transform-n | --program-transform- \
| --program-transform | --program-transfor \
| --program-transfo | --program-transf \
| --program-trans | --program-tran \
| --progr-tra | --program-tr | --program-t)
ac_prev=program_transform_name ;;
-program-transform-name=* | --program-transform-name=* \
| --program-transform-nam=* | --program-transform-na=* \
| --program-transform-n=* | --program-transform-=* \
| --program-transform=* | --program-transfor=* \
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
-pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
ac_prev=pdfdir ;;
-pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
pdfdir=$ac_optarg ;;
-psdir | --psdir | --psdi | --psd | --ps)
ac_prev=psdir ;;
-psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
psdir=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
| --sharedst | --shareds | --shared | --share | --shar \
| --sha | --sh)
ac_prev=sharedstatedir ;;
-sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
srcdir=$ac_optarg ;;
-sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
| --syscon | --sysco | --sysc | --sys | --sy)
ac_prev=sysconfdir ;;
-sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
| --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
target_alias=$ac_optarg ;;
-v | -verbose | --verbose | --verbos | --verbo | --verb)
verbose=yes ;;
-version | --version | --versio | --versi | --vers | -V)
ac_init_version=: ;;
-with-* | --with-*)
ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=\$ac_optarg ;;
-without-* | --without-*)
ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
as_fn_error $? "invalid package name: \`$ac_useropt'"
ac_useropt_orig=$ac_useropt
ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'`
case $ac_user_opts in
*"
"with_$ac_useropt"
"*) ;;
*) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
ac_unrecognized_sep=', ';;
esac
eval with_$ac_useropt=no ;;
--x)
# Obsolete; use --with-x.
with_x=yes ;;
-x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
| --x-incl | --x-inc | --x-in | --x-i)
ac_prev=x_includes ;;
-x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
| --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
x_includes=$ac_optarg ;;
-x-libraries | --x-libraries | --x-librarie | --x-librari \
| --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
ac_prev=x_libraries ;;
-x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
| --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
x_libraries=$ac_optarg ;;
-*) as_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
# FIXME: should be removed in autoconf 3.0.
printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2
expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2
: "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
;;
esac
done
if test -n "$ac_prev"; then
ac_option=--`echo $ac_prev | sed 's/_/-/g'`
as_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
esac
fi
# Check all directory arguments for consistency.
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
case $ac_val in
*/ )
ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
eval $ac_var=\$ac_val;;
esac
# Be sure to have absolute directory names.
case $ac_val in
[\\/$]* | ?:[\\/]* ) continue;;
NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
done
# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
host=$host_alias
target=$target_alias
# FIXME: To remove some day.
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
fi
ac_tool_prefix=
test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
ac_pwd=`pwd` && test -n "$ac_pwd" &&
ac_ls_di=`ls -di .` &&
ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
as_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
# Try the directory containing this script, then the parent directory.
ac_confdir=`$as_dirname -- "$as_myself" ||
$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_myself" : 'X\(//\)[^/]' \| \
X"$as_myself" : 'X\(//\)$' \| \
X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_myself" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
if test ! -r "$srcdir/$ac_unique_file"; then
test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
pwd)`
# When building in place, set srcdir=.
if test "$ac_abs_confdir" = "$ac_pwd"; then
srcdir=.
fi
# Remove unnecessary trailing slashes from srcdir.
# Double slashes in file names in object file debugging info
# mess up M-x gdb in Emacs.
case $srcdir in
*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
esac
for ac_var in $ac_precious_vars; do
eval ac_env_${ac_var}_set=\${${ac_var}+set}
eval ac_env_${ac_var}_value=\$${ac_var}
eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
eval ac_cv_env_${ac_var}_value=\$${ac_var}
done
#
# Report the --help message.
#
if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures wavemon 0.9.7 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
--help=short display options specific to this package
--help=recursive display the short help of all the included packages
-V, --version display version information and exit
-q, --quiet, --silent do not print \`checking ...' messages
--cache-file=FILE cache test results in FILE [disabled]
-C, --config-cache alias for \`--cache-file=config.cache'
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
--exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
[PREFIX]
By default, \`make install' will install all the files in
\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
an installation prefix other than \`$ac_default_prefix' using \`--prefix',
for instance \`--prefix=\$HOME'.
For better control, use the options below.
Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
--datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
--datadir=DIR read-only architecture-independent data [DATAROOTDIR]
--infodir=DIR info documentation [DATAROOTDIR/info]
--localedir=DIR locale-dependent data [DATAROOTDIR/locale]
--mandir=DIR man documentation [DATAROOTDIR/man]
--docdir=DIR documentation root [DATAROOTDIR/doc/wavemon-current]
--htmldir=DIR html documentation [DOCDIR]
--dvidir=DIR dvi documentation [DOCDIR]
--pdfdir=DIR pdf documentation [DOCDIR]
--psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]
_ACEOF
fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of wavemon 0.9.7:";;
esac
cat <<\_ACEOF
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--without-libcap disable support for libcap
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L if you have libraries in a
nonstandard directory
LIBS libraries to pass to the linker, e.g. -l
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if
you have headers in a nonstandard directory
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
LIBNL3_CLI_CFLAGS
C compiler flags for LIBNL3_CLI, overriding pkg-config
LIBNL3_CLI_LIBS
linker flags for LIBNL3_CLI, overriding pkg-config
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
Report bugs to .
wavemon home page: .
_ACEOF
ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
test -d "$ac_dir" ||
{ cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
continue
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
cd "$ac_dir" || { ac_status=$?; continue; }
# Check for configure.gnu first; this name is used for a wrapper for
# Metaconfig's "Configure" on case-insensitive file systems.
if test -f "$ac_srcdir/configure.gnu"; then
echo &&
$SHELL "$ac_srcdir/configure.gnu" --help=recursive
elif test -f "$ac_srcdir/configure"; then
echo &&
$SHELL "$ac_srcdir/configure" --help=recursive
else
printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi || ac_status=$?
cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
wavemon configure 0.9.7
generated by GNU Autoconf 2.71
Copyright (C) 2021 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
exit
fi
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest.beam
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext
then :
ac_retval=0
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if { { ac_try="$ac_cpp conftest.$ac_ext"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}
then :
ac_retval=0
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
eval "$3=yes"
else $as_nop
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main (void)
{
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main (void)
{
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
else $as_nop
eval "$3=yes"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}
then :
ac_retval=0
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
printf %s "checking for $2... " >&6; }
if eval test \${$3+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below. */
#include
#undef $2
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char $2 ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined __stub_$2 || defined __stub___$2
choke me
#endif
int
main (void)
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
eval "$3=yes"
else $as_nop
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
printf "%s\n" "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
ac_configure_args_raw=
for ac_arg
do
case $ac_arg in
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
as_fn_append ac_configure_args_raw " '$ac_arg'"
done
case $ac_configure_args_raw in
*$as_nl*)
ac_safe_unquote= ;;
*)
ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab.
ac_unsafe_a="$ac_unsafe_z#~"
ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g"
ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;;
esac
cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by wavemon $as_me 0.9.7, which was
generated by GNU Autoconf 2.71. Invocation command line was
$ $0$ac_configure_args_raw
_ACEOF
exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
} >&5
cat >&5 <<_ACEOF
## ----------- ##
## Core tests. ##
## ----------- ##
_ACEOF
# Keep a trace of the command line.
# Strip out --no-create and --no-recursion so they do not pile up.
# Strip out --silent because we don't want to record it for future runs.
# Also quote any args containing shell meta-characters.
# Make two passes to allow for proper duplicate-argument suppression.
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
ac_must_keep_next=false
for ac_pass in 1 2
do
for ac_arg
do
case $ac_arg in
-no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
*\'*)
ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append ac_configure_args1 " '$ac_arg'"
if test $ac_must_keep_next = true; then
ac_must_keep_next=false # Got value, back to normal.
else
case $ac_arg in
*=* | --config-cache | -C | -disable-* | --disable-* \
| -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
| -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
| -with-* | --with-* | -without-* | --without-* | --x)
case "$ac_configure_args0 " in
"$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
esac
;;
-* ) ac_must_keep_next=true ;;
esac
fi
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset ac_configure_args1;}
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
# WARNING: Use '\'' to represent an apostrophe within the trap.
# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Sanitize IFS.
IFS=" "" $as_nl"
# Save into config.log some information that might help in debugging.
{
echo
printf "%s\n" "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
echo
# The following way of writing the cache mishandles newlines in values,
(
for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
sed -n \
"s/'\''/'\''\\\\'\'''\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
;; #(
*)
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
)
echo
printf "%s\n" "## ----------------- ##
## Output variables. ##
## ----------------- ##"
echo
for ac_var in $ac_subst_vars
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
printf "%s\n" "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
echo
for ac_var in $ac_subst_files
do
eval ac_val=\$$ac_var
case $ac_val in
*\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
esac
printf "%s\n" "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
if test -s confdefs.h; then
printf "%s\n" "## ----------- ##
## confdefs.h. ##
## ----------- ##"
echo
cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
printf "%s\n" "$as_me: caught signal $ac_signal"
printf "%s\n" "$as_me: exit $exit_status"
} >&5
rm -f core *.core core.conftest.* &&
rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
rm -f -r conftest* confdefs.h
printf "%s\n" "/* confdefs.h */" > confdefs.h
# Predefined preprocessor variables.
printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h
printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h
# Let the site file select an alternate cache file if it wants to.
# Prefer an explicitly selected file to automatically selected ones.
if test -n "$CONFIG_SITE"; then
ac_site_files="$CONFIG_SITE"
elif test "x$prefix" != xNONE; then
ac_site_files="$prefix/share/config.site $prefix/etc/config.site"
else
ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
fi
for ac_site_file in $ac_site_files
do
case $ac_site_file in #(
*/*) :
;; #(
*) :
ac_site_file=./$ac_site_file ;;
esac
if test -f "$ac_site_file" && test -r "$ac_site_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;}
sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file" \
|| { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
fi
done
if test -r "$cache_file"; then
# Some versions of bash will fail to source /dev/null (special files
# actually), so we avoid doing that. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
printf "%s\n" "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
[\\/]* | ?:[\\/]* ) . "$cache_file";;
*) . "./$cache_file";;
esac
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
printf "%s\n" "$as_me: creating cache $cache_file" >&6;}
>$cache_file
fi
# Test code for whether the C compiler supports C89 (global declarations)
ac_c_conftest_c89_globals='
/* Does the compiler advertise C89 conformance?
Do not test the value of __STDC__, because some compilers set it to 0
while being otherwise adequately conformant. */
#if !defined __STDC__
# error "Compiler does not advertise C89 conformance"
#endif
#include
#include
struct stat;
/* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */
struct buf { int x; };
struct buf * (*rcsopen) (struct buf *, struct stat *, int);
static char *e (p, i)
char **p;
int i;
{
return p[i];
}
static char *f (char * (*g) (char **, int), char **p, ...)
{
char *s;
va_list v;
va_start (v,p);
s = g (p, va_arg (v,int));
va_end (v);
return s;
}
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not \xHH hex character constants.
These do not provoke an error unfortunately, instead are silently treated
as an "x". The following induces an error, until -std is added to get
proper ANSI mode. Curiously \x00 != x always comes out true, for an
array size at least. It is necessary to write \x00 == 0 to get something
that is true only with -std. */
int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1];
/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
inside strings and character constants. */
#define FOO(x) '\''x'\''
int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1];
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int),
int, int);'
# Test code for whether the C compiler supports C89 (body of main).
ac_c_conftest_c89_main='
ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]);
'
# Test code for whether the C compiler supports C99 (global declarations)
ac_c_conftest_c99_globals='
// Does the compiler advertise C99 conformance?
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
# error "Compiler does not advertise C99 conformance"
#endif
#include
extern int puts (const char *);
extern int printf (const char *, ...);
extern int dprintf (int, const char *, ...);
extern void *malloc (size_t);
// Check varargs macros. These examples are taken from C99 6.10.3.5.
// dprintf is used instead of fprintf to avoid needing to declare
// FILE and stderr.
#define debug(...) dprintf (2, __VA_ARGS__)
#define showlist(...) puts (#__VA_ARGS__)
#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
static void
test_varargs_macros (void)
{
int x = 1234;
int y = 5678;
debug ("Flag");
debug ("X = %d\n", x);
showlist (The first, second, and third items.);
report (x>y, "x is %d but y is %d", x, y);
}
// Check long long types.
#define BIG64 18446744073709551615ull
#define BIG32 4294967295ul
#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
#if !BIG_OK
#error "your preprocessor is broken"
#endif
#if BIG_OK
#else
#error "your preprocessor is broken"
#endif
static long long int bignum = -9223372036854775807LL;
static unsigned long long int ubignum = BIG64;
struct incomplete_array
{
int datasize;
double data[];
};
struct named_init {
int number;
const wchar_t *name;
double average;
};
typedef const char *ccp;
static inline int
test_restrict (ccp restrict text)
{
// See if C++-style comments work.
// Iterate through items via the restricted pointer.
// Also check for declarations in for loops.
for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i)
continue;
return 0;
}
// Check varargs and va_copy.
static bool
test_varargs (const char *format, ...)
{
va_list args;
va_start (args, format);
va_list args_copy;
va_copy (args_copy, args);
const char *str = "";
int number = 0;
float fnumber = 0;
while (*format)
{
switch (*format++)
{
case '\''s'\'': // string
str = va_arg (args_copy, const char *);
break;
case '\''d'\'': // int
number = va_arg (args_copy, int);
break;
case '\''f'\'': // float
fnumber = va_arg (args_copy, double);
break;
default:
break;
}
}
va_end (args_copy);
va_end (args);
return *str && number && fnumber;
}
'
# Test code for whether the C compiler supports C99 (body of main).
ac_c_conftest_c99_main='
// Check bool.
_Bool success = false;
success |= (argc != 0);
// Check restrict.
if (test_restrict ("String literal") == 0)
success = true;
char *restrict newvar = "Another string";
// Check varargs.
success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234);
test_varargs_macros ();
// Check flexible array members.
struct incomplete_array *ia =
malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
ia->datasize = 10;
for (int i = 0; i < ia->datasize; ++i)
ia->data[i] = i * 1.234;
// Check named initializers.
struct named_init ni = {
.number = 34,
.name = L"Test wide string",
.average = 543.34343,
};
ni.number = 58;
int dynamic_array[ni.number];
dynamic_array[0] = argv[0][0];
dynamic_array[ni.number - 1] = 543;
// work around unused variable warnings
ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\''
|| dynamic_array[ni.number - 1] != 543);
'
# Test code for whether the C compiler supports C11 (global declarations)
ac_c_conftest_c11_globals='
// Does the compiler advertise C11 conformance?
#if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L
# error "Compiler does not advertise C11 conformance"
#endif
// Check _Alignas.
char _Alignas (double) aligned_as_double;
char _Alignas (0) no_special_alignment;
extern char aligned_as_int;
char _Alignas (0) _Alignas (int) aligned_as_int;
// Check _Alignof.
enum
{
int_alignment = _Alignof (int),
int_array_alignment = _Alignof (int[100]),
char_alignment = _Alignof (char)
};
_Static_assert (0 < -_Alignof (int), "_Alignof is signed");
// Check _Noreturn.
int _Noreturn does_not_return (void) { for (;;) continue; }
// Check _Static_assert.
struct test_static_assert
{
int x;
_Static_assert (sizeof (int) <= sizeof (long int),
"_Static_assert does not work in struct");
long int y;
};
// Check UTF-8 literals.
#define u8 syntax error!
char const utf8_literal[] = u8"happens to be ASCII" "another string";
// Check duplicate typedefs.
typedef long *long_ptr;
typedef long int *long_ptr;
typedef long_ptr long_ptr;
// Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1.
struct anonymous
{
union {
struct { int i; int j; };
struct { int k; long int l; } w;
};
int m;
} v1;
'
# Test code for whether the C compiler supports C11 (body of main).
ac_c_conftest_c11_main='
_Static_assert ((offsetof (struct anonymous, i)
== offsetof (struct anonymous, w.k)),
"Anonymous union alignment botch");
v1.i = 2;
v1.w.k = 5;
ok |= v1.i != 5;
'
# Test code for whether the C compiler supports C11 (complete).
ac_c_conftest_c11_program="${ac_c_conftest_c89_globals}
${ac_c_conftest_c99_globals}
${ac_c_conftest_c11_globals}
int
main (int argc, char **argv)
{
int ok = 0;
${ac_c_conftest_c89_main}
${ac_c_conftest_c99_main}
${ac_c_conftest_c11_main}
return ok;
}
"
# Test code for whether the C compiler supports C99 (complete).
ac_c_conftest_c99_program="${ac_c_conftest_c89_globals}
${ac_c_conftest_c99_globals}
int
main (int argc, char **argv)
{
int ok = 0;
${ac_c_conftest_c89_main}
${ac_c_conftest_c99_main}
return ok;
}
"
# Test code for whether the C compiler supports C89 (complete).
ac_c_conftest_c89_program="${ac_c_conftest_c89_globals}
int
main (int argc, char **argv)
{
int ok = 0;
${ac_c_conftest_c89_main}
return ok;
}
"
as_fn_append ac_header_c_list " stdio.h stdio_h HAVE_STDIO_H"
as_fn_append ac_header_c_list " stdlib.h stdlib_h HAVE_STDLIB_H"
as_fn_append ac_header_c_list " string.h string_h HAVE_STRING_H"
as_fn_append ac_header_c_list " inttypes.h inttypes_h HAVE_INTTYPES_H"
as_fn_append ac_header_c_list " stdint.h stdint_h HAVE_STDINT_H"
as_fn_append ac_header_c_list " strings.h strings_h HAVE_STRINGS_H"
as_fn_append ac_header_c_list " sys/stat.h sys_stat_h HAVE_SYS_STAT_H"
as_fn_append ac_header_c_list " sys/types.h sys_types_h HAVE_SYS_TYPES_H"
as_fn_append ac_header_c_list " unistd.h unistd_h HAVE_UNISTD_H"
as_fn_append ac_header_c_list " sys/time.h sys_time_h HAVE_SYS_TIME_H"
# Auxiliary files required by this configure script.
ac_aux_files="install-sh config.guess config.sub"
# Locations in which to look for auxiliary files.
ac_aux_dir_candidates="${srcdir}/config"
# Search for a directory containing all of the required auxiliary files,
# $ac_aux_files, from the $PATH-style list $ac_aux_dir_candidates.
# If we don't find one directory that contains all the files we need,
# we report the set of missing files from the *first* directory in
# $ac_aux_dir_candidates and give up.
ac_missing_aux_files=""
ac_first_candidate=:
printf "%s\n" "$as_me:${as_lineno-$LINENO}: looking for aux files: $ac_aux_files" >&5
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in $ac_aux_dir_candidates
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
printf "%s\n" "$as_me:${as_lineno-$LINENO}: trying $as_dir" >&5
ac_aux_dir_found=yes
ac_install_sh=
for ac_aux in $ac_aux_files
do
# As a special case, if "install-sh" is required, that requirement
# can be satisfied by any of "install-sh", "install.sh", or "shtool",
# and $ac_install_sh is set appropriately for whichever one is found.
if test x"$ac_aux" = x"install-sh"
then
if test -f "${as_dir}install-sh"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install-sh found" >&5
ac_install_sh="${as_dir}install-sh -c"
elif test -f "${as_dir}install.sh"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}install.sh found" >&5
ac_install_sh="${as_dir}install.sh -c"
elif test -f "${as_dir}shtool"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}shtool found" >&5
ac_install_sh="${as_dir}shtool install -c"
else
ac_aux_dir_found=no
if $ac_first_candidate; then
ac_missing_aux_files="${ac_missing_aux_files} install-sh"
else
break
fi
fi
else
if test -f "${as_dir}${ac_aux}"; then
printf "%s\n" "$as_me:${as_lineno-$LINENO}: ${as_dir}${ac_aux} found" >&5
else
ac_aux_dir_found=no
if $ac_first_candidate; then
ac_missing_aux_files="${ac_missing_aux_files} ${ac_aux}"
else
break
fi
fi
fi
done
if test "$ac_aux_dir_found" = yes; then
ac_aux_dir="$as_dir"
break
fi
ac_first_candidate=false
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
as_fn_error $? "cannot find required auxiliary files:$ac_missing_aux_files" "$LINENO" 5
fi
# These three variables are undocumented and unsupported,
# and are intended to be withdrawn in a future Autoconf release.
# They can cause serious problems if a builder's source tree is in a directory
# whose full name contains unusual characters.
if test -f "${ac_aux_dir}config.guess"; then
ac_config_guess="$SHELL ${ac_aux_dir}config.guess"
fi
if test -f "${ac_aux_dir}config.sub"; then
ac_config_sub="$SHELL ${ac_aux_dir}config.sub"
fi
if test -f "$ac_aux_dir/configure"; then
ac_configure="$SHELL ${ac_aux_dir}configure"
fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
eval ac_old_val=\$ac_cv_env_${ac_var}_value
eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
ac_cache_corrupted=: ;;
,set)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
ac_cache_corrupted=: ;;
,);;
*)
if test "x$ac_old_val" != "x$ac_new_val"; then
# differences in whitespace do not lead to failure.
ac_old_val_w=`echo x $ac_old_val`
ac_new_val_w=`echo x $ac_new_val`
if test "$ac_old_val_w" != "$ac_new_val_w"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
ac_cache_corrupted=:
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
eval $ac_var=\$ac_old_val
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5
printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;}
fi;;
esac
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
*\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
*" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;}
as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file'
and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Variables
ac_config_files="$ac_config_files Makefile"
: ${CFLAGS="-O2 -Wall -Wextra -Wpedantic"}
# wavemon is only supported on Linux, warn user about futile compilations
# Make sure we can run config.sub.
$SHELL "${ac_aux_dir}config.sub" sun4 >/dev/null 2>&1 ||
as_fn_error $? "cannot run $SHELL ${ac_aux_dir}config.sub" "$LINENO" 5
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
printf %s "checking build system type... " >&6; }
if test ${ac_cv_build+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_build_alias=$build_alias
test "x$ac_build_alias" = x &&
ac_build_alias=`$SHELL "${ac_aux_dir}config.guess"`
test "x$ac_build_alias" = x &&
as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "${ac_aux_dir}config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
printf "%s\n" "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
esac
build=$ac_cv_build
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_build
shift
build_cpu=$1
build_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
build_os=$*
IFS=$ac_save_IFS
case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
printf %s "checking host system type... " >&6; }
if test ${ac_cv_host+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test "x$host_alias" = x; then
ac_cv_host=$ac_cv_build
else
ac_cv_host=`$SHELL "${ac_aux_dir}config.sub" $host_alias` ||
as_fn_error $? "$SHELL ${ac_aux_dir}config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
printf "%s\n" "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
esac
host=$ac_cv_host
ac_save_IFS=$IFS; IFS='-'
set x $ac_cv_host
shift
host_cpu=$1
host_vendor=$2
shift; shift
# Remember, the first character of IFS is used to create $*,
# except with old shells:
host_os=$*
IFS=$ac_save_IFS
case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
case "$host_os" in
*linux*|*LINUX*) ;;
*) as_fn_error $? "incompatible OS '$host_os' - required is Linux with nl80211." "$LINENO" 5
esac
# NCURSES_CHECK_CONFIG(LIBNAME, CONFIG_SCRIPT, ELSE_PART)
# Checks for programs.
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
printf "%s\n" "$CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
printf "%s\n" "$ac_ct_CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
printf "%s\n" "$CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
ac_prog_rejected=no
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
fi
ac_cv_prog_CC="cc"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
set dummy $ac_cv_prog_CC
shift
if test $# != 0; then
# We chose a different compiler from the bogus one.
# However, it has the same basename, so the bogon will be chosen
# first if we set CC to just the basename; use the full file name.
shift
ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@"
fi
fi
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
printf "%s\n" "$CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
printf "%s\n" "$CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
printf "%s\n" "$ac_ct_CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
test -n "$ac_ct_CC" && break
done
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
fi
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args.
set dummy ${ac_tool_prefix}clang; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$CC"; then
ac_cv_prog_CC="$CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}clang"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
printf "%s\n" "$CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "clang", so it can be a program name with args.
set dummy clang; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_prog_ac_ct_CC+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -n "$ac_ct_CC"; then
ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="clang"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
printf "%s\n" "$ac_ct_CC" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_ct_CC" = x; then
CC=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
CC=$ac_ct_CC
fi
else
CC="$ac_cv_prog_CC"
fi
fi
test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion -version; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
printf %s "checking whether the C compiler works... " >&6; }
ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
# The possible output files:
ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
ac_rmfiles=
for ac_file in $ac_files
do
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
* ) ac_rmfiles="$ac_rmfiles $ac_file";;
esac
done
rm -f $ac_rmfiles
if { { ac_try="$ac_link_default"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
# Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
# in a Makefile. We should not override ac_cv_exeext if it was cached,
# so that the user can short-circuit this test for compilers unknown to
# Autoconf.
for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no;
then :; else
ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
fi
# We set ac_cv_exeext here because the later test for it is not
# safe: cross compilers may not add the suffix if given an `-o'
# argument, so we may need to know it at that point already.
# Even if this section looks crufty: it has the advantage of
# actually working.
break;;
* )
break;;
esac
done
test "$ac_cv_exeext" = no && ac_cv_exeext=
else $as_nop
ac_file=''
fi
if test -z "$ac_file"
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
printf %s "checking for C compiler default output file name... " >&6; }
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
printf "%s\n" "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
printf %s "checking for suffix of executables... " >&6; }
if { { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
# If both `conftest.exe' and `conftest' are `present' (well, observable)
# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
# work properly (i.e., refer to `conftest.exe'), while it won't with
# `rm'.
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
break;;
* ) break;;
esac
done
else $as_nop
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
printf "%s\n" "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main (void)
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
printf %s "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
printf "%s\n" "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
printf %s "checking for suffix of object files... " >&6; }
if test ${ac_cv_objext+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
rm -f conftest.o conftest.obj
if { { ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
printf "%s\n" "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then :
for ac_file in conftest.o conftest.obj conftest.*; do
test -f "$ac_file" || continue;
case $ac_file in
*.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
done
else $as_nop
printf "%s\n" "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
printf "%s\n" "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5
printf %s "checking whether the compiler supports GNU C... " >&6; }
if test ${ac_cv_c_compiler_gnu+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_compiler_gnu=yes
else $as_nop
ac_compiler_gnu=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; }
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test $ac_compiler_gnu = yes; then
GCC=yes
else
GCC=
fi
ac_test_CFLAGS=${CFLAGS+y}
ac_save_CFLAGS=$CFLAGS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
printf %s "checking whether $CC accepts -g... " >&6; }
if test ${ac_cv_prog_cc_g+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_save_c_werror_flag=$ac_c_werror_flag
ac_c_werror_flag=yes
ac_cv_prog_cc_g=no
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_g=yes
else $as_nop
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
else $as_nop
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_g=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
ac_c_werror_flag=$ac_save_c_werror_flag
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
printf "%s\n" "$ac_cv_prog_cc_g" >&6; }
if test $ac_test_CFLAGS; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
else
CFLAGS="-g"
fi
else
if test "$GCC" = yes; then
CFLAGS="-O2"
else
CFLAGS=
fi
fi
ac_prog_cc_stdc=no
if test x$ac_prog_cc_stdc = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5
printf %s "checking for $CC option to enable C11 features... " >&6; }
if test ${ac_cv_prog_cc_c11+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cc_c11=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_c_conftest_c11_program
_ACEOF
for ac_arg in '' -std=gnu11
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_c11=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c11" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
if test "x$ac_cv_prog_cc_c11" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
else $as_nop
if test "x$ac_cv_prog_cc_c11" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5
printf "%s\n" "$ac_cv_prog_cc_c11" >&6; }
CC="$CC $ac_cv_prog_cc_c11"
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11
ac_prog_cc_stdc=c11
fi
fi
if test x$ac_prog_cc_stdc = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5
printf %s "checking for $CC option to enable C99 features... " >&6; }
if test ${ac_cv_prog_cc_c99+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cc_c99=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_c_conftest_c99_program
_ACEOF
for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99=
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_c99=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c99" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
if test "x$ac_cv_prog_cc_c99" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
else $as_nop
if test "x$ac_cv_prog_cc_c99" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
printf "%s\n" "$ac_cv_prog_cc_c99" >&6; }
CC="$CC $ac_cv_prog_cc_c99"
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
ac_prog_cc_stdc=c99
fi
fi
if test x$ac_prog_cc_stdc = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5
printf %s "checking for $CC option to enable C89 features... " >&6; }
if test ${ac_cv_prog_cc_c89+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_c_conftest_c89_program
_ACEOF
for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_prog_cc_c89=$ac_arg
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam
test "x$ac_cv_prog_cc_c89" != "xno" && break
done
rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
if test "x$ac_cv_prog_cc_c89" = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
printf "%s\n" "unsupported" >&6; }
else $as_nop
if test "x$ac_cv_prog_cc_c89" = x
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
printf "%s\n" "none needed" >&6; }
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
printf "%s\n" "$ac_cv_prog_cc_c89" >&6; }
CC="$CC $ac_cv_prog_cc_c89"
fi
ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
ac_prog_cc_stdc=c89
fi
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
printf %s "checking how to run the C preprocessor... " >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
if test ${ac_cv_prog_CPP+y}
then :
printf %s "(cached) " >&6
else $as_nop
# Double quotes because $CC needs to be expanded
for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp
do
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"
then :
else $as_nop
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"
then :
# Broken: success on invalid input.
continue
else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok
then :
break
fi
done
ac_cv_prog_CPP=$CPP
fi
CPP=$ac_cv_prog_CPP
else
ac_cv_prog_CPP=$CPP
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
printf "%s\n" "$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
# Use a header file that comes with gcc, so configuring glibc
# with a fresh cross-compiler works.
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp. "Syntax error" is here to catch this case.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"
then :
else $as_nop
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"
then :
# Broken: success on invalid input.
continue
else $as_nop
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok
then :
else $as_nop
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
# incompatible versions:
# SysV /etc/install, /usr/sbin/install
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
# AmigaOS /C/install, which installs bootblocks on floppy discs
# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
# Reject install programs that cannot install multiple files.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
printf %s "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if test ${ac_cv_path_install+y}
then :
printf %s "(cached) " >&6
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
# Account for fact that we put trailing slashes in our PATH walk.
case $as_dir in #((
./ | /[cC]/* | \
/etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
/usr/ucb/* ) ;;
*)
# OSF1 and SCO ODT 3.0 have their own names for install.
# Don't use installbsd from OSF since it installs stuff as root
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
elif test $ac_prog = install &&
grep pwplus "$as_dir$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# program-specific install script used by HP pwplus--don't use.
:
else
rm -rf conftest.one conftest.two conftest.dir
echo one > conftest.one
echo two > conftest.two
mkdir conftest.dir
if "$as_dir$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir/" &&
test -s conftest.one && test -s conftest.two &&
test -s conftest.dir/conftest.one &&
test -s conftest.dir/conftest.two
then
ac_cv_path_install="$as_dir$ac_prog$ac_exec_ext -c"
break 3
fi
fi
fi
done
done
;;
esac
done
IFS=$as_save_IFS
rm -rf conftest.one conftest.two conftest.dir
fi
if test ${ac_cv_path_install+y}; then
INSTALL=$ac_cv_path_install
else
# As a last resort, use the slow shell script. Don't cache a
# value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
# removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
printf "%s\n" "$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
printf %s "checking for grep that handles long lines and -e... " >&6; }
if test ${ac_cv_path_GREP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if test -z "$GREP"; then
ac_path_GREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in grep ggrep
do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
*GNU*)
ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
printf "%s\n" 'GREP' >> "conftest.nl"
"$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_GREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_GREP="$ac_path_GREP"
ac_path_GREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_GREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_GREP"; then
as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
printf "%s\n" "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
# Checks for header files.
ac_header= ac_cache=
for ac_item in $ac_header_c_list
do
if test $ac_cache; then
ac_fn_c_check_header_compile "$LINENO" $ac_header ac_cv_header_$ac_cache "$ac_includes_default"
if eval test \"x\$ac_cv_header_$ac_cache\" = xyes; then
printf "%s\n" "#define $ac_item 1" >> confdefs.h
fi
ac_header= ac_cache=
elif test $ac_header; then
ac_cache=$ac_item
else
ac_header=$ac_item
fi
done
if test $ac_cv_header_stdlib_h = yes && test $ac_cv_header_string_h = yes
then :
printf "%s\n" "#define STDC_HEADERS 1" >>confdefs.h
fi
for ac_header in ncurses.h fcntl.h netdb.h sys/ioctl.h sys/time.h unistd.h net/if_arp.h netinet/ether.h net/ethernet.h pthread.h
do :
as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
if eval test \"x\$"$as_ac_Header"\" = x"yes"
then :
cat >>confdefs.h <<_ACEOF
#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else $as_nop
as_fn_error $? "$ac_header not found" "$LINENO" 5
fi
done
ac_fn_c_check_header_compile "$LINENO" "ncursesw/curses.h" "ac_cv_header_ncursesw_curses_h" "$ac_includes_default"
if test "x$ac_cv_header_ncursesw_curses_h" = xyes
then :
printf "%s\n" "#define HAVE_NCURSESW_CURSES_H 1" >>confdefs.h
fi
# linux/if.h needs 'struct sockaddr'
for ac_header in sys/socket.h linux/if.h
do :
as_ac_Header=`printf "%s\n" "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "#if HAVE_SYS_SOCKET_H
# include
#endif
#if HAVE_LINUX_IF_H
# include
#endif
"
if eval test \"x\$"$as_ac_Header"\" = x"yes"
then :
cat >>confdefs.h <<_ACEOF
#define `printf "%s\n" "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
else $as_nop
as_fn_error $? "can not use $ac_header" "$LINENO" 5
fi
done
ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default"
if test "x$ac_cv_type__Bool" = xyes
then :
printf "%s\n" "#define HAVE__BOOL 1" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
printf %s "checking for stdbool.h that conforms to C99... " >&6; }
if test ${ac_cv_header_stdbool_h+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#ifndef __bool_true_false_are_defined
#error "__bool_true_false_are_defined is not defined"
#endif
char a[__bool_true_false_are_defined == 1 ? 1 : -1];
/* Regardless of whether this is C++ or "_Bool" is a
valid type name, "true" and "false" should be usable
in #if expressions and integer constant expressions,
and "bool" should be a valid type name. */
#if !true
#error "'true' is not true"
#endif
#if true != 1
#error "'true' is not equal to 1"
#endif
char b[true == 1 ? 1 : -1];
char c[true];
#if false
#error "'false' is not false"
#endif
#if false != 0
#error "'false' is not equal to 0"
#endif
char d[false == 0 ? 1 : -1];
enum { e = false, f = true, g = false * true, h = true * 256 };
char i[(bool) 0.5 == true ? 1 : -1];
char j[(bool) 0.0 == false ? 1 : -1];
char k[sizeof (bool) > 0 ? 1 : -1];
struct sb { bool s: 1; bool t; } s;
char l[sizeof s.t > 0 ? 1 : -1];
/* The following fails for
HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */
bool m[h];
char n[sizeof m == h * sizeof m[0] ? 1 : -1];
char o[-1 - (bool) 0 < 0 ? 1 : -1];
/* Catch a bug in an HP-UX C compiler. See
https://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html
https://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html
*/
bool p = true;
bool *pp = &p;
/* C 1999 specifies that bool, true, and false are to be
macros, but C++ 2011 and later overrule this. */
#if __cplusplus < 201103
#ifndef bool
#error "bool is not defined"
#endif
#ifndef false
#error "false is not defined"
#endif
#ifndef true
#error "true is not defined"
#endif
#endif
/* If _Bool is available, repeat with it all the tests
above that used bool. */
#ifdef HAVE__BOOL
struct sB { _Bool s: 1; _Bool t; } t;
char q[(_Bool) 0.5 == true ? 1 : -1];
char r[(_Bool) 0.0 == false ? 1 : -1];
char u[sizeof (_Bool) > 0 ? 1 : -1];
char v[sizeof t.t > 0 ? 1 : -1];
_Bool w[h];
char x[sizeof m == h * sizeof m[0] ? 1 : -1];
char y[-1 - (_Bool) 0 < 0 ? 1 : -1];
_Bool z = true;
_Bool *pz = &p;
#endif
int
main (void)
{
bool ps = &s;
*pp |= p;
*pp |= ! p;
#ifdef HAVE__BOOL
_Bool pt = &t;
*pz |= z;
*pz |= ! z;
#endif
/* Refer to every declared value, so they cannot be
discarded as unused. */
return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !j + !k
+ !l + !m + !n + !o + !p + !pp + !ps
#ifdef HAVE__BOOL
+ !q + !r + !u + !v + !w + !x + !y + !z + !pt
#endif
);
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_header_stdbool_h=yes
else $as_nop
ac_cv_header_stdbool_h=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5
printf "%s\n" "$ac_cv_header_stdbool_h" >&6; }
if test $ac_cv_header_stdbool_h = yes; then
printf "%s\n" "#define HAVE_STDBOOL_H 1" >>confdefs.h
fi
# Tests involving libraries
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5
printf %s "checking for pow in -lm... " >&6; }
if test ${ac_cv_lib_m_pow+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lm $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char pow ();
int
main (void)
{
return pow ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_m_pow=yes
else $as_nop
ac_cv_lib_m_pow=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5
printf "%s\n" "$ac_cv_lib_m_pow" >&6; }
if test "x$ac_cv_lib_m_pow" = xyes
then :
printf "%s\n" "#define HAVE_LIBM 1" >>confdefs.h
LIBS="-lm $LIBS"
else $as_nop
as_fn_error $? "math library not found" "$LINENO" 5
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
printf %s "checking for pthread_create in -lpthread... " >&6; }
if test ${ac_cv_lib_pthread_pthread_create+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lpthread $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char pthread_create ();
int
main (void)
{
return pthread_create ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_pthread_pthread_create=yes
else $as_nop
ac_cv_lib_pthread_pthread_create=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
printf "%s\n" "$ac_cv_lib_pthread_pthread_create" >&6; }
if test "x$ac_cv_lib_pthread_pthread_create" = xyes
then :
CFLAGS="$CFLAGS -pthread"
else $as_nop
as_fn_error $? "pthread library not found" "$LINENO" 5
fi
# Check various combinations of ncurses5/6 configuration scripts (based on htop's checks).
ncurses_config_script_libs=$("ncursesw6-config" --libs 2> /dev/null)
ncurses_config_script_cflags=$("ncursesw6-config" --cflags 2> /dev/null)
ncurses_script_success=no
ncurses_save_LDFLAGS="$LDFLAGS"
ncurses_save_CFLAGS="$CFLAGS"
if test "x$ncurses_config_script_libs" != x; then
LDFLAGS="$ncurses_config_script_libs $LDFLAGS"
CFLAGS="$CFLAGS $ncurses_config_script_cflags"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw6" >&5
printf %s "checking for addnwstr in -lncursesw6... " >&6; }
if test ${ac_cv_lib_ncursesw6_addnwstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncursesw6 $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char addnwstr ();
int
main (void)
{
return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncursesw6_addnwstr=yes
else $as_nop
ac_cv_lib_ncursesw6_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw6_addnwstr" >&5
printf "%s\n" "$ac_cv_lib_ncursesw6_addnwstr" >&6; }
if test "x$ac_cv_lib_ncursesw6_addnwstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSESW 1" >>confdefs.h
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
LIBS="$ncurses_config_script_libs $LIBS"
ncurses_script_success=yes
else $as_nop
CFLAGS="$ncurses_save_CFLAGS"
fi
LDFLAGS="$ncurses_save_LDFLAGS"
fi
if test "x$ncurses_script_success" = xno; then
ncurses_config_script_libs=$("ncursesw6-config" --libs 2> /dev/null)
ncurses_config_script_cflags=$("ncursesw6-config" --cflags 2> /dev/null)
ncurses_script_success=no
ncurses_save_LDFLAGS="$LDFLAGS"
ncurses_save_CFLAGS="$CFLAGS"
if test "x$ncurses_config_script_libs" != x; then
LDFLAGS="$ncurses_config_script_libs $LDFLAGS"
CFLAGS="$CFLAGS $ncurses_config_script_cflags"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5
printf %s "checking for addnwstr in -lncursesw... " >&6; }
if test ${ac_cv_lib_ncursesw_addnwstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncursesw $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char addnwstr ();
int
main (void)
{
return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncursesw_addnwstr=yes
else $as_nop
ac_cv_lib_ncursesw_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5
printf "%s\n" "$ac_cv_lib_ncursesw_addnwstr" >&6; }
if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSESW 1" >>confdefs.h
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
LIBS="$ncurses_config_script_libs $LIBS"
ncurses_script_success=yes
else $as_nop
CFLAGS="$ncurses_save_CFLAGS"
fi
LDFLAGS="$ncurses_save_LDFLAGS"
fi
if test "x$ncurses_script_success" = xno; then
ncurses_config_script_libs=$("ncursesw5-config" --libs 2> /dev/null)
ncurses_config_script_cflags=$("ncursesw5-config" --cflags 2> /dev/null)
ncurses_script_success=no
ncurses_save_LDFLAGS="$LDFLAGS"
ncurses_save_CFLAGS="$CFLAGS"
if test "x$ncurses_config_script_libs" != x; then
LDFLAGS="$ncurses_config_script_libs $LDFLAGS"
CFLAGS="$CFLAGS $ncurses_config_script_cflags"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5
printf %s "checking for addnwstr in -lncursesw... " >&6; }
if test ${ac_cv_lib_ncursesw_addnwstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncursesw $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char addnwstr ();
int
main (void)
{
return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncursesw_addnwstr=yes
else $as_nop
ac_cv_lib_ncursesw_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5
printf "%s\n" "$ac_cv_lib_ncursesw_addnwstr" >&6; }
if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSESW 1" >>confdefs.h
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
LIBS="$ncurses_config_script_libs $LIBS"
ncurses_script_success=yes
else $as_nop
CFLAGS="$ncurses_save_CFLAGS"
fi
LDFLAGS="$ncurses_save_LDFLAGS"
fi
if test "x$ncurses_script_success" = xno; then
ncurses_config_script_libs=$("ncurses5-config" --libs 2> /dev/null)
ncurses_config_script_cflags=$("ncurses5-config" --cflags 2> /dev/null)
ncurses_script_success=no
ncurses_save_LDFLAGS="$LDFLAGS"
ncurses_save_CFLAGS="$CFLAGS"
if test "x$ncurses_config_script_libs" != x; then
LDFLAGS="$ncurses_config_script_libs $LDFLAGS"
CFLAGS="$CFLAGS $ncurses_config_script_cflags"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncurses" >&5
printf %s "checking for addnwstr in -lncurses... " >&6; }
if test ${ac_cv_lib_ncurses_addnwstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char addnwstr ();
int
main (void)
{
return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncurses_addnwstr=yes
else $as_nop
ac_cv_lib_ncurses_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_addnwstr" >&5
printf "%s\n" "$ac_cv_lib_ncurses_addnwstr" >&6; }
if test "x$ac_cv_lib_ncurses_addnwstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSESW 1" >>confdefs.h
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
LIBS="$ncurses_config_script_libs $LIBS"
ncurses_script_success=yes
else $as_nop
CFLAGS="$ncurses_save_CFLAGS"
fi
LDFLAGS="$ncurses_save_LDFLAGS"
fi
if test "x$ncurses_script_success" = xno; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5
printf %s "checking for addnwstr in -lncursesw... " >&6; }
if test ${ac_cv_lib_ncursesw_addnwstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncursesw $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char addnwstr ();
int
main (void)
{
return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncursesw_addnwstr=yes
else $as_nop
ac_cv_lib_ncursesw_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5
printf "%s\n" "$ac_cv_lib_ncursesw_addnwstr" >&6; }
if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSESW 1" >>confdefs.h
LIBS="-lncursesw $LIBS"
else $as_nop
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for waddstr in -lncurses" >&5
printf %s "checking for waddstr in -lncurses... " >&6; }
if test ${ac_cv_lib_ncurses_waddstr+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lncurses $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char waddstr ();
int
main (void)
{
return waddstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_ncurses_waddstr=yes
else $as_nop
ac_cv_lib_ncurses_waddstr=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_waddstr" >&5
printf "%s\n" "$ac_cv_lib_ncurses_waddstr" >&6; }
if test "x$ac_cv_lib_ncurses_waddstr" = xyes
then :
printf "%s\n" "#define HAVE_LIBNCURSES 1" >>confdefs.h
LIBS="-lncurses $LIBS"
else $as_nop
as_fn_error $? "ncurses library not found" "$LINENO" 5
fi
fi
fi
fi
fi
fi
# libcap - allow to disable, since e.g. OpenWrt does not use it.
# https://github.com/uoaerg/wavemon/issues/54
# Check whether --with-libcap was given.
if test ${with_libcap+y}
then :
withval=$with_libcap;
else $as_nop
with_libcap=yes
fi
if test "x$with_libcap" != xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for cap_get_flag in -lcap" >&5
printf %s "checking for cap_get_flag in -lcap... " >&6; }
if test ${ac_cv_lib_cap_cap_get_flag+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_check_lib_save_LIBS=$LIBS
LIBS="-lcap $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char cap_get_flag ();
int
main (void)
{
return cap_get_flag ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"
then :
ac_cv_lib_cap_cap_get_flag=yes
else $as_nop
ac_cv_lib_cap_cap_get_flag=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_cap_cap_get_flag" >&5
printf "%s\n" "$ac_cv_lib_cap_cap_get_flag" >&6; }
if test "x$ac_cv_lib_cap_cap_get_flag" = xyes
then :
printf "%s\n" "#define HAVE_LIBCAP 1" >>confdefs.h
LIBS="-lcap $LIBS"
fi
fi
# Testing library functions
for ac_func in gettimeofday ether_ntohost
do :
as_ac_var=`printf "%s\n" "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
if eval test \"x\$"$as_ac_var"\" = x"yes"
then :
cat >>confdefs.h <<_ACEOF
#define `printf "%s\n" "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
else $as_nop
as_fn_error $? "function '$ac_func' not supported" "$LINENO" 5
fi
done
# libnl3 cli package (pulls in genl and route package).
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
PKG_CONFIG=$ac_cv_path_PKG_CONFIG
if test -n "$PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
printf "%s\n" "$PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
fi
if test -z "$ac_cv_path_PKG_CONFIG"; then
ac_pt_PKG_CONFIG=$PKG_CONFIG
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
printf %s "checking for $ac_word... " >&6; }
if test ${ac_cv_path_ac_pt_PKG_CONFIG+y}
then :
printf %s "(cached) " >&6
else $as_nop
case $ac_pt_PKG_CONFIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext"
printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
;;
esac
fi
ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
if test -n "$ac_pt_PKG_CONFIG"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5
printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
fi
if test "x$ac_pt_PKG_CONFIG" = x; then
PKG_CONFIG=""
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
ac_tool_warned=yes ;;
esac
PKG_CONFIG=$ac_pt_PKG_CONFIG
fi
else
PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
fi
fi
if test -n "$PKG_CONFIG"; then
_pkg_min_version=0.9.0
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5
printf %s "checking pkg-config is at least version $_pkg_min_version... " >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
PKG_CONFIG=""
fi
fi
pkg_failed=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for libnl-cli-3.0 >= 3.2.22" >&5
printf %s "checking for libnl-cli-3.0 >= 3.2.22... " >&6; }
if test -n "$LIBNL3_CLI_CFLAGS"; then
pkg_cv_LIBNL3_CLI_CFLAGS="$LIBNL3_CLI_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-cli-3.0 >= 3.2.22\""; } >&5
($PKG_CONFIG --exists --print-errors "libnl-cli-3.0 >= 3.2.22") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBNL3_CLI_CFLAGS=`$PKG_CONFIG --cflags "libnl-cli-3.0 >= 3.2.22" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test -n "$LIBNL3_CLI_LIBS"; then
pkg_cv_LIBNL3_CLI_LIBS="$LIBNL3_CLI_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libnl-cli-3.0 >= 3.2.22\""; } >&5
($PKG_CONFIG --exists --print-errors "libnl-cli-3.0 >= 3.2.22") 2>&5
ac_status=$?
printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
pkg_cv_LIBNL3_CLI_LIBS=`$PKG_CONFIG --libs "libnl-cli-3.0 >= 3.2.22" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes
else
pkg_failed=yes
fi
else
pkg_failed=untried
fi
if test $pkg_failed = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
_pkg_short_errors_supported=yes
else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
LIBNL3_CLI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libnl-cli-3.0 >= 3.2.22" 2>&1`
else
LIBNL3_CLI_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libnl-cli-3.0 >= 3.2.22" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$LIBNL3_CLI_PKG_ERRORS" >&5
as_fn_error $? "need libnl-cli-3.0 >= 3.2.22" "$LINENO" 5
elif test $pkg_failed = untried; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
printf "%s\n" "no" >&6; }
as_fn_error $? "need libnl-cli-3.0 >= 3.2.22" "$LINENO" 5
else
LIBNL3_CLI_CFLAGS=$pkg_cv_LIBNL3_CLI_CFLAGS
LIBNL3_CLI_LIBS=$pkg_cv_LIBNL3_CLI_LIBS
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5
printf "%s\n" "yes" >&6; }
fi
# Checks for typedefs, structures, and compiler characteristics.
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
printf %s "checking for egrep... " >&6; }
if test ${ac_cv_path_EGREP+y}
then :
printf %s "(cached) " >&6
else $as_nop
if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
then ac_cv_path_EGREP="$GREP -E"
else
if test -z "$EGREP"; then
ac_path_EGREP_found=false
# Loop through the user's path and test for each of PROGNAME-LIST
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
for ac_prog in egrep
do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir$ac_prog$ac_exec_ext"
as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
*GNU*)
ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
*)
ac_count=0
printf %s 0123456789 >"conftest.in"
while :
do
cat "conftest.in" "conftest.in" >"conftest.tmp"
mv "conftest.tmp" "conftest.in"
cp "conftest.in" "conftest.nl"
printf "%s\n" 'EGREP' >> "conftest.nl"
"$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
as_fn_arith $ac_count + 1 && ac_count=$as_val
if test $ac_count -gt ${ac_path_EGREP_max-0}; then
# Best one so far, save it but keep looking for a better one
ac_cv_path_EGREP="$ac_path_EGREP"
ac_path_EGREP_max=$ac_count
fi
# 10*(2^10) chars as input seems more than enough
test $ac_count -gt 10 && break
done
rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
esac
$ac_path_EGREP_found && break 3
done
done
done
IFS=$as_save_IFS
if test -z "$ac_cv_path_EGREP"; then
as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
printf "%s\n" "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
if test $ac_cv_c_compiler_gnu = yes; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5
printf %s "checking whether $CC needs -traditional... " >&6; }
if test ${ac_cv_prog_gcc_traditional+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_pattern="Autoconf.*'x'"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Autoconf TIOCGETP
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "$ac_pattern" >/dev/null 2>&1
then :
ac_cv_prog_gcc_traditional=yes
else $as_nop
ac_cv_prog_gcc_traditional=no
fi
rm -rf conftest*
if test $ac_cv_prog_gcc_traditional = no; then
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
Autoconf TCGETA
_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
$EGREP "$ac_pattern" >/dev/null 2>&1
then :
ac_cv_prog_gcc_traditional=yes
fi
rm -rf conftest*
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5
printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; }
if test $ac_cv_prog_gcc_traditional = yes; then
CC="$CC -traditional"
fi
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5
printf %s "checking for an ANSI C-conforming const... " >&6; }
if test ${ac_cv_c_const+y}
then :
printf %s "(cached) " >&6
else $as_nop
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main (void)
{
#ifndef __cplusplus
/* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
/* IBM XL C 1.02.0.0 rejects this.
It does not let you subtract one const X* pointer from another in
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
pcpcc = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
{ /* SCO 3.2v4 cc rejects this sort of thing. */
char tx;
char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
const int *foo = &x[0];
++foo;
}
{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
typedef const int *iptr;
iptr p = 0;
++p;
}
{ /* IBM XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
struct s { int j; const int *ap[3]; } bx;
struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
if (!foo) return 0;
}
return !cs[0] && !zero.x;
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_c_const=yes
else $as_nop
ac_cv_c_const=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5
printf "%s\n" "$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
printf "%s\n" "#define const /**/" >>confdefs.h
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for inline" >&5
printf %s "checking for inline... " >&6; }
if test ${ac_cv_c_inline+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifndef __cplusplus
typedef int foo_t;
static $ac_kw foo_t static_foo (void) {return 0; }
$ac_kw foo_t foo (void) {return 0; }
#endif
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
ac_cv_c_inline=$ac_kw
fi
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
test "$ac_cv_c_inline" != no && break
done
fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5
printf "%s\n" "$ac_cv_c_inline" >&6; }
case $ac_cv_c_inline in
inline | yes) ;;
*)
case $ac_cv_c_inline in
no) ac_val=;;
*) ac_val=$ac_cv_c_inline;;
esac
cat >>confdefs.h <<_ACEOF
#ifndef __cplusplus
#define inline $ac_val
#endif
_ACEOF
;;
esac
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
# tests run on this system so they can be shared between configure
# scripts and configure runs, see configure's option --config-cache.
# It is not useful on other systems. If it contains results you don't
# want to keep, you may remove or edit it.
#
# config.status only pays attention to the cache file if you give it
# the --recheck option to rerun configure.
#
# `ac_cv_env_foo' variables (set or unset) will be overridden when
# loading this file, other *unset* `ac_cv_foo' will be assigned the
# following values.
_ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
(
for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
eval ac_val=\$$ac_var
case $ac_val in #(
*${as_nl}*)
case $ac_var in #(
*_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
esac
case $ac_var in #(
_ | IFS | as_nl) ;; #(
BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
*) { eval $ac_var=; unset $ac_var;} ;;
esac ;;
esac
done
(set) 2>&1 |
case $as_nl`(ac_space=' '; set) 2>&1` in #(
*${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes: double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \.
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
esac |
sort
) |
sed '
/^ac_cv_env_/b end
t clear
:clear
s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/
t end
s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
:end' >>confcache
if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
if test -w "$cache_file"; then
if test "x$cache_file" != "x/dev/null"; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
printf "%s\n" "$as_me: updating cache $cache_file" >&6;}
if test ! -f "$cache_file" || test -h "$cache_file"; then
cat confcache >"$cache_file"
else
case $cache_file in #(
*/* | ?:*)
mv -f confcache "$cache_file"$$ &&
mv -f "$cache_file"$$ "$cache_file" ;; #(
*)
mv -f confcache "$cache_file" ;;
esac
fi
fi
else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
# Transform confdefs.h into DEFS.
# Protect against shell expansion while executing Makefile rules.
# Protect against Makefile macro expansion.
#
# If the first sed substitution is executed (which looks for macros that
# take arguments), then branch to the quote section. Otherwise,
# look for a macro that doesn't take arguments.
ac_script='
:mline
/\\$/{
N
s,\\\n,,
b mline
}
t clear
:clear
s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g
t quote
s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g
t quote
b any
:quote
s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g
s/\[/\\&/g
s/\]/\\&/g
s/\$/$$/g
H
:any
${
g
s/^\n//
s/\n/ /g
p
}
'
DEFS=`sed -n "$ac_script" confdefs.h`
ac_libobjs=
ac_ltlibobjs=
U=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"`
# 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
# will be set to the directory where LIBOBJS objects are built.
as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
ac_clean_files_save=$ac_clean_files
ac_clean_files="$ac_clean_files $CONFIG_STATUS"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;}
as_write_fail=0
cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
#! $SHELL
# Generated by $as_me.
# Run this file to recreate the current configuration.
# Compiler output produced by configure, useful for debugging
# configure, is in config.log if it exists.
debug=false
ac_cs_recheck=false
ac_cs_silent=false
SHELL=\${CONFIG_SHELL-$SHELL}
export SHELL
_ASEOF
cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
exec 6>&1
## ----------------------------------- ##
## Main body of $CONFIG_STATUS script. ##
## ----------------------------------- ##
_ASEOF
test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Save the log message, to keep $0 and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by wavemon $as_me 0.9.7, which was
generated by GNU Autoconf 2.71. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
CONFIG_LINKS = $CONFIG_LINKS
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
on `(hostname || uname -n) 2>/dev/null | sed 1q`
"
_ACEOF
case $ac_config_files in *"
"*) set x $ac_config_files; shift; ac_config_files=$*;;
esac
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
ac_cs_usage="\
\`$as_me' instantiates files and other configuration actions
from templates according to the current configuration. Unless the files
and actions are specified as TAGs, all are instantiated by default.
Usage: $0 [OPTION]... [TAG]...
-h, --help print this help, then exit
-V, --version print version number and configuration settings, then exit
--config print configuration, then exit
-q, --quiet, --silent
do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
--file=FILE[:TEMPLATE]
instantiate the configuration file FILE
Configuration files:
$config_files
Report bugs to .
wavemon home page: ."
_ACEOF
ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"`
ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"`
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
wavemon config.status 0.9.7
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"
Copyright (C) 2021 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
ac_pwd='$ac_pwd'
srcdir='$srcdir'
INSTALL='$INSTALL'
test -n "\$AWK" || AWK=awk
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# The default lists apply if the user does not specify any file.
ac_need_defaults=:
while test $# != 0
do
case $1 in
--*=?*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*=)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=
ac_shift=:
;;
*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
esac
case $ac_option in
# Handling of the options.
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
--version | --versio | --versi | --vers | --ver | --ve | --v | -V )
printf "%s\n" "$ac_cs_version"; exit ;;
--config | --confi | --conf | --con | --co | --c )
printf "%s\n" "$ac_cs_config"; exit ;;
--debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
case $ac_optarg in
*\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
'') as_fn_error $? "missing file argument" ;;
esac
as_fn_append CONFIG_FILES " '$ac_optarg'"
ac_need_defaults=false;;
--he | --h | --help | --hel | -h )
printf "%s\n" "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
-*) as_fn_error $? "unrecognized option: \`$1'
Try \`$0 --help' for more information." ;;
*) as_fn_append ac_config_targets " $1"
ac_need_defaults=false ;;
esac
shift
done
ac_configure_extra_args=
if $ac_cs_silent; then
exec 6>/dev/null
ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
export CONFIG_SHELL
exec "\$@"
fi
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
exec 5>>config.log
{
echo
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## Running $as_me. ##
_ASBOX
printf "%s\n" "$ac_log"
} >&5
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# Handling of arguments.
for ac_config_target in $ac_config_targets
do
case $ac_config_target in
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
done
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
# bizarre bug on SunOS 4.1.3.
if $ac_need_defaults; then
test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files
fi
# Have a temporary directory for convenience. Make it in the build tree
# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
# Hook for its removal unless debugging.
# Note that there is a small window in which the directory will not be cleaned:
# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
tmp= ac_tmp=
trap 'exit_status=$?
: "${ac_tmp:=$tmp}"
{ test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
' 0
trap 'as_fn_exit 1' 1 2 13 15
}
# Create a (secure) tmp directory for tmp files.
{
tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -d "$tmp"
} ||
{
tmp=./conf$$-$RANDOM
(umask 077 && mkdir "$tmp")
} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
ac_tmp=$tmp
# Set up the scripts for CONFIG_FILES section.
# No need to generate them if there are no CONFIG_FILES.
# This happens for instance with `./config.status config.h'.
if test -n "$CONFIG_FILES"; then
ac_cr=`echo X | tr X '\015'`
# On cygwin, bash can eat \r inside `` if the user requested igncr.
# But we know of no other shell where ac_cr would be empty at this
# point, so we can use a bashism as a fallback.
if test "x$ac_cr" = x; then
eval ac_cr=\$\'\\r\'
fi
ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null`
if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
ac_cs_awk_cr='\\r'
else
ac_cs_awk_cr=$ac_cr
fi
echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
_ACEOF
{
echo "cat >conf$$subs.awk <<_ACEOF" &&
echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
echo "_ACEOF"
} >conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
ac_delim='%!_!# '
for ac_last_try in false false false false false :; do
. ./conf$$subs.sh ||
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
if test $ac_delim_n = $ac_delim_num; then
break
elif $ac_last_try; then
as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
else
ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
done
rm -f conf$$subs.sh
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
_ACEOF
sed -n '
h
s/^/S["/; s/!.*/"]=/
p
g
s/^[^!]*!//
:repl
t repl
s/'"$ac_delim"'$//
t delim
:nl
h
s/\(.\{148\}\)..*/\1/
t more1
s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
p
n
b repl
:more1
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t nl
:delim
h
s/\(.\{148\}\)..*/\1/
t more2
s/["\\]/\\&/g; s/^/"/; s/$/"/
p
b
:more2
s/["\\]/\\&/g; s/^/"/; s/$/"\\/
p
g
s/.\{148\}//
t delim
' >$CONFIG_STATUS || ac_write_fail=1
rm -f conf$$subs.awk
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
_ACAWK
cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
for (key in S) S_is_set[key] = 1
FS = ""
}
{
line = $ 0
nfields = split(line, field, "@")
substed = 0
len = length(field[1])
for (i = 2; i < nfields; i++) {
key = field[i]
keylen = length(key)
if (S_is_set[key]) {
value = S[key]
line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
len += length(value) + length(field[++i])
substed = 1
} else
len += 1 + keylen
}
print line
}
_ACAWK
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
else
cat
fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
|| as_fn_error $? "could not setup config files machinery" "$LINENO" 5
_ACEOF
# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
# trailing colons and then remove the whole line if VPATH becomes empty
# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{
h
s///
s/^/:/
s/[ ]*$/:/
s/:\$(srcdir):/:/g
s/:\${srcdir}:/:/g
s/:@srcdir@:/:/g
s/^:*//
s/:*$//
x
s/\(=[ ]*\).*/\1/
G
s/\n//
s/^[^=]*=[ ]*$//
}'
fi
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_FILES"
eval set X " :F $CONFIG_FILES "
shift
for ac_tag
do
case $ac_tag in
:[FHLC]) ac_mode=$ac_tag; continue;;
esac
case $ac_mode$ac_tag in
:[FHL]*:*);;
:L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
:[FH]-) ac_tag=-:-;;
:[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
esac
ac_save_IFS=$IFS
IFS=:
set x $ac_tag
IFS=$ac_save_IFS
shift
ac_file=$1
shift
case $ac_mode in
:L) ac_source=$1;;
:[FH])
ac_file_inputs=
for ac_f
do
case $ac_f in
-) ac_f="$ac_tmp/stdin";;
*) # Look for the file first in the build tree, then in the source tree
# (if the path is not absolute). The absolute path cannot be DOS-style,
# because $ac_f cannot contain `:'.
test -f "$ac_f" ||
case $ac_f in
[\\/$]*) false;;
*) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
esac ||
as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
esac
case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
as_fn_append ac_file_inputs " '$ac_f'"
done
# Let's still pretend it is `configure' which instantiates (i.e., don't
# use $as_me), people would be surprised to read:
# /* config.h. Generated by config.status. */
configure_input='Generated from '`
printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
`' by configure.'
if test x"$ac_file" != x-; then
configure_input="$ac_file. $configure_input"
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
printf "%s\n" "$as_me: creating $ac_file" >&6;}
fi
# Neutralize special characters interpreted by sed in replacement strings.
case $configure_input in #(
*\&* | *\|* | *\\* )
ac_sed_conf_input=`printf "%s\n" "$configure_input" |
sed 's/[\\\\&|]/\\\\&/g'`;; #(
*) ac_sed_conf_input=$configure_input;;
esac
case $ac_tag in
*:-:* | *:-) cat >"$ac_tmp/stdin" \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
esac
;;
esac
ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$ac_file" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir="$ac_dir"; as_fn_mkdir_p
ac_builddir=.
case "$ac_dir" in
.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
*)
ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'`
# A ".." for each directory in $ac_dir_suffix.
ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
case $ac_top_builddir_sub in
"") ac_top_builddir_sub=. ac_top_build_prefix= ;;
*) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
esac ;;
esac
ac_abs_top_builddir=$ac_pwd
ac_abs_builddir=$ac_pwd$ac_dir_suffix
# for backward compatibility:
ac_top_builddir=$ac_top_build_prefix
case $srcdir in
.) # We are building in place.
ac_srcdir=.
ac_top_srcdir=$ac_top_builddir_sub
ac_abs_top_srcdir=$ac_pwd ;;
[\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
ac_top_srcdir=$srcdir
ac_abs_top_srcdir=$srcdir ;;
*) # Relative name.
ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
ac_top_srcdir=$ac_top_build_prefix$srcdir
ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
case $ac_mode in
:F)
#
# CONFIG_FILE
#
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
*) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# If the template does not know about datarootdir, expand it.
# FIXME: This hack should be removed a few years after 2.60.
ac_datarootdir_hack=; ac_datarootdir_seen=
ac_sed_dataroot='
/datarootdir/ {
p
q
}
/@datadir@/p
/@docdir@/p
/@infodir@/p
/@localedir@/p
/@mandir@/p'
case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
*datarootdir*) ac_datarootdir_seen=yes;;
*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_datarootdir_hack='
s&@datadir@&$datadir&g
s&@docdir@&$docdir&g
s&@infodir@&$infodir&g
s&@localedir@&$localedir&g
s&@mandir@&$mandir&g
s&\\\${datarootdir}&$datarootdir&g' ;;
esac
_ACEOF
# Neutralize VPATH when `$srcdir' = `.'.
# Shell code in configure.ac might set extrasub.
# FIXME: do we really want to maintain this feature?
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_sed_extra="$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
s|@configure_input@|$ac_sed_conf_input|;t t
s&@top_builddir@&$ac_top_builddir_sub&;t t
s&@top_build_prefix@&$ac_top_build_prefix&;t t
s&@srcdir@&$ac_srcdir&;t t
s&@abs_srcdir@&$ac_abs_srcdir&;t t
s&@top_srcdir@&$ac_top_srcdir&;t t
s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
s&@builddir@&$ac_builddir&;t t
s&@abs_builddir@&$ac_abs_builddir&;t t
s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
s&@INSTALL@&$ac_INSTALL&;t t
$ac_datarootdir_hack
"
eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
>$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
{ ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
{ ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \
"$ac_tmp/out"`; test -z "$ac_out"; } &&
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&5
printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
which seems to be undefined. Please make sure it is defined" >&2;}
rm -f "$ac_tmp/stdin"
case $ac_file in
-) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
*) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
esac \
|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
;;
esac
done # for ac_tag
as_fn_exit 0
_ACEOF
ac_clean_files=$ac_clean_files_save
test $ac_write_fail = 0 ||
as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
# configure is writing to config.log, and then calls config.status.
# config.status does its own redirection, appending to config.log.
# Unfortunately, on DOS this fails, as config.log is still kept open
# by configure, so config.status won't be able to write to it; its
# output is simply discarded. So we exec the FD to /dev/null,
# effectively closing config.log, so it can be properly (re)opened and
# appended to by config.status. When coming back to configure, we
# need to make the FD available again.
if test "$no_create" != yes; then
ac_cs_success=:
ac_config_status_args=
test "$silent" = yes &&
ac_config_status_args="$ac_config_status_args --quiet"
exec 5>/dev/null
$SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
exec 5>>config.log
# Use ||, not &&, to avoid exiting from the if with $? = 1, which
# would make configure fail if this is the last instruction.
$ac_cs_success || as_fn_exit 1
fi
if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
uoaerg-wavemon-fb158b0/configure.ac 0000664 0000000 0000000 00000007015 15142173343 0017353 0 ustar 00root root 0000000 0000000 dnl Process this file with autoconf to produce a configure script.
AC_PREREQ([2.71])
AC_INIT([wavemon],[0.9.7],[https://github.com/uoaerg/wavemon],[wavemon-current],[https://github.com/uoaerg/wavemon])
# Variables
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_FILES([Makefile])
: ${CFLAGS="-O2 -Wall -Wextra -Wpedantic"}
# wavemon is only supported on Linux, warn user about futile compilations
AC_CANONICAL_HOST
case "$host_os" in
*linux*|*LINUX*) ;;
*) AC_MSG_ERROR([incompatible OS '$host_os' - required is Linux with nl80211.])
esac
# NCURSES_CHECK_CONFIG(LIBNAME, CONFIG_SCRIPT, ELSE_PART)
m4_define([NCURSES_CHECK_CONFIG],
[
ncurses_config_script_libs=$([$2] --libs 2> /dev/null)
ncurses_config_script_cflags=$([$2] --cflags 2> /dev/null)
ncurses_script_success=no
ncurses_save_LDFLAGS="$LDFLAGS"
ncurses_save_CFLAGS="$CFLAGS"
if test "x$ncurses_config_script_libs" != x; then
LDFLAGS="$ncurses_config_script_libs $LDFLAGS"
CFLAGS="$CFLAGS $ncurses_config_script_cflags"
AC_CHECK_LIB([$1], [addnwstr], [
AC_DEFINE([HAVE_LIBNCURSESW], 1)
CFLAGS="$CFLAGS -D_XOPEN_SOURCE_EXTENDED"
LIBS="$ncurses_config_script_libs $LIBS"
ncurses_script_success=yes
], [
CFLAGS="$ncurses_save_CFLAGS"
])
LDFLAGS="$ncurses_save_LDFLAGS"
fi
if test "x$ncurses_script_success" = xno; then
[$3]
fi
])
# Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_GREP
# Checks for header files.
AC_CHECK_INCLUDES_DEFAULT
AC_CHECK_HEADERS_ONCE([sys/time.h])
AC_CHECK_HEADERS([ncurses.h fcntl.h netdb.h sys/ioctl.h sys/time.h unistd.h\
net/if_arp.h netinet/ether.h net/ethernet.h pthread.h],
[], [AC_MSG_ERROR($ac_header not found)])
AC_CHECK_HEADERS([ncursesw/curses.h])
# linux/if.h needs 'struct sockaddr'
AC_CHECK_HEADERS([sys/socket.h linux/if.h], [],
[AC_MSG_ERROR(can not use $ac_header)],
[#if HAVE_SYS_SOCKET_H
# include
#endif
#if HAVE_LINUX_IF_H
# include
#endif
])
AC_HEADER_STDBOOL
# Tests involving libraries
AC_CHECK_LIB([m], [pow], [], [AC_MSG_ERROR(math library not found)])
AC_CHECK_LIB([pthread], [pthread_create], [CFLAGS="$CFLAGS -pthread"],
[AC_MSG_ERROR(pthread library not found)])
# Check various combinations of ncurses5/6 configuration scripts (based on htop's checks).
NCURSES_CHECK_CONFIG([ncursesw6], "ncursesw6-config",
NCURSES_CHECK_CONFIG([ncursesw], "ncursesw6-config",
NCURSES_CHECK_CONFIG([ncursesw], "ncursesw5-config",
NCURSES_CHECK_CONFIG([ncurses], "ncurses5-config",
AC_CHECK_LIB([ncursesw], [addnwstr], [],
[AC_CHECK_LIB([ncurses], [waddstr], [],
[AC_MSG_ERROR(ncurses library not found)])])))))
# libcap - allow to disable, since e.g. OpenWrt does not use it.
# https://github.com/uoaerg/wavemon/issues/54
AC_ARG_WITH([libcap],
[AS_HELP_STRING([--without-libcap],
[disable support for libcap])],
[],
[with_libcap=yes])
AS_IF([test "x$with_libcap" != xno], AC_CHECK_LIB([cap], [cap_get_flag]))
# Testing library functions
AC_CHECK_FUNCS([gettimeofday ether_ntohost], [],
[AC_MSG_ERROR(function '$ac_func' not supported)])
# libnl3 cli package (pulls in genl and route package).
PKG_CHECK_MODULES([LIBNL3_CLI], [libnl-cli-3.0 >= 3.2.22], [],
[AC_MSG_ERROR(need libnl-cli-3.0 >= 3.2.22)])
# Checks for typedefs, structures, and compiler characteristics.
AC_PROG_GCC_TRADITIONAL
AC_C_CONST
AC_C_INLINE
AC_OUTPUT
uoaerg-wavemon-fb158b0/error.c 0000664 0000000 0000000 00000005156 15142173343 0016366 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
#include
#if HAVE_LIBCAP
#include
static bool has_capability(cap_value_t cap)
{
cap_t cap_proc = cap_get_proc();
cap_flag_value_t cur_val;
if (cap_get_flag(cap_proc, cap, CAP_EFFECTIVE, &cur_val))
err_sys("cap_get_flag(CAP_EFFECTIVE)");
cap_free(cap_proc);
return cur_val == CAP_SET;
}
bool has_net_admin_capability(void)
{
return has_capability(CAP_NET_ADMIN);
}
#else /* !HAVE_LIBCAP */
bool has_net_admin_capability(void)
{
return geteuid() == 0;
}
#endif
/*
* For displaying warning messages that are unrelated to system calls,
* outside ncurses mode for %WARN_DISPLAY_DELAY seconds.
*/
void err_msg(const char *format, ...)
{
va_list argp;
va_start(argp, format);
vwarnx(format, argp);
va_end(argp);
sleep(WARN_DISPLAY_DELAY);
}
/**
* terminate_all_processes - terminate wavemon and reset screen
* @fmt: printf-like format string
* @strerr: set to true if termination is due to failed system call
* @ap: argument list for @fmt
*/
static void terminate_all_processes(const char *fmt, bool strerr, va_list ap)
{
int saved_errno = strerr ? errno : 0;
/*
* wavemon runs in its own process group. Block TERM in this process,
* but send to all others (parent or child), which by default do not
* block TERM.
*/
xsignal(SIGTERM, SIG_IGN);
endwin();
kill(0, SIGTERM);
reset_shell_mode();
if (saved_errno) {
errno = saved_errno;
vwarn(fmt, ap);
} else {
vwarnx(fmt, ap);
}
va_end(ap);
exit(EXIT_FAILURE);
}
/*
* Abort on fatal error unrelated to system call.
*/
void err_quit(const char *format, ...)
{
va_list argp;
va_start(argp, format);
terminate_all_processes(format, false, argp);
}
/*
* Abort on fatal error related to system call.
*/
void err_sys(const char *format, ...)
{
va_list argp;
va_start(argp, format);
terminate_all_processes(format, true, argp);
}
uoaerg-wavemon-fb158b0/help_scr.c 0000664 0000000 0000000 00000002123 15142173343 0017023 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
/* GLOBALS */
static WINDOW *w_help;
void scr_help_init(void)
{
w_help = newwin_title(0, WAV_HEIGHT, "Help", false);
waddstr_center(w_help, WAV_HEIGHT/2 - 1, "don't panic.");
wrefresh(w_help);
}
int scr_help_loop(WINDOW *w_menu)
{
return wgetch(w_menu);
}
void scr_help_fini(void)
{
delwin(w_help);
}
uoaerg-wavemon-fb158b0/info_scr.c 0000664 0000000 0000000 00000055157 15142173343 0017045 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "iw_if.h"
#include "iw_nl80211.h"
/* GLOBALS */
static WINDOW *w_levels, *w_stats, *w_if, *w_info, *w_net;
static pthread_t sampling_thread;
static time_t last_update;
/* Linkstat pointers, shared between sampling thread and UI main thread. */
static struct iw_nl80211_linkstat *ls_tmp = NULL,
*ls_cur = NULL,
*ls_new = NULL;
static pthread_mutex_t linkstat_mutex;
/** Sampling pthread - shared by info and histogram screen. */
static void *sampling_loop(void *arg)
{
const bool do_not_swap_pointers = (bool)arg;
sigset_t blockmask;
/* See comment in iw_scan.c for rationale of blocking SIGWINCH. */
sigemptyset(&blockmask);
sigaddset(&blockmask, SIGWINCH);
pthread_sigmask(SIG_BLOCK, &blockmask, NULL);
do {
if (!ls_new && ls_tmp) {
iw_nl80211_get_linkstat(ls_tmp);
iw_cache_update(ls_tmp);
if (do_not_swap_pointers)
continue;
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_mutex_lock(&linkstat_mutex);
ls_new = ls_tmp;
ls_tmp = NULL;
pthread_mutex_unlock(&linkstat_mutex);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
}
} while (usleep(conf.stat_iv * 1000) == 0);
return NULL;
}
/* Start thread. Ensure that !ls_new && ls_tmp. */
void sampling_init(bool do_not_swap_pointers)
{
if (!ls_tmp && !ls_cur) {
ls_tmp = calloc(1, sizeof(*ls_tmp));
ls_cur = calloc(1, sizeof(*ls_cur));
if (!ls_tmp || !ls_cur)
err_sys("Out of memory");
} else if (ls_new && !ls_tmp) { /* Old state from previous run. */
ls_tmp = ls_cur;
ls_cur = ls_new;
ls_new = NULL;
}
pthread_create(&sampling_thread, NULL, sampling_loop, (void*)do_not_swap_pointers);
}
void sampling_stop(void)
{
pthread_cancel(sampling_thread);
pthread_join(sampling_thread, NULL);
}
static void display_levels(void)
{
static float qual, signal, noise, ssnr;
/*
* FIXME: revise the scale implementation. It does not work
* satisfactorily, maybe it is better to have a simple
* solution using 3 levels of different colour.
*/
int8_t nscale[2] = { conf.noise_min, conf.noise_max },
lvlscale[2] = { -40, -20};
char tmp[0x100];
int line;
bool noise_data_valid;
int sig_qual = -1, sig_qual_max = 0, sig_level = 0;
noise_data_valid = iw_nl80211_have_survey_data(ls_cur);
sig_level = ls_cur->signal;
/* See comments in iw_cache_update */
if (sig_level == 0)
sig_level = ls_cur->signal_avg;
if (sig_level == 0)
sig_level = ls_cur->bss_signal;
/* If the signal level is positive, assume it is an absolute value (#100). */
if (sig_level > 0)
sig_level *= -1;
for (line = 1; line <= WH_LEVEL; line++)
mvwclrtoborder(w_levels, line, 1);
if (ls_cur->bss_signal_qual) {
/* BSS_SIGNAL_UNSPEC is scaled 0..100 */
sig_qual = ls_cur->bss_signal_qual;
sig_qual_max = 100;
} else if (sig_level) {
if (sig_level < -110)
sig_qual = 0;
else if (sig_level > -40)
sig_qual = 70;
else
sig_qual = sig_level + 110;
sig_qual_max = 70;
}
line = 1;
/* Noise data is rare. Use the space for spreading out. */
if (!noise_data_valid)
line++;
if (sig_qual == -1) {
line++;
} else {
qual = ewma(qual, sig_qual, conf.meter_decay / 100.0);
mvwclrtoborder(w_levels, line, 1);
mvwaddstr(w_levels, line++, 1, "link quality: ");
sprintf(tmp, "%0.f%% ", (1e2 * qual)/sig_qual_max);
waddstr_b(w_levels, tmp);
sprintf(tmp, "(%0.f/%d) ", qual, sig_qual_max);
waddstr(w_levels, tmp);
waddbar(w_levels, line++, qual, 0, sig_qual_max, lvlscale, true);
}
/* Spacer */
line++;
if (!noise_data_valid)
line++;
if (sig_level != 0) {
signal = ewma(signal, sig_level, conf.meter_decay / 100.0);
mvwclrtoborder(w_levels, line, 1);
mvwaddstr(w_levels, line++, 1, "signal level: ");
sprintf(tmp, "%.0f dBm (%s)", signal, dbm2units(signal));
waddstr_b(w_levels, tmp);
waddbar(w_levels, line, signal, conf.sig_min, conf.sig_max,
lvlscale, true);
if (conf.lthreshold_action)
waddthreshold(w_levels, line, signal, conf.lthreshold,
conf.sig_min, conf.sig_max, lvlscale, '>');
if (conf.hthreshold_action)
waddthreshold(w_levels, line, signal, conf.hthreshold,
conf.sig_min, conf.sig_max, lvlscale, '<');
}
line++;
if (noise_data_valid) {
noise = ewma(noise, ls_cur->survey.noise, conf.meter_decay / 100.0);
mvwaddstr(w_levels, line++, 1, "noise level: ");
sprintf(tmp, "%.0f dBm (%s)", noise, dbm2units(noise));
waddstr_b(w_levels, tmp);
waddbar(w_levels, line++, noise, conf.noise_min, conf.noise_max,
nscale, false);
if (sig_level) {
ssnr = ewma(ssnr, sig_level - ls_cur->survey.noise,
conf.meter_decay / 100.0);
mvwaddstr(w_levels, line++, 1, "SNR: ");
sprintf(tmp, "%.0f dB", ssnr);
waddstr_b(w_levels, tmp);
}
} else {
// Force redraw on next line (needed on some terminals).
mvwaddstr(w_levels, line++, 1, "");
}
wrefresh(w_levels);
}
static void display_packet_counts(void)
{
char tmp[0x120];
/*
* Interface RX stats
*/
mvwaddstr(w_stats, 1, 1, "RX: ");
if (ls_cur->rx_packets) {
sprintf(tmp, "%s (%s)", int_counts(ls_cur->rx_packets),
byte_units(ls_cur->rx_bytes));
waddstr_b(w_stats, tmp);
} else {
waddstr(w_stats, "n/a");
}
if (iw_nl80211_have_survey_data(ls_cur)) {
if (ls_cur->rx_bitrate[0]) {
waddstr(w_stats, ", rate: ");
waddstr_b(w_stats, ls_cur->rx_bitrate);
}
if (ls_cur->expected_thru) {
if (ls_cur->expected_thru >= 1024)
sprintf(tmp, " (expected: %.1f MB/s)", ls_cur->expected_thru/1024.0);
else
sprintf(tmp, " (expected: %u kB/s)", ls_cur->expected_thru);
waddstr(w_stats, tmp);
}
}
if (ls_cur->rx_drop_misc) {
waddstr(w_stats, ", drop: ");
sprintf(tmp, "%llu (%.2f%%)", (unsigned long long)ls_cur->rx_drop_misc,
(1e2 * ls_cur->rx_drop_misc)/ls_cur->rx_packets);
waddstr_b(w_stats, tmp);
}
wclrtoborder(w_stats);
/*
* Interface TX stats
*/
mvwaddstr(w_stats, 2, 1, "TX: ");
if (ls_cur->tx_packets) {
sprintf(tmp, "%s (%s)", int_counts(ls_cur->tx_packets),
byte_units(ls_cur->tx_bytes));
waddstr_b(w_stats, tmp);
} else {
waddstr(w_stats, "n/a");
}
if (iw_nl80211_have_survey_data(ls_cur) && ls_cur->tx_bitrate[0]) {
waddstr(w_stats, ", rate: ");
waddstr_b(w_stats, ls_cur->tx_bitrate);
}
if (ls_cur->tx_retries) {
waddstr(w_stats, ", retries: ");
sprintf(tmp, "%s (%.2f%%)", int_counts(ls_cur->tx_retries),
(1e2 * ls_cur->tx_retries)/ls_cur->tx_packets);
waddstr_b(w_stats, tmp);
}
if (ls_cur->tx_failed) {
waddstr(w_stats, ", failed: ");
waddstr_b(w_stats, int_counts(ls_cur->tx_failed));
}
wclrtoborder(w_stats);
wrefresh(w_stats);
}
/** Wireless interface information */
static void display_interface(WINDOW *w_if, struct iw_nl80211_ifstat *ifs, bool if_is_up)
{
struct iw_nl80211_reg ir;
char tmp[0x100];
iw_nl80211_getreg(&ir);
wmove(w_if, 1, 1);
waddstr_b(w_if, conf_ifname());
waddstr(w_if, " - ");
if (if_is_up) {
/* Wireless device index */
waddstr(w_if, "wdev ");
sprintf(tmp, "%d", ifs->wdev);
waddstr_b(w_if, tmp);
/* PHY */
waddstr(w_if, ", phy ");
sprintf(tmp, "%d", ifs->phy_id);
waddstr_b(w_if, tmp);
/* Regulatory domain */
waddstr(w_if, ", reg: ");
if (ir.region > 0) {
waddstr_b(w_if, ir.country);
sprintf(tmp, " (%s)", dfs_domain_name(ir.region));
waddstr(w_if, tmp);
} else {
waddstr_b(w_if, "n/a");
}
if (ifs->ssid[0]) {
waddstr(w_if, ", SSID: ");
waddstr_b(w_if, ifs->ssid);
}
} else {
rfkill_state_t rfkill_state = get_rfkill_state(ifs->wdev);
if (is_rfkill_blocked_state(rfkill_state)) {
sprintf(tmp, "Interface is blocked by %s", rfkill_state_name(rfkill_state));
} else {
sprintf(tmp, "Interface is DOWN");
}
wadd_attr_str(w_if, COLOR_PAIR(CP_RED) | A_REVERSE, tmp);
}
wclrtoborder(w_if);
wrefresh(w_if);
}
/** General information section */
static void display_info(WINDOW *w_info, struct iw_nl80211_ifstat *ifs)
{
char tmp[0x100];
iw_nl80211_get_power_save(ifs);
iw_nl80211_get_phy(ifs);
wmove(w_info, 1, 1);
waddstr(w_info, "mode: ");
waddstr_b(w_info, iftype_name(ifs->iftype));
if (!ether_addr_is_zero(&ls_cur->bssid)) {
waddstr_b(w_info, ", ");
switch (ls_cur->status) {
case NL80211_BSS_STATUS_ASSOCIATED:
waddstr(w_info, "connected to: ");
break;
case NL80211_BSS_STATUS_AUTHENTICATED:
waddstr(w_info, "authenticated with: ");
break;
case NL80211_BSS_STATUS_IBSS_JOINED:
waddstr(w_info, "joined IBSS: ");
break;
default:
waddstr(w_info, "station: ");
}
waddstr_b(w_info, ether_lookup(&ls_cur->bssid));
if (ls_cur->status == NL80211_BSS_STATUS_ASSOCIATED) {
waddstr_b(w_info, ",");
waddstr(w_info, " time: ");
waddstr_b(w_info, pretty_time(ls_cur->connected_time));
waddstr(w_info, ", inactive: ");
if (ls_cur->inactive_time > 100)
sprintf(tmp, "%.1fs", (float)ls_cur->inactive_time/1e3);
else
sprintf(tmp, "%dms", ls_cur->inactive_time);
waddstr_b(w_info, tmp);
}
}
wclrtoborder(w_info);
/* Frequency / channel */
wmove(w_info, 2, 1);
if (ifs->freq) {
waddstr(w_info, "freq: ");
sprintf(tmp, "%d MHz", ifs->freq);
waddstr_b(w_info, tmp);
/* The following condition should in theory never happen: */
if (ls_cur->survey.freq && ls_cur->survey.freq != ifs->freq) {
sprintf(tmp, " [survey freq: %d MHz]", ls_cur->survey.freq);
waddstr(w_info, tmp);
}
if (ifs->freq_ctr1 && ifs->freq_ctr1 != ifs->freq) {
waddstr(w_info, ", ctr1: ");
sprintf(tmp, "%d MHz", ifs->freq_ctr1);
waddstr_b(w_info, tmp);
}
if (ifs->freq_ctr2 &&
ifs->freq_ctr2 != ifs->freq_ctr1 &&
ifs->freq_ctr2 != ifs->freq) {
waddstr(w_info, ", ctr2: ");
sprintf(tmp, "%d MHz", ifs->freq_ctr2);
waddstr_b(w_info, tmp);
}
waddstr(w_info, ", channel: ");
sprintf(tmp, "%d", ieee80211_frequency_to_channel(ifs->freq));
waddstr_b(w_info, tmp);
if (ifs->chan_width != (uint32_t)-1) {
sprintf(tmp, " (width: %s)", channel_width_name(ifs->chan_width));
waddstr(w_info, tmp);
} else if (ifs->chan_type != (uint32_t)-1) {
sprintf(tmp, " (%s)", channel_type_name(ifs->chan_type));
waddstr(w_info, tmp);
}
} else if (iw_nl80211_have_survey_data(ls_cur)) {
waddstr(w_info, "freq: ");
sprintf(tmp, "%d MHz", ls_cur->survey.freq);
waddstr_b(w_info, tmp);
} else {
waddstr(w_info, "frequency/channel: n/a");
}
waddstr(w_info, ", bands: ");
sprintf(tmp, "%u", ifs->phy.bands);
waddstr_b(w_info, tmp);
wclrtoborder(w_info);
/* Beacons */
wmove(w_info, 3, 1);
if (ls_cur->beacons) {
waddstr(w_info, "beacons: ");
sprintf(tmp, "%llu", (unsigned long long)ls_cur->beacons);
waddstr_b(w_info, tmp);
if (ls_cur->beacon_loss) {
waddstr(w_info, ", lost: ");
waddstr_b(w_info, int_counts(ls_cur->beacon_loss));
}
waddstr(w_info, ", avg sig: ");
sprintf(tmp, "%d dBm", (int8_t)ls_cur->beacon_avg_sig);
waddstr_b(w_info, tmp);
waddstr(w_info, ", interval: ");
sprintf(tmp, "%.1fs", (ls_cur->beacon_int * 1024.0)/1e6);
waddstr_b(w_info, tmp);
waddstr(w_info, ", DTIM: ");
sprintf(tmp, "%u", ls_cur->dtim_period);
waddstr_b(w_info, tmp);
} else {
waddstr(w_info, "station flags:");
if (ls_cur->cts_protection)
waddstr_b(w_info, " CTS");
if (ls_cur->wme)
waddstr_b(w_info, " WME");
if (ls_cur->tdls)
waddstr_b(w_info, " TDLS");
if (ls_cur->mfp)
waddstr_b(w_info, " MFP");
if (!(ls_cur->cts_protection | ls_cur->wme | ls_cur->tdls | ls_cur->mfp))
waddstr_b(w_info, " (none)");
waddstr(w_info, ", preamble:");
if (ls_cur->long_preamble)
waddstr_b(w_info, " long");
else
waddstr_b(w_info, " short");
waddstr(w_info, ", slot:");
if (ls_cur->short_slot_time)
waddstr_b(w_info, " short");
else
waddstr_b(w_info, " long");
}
wclrtoborder(w_info);
/* Channel data */
wmove(w_info, 4, 1);
if (iw_nl80211_have_survey_data(ls_cur)) {
waddstr(w_info, "channel ");
waddstr(w_info, "active: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.active));
waddstr(w_info, ", busy: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.busy));
if (ls_cur->survey.time.ext_busy) {
waddstr(w_info, ", ext-busy: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.ext_busy));
}
wmove(w_info, 5, 1);
waddstr(w_info, "channel rx: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.rx));
waddstr(w_info, ", tx: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.tx));
if (ls_cur->survey.time.scan) {
waddstr(w_info, ", scan: ");
waddstr_b(w_info, pretty_time_ms(ls_cur->survey.time.scan));
}
} else {
wclrtoborder(w_info);
waddstr(w_info, "rx rate: ");
waddstr_b(w_info, ls_cur->rx_bitrate[0] ? ls_cur->rx_bitrate : "n/a");
if (ls_cur->expected_thru) {
if (ls_cur->expected_thru >= 1024)
sprintf(tmp, " (exp: %.1f MB/s)", ls_cur->expected_thru/1024.0);
else
sprintf(tmp, " (exp: %u kB/s)", ls_cur->expected_thru);
waddstr(w_info, tmp);
}
wmove(w_info, 5, 1);
waddstr(w_info, "tx rate: ");
waddstr_b(w_info, ls_cur->tx_bitrate[0] ? ls_cur->tx_bitrate : "n/a");
}
wclrtoborder(w_info);
/* TX Power */
wmove(w_info, 6, 1);
waddstr(w_info, "tx power: ");
sprintf(tmp, "%g dBm (%.2f mW)", ifs->tx_power, dbm2mw(ifs->tx_power));
waddstr_b(w_info, tmp);
/* Power-saving mode */
waddstr(w_info, ", power save: ");
sprintf(tmp, "%s", ifs->power_save ? "on" : "off");
waddstr_b(w_info, tmp);
wclrtoborder(w_info);
/* Retry handling */
wmove(w_info, 7, 1);
waddstr(w_info, "retry short/long: ");
sprintf(tmp, "%u", ifs->phy.retry_short);
waddstr_b(w_info, tmp);
waddstr(w_info, "/");
sprintf(tmp, "%u", ifs->phy.retry_long);
waddstr_b(w_info, tmp);
/* RTS/CTS handshake threshold */
waddstr(w_info, ", rts/cts: ");
if (ifs->phy.rts_threshold != (uint32_t)-1) {
sprintf(tmp, "%u", ifs->phy.rts_threshold);
} else {
sprintf(tmp, "off");
}
waddstr_b(w_info, tmp);
/* Fragmentation threshold */
waddstr(w_info, ", frag: ");
if (ifs->phy.frag_threshold != (uint32_t)-1) {
sprintf(tmp, "%u", ifs->phy.frag_threshold);
} else {
sprintf(tmp, "off");
}
waddstr_b(w_info, tmp);
wclrtoborder(w_info);
wrefresh(w_info);
}
/** Network information pertaining to interface with interface index @ifindex. */
static void display_netinfo(WINDOW *w_net, struct if_info *info)
{
struct if_info *active = info->master ? info->master : info;
char tmp[0x40];
wmove(w_net, 1, 1);
wclrtoborder(w_net);
if (!ifinfo_is_up(info)) {
waddstr(w_net, info->ifname);
sprintf(tmp, " #%u ", info->ifindex);
waddstr(w_net, tmp);
waddstr_b(w_net, "(");
wadd_attr_str(w_net, COLOR_PAIR(CP_RED) | A_REVERSE,
!(info->flags & IFF_UP) ? "DOWN" : "no carrier");
} else if (info->master) {
waddstr_b(w_net, info->ifname);
sprintf(tmp, " #%u, %sslave of ", info->ifindex,
is_primary_slave(info->master->ifname, info->ifname)
? "primary " : "");
waddstr(w_net, tmp);
waddstr_b(w_net, info->master->ifname);
sprintf(tmp, " #%u ", info->master->ifindex);
waddstr(w_net, tmp);
waddstr_b(w_net, "(");
if (!(active->flags & IFF_UP)) {
waddstr(w_net, "DOWN");
} else {
const char *mode = NULL;
if (strcmp(info->master->type, "bond") == 0)
mode = get_bonding_mode(info->master->ifname);
if (mode) {
sprintf(tmp, "%s mode", mode);
waddstr(w_net, tmp);
} else if (*info->master->type) {
sprintf(tmp, "type %s", info->master->type);
waddstr(w_net, tmp);
} else {
waddstr(w_net, "UP");
if (active->flags & IFF_RUNNING)
waddstr(w_net, " RUNNING");
if (active->flags & IFF_MASTER)
waddstr(w_net, " MASTER");
}
}
} else {
waddstr(w_net, info->ifname);
sprintf(tmp, " #%u ", info->ifindex);
waddstr(w_net, tmp);
waddstr_b(w_net, "(");
waddstr(w_net, "UP");
if (info->flags & IFF_RUNNING) /* Interface RFC2863 OPER_UP */
waddstr(w_net, " RUNNING");
#ifdef IFF_LOWER_UP /* Linux 2.6.17 */
if (info->flags & IFF_LOWER_UP) /* Driver signals L1 up */
waddstr(w_net, " LOWER_UP");
#endif
#ifdef IFF_DORMANT /* Linux 2.6.17 */
if (info->flags & IFF_DORMANT) /* Driver signals dormant */
waddstr(w_net, " DORMANT");
#endif
if (info->flags & IFF_MASTER) /* Master of a load balancer */
waddstr(w_net, " MASTER");
if (info->flags & IFF_SLAVE) /* Slave of a load balancer */
waddstr(w_net, " SLAVE");
if (info->flags & IFF_POINTOPOINT) /* Is a point-to-point link */
waddstr(w_net, " POINTOPOINT");
if (info->flags & IFF_DYNAMIC) /* Address is volatile */
waddstr(w_net, " DYNAMIC");
if (info->flags & IFF_BROADCAST) /* Valid broadcast address set */
waddstr(w_net, " BROADCAST");
if (info->flags & IFF_MULTICAST) /* Supports multicast */
waddstr(w_net, " MULTICAST");
if (info->flags & IFF_ALLMULTI) /* Receive all mcast packets */
waddstr(w_net, " ALLMULTI");
if (info->flags & IFF_NOARP) /* No ARP protocol */
waddstr(w_net, " NOARP");
if (info->flags & IFF_NOTRAILERS) /* Avoid use of trailers */
waddstr(w_net, " NOTRAILERS");
if (info->flags & IFF_PROMISC) /* Is in promiscuous mode */
waddstr(w_net, " PROMISC");
if (info->flags & IFF_DEBUG) /* Internal debugging flag */
waddstr(w_net, " DEBUG");
}
waddstr_b(w_net, ")");
wmove(w_net, 2, 1);
wclrtoborder(w_net);
waddstr(w_net, "mode: ");
if (ifinfo_is_up(info)) {
waddstr_b(w_net, info->mode);
// Queueing discipline
if (*info->qdisc) {
waddstr(w_net, ", qdisc: ");
waddstr_b(w_net, info->qdisc);
if (info->master && *info->master->qdisc &&
strcmp(info->master->qdisc, info->qdisc)) {
waddstr(w_net, "/");
waddstr_b(w_net, info->master->qdisc);
}
}
// Number of TX queues
if (info->numtxq > 1 || (info->master && info->master->numtxq > 1)) {
waddstr(w_net, ", txq: ");
sprintf(tmp, "%u", info->numtxq);
waddstr_b(w_net, tmp);
if (info->master && info->master->numtxq != info->numtxq) {
waddstr(w_net, "/");
sprintf(tmp, "%u", info->master->numtxq);
waddstr_b(w_net, tmp);
}
}
// Queue lengths
waddstr(w_net, ", qlen: ");
sprintf(tmp, "%u", info->txqlen);
waddstr_b(w_net, tmp);
if (info->master && info->master->txqlen != info->txqlen) {
waddstr(w_net, "/");
sprintf(tmp, "%u", info->master->txqlen);
waddstr_b(w_net, tmp);
}
}
wmove(w_net, 3, 1);
wclrtoborder(w_net);
/* Layer 2 information (display hardware address of active interface). */
waddstr(w_net, "mac: ");
if (ether_addr_is_zero(&active->hwaddr)) {
waddstr_b(w_net, "n/a");
} else if (!ifinfo_is_up(info)) {
wadd_attr_str(w_net, COLOR_PAIR(CP_RED) | A_REVERSE,
ether_lookup(&active->hwaddr));
} else {
waddstr_b(w_net, ether_lookup(&active->hwaddr));
}
if (ifinfo_is_up(info)) {
/* 802.11 MTU may be greater than Ethernet MTU (1500) */
if (info->mtu && info->mtu != ETH_DATA_LEN) {
waddstr(w_net, ", mtu: ");
sprintf(tmp, "%u", info->mtu);
waddstr_b(w_net, tmp);
if (info->master && info->master->mtu != info->mtu) {
waddstr(w_net, "/");
sprintf(tmp, "%u", info->master->mtu);
waddstr_b(w_net, tmp);
}
}
}
wclrtoborder(w_net);
wmove(w_net, 4, 1);
/* Layer 3 information of active interface */
waddstr(w_net, "ip4: ");
if (!*active->v4.addr) {
waddstr_b(w_net, "n/a");
} else {
waddstr_b(w_net, active->v4.addr);
if (active->v4.count > 1) {
sprintf(tmp, " (+%d)", active->v4.count-1);
waddstr(w_net, tmp);
}
if (active->v4.valid_lft && active->v4.valid_lft >= active->v4.preferred_lft) {
waddstr(w_net, ", valid: ");
waddstr_b(w_net, lft2str(active->v4.valid_lft));
} else if (active->v4.preferred_lft) {
waddstr(w_net, ", preferred: ");
waddstr_b(w_net, lft2str(active->v4.preferred_lft));
}
}
wclrtoborder(w_net);
wmove(w_net, 5, 1);
waddstr(w_net, "ip6: ");
if (!*active->v6.addr) {
waddstr_b(w_net, "n/a");
} else {
waddstr_b(w_net, active->v6.addr);
if (active->v6.count > 1) {
sprintf(tmp, " (+%d)", active->v6.count-1);
waddstr(w_net, tmp);
}
if (active->v6.valid_lft && active->v6.valid_lft >= active->v6.preferred_lft) {
waddstr(w_net, ", valid: ");
waddstr_b(w_net, lft2str(active->v6.valid_lft));
} else if (active->v6.preferred_lft) {
waddstr(w_net, ", preferred: ");
waddstr_b(w_net, lft2str(active->v6.preferred_lft));
}
}
free(info->master);
wclrtoborder(w_net);
wrefresh(w_net);
}
static void display_static_parts(WINDOW *w_if, WINDOW *w_info, WINDOW *w_net)
{
struct iw_nl80211_ifstat ifs;
struct if_info net_info;
iw_nl80211_getifstat(&ifs);
if_getinf(conf_ifname(), &net_info);
display_interface(w_if, &ifs, net_info.flags & IFF_UP);
if (ifinfo_is_up(&net_info)) {
display_info(w_info, &ifs);
} else {
for (int i = 1; i <= WH_INFO; i++)
mvwclrtoborder(w_info, i, 1);
}
wrefresh(w_info);
display_netinfo(w_net, &net_info);
}
void scr_info_init(void)
{
int line = 0;
bool ready = false;
static bool initialized = false;
w_if = newwin_title(line, WH_IFACE, "Interface", true);
line += WH_IFACE;
w_levels = newwin_title(line, WH_LEVEL, "Levels", true);
line += WH_LEVEL;
w_stats = newwin_title(line, WH_STATS, "Packet Counts", true);
line += WH_STATS;
w_info = newwin_title(line, WH_INFO, "Info", true);
line += WH_INFO;
w_net = newwin_title(line, WH_NET, "Network", false);
if (!initialized) {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&linkstat_mutex, &attr);
initialized = true;
}
sampling_init(false);
while (!ready) {
pthread_mutex_lock(&linkstat_mutex);
ready = ls_new && !ls_tmp;
pthread_mutex_unlock(&linkstat_mutex);
}
}
int scr_info_loop(WINDOW *w_menu)
{
time_t now = time(NULL);
if (pthread_mutex_trylock(&linkstat_mutex) == 0) {
if (ls_new && !ls_tmp) {
ls_tmp = ls_cur;
ls_cur = ls_new;
ls_new = NULL;
}
pthread_mutex_unlock(&linkstat_mutex);
}
display_levels();
display_packet_counts();
if (now - last_update >= conf.info_iv) {
last_update = now;
display_static_parts(w_if, w_info, w_net);
}
return wgetch(w_menu);
}
void scr_info_fini(void)
{
/* Unlock mutex in case it was taken when scr_info_loop got interrupted by a SIGWINCH. */
pthread_mutex_unlock(&linkstat_mutex);
sampling_stop();
last_update = 0;
delwin(w_net);
delwin(w_info);
delwin(w_stats);
delwin(w_levels);
delwin(w_if);
}
uoaerg-wavemon-fb158b0/iw_if.c 0000664 0000000 0000000 00000021055 15142173343 0016326 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "iw_if.h"
#include "iw_nl80211.h"
#include
#include
/*
* Obtain network device information
*/
static int if_get_flags(int skfd, const char *ifname)
{
struct ifreq ifr;
memset(&ifr, 0, sizeof(struct ifreq));
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
if (ioctl(skfd, SIOCGIFFLAGS, &ifr) < 0)
err_sys("can not get interface flags for %s", ifname);
return ifr.ifr_flags;
}
/* Return true if @ifname is known to be up. */
bool if_is_up(const char *ifname)
{
int ret, skfd = socket(AF_INET, SOCK_DGRAM, 0);
if (skfd < 0)
err_sys("%s: can not open socket", __func__);
ret = if_get_flags(skfd, ifname) & IFF_UP;
close(skfd);
return ret;
}
/** Change the up/down state of @ifname according to @up. */
static int if_set_up_or_down(const char *ifname, bool up)
{
struct ifreq ifr;
int ret, skfd = socket(AF_INET, SOCK_DGRAM, 0);
if (skfd < 0)
err_sys("%s: can not open socket", __func__);
memset(&ifr, 0, sizeof(ifr));
strncpy(ifr.ifr_name, ifname, sizeof(ifr.ifr_name) - 1);
ifr.ifr_flags = if_get_flags(skfd, ifname);
if (up) {
ifr.ifr_flags |= IFF_UP;
} else {
ifr.ifr_flags &= ~IFF_UP;
}
ret = ioctl(skfd, SIOCSIFFLAGS, &ifr);
close(skfd);
return ret;
}
/** Bring @ifname up. */
int if_set_up(const char *ifname)
{
return if_set_up_or_down(ifname, true);
}
/** Set @ifname down. */
int if_set_down(const char *ifname)
{
return if_set_up_or_down(ifname, false);
}
/** Exit handler to restore interface 'down' state on exit via atexit(3). */
void if_set_down_on_exit(void)
{
const char *ifname = conf_ifname();
if (ifname && if_set_down(ifname) < 0) {
err_msg("unable to restore %s interface state - set down manually", ifname);
}
}
/**
* Return bonding mode of @bonding_iface, or NULL if not appropriate.
* https://www.kernel.org/doc/Documentation/networking/bonding.txt for possible modes.
*/
const char *get_bonding_mode(const char *bonding_iface) {
static char mode[64];
char path[128];
snprintf(path, sizeof(path)-1, "/sys/class/net/%s/bonding/mode", bonding_iface);
if (read_file(path, mode, sizeof(mode)) > 0) {
char *p = mode;
// File contents look like: "active-backup 1". Return first word only.
for (int i = strlen(mode); --i > 0 && !isspace(*p);)
p++;
*p = '\0';
return mode;
}
return NULL;
}
/** Return true if @slave is the primary slave interface of @bonding_iface. */
bool is_primary_slave(const char *bonding_iface, const char *slave) {
char path[128], primary[64];
snprintf(path, sizeof(path)-1, "/sys/class/net/%s/bonding/primary", bonding_iface);
if (read_file(path, primary, sizeof(primary)) > 0)
return strncmp(slave, primary, strlen(slave)) == 0;
return false;
}
/* if_info_link_cb fills in link information into @data. */
static void if_info_link_cb(struct nl_object *obj, void *data) {
struct rtnl_link *link = (struct rtnl_link *)obj;
struct if_info *info = data;
if (link && rtnl_link_get_ifindex(link) == info->ifindex) {
struct nl_addr *hwaddr = rtnl_link_get_addr(link);
const char * const type = rtnl_link_get_type(link);
memcpy(&info->hwaddr, nl_addr_get_binary_addr(hwaddr), nl_addr_get_len(hwaddr));
if (type)
strncpy(info->type, type, sizeof(info->type)-1);
strncpy(info->ifname, rtnl_link_get_name(link), sizeof(info->ifname)-1);
strncpy(info->qdisc, rtnl_link_get_qdisc(link), sizeof(info->qdisc)-1);
rtnl_link_mode2str(rtnl_link_get_linkmode(link), info->mode, sizeof(info->mode)-1);
info->flags = rtnl_link_get_flags(link);
info->carrier = rtnl_link_get_carrier(link);
info->mtu = rtnl_link_get_mtu(link);
info->numtxq = rtnl_link_get_num_tx_queues(link);
info->txqlen = rtnl_link_get_txqlen(link);
if (info->flags & IFF_SLAVE) {
info->master = calloc(1, sizeof(*info->master));
if (!info->master)
err_sys("failed to allocate master interface entry");
info->master->ifindex = rtnl_link_get_master(link);
}
}
}
/* ifinfo_is_up if the interface specified by @if_info is up and has carrier. */
bool ifinfo_is_up(const struct if_info *const info) {
if (info->master && !(info->master->flags & IFF_UP))
return false;
return (info->flags & IFF_UP) && info->carrier;
}
/* if_info_addr_cb fills in interface address information into @data. */
static void if_info_addr_cb(struct nl_object *obj, void *data) {
struct rtnl_addr *addr = (struct rtnl_addr *)obj;
struct if_info *info = data;
if (!addr || rtnl_addr_get_ifindex(addr) != info->ifindex)
return;
// Only display addresses with global scope, omit site/link-local addresses.
if (rtnl_addr_get_scope(addr) == RT_SCOPE_UNIVERSE) {
struct addr_info *ai;
switch (rtnl_addr_get_family(addr)) {
case AF_INET:
ai = &info->v4;
break;
case AF_INET6:
ai = &info->v6;
break;
default:
return;
}
if (!ai->count || (ai == &info->v6 && rtnl_addr_get_prefixlen(addr) < 128)) {
const struct nl_addr *local = rtnl_addr_get_local(addr);
if (!local)
return;
if (!nl_addr2str(local, ai->addr, sizeof(ai->addr)))
return;
ai->preferred_lft = rtnl_addr_get_preferred_lifetime(addr);
ai->valid_lft = rtnl_addr_get_valid_lifetime(addr);
}
ai->count++;
}
}
void if_getinf(const char *ifname, struct if_info *info)
{
struct nl_cache *link_cache, *addr_cache;
struct nl_sock *sock = nl_cli_alloc_socket();
nl_cli_connect(sock, NETLINK_ROUTE);
link_cache = nl_cli_link_alloc_cache(sock);
addr_cache = nl_cli_addr_alloc_cache(sock);
memset(info, 0, sizeof(struct if_info));
info->ifindex = if_nametoindex(ifname);
nl_cache_foreach(link_cache, if_info_link_cb, info);
if (info->master)
nl_cache_foreach(link_cache, if_info_link_cb, info->master);
nl_cache_foreach(addr_cache, if_info_addr_cb, info->master ? info->master : info);
/* Clean up. */
nl_cache_mngt_unprovide(link_cache);
nl_cache_put(link_cache);
nl_cache_mngt_unprovide(addr_cache);
nl_cache_put(addr_cache);
nl_socket_free(sock);
}
static int iface_list_handler(struct nl_msg *msg, void *arg)
{
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
struct interface_info **head = arg, *new;
nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (tb_msg[NL80211_ATTR_IFNAME]) {
new = calloc(1, sizeof(*new));
if (!new)
err_sys("failed to allocate interface list entry");
new->ifname = strdup(nla_get_string(tb_msg[NL80211_ATTR_IFNAME]));
new->next = *head;
*head = new;
if (tb_msg[NL80211_ATTR_WIPHY])
new->phy_id = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]);
if (tb_msg[NL80211_ATTR_IFINDEX])
new->ifindex = nla_get_u32(tb_msg[NL80211_ATTR_IFINDEX]);
if (tb_msg[NL80211_ATTR_WDEV])
new->wdev = nla_get_u64(tb_msg[NL80211_ATTR_WDEV]);
if (tb_msg[NL80211_ATTR_MAC])
memcpy(&new->mac_addr, nla_data(tb_msg[NL80211_ATTR_MAC]), ETH_ALEN);
}
return NL_SKIP;
}
/** Return information about the default interface in @data. */
int iw_nl80211_get_interface_data(struct interface_info **data)
{
static struct cmd cmd_get_interface = {
.cmd = NL80211_CMD_GET_INTERFACE,
.handler = iface_list_handler,
};
cmd_get_interface.handler_arg = data;
return handle_interface_cmd(&cmd_get_interface);
}
/** Populate singly-linked list of wireless interfaces starting at @head. */
int iw_nl80211_get_interface_list(struct interface_info **head)
{
static struct cmd cmd_get_interfaces = {
.cmd = NL80211_CMD_GET_INTERFACE,
.flags = NLM_F_DUMP,
.handler = iface_list_handler,
};
cmd_get_interfaces.handler_arg = head;
return handle_cmd(&cmd_get_interfaces);
}
/** Count the number of wireless interfaces starting at @head. */
size_t count_interface_list(struct interface_info *head)
{
return head ? count_interface_list(head->next) + 1 : 0;
}
void free_interface_list(struct interface_info *head)
{
if (head) {
free_interface_list(head->next);
free(head->ifname);
free(head);
}
}
uoaerg-wavemon-fb158b0/iw_if.h 0000664 0000000 0000000 00000013545 15142173343 0016340 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
#include "nl80211.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* Definitions from linux/ieee80211.h (not necessarily part of distro headers) */
#define WLAN_CAPABILITY_ESS (1<<0)
#define WLAN_CAPABILITY_IBSS (1<<1)
#define WLAN_CAPABILITY_IS_STA_BSS(cap) \
(!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
#define WLAN_CAPABILITY_PRIVACY (1<<4)
/* 802.11h */
#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
#define WLAN_CAPABILITY_QOS (1<<9)
#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
#define WLAN_CAPABILITY_APSD (1<<11)
#define WLAN_CAPABILITY_RADIO_MEASURE (1<<12)
#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
#define WLAN_CAPABILITY_DEL_BACK (1<<14)
#define WLAN_CAPABILITY_IMM_BACK (1<<15)
/**
* struct interface_info - record wireless interface information
*
* @ifname: interface name (e.g. 'wlp3s0')
* @mac_addr: Mac address of @ifname
* @phy_id: PHY index
* @ifindex: general network interface index
* @wdev: wireless-device index
*/
struct interface_info {
char *ifname;
struct ether_addr mac_addr;
uint32_t phy_id,
ifindex,
wdev;
struct interface_info *next;
};
extern int iw_nl80211_get_interface_list(struct interface_info **head);
extern int iw_nl80211_get_interface_data(struct interface_info **data);
extern size_t count_interface_list(struct interface_info *head);
extern void free_interface_list(struct interface_info *head);
/**
* struct addr_info - interface address information
* @addr: IP address in CIDR format
* @count: How many addresses of this type are present
* @preferred_lft: Preferred lifetime of @addr
* @valid_lft: Valid lifetime of @addr
*/
struct addr_info {
char addr[64];
uint8_t count;
uint32_t preferred_lft,
valid_lft;
};
/**
* struct if_info - wireless interface network information
* @ifindex: Interface index
* @ifname: Interface name
* @hwaddr: MAC address
* @v4,v6: IPv4/6 address
* @flags: Interface flags
* @carrier: Whether the carrier is up
* @mtu: Interface MTU
* @type: Interface type (relevant for master interface)
* @mode: Link mode of the interface
* @qdisc: Queuing discipline
* @numtxq: Number of TX queues
* @txqlen: TX queue length
* @master: Link to master interface (if present)
*/
struct if_info {
int ifindex;
char ifname[64];
struct ether_addr hwaddr;
struct addr_info v4,
v6;
uint16_t flags;
bool carrier;
uint16_t mtu;
char type[16],
mode[16],
qdisc[16];
uint16_t numtxq,
txqlen;
struct if_info *master;
};
extern bool ifinfo_is_up(const struct if_info *const if_info);
extern bool if_is_up(const char *ifname);
extern int if_set_up(const char *ifname);
extern void if_set_down_on_exit(void);
extern void if_getinf(const char *ifname, struct if_info *info);
/** Interface bonding. */
extern const char *get_bonding_mode(const char *bonding_iface);
extern bool is_primary_slave(const char *bonding_iface, const char *slave);
/*
* Structs to communicate WiFi statistics
*/
struct iw_levelstat {
float signal; /* Signal level in dBm. */
bool valid; /* Whether a valid @signal was registered. */
};
/*
* Periodic sampling of wireless statistics
*/
extern void sampling_init(bool do_not_swap_pointers);
extern void sampling_stop(void);
/*
* rfkill.c
*/
typedef enum {
RFKILL_STATE_SOFT_BLOCKED = 0, // Transmitter is turned off by software.
RFKILL_STATE_UNBLOCKED = 1, // Transmitter is (potentially) active.
RFKILL_STATE_HARD_BLOCKED = 2, // Transmitter is blocked by hardware (e.g. switch).
RFKILL_STATE_FULL_BLOCKED = 3, // Transmitter is both soft and hard blocked.
RFKILL_STATE_UNDEFINED = 4, // Unable to determine rfkill state.
} rfkill_state_t;
extern rfkill_state_t get_rfkill_state(const uint32_t wdev_index);
extern bool is_rfkill_blocked_state(const rfkill_state_t state);
extern const char *rfkill_state_name(const rfkill_state_t state);
extern bool default_interface_is_rfkill_blocked(void);
/*
* utils.c
*/
extern ssize_t read_file(const char *path, char *buf, size_t buflen);
extern int read_number_file(const char *path, uint32_t *num);
extern char *ether_addr(const struct ether_addr *ea);
extern char *ether_lookup(const struct ether_addr *ea);
extern char *mac_addr(const struct sockaddr *sa);
extern char *a_sprintf(const char *fmt, ...);
extern uint8_t bit_count(uint32_t mask);
extern uint8_t prefix_len(const struct sockaddr *netmask);
extern const char *lft2str(const uint32_t lifetime);
extern const char *pretty_time(const unsigned sec);
extern const char *pretty_time_ms(const unsigned msec);
extern double dbm2mw(const double in);
extern char *dbm2units(const double in);
extern const char *dfs_domain_name(enum nl80211_dfs_regions region);
extern int ieee80211_frequency_to_channel(int freq);
extern const char *channel_width_name(enum nl80211_chan_width width);
extern const char *channel_type_name(enum nl80211_channel_type channel_type);
extern const char *iftype_name(enum nl80211_iftype iftype);
uoaerg-wavemon-fb158b0/iw_nl80211.c 0000664 0000000 0000000 00000065766 15142173343 0016756 0 ustar 00root root 0000000 0000000 /*
* nl80211 calls and utilies. These were mostly taken from the iw code.
*/
#include "wavemon.h"
#include
#include
#include
#include
#include "iw_nl80211.h"
/** Append msg_attribute{type, len, data} to @cmd. */
static void add_msg_arg(struct cmd *cmd, int type, size_t len, const void * const data)
{
cmd->msg_args = realloc(cmd->msg_args, sizeof(*cmd->msg_args) * (cmd->msg_args_len + 1));
if (!cmd->msg_args)
err_sys("failed to allocate space for message attributes");
cmd->msg_args[cmd->msg_args_len].type = type;
cmd->msg_args[cmd->msg_args_len].len = len;
cmd->msg_args[cmd->msg_args_len].data = data;
cmd->msg_args_len += 1;
}
static void free_msg_args(struct cmd *cmd)
{
free(cmd->msg_args);
cmd->msg_args = NULL;
cmd->msg_args_len = 0;
}
/**
* handle_cmd: process @cmd (generic variant)
* Returns 0 if ok, -errno < 0 on failure
*/
int handle_cmd(struct cmd *cmd)
{
struct nl_cb *cb;
struct nl_msg *msg;
static int nl80211_id = -1;
int ret;
/*
* Initialization of static components:
* - per-cmd socket
* - global nl80211 ID
*/
if (!cmd->sk) {
cmd->sk = nl_socket_alloc();
if (!cmd->sk)
err_sys("failed to allocate netlink socket");
/* NB: not setting sk buffer size, using default 32Kb */
if (genl_connect(cmd->sk))
err_sys("failed to connect to GeNetlink");
}
if (nl80211_id < 0) {
nl80211_id = genl_ctrl_resolve(cmd->sk, "nl80211");
if (nl80211_id < 0)
err_sys("nl80211 not found");
}
/*
* Message Preparation
*/
msg = nlmsg_alloc();
if (!msg)
err_sys("failed to allocate netlink message");
cb = nl_cb_alloc(IW_NL_CB_DEBUG ? NL_CB_DEBUG : NL_CB_DEFAULT);
if (!cb)
err_sys("failed to allocate netlink callback");
genlmsg_put(msg, 0, 0, nl80211_id, 0, cmd->flags, cmd->cmd, 0);
/* Message attributes */
if (cmd->msg_args) {
for (size_t idx = 0; idx < cmd->msg_args_len; idx++)
NLA_PUT(msg, cmd->msg_args[idx].type,
cmd->msg_args[idx].len,
cmd->msg_args[idx].data);
free_msg_args(cmd);
}
ret = nl_send_auto(cmd->sk, msg);
if (ret < 0)
err_sys("failed to send netlink message");
/*-------------------------------------------------------------------------
* Receive loop
*-------------------------------------------------------------------------*/
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &ret);
nl_cb_set(cb, NL_CB_FINISH, NL_CB_CUSTOM, finish_handler, &ret);
nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &ret);
if (cmd->handler)
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, cmd->handler, cmd->handler_arg);
/* Do not block, otherwise UI might get stalled waiting for updates */
nl_socket_set_nonblocking(cmd->sk);
while (ret > 0)
if (nl_recvmsgs(cmd->sk, cb) == -NLE_AGAIN) {
ret = -NLE_AGAIN;
break;
}
nl_cb_put(cb);
nlmsg_free(msg);
goto out;
nla_put_failure:
err_quit("failed to add attribute to netlink message");
out:
return ret;
}
/**
* handle_interface_cmd: handle @cmd for the configured default interface.
*/
int handle_interface_cmd(struct cmd *cmd)
{
uint32_t ifindex = if_nametoindex(conf_ifname());
if (ifindex == 0 && errno)
err_sys("failed to look up interface index of '%s'", conf_ifname());
/* netdev identifier: interface index */
add_msg_arg(cmd, NL80211_ATTR_IFINDEX, sizeof(ifindex), &ifindex);
return handle_cmd(cmd);
}
/*
* STATION COMMANDS
*/
/* stolen from iw:station.c */
void parse_bitrate(struct nlattr *bitrate_attr, char *buf, int buflen)
{
int rate = 0;
char *pos = buf;
struct nlattr *rinfo[NL80211_RATE_INFO_MAX + 1];
static struct nla_policy rate_policy[NL80211_RATE_INFO_MAX + 1] = {
[NL80211_RATE_INFO_BITRATE] = { .type = NLA_U16 },
[NL80211_RATE_INFO_BITRATE32] = { .type = NLA_U32 },
[NL80211_RATE_INFO_MCS] = { .type = NLA_U8 },
[NL80211_RATE_INFO_40_MHZ_WIDTH] = { .type = NLA_FLAG },
[NL80211_RATE_INFO_SHORT_GI] = { .type = NLA_FLAG },
};
if (nla_parse_nested(rinfo, NL80211_RATE_INFO_MAX,
bitrate_attr, rate_policy)) {
snprintf(buf, buflen, "failed to parse nested rate attributes!");
return;
}
if (rinfo[NL80211_RATE_INFO_BITRATE32])
rate = nla_get_u32(rinfo[NL80211_RATE_INFO_BITRATE32]);
else if (rinfo[NL80211_RATE_INFO_BITRATE])
rate = nla_get_u16(rinfo[NL80211_RATE_INFO_BITRATE]);
if (rate > 0)
pos += snprintf(pos, buflen - (pos - buf),
"%d.%d MBit/s", rate / 10, rate % 10);
else
pos += snprintf(pos, buflen - (pos - buf), "(unknown)");
if (rinfo[NL80211_RATE_INFO_MCS])
pos += snprintf(pos, buflen - (pos - buf),
" MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_MCS]));
if (rinfo[NL80211_RATE_INFO_VHT_MCS])
pos += snprintf(pos, buflen - (pos - buf),
" VHT-MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_VHT_MCS]));
if (rinfo[NL80211_RATE_INFO_40_MHZ_WIDTH])
pos += snprintf(pos, buflen - (pos - buf), " 40MHz");
if (rinfo[NL80211_RATE_INFO_80_MHZ_WIDTH])
pos += snprintf(pos, buflen - (pos - buf), " 80MHz");
if (rinfo[NL80211_RATE_INFO_80P80_MHZ_WIDTH])
pos += snprintf(pos, buflen - (pos - buf), " 80P80MHz");
if (rinfo[NL80211_RATE_INFO_160_MHZ_WIDTH])
pos += snprintf(pos, buflen - (pos - buf), " 160MHz");
if (rinfo[NL80211_RATE_INFO_SHORT_GI])
pos += snprintf(pos, buflen - (pos - buf), " short GI");
if (rinfo[NL80211_RATE_INFO_VHT_NSS])
pos += snprintf(pos, buflen - (pos - buf),
" VHT-NSS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_VHT_NSS]));
if (rinfo[NL80211_RATE_INFO_HE_MCS])
pos += snprintf(pos, buflen - (pos - buf),
" HE-MCS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_MCS]));
if (rinfo[NL80211_RATE_INFO_HE_NSS])
pos += snprintf(pos, buflen - (pos - buf),
" HE-NSS %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_NSS]));
if (rinfo[NL80211_RATE_INFO_HE_GI])
pos += snprintf(pos, buflen - (pos - buf),
" HE-GI %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_GI]));
if (rinfo[NL80211_RATE_INFO_HE_DCM])
pos += snprintf(pos, buflen - (pos - buf),
" HE-DCM %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_DCM]));
if (rinfo[NL80211_RATE_INFO_HE_RU_ALLOC])
pos += snprintf(pos, buflen - (pos - buf),
" HE-RU-ALLOC %d", nla_get_u8(rinfo[NL80211_RATE_INFO_HE_RU_ALLOC]));
}
/*
* INTERFACE COMMANDS
*/
void print_ssid_escaped(char *buf, const size_t buflen,
const uint8_t *data, const size_t datalen)
{
size_t i, l;
memset(buf, '\0', buflen);
/* Treat zeroed-out SSIDs separately */
for (i = 0; i < datalen && data[i] == '\0'; i++)
;
if (i == datalen)
return;
for (i = l= 0; i < datalen; i++) {
if (l + 4 >= buflen)
return;
else if (isprint(data[i]) && data[i] != ' ' && data[i] != '\\')
l += sprintf(buf + l, "%c", data[i]);
else if (data[i] == ' ' && i != 0 && i != datalen -1)
l += sprintf(buf + l, " ");
else
l += sprintf(buf + l, "\\x%.2x", data[i]);
}
}
/* stolen from iw:interface.c */
static int iface_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_ifstat *ifs = (struct iw_nl80211_ifstat *)arg;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
assert(ifs != NULL);
nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (tb_msg[NL80211_ATTR_WDEV])
ifs->wdev = nla_get_u64(tb_msg[NL80211_ATTR_WDEV]);
if (tb_msg[NL80211_ATTR_WIPHY])
ifs->phy_id = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]);
if (tb_msg[NL80211_ATTR_IFINDEX])
ifs->ifindex = nla_get_u32(tb_msg[NL80211_ATTR_IFINDEX]);
if (tb_msg[NL80211_ATTR_IFTYPE])
ifs->iftype = nla_get_u32(tb_msg[NL80211_ATTR_IFTYPE]);
if (tb_msg[NL80211_ATTR_SSID])
print_ssid_escaped(ifs->ssid, sizeof(ifs->ssid),
nla_data(tb_msg[NL80211_ATTR_SSID]),
nla_len(tb_msg[NL80211_ATTR_SSID]));
ifs->chan_width = -1;
ifs->chan_type = -1;
if (tb_msg[NL80211_ATTR_WIPHY_FREQ]) {
ifs->freq = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FREQ]);
if (tb_msg[NL80211_ATTR_CHANNEL_WIDTH]) {
ifs->chan_width = nla_get_u32(tb_msg[NL80211_ATTR_CHANNEL_WIDTH]);
if (tb_msg[NL80211_ATTR_CENTER_FREQ1])
ifs->freq_ctr1 = nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ1]);
if (tb_msg[NL80211_ATTR_CENTER_FREQ2])
ifs->freq_ctr2 = nla_get_u32(tb_msg[NL80211_ATTR_CENTER_FREQ2]);
}
if (tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE])
ifs->chan_type = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_CHANNEL_TYPE]);
}
if (tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL])
ifs->tx_power = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_TX_POWER_LEVEL]) / 100.0;
return NL_SKIP;
}
/* Power-saving-mode handler. Adapted from iw:ps.c. */
static int power_save_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_ifstat *ifs = (struct iw_nl80211_ifstat *)arg;
struct nlattr *attrs[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
nla_parse(attrs, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (attrs[NL80211_ATTR_PS_STATE]) {
uint32_t state = nla_get_u32(attrs[NL80211_ATTR_PS_STATE]);
ifs->power_save = state == NL80211_PS_ENABLED;
}
return NL_SKIP;
}
/* Query PHY information. */
static int phy_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_ifstat *ifs = (struct iw_nl80211_ifstat *)arg;
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (tb_msg[NL80211_ATTR_WIPHY] &&
nla_get_u32(tb_msg[NL80211_ATTR_WIPHY]) != ifs->phy_id)
return NL_SKIP;
if (tb_msg[NL80211_ATTR_WIPHY_RETRY_SHORT])
ifs->phy.retry_short = nla_get_u8(tb_msg[NL80211_ATTR_WIPHY_RETRY_SHORT]);
if (tb_msg[NL80211_ATTR_WIPHY_RETRY_LONG])
ifs->phy.retry_long = nla_get_u8(tb_msg[NL80211_ATTR_WIPHY_RETRY_LONG]);
if (tb_msg[NL80211_ATTR_WIPHY_BANDS]) {
struct nlattr *nl_band;
int rem_band;
nla_for_each_nested(nl_band, tb_msg[NL80211_ATTR_WIPHY_BANDS], rem_band) {
ifs->phy.bands++;
}
}
if (tb_msg[NL80211_ATTR_WIPHY_RTS_THRESHOLD])
ifs->phy.rts_threshold = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_RTS_THRESHOLD]);
if (tb_msg[NL80211_ATTR_WIPHY_FRAG_THRESHOLD])
ifs->phy.frag_threshold = nla_get_u32(tb_msg[NL80211_ATTR_WIPHY_FRAG_THRESHOLD]);
return NL_SKIP;
}
/**
* survey_handler - channel survey data
* This handler will be called multiple times, for each channel.
* stolen from iw:survey.c
*/
static int survey_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_survey *sd = (struct iw_nl80211_survey *)arg;
struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *sinfo[NL80211_SURVEY_INFO_MAX + 1];
static struct nla_policy survey_policy[NL80211_SURVEY_INFO_MAX + 1] = {
[NL80211_SURVEY_INFO_FREQUENCY] = { .type = NLA_U32 },
[NL80211_SURVEY_INFO_NOISE] = { .type = NLA_U8 },
[NL80211_SURVEY_INFO_IN_USE] = { .type = NLA_FLAG },
[NL80211_SURVEY_INFO_TIME] = { .type = NLA_U64 },
[NL80211_SURVEY_INFO_TIME_BUSY] = { .type = NLA_U64 },
[NL80211_SURVEY_INFO_TIME_EXT_BUSY] = { .type = NLA_U64 },
[NL80211_SURVEY_INFO_TIME_RX] = { .type = NLA_U64 },
[NL80211_SURVEY_INFO_TIME_TX] = { .type = NLA_U64 },
[NL80211_SURVEY_INFO_TIME_SCAN] = { .type = NLA_U64 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[NL80211_ATTR_SURVEY_INFO])
return NL_SKIP;
if (nla_parse_nested(sinfo, NL80211_SURVEY_INFO_MAX,
tb[NL80211_ATTR_SURVEY_INFO], survey_policy))
return NL_SKIP;
/* The frequency is needed to match up with the associated station */
if (!sinfo[NL80211_SURVEY_INFO_FREQUENCY])
return NL_SKIP;
/* We are only interested in the data of the operating channel */
if (!sinfo[NL80211_SURVEY_INFO_IN_USE])
return NL_SKIP;
sd->freq = nla_get_u32(sinfo[NL80211_SURVEY_INFO_FREQUENCY]);
if (sinfo[NL80211_SURVEY_INFO_NOISE])
sd->noise = (int8_t)nla_get_u8(sinfo[NL80211_SURVEY_INFO_NOISE]);
if (sinfo[NL80211_SURVEY_INFO_TIME])
sd->time.active = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME]);
if (sinfo[NL80211_SURVEY_INFO_TIME_BUSY])
sd->time.busy = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_BUSY]);
if (sinfo[NL80211_SURVEY_INFO_TIME_EXT_BUSY])
sd->time.ext_busy = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_EXT_BUSY]);
if (sinfo[NL80211_SURVEY_INFO_TIME_RX])
sd->time.rx = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_RX]);
if (sinfo[NL80211_SURVEY_INFO_TIME_TX])
sd->time.tx = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_TX]);
if (sinfo[NL80211_SURVEY_INFO_TIME_SCAN])
sd->time.scan = nla_get_u64(sinfo[NL80211_SURVEY_INFO_TIME_SCAN]);
return NL_SKIP;
}
/* Regulatory domain, stolen from iw:reg.c */
static int reg_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_reg *ir = (struct iw_nl80211_reg *)arg;
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
char *alpha2;
ir->region = -1;
nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb_msg[NL80211_ATTR_REG_ALPHA2])
return NL_SKIP;
if (!tb_msg[NL80211_ATTR_REG_RULES])
return NL_SKIP;
if (tb_msg[NL80211_ATTR_DFS_REGION])
ir->region = nla_get_u8(tb_msg[NL80211_ATTR_DFS_REGION]);
else
ir->region = NL80211_DFS_UNSET;
alpha2 = nla_data(tb_msg[NL80211_ATTR_REG_ALPHA2]);
ir->country[0] = alpha2[0];
ir->country[1] = alpha2[1];
return NL_SKIP;
}
/* Check if nl80211 allows splitting of wiphy information. Adapted from iw:info.c.*/
static int have_split_wiphy_handler(struct nl_msg *msg, void *arg)
{
struct nlattr *tb_msg[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
bool *has_split_wiphy = (bool *)arg;
nla_parse(tb_msg, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (tb_msg[NL80211_ATTR_PROTOCOL_FEATURES]) {
uint32_t feat = nla_get_u32(tb_msg[NL80211_ATTR_PROTOCOL_FEATURES]);
if (feat & NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP) {
*has_split_wiphy = true;
}
}
return NL_SKIP;
}
static int link_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_linkstat *ls = arg;
struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *bss[NL80211_BSS_MAX + 1];
static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
[NL80211_BSS_TSF] = { .type = NLA_U64 },
[NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
[NL80211_BSS_BSSID] = { 0 },
[NL80211_BSS_BEACON_INTERVAL] = { .type = NLA_U16 },
[NL80211_BSS_CAPABILITY] = { .type = NLA_U16 },
[NL80211_BSS_INFORMATION_ELEMENTS] = { 0 },
[NL80211_BSS_SIGNAL_MBM] = { .type = NLA_U32 },
[NL80211_BSS_SIGNAL_UNSPEC] = { .type = NLA_U8 },
[NL80211_BSS_STATUS] = { .type = NLA_U32 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[NL80211_ATTR_BSS])
return NL_SKIP;
if (nla_parse_nested(bss, NL80211_BSS_MAX, tb[NL80211_ATTR_BSS], bss_policy))
return NL_SKIP;
if (!bss[NL80211_BSS_BSSID])
return NL_SKIP;
if (!bss[NL80211_BSS_STATUS])
return NL_SKIP;
if (bss[NL80211_BSS_SIGNAL_UNSPEC])
ls->bss_signal_qual = nla_get_u8(bss[NL80211_BSS_SIGNAL_UNSPEC]);
if (bss[NL80211_BSS_SIGNAL_MBM]) {
int s = nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM]);
ls->bss_signal = s / 100;
}
ls->status = nla_get_u32(bss[NL80211_BSS_STATUS]);
switch (ls->status) {
case NL80211_BSS_STATUS_ASSOCIATED: /* apparently no longer used */
case NL80211_BSS_STATUS_AUTHENTICATED:
case NL80211_BSS_STATUS_IBSS_JOINED:
memcpy(&ls->bssid, nla_data(bss[NL80211_BSS_BSSID]), ETH_ALEN);
}
return NL_SKIP;
}
static int link_sta_handler(struct nl_msg *msg, void *arg)
{
struct iw_nl80211_linkstat *ls = arg;
struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
struct nlattr *binfo[NL80211_STA_BSS_PARAM_MAX + 1];
struct nl80211_sta_flag_update *sta_flags;
static struct nla_policy stats_policy[NL80211_STA_INFO_MAX + 1] = {
[NL80211_STA_INFO_CONNECTED_TIME] = { .type = NLA_U32 },
[NL80211_STA_INFO_INACTIVE_TIME] = { .type = NLA_U32 },
[NL80211_STA_INFO_RX_BYTES] = { .type = NLA_U32 },
[NL80211_STA_INFO_RX_BYTES64] = { .type = NLA_U64 },
[NL80211_STA_INFO_TX_BYTES] = { .type = NLA_U32 },
[NL80211_STA_INFO_TX_BYTES64] = { .type = NLA_U64 },
[NL80211_STA_INFO_RX_PACKETS] = { .type = NLA_U32 },
[NL80211_STA_INFO_TX_PACKETS] = { .type = NLA_U32 },
[NL80211_STA_INFO_SIGNAL] = { .type = NLA_U8 },
[NL80211_STA_INFO_SIGNAL_AVG] = { .type = NLA_U8 },
[NL80211_STA_INFO_T_OFFSET] = { .type = NLA_U64 },
[NL80211_STA_INFO_TX_BITRATE] = { .type = NLA_NESTED },
[NL80211_STA_INFO_RX_BITRATE] = { .type = NLA_NESTED },
[NL80211_STA_INFO_RX_DROP_MISC] = { .type = NLA_U64 },
[NL80211_STA_INFO_BEACON_RX] = { .type = NLA_U64 },
[NL80211_STA_INFO_BEACON_LOSS] = { .type = NLA_U32 },
[NL80211_STA_INFO_BEACON_SIGNAL_AVG] = { .type = NLA_U8 },
[NL80211_STA_INFO_LLID] = { .type = NLA_U16 },
[NL80211_STA_INFO_PLID] = { .type = NLA_U16 },
[NL80211_STA_INFO_PLINK_STATE] = { .type = NLA_U8 },
[NL80211_STA_INFO_TX_RETRIES] = { .type = NLA_U32 },
[NL80211_STA_INFO_TX_FAILED] = { .type = NLA_U32 },
[NL80211_STA_INFO_STA_FLAGS] =
{ .minlen = sizeof(struct nl80211_sta_flag_update) },
[NL80211_STA_INFO_LOCAL_PM] = { .type = NLA_U32},
[NL80211_STA_INFO_PEER_PM] = { .type = NLA_U32},
[NL80211_STA_INFO_NONPEER_PM] = { .type = NLA_U32},
[NL80211_STA_INFO_CHAIN_SIGNAL] = { .type = NLA_NESTED },
[NL80211_STA_INFO_CHAIN_SIGNAL_AVG] = { .type = NLA_NESTED },
};
static struct nla_policy bss_policy[NL80211_STA_BSS_PARAM_MAX + 1] = {
[NL80211_STA_BSS_PARAM_CTS_PROT] = { .type = NLA_FLAG },
[NL80211_STA_BSS_PARAM_SHORT_PREAMBLE] = { .type = NLA_FLAG },
[NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME] = { .type = NLA_FLAG },
[NL80211_STA_BSS_PARAM_DTIM_PERIOD] = { .type = NLA_U8 },
[NL80211_STA_BSS_PARAM_BEACON_INTERVAL] = { .type = NLA_U16 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[NL80211_ATTR_STA_INFO])
return NL_SKIP;
if (nla_parse_nested(sinfo, NL80211_STA_INFO_MAX,
tb[NL80211_ATTR_STA_INFO],
stats_policy))
return NL_SKIP;
if (sinfo[NL80211_STA_INFO_TX_RETRIES])
ls->tx_retries = nla_get_u32(sinfo[NL80211_STA_INFO_TX_RETRIES]);
if (sinfo[NL80211_STA_INFO_TX_FAILED])
ls->tx_failed = nla_get_u32(sinfo[NL80211_STA_INFO_TX_FAILED]);
if (sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]) {
ls->expected_thru = nla_get_u32(sinfo[NL80211_STA_INFO_EXPECTED_THROUGHPUT]);
/* convert in Mbps but scale by 1000 to save kbps units */
ls->expected_thru = ls->expected_thru * 1000 / 1024;
}
if (sinfo[NL80211_STA_INFO_INACTIVE_TIME])
ls->inactive_time = nla_get_u32(sinfo[NL80211_STA_INFO_INACTIVE_TIME]);
if (sinfo[NL80211_STA_INFO_CONNECTED_TIME])
ls->connected_time = nla_get_u32(sinfo[NL80211_STA_INFO_CONNECTED_TIME]);
if (sinfo[NL80211_STA_INFO_RX_BYTES64])
ls->rx_bytes = nla_get_u64(sinfo[NL80211_STA_INFO_RX_BYTES64]);
else if (sinfo[NL80211_STA_INFO_RX_BYTES])
ls->rx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_RX_BYTES]);
if (sinfo[NL80211_STA_INFO_RX_PACKETS])
ls->rx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_RX_PACKETS]);
if (sinfo[NL80211_STA_INFO_RX_DROP_MISC])
ls->rx_drop_misc = nla_get_u64(sinfo[NL80211_STA_INFO_RX_DROP_MISC]);
if (sinfo[NL80211_STA_INFO_TX_BYTES64])
ls->tx_bytes = nla_get_u64(sinfo[NL80211_STA_INFO_TX_BYTES64]);
else if (sinfo[NL80211_STA_INFO_TX_BYTES])
ls->tx_bytes = nla_get_u32(sinfo[NL80211_STA_INFO_TX_BYTES]);
if (sinfo[NL80211_STA_INFO_TX_PACKETS])
ls->tx_packets = nla_get_u32(sinfo[NL80211_STA_INFO_TX_PACKETS]);
if (sinfo[NL80211_STA_INFO_SIGNAL])
ls->signal = (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL]);
if (sinfo[NL80211_STA_INFO_SIGNAL_AVG])
ls->signal_avg = (int8_t)nla_get_u8(sinfo[NL80211_STA_INFO_SIGNAL_AVG]);
if (sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG])
ls->beacon_avg_sig = nla_get_u8(sinfo[NL80211_STA_INFO_BEACON_SIGNAL_AVG]);
if (sinfo[NL80211_STA_INFO_BEACON_RX])
ls->beacons = nla_get_u64(sinfo[NL80211_STA_INFO_BEACON_RX]);
if (sinfo[NL80211_STA_INFO_BEACON_LOSS])
ls->beacon_loss = nla_get_u32(sinfo[NL80211_STA_INFO_BEACON_LOSS]);
if (sinfo[NL80211_STA_INFO_TX_BITRATE])
parse_bitrate(sinfo[NL80211_STA_INFO_TX_BITRATE], ls->tx_bitrate, sizeof(ls->tx_bitrate));
if (sinfo[NL80211_STA_INFO_RX_BITRATE])
parse_bitrate(sinfo[NL80211_STA_INFO_RX_BITRATE], ls->rx_bitrate, sizeof(ls->rx_bitrate));
if (sinfo[NL80211_STA_INFO_STA_FLAGS]) {
sta_flags = (struct nl80211_sta_flag_update *)
nla_data(sinfo[NL80211_STA_INFO_STA_FLAGS]);
if (sta_flags->mask & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE) &&
sta_flags->set & BIT(NL80211_STA_FLAG_SHORT_PREAMBLE))
ls->long_preamble = true;
if (sta_flags->mask & BIT(NL80211_STA_FLAG_WME) &&
sta_flags->set & BIT(NL80211_STA_FLAG_WME))
ls->wme = true;
if (sta_flags->mask & BIT(NL80211_STA_FLAG_MFP) &&
sta_flags->set & BIT(NL80211_STA_FLAG_MFP))
ls->mfp = true;
if (sta_flags->mask & BIT(NL80211_STA_FLAG_TDLS_PEER) &&
sta_flags->set & BIT(NL80211_STA_FLAG_TDLS_PEER))
ls->tdls = true;
}
/* BSS Flags */
if (sinfo[NL80211_STA_INFO_BSS_PARAM]) {
if (nla_parse_nested(binfo, NL80211_STA_BSS_PARAM_MAX,
sinfo[NL80211_STA_INFO_BSS_PARAM],
bss_policy) == 0) {
if (binfo[NL80211_STA_BSS_PARAM_CTS_PROT]) {
ls->cts_protection = true;
}
if (binfo[NL80211_STA_BSS_PARAM_SHORT_PREAMBLE])
ls->long_preamble = false;
if (binfo[NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME])
ls->short_slot_time = true;
ls->beacon_int = nla_get_u16(binfo[NL80211_STA_BSS_PARAM_BEACON_INTERVAL]);
ls->dtim_period = nla_get_u8(binfo[NL80211_STA_BSS_PARAM_DTIM_PERIOD]);
}
}
return NL_SKIP;
}
/*
* COMMAND HANDLERS
*/
void iw_nl80211_get_linkstat(struct iw_nl80211_linkstat *ls)
{
static struct cmd cmd_linkstat = {
.cmd = NL80211_CMD_GET_SCAN,
.flags = NLM_F_DUMP,
.handler = link_handler
};
static struct cmd cmd_getstation = {
.cmd = NL80211_CMD_GET_STATION,
.flags = 0,
.handler = link_sta_handler
};
cmd_linkstat.handler_arg = ls;
memset(ls, 0, sizeof(*ls));
handle_interface_cmd(&cmd_linkstat);
/* If not associated to another station, the bssid is zeroed out */
if (ether_addr_is_zero(&ls->bssid))
return;
/*
* Details of the associated station
*/
cmd_getstation.handler_arg = ls;
add_msg_arg(&cmd_getstation, NL80211_ATTR_MAC, sizeof(ls->bssid), &ls->bssid);
handle_interface_cmd(&cmd_getstation);
/* Channel survey data */
iw_nl80211_get_survey(&ls->survey);
}
void iw_nl80211_getreg(struct iw_nl80211_reg *ir)
{
static struct cmd cmd_reg = {
.cmd = NL80211_CMD_GET_REG,
.flags = 0,
.handler = reg_handler
};
cmd_reg.handler_arg = ir;
memset(ir, 0, sizeof(*ir));
handle_interface_cmd(&cmd_reg);
}
/** Check kernel for split-wiphy support. Single-thread use only. */
static bool iw_nl80211_have_split_wiphy_dump()
{
static bool nl80211_has_split_wiphy, checked;
static struct cmd cmd_features = {
.cmd = NL80211_CMD_GET_PROTOCOL_FEATURES,
.flags = 0,
.handler = have_split_wiphy_handler,
.handler_arg = &nl80211_has_split_wiphy,
};
if (!checked)
handle_interface_cmd(&cmd_features);
checked = true;
return nl80211_has_split_wiphy;
}
void iw_nl80211_getifstat(struct iw_nl80211_ifstat *ifs)
{
static struct cmd cmd_ifstat = {
.cmd = NL80211_CMD_GET_INTERFACE,
.flags = 0,
.handler = iface_handler
};
cmd_ifstat.handler_arg = ifs;
memset(ifs, 0, sizeof(*ifs));
handle_interface_cmd(&cmd_ifstat);
}
void iw_nl80211_get_phy(struct iw_nl80211_ifstat *ifs)
{
static struct cmd cmd_phy_info = {
.cmd = NL80211_CMD_GET_WIPHY,
.flags = 0,
.hdr_flags = 0,
.handler = phy_handler,
};
if (iw_nl80211_have_split_wiphy_dump()) {
cmd_phy_info.hdr_flags |= NL80211_ATTR_SPLIT_WIPHY_DUMP;
cmd_phy_info.flags |= NLM_F_DUMP;
}
cmd_phy_info.handler_arg = ifs;
memset(&ifs->phy, 0, sizeof(ifs->phy));
handle_interface_cmd(&cmd_phy_info);
}
void iw_nl80211_get_power_save(struct iw_nl80211_ifstat *ifs) {
static struct cmd cmd_power_save_info = {
.cmd = NL80211_CMD_GET_POWER_SAVE,
.flags = 0,
.handler = power_save_handler,
};
cmd_power_save_info.handler_arg = ifs;
ifs->power_save = false;
handle_interface_cmd(&cmd_power_save_info);
}
void iw_nl80211_get_survey(struct iw_nl80211_survey *sd)
{
static struct cmd cmd_survey = {
.cmd = NL80211_CMD_GET_SURVEY,
.flags = NLM_F_DUMP,
.handler = survey_handler
};
cmd_survey.handler_arg = sd;
memset(sd, 0, sizeof(*sd));
handle_interface_cmd(&cmd_survey);
}
/*
* Multicast Handling
*/
/**
* struct handler_args - arguments to resolve multicast group
* @group: group name to resolve
* @id: ID it resolves into
*/
struct handler_args {
const char *group;
int id;
};
/* stolen from iw:genl.c */
static int family_handler(struct nl_msg *msg, void *arg)
{
struct handler_args *grp = arg;
struct nlattr *tb[CTRL_ATTR_MAX + 1];
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *mcgrp;
int rem_mcgrp;
nla_parse(tb, CTRL_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[CTRL_ATTR_MCAST_GROUPS])
return NL_SKIP;
nla_for_each_nested(mcgrp, tb[CTRL_ATTR_MCAST_GROUPS], rem_mcgrp) {
struct nlattr *tb_mcgrp[CTRL_ATTR_MCAST_GRP_MAX + 1];
nla_parse(tb_mcgrp, CTRL_ATTR_MCAST_GRP_MAX,
nla_data(mcgrp), nla_len(mcgrp), NULL);
if (!tb_mcgrp[CTRL_ATTR_MCAST_GRP_NAME] ||
!tb_mcgrp[CTRL_ATTR_MCAST_GRP_ID])
continue;
if (strncmp(nla_data(tb_mcgrp[CTRL_ATTR_MCAST_GRP_NAME]),
grp->group, nla_len(tb_mcgrp[CTRL_ATTR_MCAST_GRP_NAME])))
continue;
grp->id = nla_get_u32(tb_mcgrp[CTRL_ATTR_MCAST_GRP_ID]);
break;
}
return NL_SKIP;
}
/* stolen from iw:genl.c */
int nl_get_multicast_id(struct nl_sock *sock, const char *family, const char *group)
{
struct nl_msg *msg;
struct nl_cb *cb;
int ret, ctrlid;
struct handler_args grp = {
.group = group,
.id = -ENOENT,
};
msg = nlmsg_alloc();
if (!msg)
return -ENOMEM;
cb = nl_cb_alloc(NL_CB_DEFAULT);
if (!cb) {
ret = -ENOMEM;
goto out_fail_cb;
}
ctrlid = genl_ctrl_resolve(sock, "nlctrl");
genlmsg_put(msg, 0, 0, ctrlid, 0,
0, CTRL_CMD_GETFAMILY, 0);
ret = -ENOBUFS;
NLA_PUT_STRING(msg, CTRL_ATTR_FAMILY_NAME, family);
ret = nl_send_auto(sock, msg);
if (ret < 0)
goto out;
ret = 1;
nl_cb_err(cb, NL_CB_CUSTOM, error_handler, &ret);
nl_cb_set(cb, NL_CB_ACK, NL_CB_CUSTOM, ack_handler, &ret);
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, family_handler, &grp);
while (ret > 0)
nl_recvmsgs(sock, cb);
if (ret == 0)
ret = grp.id;
nla_put_failure:
out:
nl_cb_put(cb);
out_fail_cb:
nlmsg_free(msg);
return ret;
}
/**
* Allocate a GeNetlink socket ready to listen for nl80211 multicast group @grp
* @grp: identifier of an nl80211 multicast group (e.g. "scan")
*/
struct nl_sock *alloc_nl_mcast_sk(const char *grp)
{
int mcid, ret;
struct nl_sock *sk = nl_socket_alloc();
if (!sk)
err_sys("failed to allocate netlink multicast socket");
if (genl_connect(sk))
err_sys("failed to connect multicast socket to GeNetlink");
mcid = nl_get_multicast_id(sk, "nl80211", grp);
if (mcid < 0)
err_quit("failed to resolve nl80211 '%s' multicast group", grp);
ret = nl_socket_add_membership(sk, mcid);
if (ret)
err_sys("failed to join nl80211 multicast group %s", grp);
return sk;
}
uoaerg-wavemon-fb158b0/iw_nl80211.h 0000664 0000000 0000000 00000017722 15142173343 0016750 0 ustar 00root root 0000000 0000000 /*
* Definitions and functions for nl80211 based routines.
*/
#include
#include
#include
#include
#include
/*
* Use local copy of nl80211.h rather than the one shipped with the distro in
* /usr/include/linux. There are different versions, local one may be out of date.
*/
#include "nl80211.h"
#define BIT(x) (1ULL<<(x)) /* from iw:iw.h */
/* Set to 1 to enable callback debugging */
#define IW_NL_CB_DEBUG 0
/**
* struct msg_attribute - attributes to nla_put into the message
* @type: type of the attribute
* @len: attribute length
* @data: pointer to data area of length @len
*/
struct msg_attribute {
int type;
size_t len;
const void *data;
};
/**
* struct cmd - represent a single nl80211 command
* @cmd: nl80211 command to send via GeNetlink
* @sk: netlink socket to be used for this command
* @flags: flags to set in the GeNetlink message
* @hdr_flags: flags to set in the header of the message
* @handler: netlink callback handler
* @handler_arg: argument for @handler
* @msg_args: additional attributes to pass into message
* @msg_args_len: number of elements in @msg_args
*/
struct cmd {
enum nl80211_commands cmd;
struct nl_sock *sk;
int flags,
hdr_flags;
int (*handler)(struct nl_msg *msg, void *arg);
void *handler_arg;
struct msg_attribute *msg_args;
size_t msg_args_len;
};
extern int handle_cmd(struct cmd *cmd);
extern int handle_interface_cmd(struct cmd *cmd);
/**
* iw_nl80211_phy - PHY information
* @retry_short: short retry limit
* @retry_long: long retry limit
* @bands: number of bands
* @rts_threshold: RTS/CTS handshake frame length threshold (0..65536)
* @frag_threshold: fragmentation threshold (max frame length, 256..8000)
*/
struct iw_nl80211_phy {
uint8_t retry_short,
retry_long,
bands;
uint32_t rts_threshold,
frag_threshold;
};
/**
* iw_nl80211_ifstat - interface statistics
* @phy_id: PHY index
* @ifindex: ifindex of receiving interface
* @wdev: wireless device index
* @iftype: interface mode (access point ...)
*
* @freq: frequency in MHz
* @chan_width: channel width
* @chan_type: channel type
* @freq_ctr1: center frequency #1
* @freq_ctr2: center frequency #2
* @power_save: whether power-saving mode is enabled
* @tx_power: TX power in dBm
* @phy: PHY information
*/
struct iw_nl80211_ifstat {
uint32_t phy_id,
ifindex,
wdev,
iftype;
char ssid[64];
uint32_t freq,
chan_width,
chan_type,
freq_ctr1,
freq_ctr2;
double tx_power;
bool power_save;
struct iw_nl80211_phy phy;
};
extern void iw_nl80211_getifstat(struct iw_nl80211_ifstat *is);
extern void iw_nl80211_get_phy(struct iw_nl80211_ifstat *ifs);
extern void iw_nl80211_get_power_save(struct iw_nl80211_ifstat *ifs);
/**
* struct iw_nl80211_survey_data - channel survey data
* @freq: channel frequency (only filled in if it is in use)
* @noise: channel noise in dBm (0 means invalid data)
*
* @active: amount of time that the radio was on
* @busy: amount of the time the primary channel was sensed busy
* @ext_busy: amount of time the extension channel was sensed busy
* @rx: amount of time the radio spent receiving data
* @tx: amount of time the radio spent transmitting data
* @scan: time the radio spent for scan
*/
struct iw_nl80211_survey {
uint32_t freq;
int8_t noise;
struct time_data_in_milliseconds {
uint64_t active,
busy,
ext_busy,
rx,
tx,
scan;
} time;
};
extern void iw_nl80211_get_survey(struct iw_nl80211_survey *sd);
/* struct iw_nl80211_linkstat - aggregate link statistics
* @status: association status (%nl80211_bss_status)
* @bssid: station MAC address
* @inactive_time: inactivity in msec
* @connected_time: time since last connecting in sec
* @beacon_loss: count of time beacon loss was detected
* @rx_bytes/packets: byte/packet counter for RX direction
* @rx_drop_misc: packets dropped for unspecified reasons
* @tx_bytes/packets: byte/packet counter for TX direction
* @tx_retries: TX retry counter
* @tx_failed: TX failure counter
* @expected_thru: expected throughput in kB/s
* @beacon_int: beacon interval in Time Units of 1024usec
* @dtim_period: DTIM period for beaconing
* @beacon_avg_sig: average beacon signal (in dBm)
* @beacons: number of beacons received
* @beacon_loss: count of times beacon loss was detected
* @signal: signal strength in dBm (0 if not present)
* @signal_avg: average signal strength in dBm
* @bss_signal: signal strength of BSS probe in dBm (or 0)
* @bss_signal_qual: unitless signal strength of BSS probe, 0..100
* @tx_bitrate: string describing current TX bitrate
* @rx_bitrate: string describing current RX bitrate
* @cts_protection: whether CTS protection is set
* @long_preamble: whether using long or short preamble
* @short_slot_time: whether short slots are enabled
* @wme: Wireless Multimedia Extensions / Wi-Fi Multimedia
* @mfp: Management Frame Protection
* @tdls: Tunneled Direct Link Setup
* @survey: channel survey data (where present)
*/
struct iw_nl80211_linkstat {
uint32_t status;
struct ether_addr bssid;
/*
* Station details (not always filled in):
*/
uint32_t inactive_time,
connected_time;
uint64_t rx_bytes;
uint32_t rx_packets;
uint64_t rx_drop_misc;
uint16_t beacon_int;
uint8_t dtim_period,
beacon_avg_sig;
uint64_t beacons;
uint32_t beacon_loss;
uint64_t tx_bytes;
uint32_t tx_packets,
tx_retries,
tx_failed;
uint32_t expected_thru;
int8_t signal,
signal_avg;
int8_t bss_signal;
uint8_t bss_signal_qual;
char tx_bitrate[100],
rx_bitrate[100];
bool cts_protection:1,
long_preamble:1,
short_slot_time:1,
wme:1,
mfp:1,
tdls:1;
/*
* Channel survey data (requires suitable card, e.g. ath9k).
*/
struct iw_nl80211_survey survey;
};
extern void iw_nl80211_get_linkstat(struct iw_nl80211_linkstat *ls);
extern void iw_cache_update(struct iw_nl80211_linkstat *ls);
/* Indicate whether @ls contains usable channel survey data */
static inline bool iw_nl80211_have_survey_data(struct iw_nl80211_linkstat *ls)
{
return ls->survey.freq != 0 && ls->survey.noise != 0;
}
/**
* struct iw_nl80211_reg - regulatory domain information
* @region: regulatory DFS region (%nl80211_dfs_regions or -1)
* @country: two-character country code
*/
struct iw_nl80211_reg {
int region;
char country[3];
};
extern void iw_nl80211_getreg(struct iw_nl80211_reg *ir);
extern void print_ssid_escaped(char *buf, const size_t buflen,
const uint8_t *data, const size_t datalen);
/*
* Multicast event handling (taken from iw:event.c and iw:scan.c)
*/
/**
* struct wait_event - wait for arrival of a specified message
* @cmds: array of GeNetlink commands (>0) to match
* @n_cmds: length of @cmds
* @cmd: matched element of @cmds (if message arrived), else 0
*/
struct wait_event {
const uint32_t *cmds;
uint8_t n_cmds;
uint32_t cmd;
};
extern struct nl_sock *alloc_nl_mcast_sk(const char *grp);
/*
* utils.c
*/
extern bool ether_addr_is_zero(const struct ether_addr *ea);
/*
* (Ge)Netlink and nl80211 Internals
*/
// stolen from iw:station.c
enum plink_state {
LISTEN,
OPN_SNT,
OPN_RCVD,
CNF_RCVD,
ESTAB,
HOLDING,
BLOCKED
};
/* Predefined handlers, stolen from iw:iw.c */
static inline int error_handler(struct sockaddr_nl __attribute__((unused))*nla,
struct nlmsgerr *err, void *arg)
{
int *ret = arg;
*ret = err->error;
return NL_STOP;
}
static inline int finish_handler(struct nl_msg __attribute__((unused))*msg, void *arg)
{
int *ret = arg;
*ret = 0;
return NL_SKIP;
}
static inline int ack_handler(struct nl_msg __attribute__((unused))*msg, void *arg)
{
int *ret = arg;
*ret = 0;
return NL_STOP;
}
static inline int no_seq_check(struct nl_msg __attribute__((unused))*msg,
void __attribute__((unused))*arg)
{
return NL_OK;
}
uoaerg-wavemon-fb158b0/iw_scan.c 0000664 0000000 0000000 00000032017 15142173343 0016654 0 ustar 00root root 0000000 0000000 /*
* Auxiliary declarations and functions to process and parse scan events.
*/
#include "iw_scan.h"
#include
#include
#include
#include
#include "iw_nl80211.h"
/* GLOBAL VARIABLES */
static struct nl_sock *scan_wait_sk;
/*
* Ordering functions for scan results: all return true for a < b.
*/
/* Order by frequency. */
static bool cmp_freq(const struct scan_entry *a, const struct scan_entry *b)
{
return a->freq < b->freq;
}
/* Order by signal strength. */
static bool cmp_sig(const struct scan_entry *a, const struct scan_entry *b)
{
if (!a->bss_signal && !b->bss_signal)
return a->bss_signal_qual < b->bss_signal_qual;
return a->bss_signal < b->bss_signal;
}
/* Order by ESSID, organize entries with same ESSID by frequency and signal. */
static bool cmp_essid(const struct scan_entry *a, const struct scan_entry *b)
{
int res = strncmp(a->essid, b->essid, MAX_ESSID_LEN);
return res == 0 ? (a->freq == b->freq ? cmp_sig(a, b) : cmp_freq(a, b))
: res < 0;
}
/* Order by MAC address */
static bool cmp_mac(const struct scan_entry *a, const struct scan_entry *b)
{
return memcmp(&a->ap_addr, &b->ap_addr, sizeof(a->ap_addr)) < 0;
}
/* Order by frequency, grouping channels by ESSID. */
static bool cmp_chan(const struct scan_entry *a, const struct scan_entry *b)
{
return a->freq == b->freq ? cmp_essid(a, b) : cmp_freq(a, b);
}
/* Order by frequency first, then by signal strength. */
static bool cmp_chan_sig(const struct scan_entry *a, const struct scan_entry *b)
{
return a->freq == b->freq ? cmp_sig(a, b) : cmp_chan(a, b);
}
/* Order by openness (open access points frist). */
static bool cmp_open(const struct scan_entry *a, const struct scan_entry *b)
{
return a->has_key < b->has_key;
}
/* Sort (open) access points by signal strength. */
static bool cmp_open_sig(const struct scan_entry *a, const struct scan_entry *b)
{
return a->has_key == b->has_key ? cmp_sig(a, b) : cmp_open(a, b);
}
static bool (*scan_cmp[])(const struct scan_entry *, const struct scan_entry *) = {
[SO_CHAN] = cmp_chan,
[SO_SIGNAL] = cmp_sig,
[SO_MAC] = cmp_mac,
[SO_ESSID] = cmp_essid,
[SO_OPEN] = cmp_open,
[SO_CHAN_SIG] = cmp_chan_sig,
[SO_OPEN_SIG] = cmp_open_sig
};
/*
* Scan event handling
*/
/* Callback event handler */
static int wait_event(struct nl_msg *msg, void *arg)
{
struct wait_event *wait = arg;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
int i;
for (i = 0; i < wait->n_cmds; i++) {
if (gnlh->cmd == wait->cmds[i])
wait->cmd = gnlh->cmd;
}
return NL_SKIP;
}
/**
* Wait for scan result notification sent by the kernel
* Returns true if scan results are available, false if scan was aborted.
* Taken from iw:event.c:__do_listen_events
*/
static bool wait_for_scan_events(void)
{
static const uint32_t cmds[] = {
NL80211_CMD_NEW_SCAN_RESULTS,
NL80211_CMD_SCAN_ABORTED,
};
struct wait_event wait_ev = {
.cmds = cmds,
.n_cmds = ARRAY_SIZE(cmds),
.cmd = 0
};
struct nl_cb *cb;
if (!scan_wait_sk)
scan_wait_sk = alloc_nl_mcast_sk("scan");
cb = nl_cb_alloc(IW_NL_CB_DEBUG ? NL_CB_DEBUG : NL_CB_DEFAULT);
if (!cb)
err_sys("failed to allocate netlink callbacks");
/* no sequence checking for multicast messages */
nl_cb_set(cb, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, no_seq_check, NULL);
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, wait_event, &wait_ev);
while (!wait_ev.cmd)
nl_recvmsgs(scan_wait_sk, cb);
nl_cb_put(cb);
return wait_ev.cmd == NL80211_CMD_NEW_SCAN_RESULTS;
}
/**
* Scan result handler. Stolen from iw:scan.c
* This also updates the scan-result statistics.
*/
static int scan_dump_handler(struct nl_msg *msg, void *arg)
{
struct scan_result *sr = (struct scan_result *)arg;
struct scan_entry *new;
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
struct nlattr *tb[NL80211_ATTR_MAX + 1];
struct nlattr *bss[NL80211_BSS_MAX + 1];
static struct nla_policy bss_policy[NL80211_BSS_MAX + 1] = {
[NL80211_BSS_TSF] = { .type = NLA_U64 },
[NL80211_BSS_FREQUENCY] = { .type = NLA_U32 },
[NL80211_BSS_BSSID] = { 0 },
[NL80211_BSS_BEACON_INTERVAL] = { .type = NLA_U16 },
[NL80211_BSS_CAPABILITY] = { .type = NLA_U16 },
[NL80211_BSS_INFORMATION_ELEMENTS] = { 0 },
[NL80211_BSS_SIGNAL_MBM] = { .type = NLA_U32 },
[NL80211_BSS_SIGNAL_UNSPEC] = { .type = NLA_U8 },
[NL80211_BSS_STATUS] = { .type = NLA_U32 },
[NL80211_BSS_SEEN_MS_AGO] = { .type = NLA_U32 },
[NL80211_BSS_BEACON_IES] = { 0 },
};
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
genlmsg_attrlen(gnlh, 0), NULL);
if (!tb[NL80211_ATTR_BSS])
return NL_SKIP;
if (nla_parse_nested(bss, NL80211_BSS_MAX,
tb[NL80211_ATTR_BSS],
bss_policy))
return NL_SKIP;
if (!bss[NL80211_BSS_BSSID])
return NL_SKIP;
/* Band filtering */
if (bss[NL80211_BSS_FREQUENCY] && conf.scan_filter_band != SCAN_FILTER_BAND_BOTH) {
uint32_t freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
if (conf.scan_filter_band == SCAN_FILTER_BAND_2G && freq > 2500)
return NL_SKIP;
if (conf.scan_filter_band == SCAN_FILTER_BAND_5G && freq < 2500)
return NL_SKIP;
}
new = calloc(1, sizeof(*new));
if (!new)
err_sys("failed to allocate scan entry");
memcpy(&new->ap_addr, nla_data(bss[NL80211_BSS_BSSID]), sizeof(new->ap_addr));
if (bss[NL80211_BSS_FREQUENCY]) {
new->freq = nla_get_u32(bss[NL80211_BSS_FREQUENCY]);
new->chan = ieee80211_frequency_to_channel(new->freq);
}
if (bss[NL80211_BSS_SIGNAL_UNSPEC])
new->bss_signal_qual = nla_get_u8(bss[NL80211_BSS_SIGNAL_UNSPEC]);
if (bss[NL80211_BSS_SIGNAL_MBM]) {
int s = nla_get_u32(bss[NL80211_BSS_SIGNAL_MBM]);
new->bss_signal = s / 100;
}
if (bss[NL80211_BSS_CAPABILITY]) {
new->bss_capa = nla_get_u16(bss[NL80211_BSS_CAPABILITY]);
new->has_key = (new->bss_capa & WLAN_CAPABILITY_PRIVACY) != 0;
}
if (bss[NL80211_BSS_SEEN_MS_AGO])
new->last_seen = nla_get_u32(bss[NL80211_BSS_SEEN_MS_AGO]);
if (bss[NL80211_BSS_TSF])
new->tsf = nla_get_u64(bss[NL80211_BSS_TSF]);
if (bss[NL80211_BSS_INFORMATION_ELEMENTS]) {
uint8_t *ie = nla_data(bss[NL80211_BSS_INFORMATION_ELEMENTS]);
int ielen = nla_len(bss[NL80211_BSS_INFORMATION_ELEMENTS]);
while (ielen >= 2 && ielen >= ie[1]) {
const ie_id_t id = (ie_id_t)ie[0];
const uint8_t len = (uint8_t)ie[1];
switch (id) {
case IE_SSID:
if (len > 0 && len <= 32)
print_ssid_escaped(new->essid, sizeof(new->essid),
ie+2, len);
break;
case IE_BSS_LOAD:
if (len >= 5) {
new->bss_sta_count = ie[3] << 8 | ie[2];
new->bss_chan_usage = ie[4];
}
break;
case IE_HT_CAPABILITIES:
new->ht_capable = true;
break;
case IE_RM_CAPABILITIES:
new->rm_enabled = true;
break;
case IE_MESH_CONFIG:
new->mesh_enabled = true;
break;
default: /* ignored */
break;
}
ielen -= ie[1] + 2;
ie += ie[1] + 2;
}
}
/* Update stats */
new->next = sr->head;
sr->head = new;
if (!*new->essid) {
sr->num.hidden++;
} else if (str_is_ascii(new->essid)) {
sr->max_essid_len = clamp(strlen(new->essid),
sr->max_essid_len,
MAX_ESSID_LEN);
}
if (new->freq > 45000) /* 802.11ad 60GHz spectrum */
err_quit("FIXME: can not handle %d MHz spectrum yet", new->freq);
else if (new->freq >= 5000)
sr->num.five_gig++;
else if (new->freq >= 2000)
sr->num.two_gig++;
sr->num.entries += 1;
sr->num.open += !new->has_key;
return NL_SKIP;
}
static int iw_nl80211_scan_trigger(void)
{
static struct cmd cmd_trigger_scan = {
.cmd = NL80211_CMD_TRIGGER_SCAN,
};
return handle_interface_cmd(&cmd_trigger_scan);
}
static int iw_nl80211_get_scan_data(struct scan_result *sr)
{
static struct cmd cmd_scan_dump = {
.cmd = NL80211_CMD_GET_SCAN,
.flags = NLM_F_DUMP,
.handler = scan_dump_handler
};
sr->max_essid_len = MAX_ESSID_LEN;
cmd_scan_dump.handler_arg = sr;
return handle_interface_cmd(&cmd_scan_dump);
}
/*
* Simple sort routine.
* FIXME: use hash or tree to store entries, a list to display them.
*/
void sort_scan_list(struct scan_entry **headp)
{
struct scan_entry *head = NULL, *cur, *new = *headp, **prev;
while (new) {
for (cur = head, prev = &head; cur &&
conf.scan_sort_asc == scan_cmp[conf.scan_sort_order](cur, new);
prev = &cur->next, cur = cur->next)
;
*prev = new;
new = new->next;
(*prev)->next = cur;
}
*headp = head;
}
static void free_scan_list(struct scan_entry *head)
{
if (head) {
free_scan_list(head->next);
free(head);
}
}
/*
* Channel statistics shown at the bottom of scan screen.
*/
/*
* For lsearch, it compares key value with array member, needs to
* return 0 if they are the same, non-0 otherwise.
*/
static int cmp_key(const void *a, const void *b)
{
return ((struct cnt *)a)->val - ((struct cnt *)b)->val;
}
/* For quick-sorting the array in descending order of counts */
static int cmp_cnt(const void *a, const void *b)
{
if (conf.scan_sort_order == SO_CHAN && !conf.scan_sort_asc)
return ((struct cnt *)a)->count - ((struct cnt *)b)->count;
return ((struct cnt *)b)->count - ((struct cnt *)a)->count;
}
/**
* Fill in sr->channel_stats (must not have been allocated yet).
*/
static void compute_channel_stats(struct scan_result *sr)
{
struct scan_entry *cur;
struct cnt *bin, key = {0, 0};
size_t n = 0;
if (!sr->num.entries)
return;
sr->channel_stats = calloc(sr->num.entries, sizeof(key));
for (cur = sr->head; cur; cur = cur->next) {
if (cur->chan >= 0) {
key.val = cur->chan;
bin = lsearch(&key, sr->channel_stats, &n, sizeof(key), cmp_key);
if (bin)
bin->count++;
}
}
if (n > 0) {
qsort(sr->channel_stats, n, sizeof(key), cmp_cnt);
} else {
free(sr->channel_stats);
sr->channel_stats = NULL;
}
sr->num.ch_stats = n < MAX_CH_STATS ? n : MAX_CH_STATS;
}
/*
* Scan results.
*/
static void _clear_scan_result(struct scan_result *sr)
{
free_scan_list(sr->head);
free(sr->channel_stats);
sr->head = NULL;
sr->channel_stats = NULL;
sr->msg[0] = '\0';
memset(&(sr->num), 0, sizeof(sr->num));
}
static void _write_warning_msg(struct scan_result *sr, const char *format, ...)
{
va_list argp;
va_start(argp, format);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_mutex_lock(&sr->mutex);
_clear_scan_result(sr);
vsnprintf(sr->msg, sizeof(sr->msg), format, argp);
pthread_mutex_unlock(&sr->mutex);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
}
/** The actual scan thread. */
void *do_scan(void *sr_ptr)
{
struct scan_result *sr = sr_ptr;
sigset_t blockmask;
int ret = 0;
/* SIGWINCH is supposed to be handled in the main thread. */
sigemptyset(&blockmask);
sigaddset(&blockmask, SIGWINCH);
pthread_sigmask(SIG_BLOCK, &blockmask, NULL);
do {
ret = iw_nl80211_scan_trigger();
if (-ret == EPERM && !has_net_admin_capability()) {
_write_warning_msg(sr, "This screen requires CAP_NET_ADMIN permissions");
pthread_exit(0);
} else if (-ret == ENETDOWN && default_interface_is_rfkill_blocked()) {
_write_warning_msg(sr, "Interface %s is blocked by rfkill", conf_ifname());
continue;
} else if (-ret == ENETDOWN && !if_is_up(conf_ifname())) {
_write_warning_msg(sr, "Interface %s is down - setting it up ...", conf_ifname());
if (if_set_up(conf_ifname()) < 0)
err_sys("Can not bring up interface '%s'", conf_ifname());
if (atexit(if_set_down_on_exit) < 0)
_write_warning_msg(sr, "Warning: unable to restore %s down state on exit", conf_ifname());
continue;
}
switch(-ret) {
case EBUSY:
/* Trigger returns -EBUSY if a scan request is pending or ready. */
case 0:
if (!wait_for_scan_events()) {
_write_warning_msg(sr, "Waiting for scan data...");
} else {
struct scan_result *tmp = calloc(1, sizeof(*tmp));
if (!tmp)
err_sys("Out of memory");
ret = iw_nl80211_get_scan_data(tmp);
if (ret < 0) {
_write_warning_msg(sr, "Scan failed on %s: %s", conf_ifname(), strerror(-ret));
} else if (!tmp->head) {
if (conf.scan_filter_band != SCAN_FILTER_BAND_BOTH) {
// Reset filter in case the card does not suport the band.
conf.scan_filter_band = SCAN_FILTER_BAND_BOTH;
} else {
_write_warning_msg(sr, "Empty scan results on %s", conf_ifname());
}
} else {
// Sort only when new data arrives.
compute_channel_stats(tmp);
sort_scan_list(&tmp->head);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
pthread_mutex_lock(&sr->mutex);
_clear_scan_result(sr);
sr->head = tmp->head;
sr->channel_stats = tmp->channel_stats;
sr->max_essid_len = tmp->max_essid_len;
memcpy(&(sr->num), &(tmp->num), sizeof(tmp->num));
pthread_mutex_unlock(&sr->mutex);
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
}
free(tmp);
}
break;
case EFAULT:
/* EFAULT can occur after a window resizing event - treat as temporary error. */
case EINTR:
case EAGAIN:
_write_warning_msg(sr, "Waiting for device to become ready ...");
break;
default:
_write_warning_msg(sr, "Scan trigger failed on %s: %s", conf_ifname(), strerror(-ret));
break;
}
} while (usleep(conf.stat_iv * 1000) == 0);
return NULL;
}
uoaerg-wavemon-fb158b0/iw_scan.h 0000664 0000000 0000000 00000027704 15142173343 0016670 0 ustar 00root root 0000000 0000000 /*
* Scan-related definitions.
*/
#include "iw_if.h"
/*
* Organization of scan results
*/
/**
* struct scan_entry - Representation of a single scan result.
* @ap_addr: MAC address
* @essid: station SSID (may be empty)
* @freq: frequency in MHz
* @chan: channel corresponding to @freq (where applicable)
* @has_key: whether using encryption or not
* @ht_capable: whether this is an HT station
* @rm_enabled: whether Radio Measurement is enabled
* @mesh_enabled: whether station advertises mesh services
* @last_seen: time station was last seen (in seconds)
* @tsf: value of the Timing Synchronisation Function counter
* @bss_signal: signal strength of BSS probe in dBm (or 0)
* @bss_signal_qual: unitless signal strength of BSS probe, 0..100
* @bss_capa: BSS capability flags
* @bss_sta_count: BSS station count
* @bss_chan_usage: BSS channel utilisation
*/
struct scan_entry {
struct ether_addr ap_addr;
char essid[MAX_ESSID_LEN + 2];
uint32_t freq;
int chan;
bool has_key:1,
ht_capable:1,
rm_enabled:1,
mesh_enabled:1;
uint32_t last_seen;
uint64_t tsf;
int8_t bss_signal;
uint8_t bss_signal_qual;
uint16_t bss_capa;
uint8_t bss_sta_count,
bss_chan_usage;
struct scan_entry *next;
};
extern void sort_scan_list(struct scan_entry **headp);
/**
* struct cnt - count frequency of integer numbers
* @val: value to count
* @count: how often @val occurs
*/
struct cnt {
int val;
int count;
};
/**
* struct scan_result - Structure to aggregate all collected scan data.
* @head: begin of scan_entry list (may be NULL)
* @msg: error message, if any
* @max_essid_len: maximum ESSID-string length (up to %MAX_ESSID_LEN)
* @channel_stats: array of channel statistics entries
* @num.total: number of entries in list starting at @head
* @num.open: number of open entries among @num.total
* @num.hidden: number of entries with hidden ESSIDs among @num.total
* @num.two_gig: number of 2.4GHz stations among @num.total
* @num.five_gig: number of 5 GHz stations among @num.total
* @num.ch_stats: length of @channel_stats array
* @mutex: protects against concurrent consumer/producer access
*/
struct scan_result {
struct scan_entry *head;
char msg[128];
uint16_t max_essid_len;
struct cnt *channel_stats;
struct assorted_numbers {
uint16_t entries,
open,
hidden,
two_gig,
five_gig;
/* Maximum number of 'top' statistics entries. */
#define MAX_CH_STATS 3
size_t ch_stats;
} num;
pthread_mutex_t mutex;
};
extern void *do_scan(void *sr_ptr);
/*
* Information ID elements.
* References denote 802.11-2012 sections, unless otherwise noted.
*/
typedef enum {
IE_SSID = 0, // 8.4.2.2: Identity of ESS or IBSS
IE_SUPPORTED_RATES = 1, // 8.4.2.3: Up to 8 supported rates
IE_FH_PARAM_SET = 2, // 8.4.2.4: STA FH PHY synchronization parameters
IE_DS_PARAM_SET = 3, // 8.4.2.5: STA DSSS PHY synchronization parameters
IE_CF_PARAM_SET = 4, // 8.4.2.6: CF parameters for PCF support
IE_TIM = 5, // 8.4.2.7: TIM element (DTIM parameters)
IE_IBSS = 6, // 8.4.2.8: IBSS parameter set
IE_COUNTRY = 7, // 8.4.2.10: Country (PHY regulatory domain)
IE_FH_PAT_PARAMS = 8, // 8.4.2.11: Hopping Pattern parameters
IE_FH_PAT_TABLE = 9, // 8.4.2.12: Hopping Pattern table
IE_REQUEST = 10, // 8.4.2.13: Request element (Probe req/resp)
IE_BSS_LOAD = 11, // 8.4.2.30: BSS Load (STA population/traffic)
IE_EDCA_PARAM_SET = 12, // 8.4.2.31: EDCA Parameter Set (QoS)
IE_TSPEC = 13, // 8.4.2.32: TSPEC (QoS traffic expectations)
IE_TCLAS = 14, // 8.4.2.33: TCLAS (identifies TS)
IE_SCHEDULE = 15, // 8.4.2.36: Schedule announcement
IE_CHALLENGE_TXT = 16, // 8.4.2.9: Challenge text
/* 17-31 reserved */
IE_PWR_CONSTRAINT = 32, // 8.4.2.16: Power constraint (max allowed TX power)
IE_PWR_CAPABILITY = 33, // 8.4.2.17: Power capability (min/max TX power)
IE_TPC_REQUEST = 34, // 8.4.2.18: TPC request (TX power / link margin)
IE_TPC_REPORT = 35, // 8.4.2.19: TPC response (TX power / link margin)
IE_SUPP_CHANNELS = 36, // 8.4.2.20: Supported channels (channel subbands)
IE_CHANNEL_SW_ANN = 37, // 8.4.2.21: Channel switch announcement
IE_MEASURE_REQUEST = 38, // 8.4.2.23: Measurement request
IE_MEASURE_REPOR = 39, // 8.4.2.24: Measurement report
IE_QUIET = 40, // 8.4.2.25: Quiet interval
IE_IBSS_DFS = 41, // 8.4.2.26: IBSS DFS operation parameters
IE_ERP_INFO = 42, // 8.4.2.14: ERP data rate / Barker preambles
IE_TS_DELAY = 43, // 8.4.2.34: TS Delay (ADDTS response)
IE_TCLAS_PROCESSING = 44, // 8.4.2.35: TCLAS Processing (ADDTS req/resp)
IE_HT_CAPABILITIES = 45, // 8.4.2.58: HT capabilities (declares STA to be HT)
IE_QOS_CAPABILITY = 46, // 8.4.2.37: QoS capabilities (at a QoS STA)
/* 47 reserved */
IE_RSN = 48, // 8.4.2.27: RSN (authentication / cipher)
/* 49 reserved */
IE_EXT_SUPP_RATES = 50, // 8.4.2.15: Extended Support Rates information
IE_AP_CHANNEL_REPORT = 51, // 8.4.2.38: AP channel report (likely location of APs)
IE_NEIGHBOUR_REPORT = 52, // 8.4.2.39: Neighbour report
IE_RCPI = 53, // 8.4.2.40: RCPI (received frame power level)
IE_MOBILITY_DOMAIN = 54, // 8.4.2.49: Mobility domain parameters (MDID, FT, ...)
IE_FAST_BSS_TRANS = 55, // 8.4.2.50: Fast BSS transition (FTE)
IE_TIMEOUT_INTERVAL = 56, // 8.4.2.51: Timeout Interval Element (TIE)
IE_RIC_DATA_ELEMENT = 57, // 8.4.2.52: Resource Information (RIC data, RDE)
IE_DSE_LOCATION = 58, // 8.4.2.54: DSE registered location (lat/long/alt)
IE_SUPP_OPER_CLASSES = 59, // 8.4.2.56: Supported (allowed) operating classes
IE_EXT_CHAN_SWITCH = 60, // 8.4.2.55: Extended channel switch announcement
IE_HT_OPERATION = 61, // 8.4.2.59: HT STA operation element
IE_SEC_CHAN_OFFSET = 62, // 8.4.2.22: Secondary channel offset (40Mhz channel)
IE_BSS_AVG_ACCESS = 63, // 8.4.2.41: BSS average access delay (BSS load measure)
IE_ANTENNA = 64, // 8.4.2.42: Antenna ID element
IE_RSNI = 65, // 8.4.2.43: RSNI (received signal-to-noise)
IE_MEAS_PILOT_TRAN = 66, // 8.4.2.44: Measure Pilot Transmission
IE_BSS_ADMN_CAPACITY = 67, // 8.4.2.45: BSS Available Admission Capacity
IE_BSS_ACCESS_DELAY = 68, // 8.4.2.46: BSS AC (Access Category) Access Delay field
IE_TIME_ADVERTISEMT = 69, // 8.4.2.63: Time advertisement (clock, offset, ...)
IE_RM_CAPABILITIES = 70, // 8.4.2.47: Radio measurement capabilities (RM enabled)
IE_MULTIPLE_BSSID = 71, // 8.4.2.48: Multiple BSSID indicator
IE_20_40_COEXISTENCE = 72, // 8.4.2.62: 20/40 STA BSS coexistence in same spectrum
IE_20_40_INTOL_CHANS = 73, // 8.4.2.60: 20/40 Intolerant channels report
IE_OBSS_SCAN_PARAMS = 74, // 8.4.2.61: Overlapping BSS scan (OBSS) parameters
IE_RIC_DESCRIPTOR = 75, // 8.4.2.53: RIC descriptor (fast BSS transition)
IE_MGMT_MIC_ELEM = 76, // 8.4.2.57: Management MIC element (MME)
/* 77 unused */
IE_EVENT_REQUEST = 78, // 8.4.2.69: Event request
IE_EVENT_REPORT = 79, // 8.4.2.70: Event report
IE_DIAGNOSTIC_REQ = 80, // 8.4.2.71: Diagnostic request
IE_DIAGNOSTIC_REP = 81, // 8.4.2.72: Diagnostic report
IE_LOCATION_PARAMS = 82, // 8.4.2.73: Location parameters (for location services)
IE_NON_TRANSM_BSSID = 83, // 8.4.2.74: Nontransmitted BSSID Capability
IE_SSID_LIST = 84, // 8.4.2.75: SSID List
IE_MULTI_BSSID_IDX = 85, // 8.4.2.76: Multiple BSSID Index (with DTIM information)
IE_FMS_DESCRIPTOR = 86, // 8.4.2.77: FMS Descriptor (group-addressed BUs)
IE_FMS_REQUEST = 87, // 8.4.2.78: FMS Request (group-addressed frames)
IE_FMS_RESPONSE = 88, // 8.4.2.79: FMS Response (group-addressed frames)
IE_QOS_TRAFFIC_CAPA = 89, // 8.4.2.80: QoS traffic capability information
IE_BSS_MAX_IDLE_PER = 90, // 8.4.2.81: Maximum idle period of a non-AP STA
IE_TFS_REQUEST = 91, // 8.4.2.82: TFS (traffic filters) request
IE_TFS_RESPONSE = 92, // 8.4.2.83: TFS (traffic filters) response
IE_WNM_SLEEP_MODE = 93, // 8.4.2.84: WNM Sleep Mode
IE_TIM_BROADCAST_REQ = 94, // 8.4.2.85: Periodic TIM broadcast information request
IE_TIM_BROADCAST_RES = 95, // 8.4.2.86: Periodic TIM broadcast information response
IE_INTERFERENCE_REPT = 96, // 8.4.2.87: Co-located interference report
IE_CHANNEL_USAGE = 97, // 8.4.2.88: Channel usage (non-infrastructure / off-channel TDLS)
IE_TIME_ZONE = 98, // 8.4.2.89: Local time zone of the AP
IE_DMS_REQUEST = 99, // 8.4.2.90: DMS (group addressed frames) request
IE_DMS_RESPONSE = 100, // 8.4.2.91: DMS (group addressed frames) response
IE_LINK_IDENTIFIER = 101, // 8.4.2.64: Link identifier (identifies TDLS direct link)
IE_WAKEUP_SCHEDULE = 102, // 8.4.2.65: Periodic wakeup schedule (TDLS Peer Power Save Mode)
/* 103 unused */
IE_CHAN_SWITCH_TIM = 104, // 8.4.2.66: Channel Switch time and timeout
IE_PTI_CONTROL = 105, // 8.4.2.67: PTI control (traffic buffered at TPU buffer STA)
IE_TPU_BUFFER_STATUS = 106, // 8.4.2.68: TPU buffer status (traffic buffered at TPU buffer STA)
IE_INTERWORKING = 107, // 8.4.2.94: Interworking service capabilities of a STA
IE_ADVERTISEMT_PROTO = 108, // 8.4.2.95: Advertisement protocol and control
IE_EXPED_BNDWDTH_REQ = 109, // 8.4.2.96: Expedited bandwidth request (ADDTS request frame)
IE_QOS_MAP_SET = 110, // 8.4.2.97: QoS map set (from AP to non-AP STA)
IE_ROAMING_CONSORTM = 111, // 8.4.2.98: Roaming consortium (SSP)
IE_EMERGENCY_ALRT_ID = 112, // 8.4.2.99: Emergency alert identifier (availabe EAS messages)
IE_MESH_CONFIG = 113, // 8.4.2.100: Mesh configuration (advertises mesh services)
IE_MESH_ID = 114, // 8.4.2.101: Mesh ID (advertises the identification of an MBSS)
IE_MESH_LINK_REPORT = 115, // 8.4.2.102: Mesh link report (mesh STA to neighbour peer mesh STA)
IE_MESH_CONGESTION = 116, // 8.4.2.103: Mesh congestion notification
IE_MESH_PEERING_MGMT = 117, // 8.4.2.104: Mesh peering management (with a neighbour mesh STA)
IE_MESH_CHAN_SWITCH = 118, // 8.4.2.105: Mesh channel switch (change operating channel / class)
IE_MESH_AWAKE_WINDOW = 119, // 8.4.2.106: Mesh awake window (beacon frames)
IE_BEACON_TIMING = 120, // 8.4.2.107: Beacon timing (of neighbour STAs)
IE_MCCAOP_SETUP_REQ = 121, // 8.4.2.108: MCCAOP setup request (MCCAOP reservation)
IE_MCCAOP_SETUP_RES = 122, // 8.4.2.109: MCCAOP setup response
IE_MCCAOP_ADVERTMT = 123, // 8.4.2.111: MCCAOP advertisement overview (by a mesh STA)
IE_MCCAOP_TEARDOWN = 124, // 8.4.2.112: MCCAOP teardown (of MCCAOP reservation)
IE_GATE_ANNOUNCEMENT = 125, // 8.4.2.113: Mesh Gate Announcement (GANN) in the MBSS
IE_ROOT_ANNOUNCEMENT = 126, // 8.4.2.114: Mesh Root Announcement (RANN) of root mesh STA
IE_EXT_CAPABILITIES = 127, // 8.4.2.29: Extended capabilities information
/* 128-129 reserved */
IE_MESH_PATH_REQUEST = 130, // 8.4.2.115: Mesh path request (PREQ)
IE_MESH_PATH_REPLY = 131, // 8.4.2.116: Mesh path reply (PREP)
IE_MESH_PATH_ERROR = 132, // 8.4.2.117: Mesh path error (PERR)
/* 133-136 reserved */
IE_MESH_PROXY_PXU = 137, // 8.4.2.118: Mesh proxy update (PXU)
IE_MESH_PROXY_PXUC = 138, // 8.4.2.119: Mesh proxy update confirmation (PXUC)
IE_MESH_PEERING_AUTH = 139, // 8.4.2.120: Authenticated mesh peering exchange
IE_MESH_MESSAGE_MIC = 140, // 8.4.2.121: Mesh message integrity code (MIC) (of peering mgmt frames)
IE_DESTINATION_URI = 141, // 8.4.2.92: Destination URI (URI/ESS detection interval values)
IE_U_APSD_COEXIST = 142, // 8.4.2.93: U-APSD coexistence (duration of requested transmission)
/* 143-173 reserved */
IE_MCCAOP_ADV_OVERVW = 174, // 8.4.2.110: MCCAOP advertisement overview (mesh STA, MCCA information)
/* 175-220 reserved */
IE_VENDOR_SPECIFIC = 221, // 8.4.2.28: Vendor specific information (non-standard)
/* 222-255 reserved */
} ie_id_t;
uoaerg-wavemon-fb158b0/lhist_scr.c 0000664 0000000 0000000 00000016561 15142173343 0017231 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "iw_if.h"
#include "iw_nl80211.h"
/* Number of lines in the key window at the bottom */
#define KEY_WIN_HEIGHT 3
/* Total number of lines in the histogram window */
#define HIST_WIN_HEIGHT (WAV_HEIGHT - KEY_WIN_HEIGHT)
/*
* Analogous to MAXYLEN, the following sets both the
* - highest y/line index and the
* - total count of lines inside the histogram window.
*/
#define HIST_MAXYLEN (HIST_WIN_HEIGHT - 1)
/* Position (relative to right border) and maximum length of dBm level tags. */
#define LEVEL_TAG_POS 5
/* GLOBALS */
static WINDOW *w_lhist, *w_key;
/* Keep track of interface changes. */
static int last_if_idx = -1;
/*
* Keeping track of global minima/maxima
*/
static struct iw_extrema {
bool initialised;
float min;
float max;
} e_signal;
static void track_extrema(const float new_sample, struct iw_extrema *ie)
{
if (!ie->initialised) {
ie->initialised = true;
ie->min = ie->max = new_sample;
} else if (new_sample < ie->min) {
ie->min = new_sample;
} else if (new_sample > ie->max) {
ie->max = new_sample;
}
}
static char *fmt_extrema(const struct iw_extrema *ie, const char *unit)
{
static char range[256];
if (!ie->initialised)
snprintf(range, sizeof(range), "unknown");
else if (ie->min == ie->max)
snprintf(range, sizeof(range), "%+.0f %s", ie->min, unit);
else
snprintf(range, sizeof(range), "%+.0f %s ... %+.0f %s",
ie->min, unit, ie->max, unit);
return range;
}
/*
* Simple array-based circular FIFO buffer
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
* Insertion works from lower to higher indices.
* Access works from higher down to lower indices.
*
* Cases & assumptions:
* ~~~~~~~~~~~~~~~~~~~~
* - principle: unsigned counter + hash function to handle array wrap-around;
* - buffer is empty if count == 0;
* - else count indicates the next place to insert(modulo %IW_STACKSIZE).
*/
#define IW_STACKSIZE 1024
static struct iw_levelstat iw_stats_cache[IW_STACKSIZE];
static uint32_t count;
static const uint32_t COUNTMAX = ~0;
static void iw_cache_insert(const struct iw_levelstat new)
{
iw_stats_cache[count % IW_STACKSIZE] = new;
/*
* Handle counter overflow by mapping into a smaller index which is
* identical (modulo %IW_STACKSIZE) to the old value. (The datatype
* of 'count' must be able to express at least 2 * IW_STACKSIZE.)
*/
if (++count == COUNTMAX)
count = IW_STACKSIZE + (COUNTMAX % IW_STACKSIZE);
}
static struct iw_levelstat iw_cache_get(const uint32_t index)
{
struct iw_levelstat zero = {.signal = 0, .valid = false};
if (index > IW_STACKSIZE || index > count)
return zero;
return iw_stats_cache[(count - index) % IW_STACKSIZE];
}
void iw_cache_update(struct iw_nl80211_linkstat *ls)
{
static struct iw_levelstat avg = {.signal = 0, .valid = false};
static int slot;
int sig_level = ls->signal;
/*
* Prefer signal level over average signal level.
* One card in particular (Intel 9260NGW) reported inconsistent
* station and beacon average signals.
* See https://github.com/uoaerg/wavemon/issues/47
*/
if (sig_level == 0)
sig_level = ls->signal_avg;
/*
* If hardware does not support dBm signal level, it will not
* be filled in, and show up as 0. Try to fall back to the BSS
* probe where again a 0 dBm value reflects 'not initialized'.
*/
if (sig_level == 0)
sig_level = ls->bss_signal;
/* If the signal level is positive, assume it is an absolute value (#100). */
if (sig_level > 0)
sig_level *= -1;
if (sig_level == 0) {
avg.valid = false;
} else {
avg.valid = true;
avg.signal += (float)sig_level / conf.slotsize;
track_extrema(sig_level, &e_signal);
}
if (++slot >= conf.slotsize) {
iw_cache_insert(avg);
avg.signal = slot = 0;
avg.valid = false;
}
}
/*
* Histogram-specific display functions
*/
static double hist_level(double val, int min, int max)
{
return map_range(val, min, max, 1, HIST_MAXYLEN);
}
static double hist_level_inverse(int y_level, int min, int max)
{
return map_range(y_level, 1, HIST_MAXYLEN, min, max);
}
/* Order needs to be reversed as y-coordinates grow downwards */
static int hist_y(int yval)
{
return reverse_range(yval, 1, HIST_MAXYLEN);
}
/* Values come in from the right, so 'x' also needs to be reversed */
static int hist_x(int xval)
{
return reverse_range(xval, 1, MAXXLEN);
}
/* plot single values, without clamping to min/max */
static void hist_plot(double yval, int xval, enum colour_pair plot_colour)
{
int level = round(yval);
if (in_range(level, 1, HIST_MAXYLEN)) {
wattrset(w_lhist, COLOR_PAIR(plot_colour) | A_BOLD);
#ifdef HAVE_LIBNCURSESW
mvwadd_wch(w_lhist, hist_y(level), hist_x(xval), WACS_HLINE);
#else
mvwaddch(w_lhist, hist_y(level), hist_x(xval), ACS_HLINE);
#endif
}
}
static void display_lhist(void)
{
struct iw_levelstat iwl;
double sig_level;
int x, y;
for (x = 1; x <= MAXXLEN; x++) {
iwl = iw_cache_get(x);
/* Clear screen and set up horizontal grid lines */
wattrset(w_lhist, COLOR_PAIR(CP_BLUE));
for (y = 1; y <= HIST_MAXYLEN; y++)
mvwaddch(w_lhist, hist_y(y), hist_x(x), (y % 5) ? ' ' : '-');
if (x == LEVEL_TAG_POS && iwl.valid) {
char tmp[LEVEL_TAG_POS + 1];
int len;
/*
* Tag the horizontal grid lines with dBm levels.
*/
wattrset(w_lhist, COLOR_PAIR(CP_GREEN));
for (y = 1; y <= HIST_MAXYLEN; y++) {
if (y != 1 && (y % 5) && y != HIST_MAXYLEN)
continue;
len = snprintf(tmp, sizeof(tmp), "%.0f",
hist_level_inverse(y, conf.sig_min,
conf.sig_max));
mvwaddstr(w_lhist, hist_y(y), hist_x(len), tmp);
}
}
if (iwl.valid) {
sig_level = hist_level(iwl.signal, conf.sig_min, conf.sig_max);
hist_plot(sig_level, x, CP_GREEN);
}
}
wrefresh(w_lhist);
}
static void display_key(WINDOW *w_key)
{
char buf[280];
/* Clear the (one-line) screen) */
wmove(w_key, 1, 1);
wclrtoborder(w_key);
wattrset(w_key, COLOR_PAIR(CP_STANDARD));
waddch(w_key, '[');
wattrset(w_key, COLOR_PAIR(CP_GREEN));
waddch(w_key, ACS_HLINE);
wattrset(w_key, COLOR_PAIR(CP_STANDARD));
snprintf(buf, sizeof(buf), "] signal level (%s)", fmt_extrema(&e_signal, "dBm"));
waddstr(w_key, buf);
wrefresh(w_key);
}
void scr_lhist_init(void)
{
w_lhist = newwin_title(0, HIST_WIN_HEIGHT, "Level histogram", true);
w_key = newwin_title(HIST_MAXYLEN + 1, KEY_WIN_HEIGHT, "Key", false);
if (last_if_idx != conf.if_idx) {
count = 0;
e_signal.initialised = false;
last_if_idx = conf.if_idx;
}
sampling_init(true);
display_key(w_key);
}
int scr_lhist_loop(WINDOW *w_menu)
{
static int vcount = 1;
if (!--vcount) {
vcount = conf.slotsize;
display_lhist();
display_key(w_key);
}
return wgetch(w_menu);
}
void scr_lhist_fini(void)
{
sampling_stop();
delwin(w_lhist);
delwin(w_key);
}
uoaerg-wavemon-fb158b0/llist.c 0000664 0000000 0000000 00000010147 15142173343 0016360 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include
#include
#include
#include "llist.h"
/*
* llist - a library of functions for transparent handling of linked lists.
* programmed by Jan Morgenstern
*
* format parameters are specified as follows:
* d = int
* c = char
* f = float
* s = char *
* S = char *, case-insensitive and fuzzy
* * = void *
*/
#define NUM_LISTS 0x100
typedef struct chain {
void *e;
char type;
struct chain *next;
} llist;
static llist *lists[NUM_LISTS];
/* position pointer for ll_getall() */
static struct {
unsigned long n;
char eol;
} lp[NUM_LISTS];
/*
* helper function for generating an element from an argument
*/
static llist *arg2element(char type, va_list * ap, llist * next)
{
llist *l;
l = (llist *) malloc(sizeof(llist));
switch (type) {
case 'd':
l->e = (void *)malloc(sizeof(int));
*((int *)l->e) = va_arg(*ap, int);
break;
case 's':
l->e = (void *)malloc(sizeof(char *));
l->e = strdup(va_arg(*ap, char *));
break;
case 'f':
l->e = (void *)malloc(sizeof(double));
*((double *)l->e) = va_arg(*ap, double);
break;
case '*':
l->e = va_arg(*ap, void *);
}
l->next = next;
return l;
}
/*
* start a new list
*/
int ll_create(void)
{
unsigned long i;
static char firstcall = 1;
if (firstcall) {
for (i = 0; i < NUM_LISTS; i++)
lists[i] = NULL;
firstcall = 0;
}
i = 0;
while (i < NUM_LISTS && lists[i] != NULL)
i++;
if (i < NUM_LISTS) {
lists[i] = (llist *) calloc(1, sizeof(llist));
return i;
} else
return -1;
}
/*
* get an element without modifying the list
*/
void *ll_get(int ld, unsigned long n)
{
llist *l = lists[ld]->next;
unsigned long i;
for (i = 0; i < n && l->next; i++)
l = l->next;
return l->e;
}
/*
* return all elements successively
*/
void *ll_getall(int ld)
{
llist *l = lists[ld]->next;
void *rv;
static char firstcall = 1;
unsigned long i;
if (firstcall) {
for (i = 0; i < NUM_LISTS; i++)
lp[i].n = lp[i].eol = 0;
firstcall = 0;
}
if (!lp[ld].eol) {
for (i = 0; i < lp[ld].n; i++)
l = l->next;
if (!l->next)
lp[ld].eol = 1;
rv = l->e;
lp[ld].n++;
} else {
rv = NULL;
lp[ld].eol = lp[ld].n = 0;
}
return rv;
}
/*
* reset the position pointer for ll_getall
*/
void ll_reset(int ld)
{
lp[ld].n = lp[ld].eol = 0;
}
/*
* push an element onto the end of the list
*/
void ll_push(int ld, const char *format, ...)
{
llist *l = lists[ld];
va_list ap;
while (l->next)
l = l->next;
va_start(ap, format);
while (*format)
l = l->next = arg2element(*format++, &ap, NULL);
va_end(ap);
l->next = NULL;
}
/*
* replace an element it with a new one
*/
void ll_replace(int ld, unsigned long n, const char *format, ...)
{
llist *prevl = lists[ld], *l = lists[ld]->next;
unsigned long i;
va_list ap;
for (i = 0; i < n && l->next; i++) {
prevl = l;
l = l->next;
}
va_start(ap, format);
if (*format)
prevl->next = arg2element(*format, &ap, l->next);
va_end(ap);
free(l->e);
free(l);
}
/*
* return the number of elements in a given list
*/
unsigned long ll_size(int ld)
{
llist *l = lists[ld];
unsigned long i;
for (i = 0; (l = l->next); i++)
/* do nothing */ ;
return i;
}
/*
* destroy a list and free the memory
*/
void ll_destroy(int ld)
{
llist *l = lists[ld], *lnext;
while (l) {
lnext = l->next;
free(l->e);
free(l);
l = lnext;
}
lp[ld].n = lp[ld].eol = 0;
lists[ld] = NULL;
}
uoaerg-wavemon-fb158b0/llist.h 0000664 0000000 0000000 00000002150 15142173343 0016360 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#define LISTVAL_MAX 32 /* maximum string length of `s' elements */
int ll_create(void);
void *ll_get(int ld, unsigned long n);
void *ll_getall(int ld);
void ll_reset(int ld);
void ll_push(int ld, const char *format, ...);
void ll_replace(int ld, unsigned long n, const char *format, ...);
unsigned long ll_size(int ld);
void ll_destroy(int ld);
uoaerg-wavemon-fb158b0/nl80211.h 0000664 0000000 0000000 00001306736 15142173343 0016260 0 ustar 00root root 0000000 0000000 #ifndef __LINUX_NL80211_H
#define __LINUX_NL80211_H
/*
* 802.11 netlink interface public header
*
* Copyright 2006-2010 Johannes Berg
* Copyright 2008 Michael Wu
* Copyright 2008 Luis Carlos Cobo
* Copyright 2008 Michael Buesch
* Copyright 2008, 2009 Luis R. Rodriguez
* Copyright 2008 Jouni Malinen
* Copyright 2008 Colin McCabe
* Copyright 2015-2017 Intel Deutschland GmbH
* Copyright (C) 2018-2025 Intel Corporation
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
*/
/*
* This header file defines the userspace API to the wireless stack. Please
* be careful not to break things - i.e. don't move anything around or so
* unless you can demonstrate that it breaks neither API nor ABI.
*
* Additions to the API should be accompanied by actual implementations in
* an upstream driver, so that example implementations exist in case there
* are ever concerns about the precise semantics of the API or changes are
* needed, and to ensure that code for dead (no longer implemented) API
* can actually be identified and removed.
* Nonetheless, semantics should also be documented carefully in this file.
*/
#include
#define NL80211_GENL_NAME "nl80211"
#define NL80211_MULTICAST_GROUP_CONFIG "config"
#define NL80211_MULTICAST_GROUP_SCAN "scan"
#define NL80211_MULTICAST_GROUP_REG "regulatory"
#define NL80211_MULTICAST_GROUP_MLME "mlme"
#define NL80211_MULTICAST_GROUP_VENDOR "vendor"
#define NL80211_MULTICAST_GROUP_NAN "nan"
#define NL80211_MULTICAST_GROUP_TESTMODE "testmode"
#define NL80211_EDMG_BW_CONFIG_MIN 4
#define NL80211_EDMG_BW_CONFIG_MAX 15
#define NL80211_EDMG_CHANNELS_MIN 1
#define NL80211_EDMG_CHANNELS_MAX 0x3c /* 0b00111100 */
/**
* DOC: Station handling
*
* Stations are added per interface, but a special case exists with VLAN
* interfaces. When a station is bound to an AP interface, it may be moved
* into a VLAN identified by a VLAN interface index (%NL80211_ATTR_STA_VLAN).
* The station is still assumed to belong to the AP interface it was added
* to.
*
* Station handling varies per interface type and depending on the driver's
* capabilities.
*
* For drivers supporting TDLS with external setup (WIPHY_FLAG_SUPPORTS_TDLS
* and WIPHY_FLAG_TDLS_EXTERNAL_SETUP), the station lifetime is as follows:
* - a setup station entry is added, not yet authorized, without any rate
* or capability information; this just exists to avoid race conditions
* - when the TDLS setup is done, a single NL80211_CMD_SET_STATION is valid
* to add rate and capability information to the station and at the same
* time mark it authorized.
* - %NL80211_TDLS_ENABLE_LINK is then used
* - after this, the only valid operation is to remove it by tearing down
* the TDLS link (%NL80211_TDLS_DISABLE_LINK)
*
* TODO: need more info for other interface types
*/
/**
* DOC: Frame transmission/registration support
*
* Frame transmission and registration support exists to allow userspace
* management entities such as wpa_supplicant to react to management frames
* that are not being handled by the kernel. This includes, for example,
* certain classes of action frames that cannot be handled in the kernel
* for various reasons.
*
* Frame registration is done on a per-interface basis and registrations
* cannot be removed other than by closing the socket. It is possible to
* specify a registration filter to register, for example, only for a
* certain type of action frame. In particular with action frames, those
* that userspace registers for will not be returned as unhandled by the
* driver, so that the registered application has to take responsibility
* for doing that.
*
* The type of frame that can be registered for is also dependent on the
* driver and interface type. The frame types are advertised in wiphy
* attributes so applications know what to expect.
*
* NOTE: When an interface changes type while registrations are active,
* these registrations are ignored until the interface type is
* changed again. This means that changing the interface type can
* lead to a situation that couldn't otherwise be produced, but
* any such registrations will be dormant in the sense that they
* will not be serviced, i.e. they will not receive any frames.
*
* Frame transmission allows userspace to send for example the required
* responses to action frames. It is subject to some sanity checking,
* but many frames can be transmitted. When a frame is transmitted, its
* status is indicated to the sending socket.
*
* For more technical details, see the corresponding command descriptions
* below.
*/
/**
* DOC: Virtual interface / concurrency capabilities
*
* Some devices are able to operate with virtual MACs; they can have
* more than one virtual interface. The capability handling for this
* is a bit complex though, as there may be a number of restrictions
* on the types of concurrency that are supported.
*
* To start with, each device supports the interface types listed in
* the %NL80211_ATTR_SUPPORTED_IFTYPES attribute, but by listing the
* types there no concurrency is implied.
*
* Once concurrency is desired, more attributes must be observed:
* To start with, since some interface types are purely managed in
* software, like the AP-VLAN type in mac80211 for example, there's
* an additional list of these; they can be added at any time and
* are only restricted by some semantic restrictions (e.g. AP-VLAN
* cannot be added without a corresponding AP interface). This list
* is exported in the %NL80211_ATTR_SOFTWARE_IFTYPES attribute.
*
* Further, the list of supported combinations is exported. This is
* in the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute. Basically,
* it exports a list of "groups", and at any point in time the
* interfaces that are currently active must fall into any one of
* the advertised groups. Within each group, there are restrictions
* on the number of interfaces of different types that are supported
* and also the number of different channels, along with potentially
* some other restrictions. See &enum nl80211_if_combination_attrs.
*
* All together, these attributes define the concurrency of virtual
* interfaces that a given device supports.
*/
/**
* DOC: packet coalesce support
*
* In most cases, host that receives IPv4 and IPv6 multicast/broadcast
* packets does not do anything with these packets. Therefore the
* reception of these unwanted packets causes unnecessary processing
* and power consumption.
*
* Packet coalesce feature helps to reduce number of received interrupts
* to host by buffering these packets in firmware/hardware for some
* predefined time. Received interrupt will be generated when one of the
* following events occurs.
* a) Expiration of hardware timer whose expiration time is set to maximum
* coalescing delay of matching coalesce rule.
* b) Coalescing buffer in hardware reaches its limit.
* c) Packet doesn't match any of the configured coalesce rules.
*
* User needs to configure following parameters for creating a coalesce
* rule.
* a) Maximum coalescing delay
* b) List of packet patterns which needs to be matched
* c) Condition for coalescence: pattern 'match' or 'no match'
* Multiple such rules can be created.
*/
/**
* DOC: WPA/WPA2 EAPOL handshake offload
*
* By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK flag drivers
* can indicate they support offloading EAPOL handshakes for WPA/WPA2
* preshared key authentication in station mode. In %NL80211_CMD_CONNECT
* the preshared key should be specified using %NL80211_ATTR_PMK. Drivers
* supporting this offload may reject the %NL80211_CMD_CONNECT when no
* preshared key material is provided, for example when that driver does
* not support setting the temporal keys through %NL80211_CMD_NEW_KEY.
*
* Similarly @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X flag can be
* set by drivers indicating offload support of the PTK/GTK EAPOL
* handshakes during 802.1X authentication in station mode. In order to
* use the offload the %NL80211_CMD_CONNECT should have
* %NL80211_ATTR_WANT_1X_4WAY_HS attribute flag. Drivers supporting this
* offload may reject the %NL80211_CMD_CONNECT when the attribute flag is
* not present.
*
* By setting @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK flag drivers
* can indicate they support offloading EAPOL handshakes for WPA/WPA2
* preshared key authentication in AP mode. In %NL80211_CMD_START_AP
* the preshared key should be specified using %NL80211_ATTR_PMK. Drivers
* supporting this offload may reject the %NL80211_CMD_START_AP when no
* preshared key material is provided, for example when that driver does
* not support setting the temporal keys through %NL80211_CMD_NEW_KEY.
*
* For 802.1X the PMK or PMK-R0 are set by providing %NL80211_ATTR_PMK
* using %NL80211_CMD_SET_PMK. For offloaded FT support also
* %NL80211_ATTR_PMKR0_NAME must be provided.
*/
/**
* DOC: FILS shared key authentication offload
*
* FILS shared key authentication offload can be advertised by drivers by
* setting @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD flag. The drivers that support
* FILS shared key authentication offload should be able to construct the
* authentication and association frames for FILS shared key authentication and
* eventually do a key derivation as per IEEE 802.11ai. The below additional
* parameters should be given to driver in %NL80211_CMD_CONNECT and/or in
* %NL80211_CMD_UPDATE_CONNECT_PARAMS.
* %NL80211_ATTR_FILS_ERP_USERNAME - used to construct keyname_nai
* %NL80211_ATTR_FILS_ERP_REALM - used to construct keyname_nai
* %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used to construct erp message
* %NL80211_ATTR_FILS_ERP_RRK - used to generate the rIK and rMSK
* rIK should be used to generate an authentication tag on the ERP message and
* rMSK should be used to derive a PMKSA.
* rIK, rMSK should be generated and keyname_nai, sequence number should be used
* as specified in IETF RFC 6696.
*
* When FILS shared key authentication is completed, driver needs to provide the
* below additional parameters to userspace, which can be either after setting
* up a connection or after roaming.
* %NL80211_ATTR_FILS_KEK - used for key renewal
* %NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM - used in further EAP-RP exchanges
* %NL80211_ATTR_PMKID - used to identify the PMKSA used/generated
* %Nl80211_ATTR_PMK - used to update PMKSA cache in userspace
* The PMKSA can be maintained in userspace persistently so that it can be used
* later after reboots or wifi turn off/on also.
*
* %NL80211_ATTR_FILS_CACHE_ID is the cache identifier advertised by a FILS
* capable AP supporting PMK caching. It specifies the scope within which the
* PMKSAs are cached in an ESS. %NL80211_CMD_SET_PMKSA and
* %NL80211_CMD_DEL_PMKSA are enhanced to allow support for PMKSA caching based
* on FILS cache identifier. Additionally %NL80211_ATTR_PMK is used with
* %NL80211_SET_PMKSA to specify the PMK corresponding to a PMKSA for driver to
* use in a FILS shared key connection with PMKSA caching.
*/
/**
* DOC: SAE authentication offload
*
* By setting @NL80211_EXT_FEATURE_SAE_OFFLOAD flag drivers can indicate they
* support offloading SAE authentication for WPA3-Personal networks in station
* mode. Similarly @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP flag can be set by
* drivers indicating the offload support in AP mode.
*
* The password for SAE should be specified using %NL80211_ATTR_SAE_PASSWORD in
* %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP for station and AP mode
* respectively.
*/
/**
* DOC: VLAN offload support for setting group keys and binding STAs to VLANs
*
* By setting @NL80211_EXT_FEATURE_VLAN_OFFLOAD flag drivers can indicate they
* support offloading VLAN functionality in a manner where the driver exposes a
* single netdev that uses VLAN tagged frames and separate VLAN-specific netdevs
* can then be added using RTM_NEWLINK/IFLA_VLAN_ID similarly to the Ethernet
* case. Frames received from stations that are not assigned to any VLAN are
* delivered on the main netdev and frames to such stations can be sent through
* that main netdev.
*
* %NL80211_CMD_NEW_KEY (for group keys), %NL80211_CMD_NEW_STATION, and
* %NL80211_CMD_SET_STATION will optionally specify vlan_id using
* %NL80211_ATTR_VLAN_ID.
*/
/**
* DOC: TID configuration
*
* TID config support can be checked in the %NL80211_ATTR_TID_CONFIG
* attribute given in wiphy capabilities.
*
* The necessary configuration parameters are mentioned in
* &enum nl80211_tid_config_attr and it will be passed to the
* %NL80211_CMD_SET_TID_CONFIG command in %NL80211_ATTR_TID_CONFIG.
*
* If the configuration needs to be applied for specific peer then the MAC
* address of the peer needs to be passed in %NL80211_ATTR_MAC, otherwise the
* configuration will be applied for all the connected peers in the vif except
* any peers that have peer-specific configuration for the TID by default; if
* the %NL80211_TID_CONFIG_ATTR_OVERRIDE flag is set, peer-specific values
* will be overwritten.
*
* All this configuration is valid only for STA's current connection,
* i.e., the configuration will be reset to default when the STA connects back
* after disconnection/roaming, and this configuration will be cleared when
* the interface goes down.
*/
/**
* DOC: FILS shared key crypto offload
*
* This feature is applicable to drivers running in AP mode.
*
* FILS shared key crypto offload can be advertised by drivers by setting
* @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD flag. The drivers that support
* FILS shared key crypto offload should be able to encrypt and decrypt
* association frames for FILS shared key authentication as per IEEE 802.11ai.
* With this capability, for FILS key derivation, drivers depend on userspace.
*
* After FILS key derivation, userspace shares the FILS AAD details with the
* driver and the driver stores the same to use in decryption of association
* request and in encryption of association response. The below parameters
* should be given to the driver in %NL80211_CMD_SET_FILS_AAD.
* %NL80211_ATTR_MAC - STA MAC address, used for storing FILS AAD per STA
* %NL80211_ATTR_FILS_KEK - Used for encryption or decryption
* %NL80211_ATTR_FILS_NONCES - Used for encryption or decryption
* (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
*
* Once the association is done, the driver cleans the FILS AAD data.
*/
/**
* DOC: Multi-Link Operation
*
* In Multi-Link Operation, a connection between two MLDs utilizes multiple
* links. To use this in nl80211, various commands and responses now need
* to or will include the new %NL80211_ATTR_MLO_LINKS attribute.
* Additionally, various commands that need to operate on a specific link
* now need to be given the %NL80211_ATTR_MLO_LINK_ID attribute, e.g. to
* use %NL80211_CMD_START_AP or similar functions.
*/
/**
* DOC: OWE DH IE handling offload
*
* By setting @NL80211_EXT_FEATURE_OWE_OFFLOAD flag, drivers can indicate
* kernel/application space to avoid DH IE handling. When this flag is
* advertised, the driver/device will take care of DH IE inclusion and
* processing of peer DH IE to generate PMK.
*/
/**
* enum nl80211_commands - supported nl80211 commands
*
* @NL80211_CMD_UNSPEC: unspecified command to catch errors
*
* @NL80211_CMD_GET_WIPHY: request information about a wiphy or dump request
* to get a list of all present wiphys.
* @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or
* %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME,
* %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ,
* %NL80211_ATTR_WIPHY_FREQ_OFFSET (and the attributes determining the
* channel width; this is used for setting monitor mode channel),
* %NL80211_ATTR_WIPHY_RETRY_SHORT, %NL80211_ATTR_WIPHY_RETRY_LONG,
* %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, and/or
* %NL80211_ATTR_WIPHY_RTS_THRESHOLD. However, for setting the channel,
* see %NL80211_CMD_SET_CHANNEL instead, the support here is for backward
* compatibility only.
* @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
* or rename notification. Has attributes %NL80211_ATTR_WIPHY and
* %NL80211_ATTR_WIPHY_NAME.
* @NL80211_CMD_DEL_WIPHY: Wiphy deleted. Has attributes
* %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME.
*
* @NL80211_CMD_GET_INTERFACE: Request an interface's configuration;
* either a dump request for all interfaces or a specific get with a
* single %NL80211_ATTR_IFINDEX is supported.
* @NL80211_CMD_SET_INTERFACE: Set type of a virtual interface, requires
* %NL80211_ATTR_IFINDEX and %NL80211_ATTR_IFTYPE.
* @NL80211_CMD_NEW_INTERFACE: Newly created virtual interface or response
* to %NL80211_CMD_GET_INTERFACE. Has %NL80211_ATTR_IFINDEX,
* %NL80211_ATTR_WIPHY and %NL80211_ATTR_IFTYPE attributes. Can also
* be sent from userspace to request creation of a new virtual interface,
* then requires attributes %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFTYPE and
* %NL80211_ATTR_IFNAME.
* @NL80211_CMD_DEL_INTERFACE: Virtual interface was deleted, has attributes
* %NL80211_ATTR_IFINDEX and %NL80211_ATTR_WIPHY. Can also be sent from
* userspace to request deletion of a virtual interface, then requires
* attribute %NL80211_ATTR_IFINDEX. If multiple BSSID advertisements are
* enabled using %NL80211_ATTR_MBSSID_CONFIG, %NL80211_ATTR_MBSSID_ELEMS,
* and if this command is used for the transmitting interface, then all
* the non-transmitting interfaces are deleted as well.
*
* @NL80211_CMD_GET_KEY: Get sequence counter information for a key specified
* by %NL80211_ATTR_KEY_IDX and/or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC
* represents peer's MLD address for MLO pairwise key. For MLO group key,
* the link is identified by %NL80211_ATTR_MLO_LINK_ID.
* @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT,
* %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD.
* For MLO connection, the link to set default key is identified by
* %NL80211_ATTR_MLO_LINK_ID.
* @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
* %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER,
* and %NL80211_ATTR_KEY_SEQ attributes. %NL80211_ATTR_MAC represents
* peer's MLD address for MLO pairwise key. The link to add MLO
* group key is identified by %NL80211_ATTR_MLO_LINK_ID.
* @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX
* or %NL80211_ATTR_MAC. %NL80211_ATTR_MAC represents peer's MLD address
* for MLO pairwise key. The link to delete group key is identified by
* %NL80211_ATTR_MLO_LINK_ID.
*
* @NL80211_CMD_GET_BEACON: (not used)
* @NL80211_CMD_SET_BEACON: change the beacon on an access point interface
* using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL
* attributes. For drivers that generate the beacon and probe responses
* internally, the following attributes must be provided: %NL80211_ATTR_IE,
* %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP.
* @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters
* are like for %NL80211_CMD_SET_BEACON, and additionally parameters that
* do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL,
* %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID,
* %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
* %NL80211_ATTR_CIPHER_SUITE_GROUP, %NL80211_ATTR_WPA_VERSIONS,
* %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY,
* %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_INACTIVITY_TIMEOUT,
* %NL80211_ATTR_ACL_POLICY and %NL80211_ATTR_MAC_ADDRS.
* The channel to use can be set on the interface or be given using the
* %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_FREQ_OFFSET, and the
* attributes determining channel width.
* @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP
* @NL80211_CMD_STOP_AP: Stop AP operation on the given interface
* @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP
*
* @NL80211_CMD_GET_STATION: Get station attributes for station identified by
* %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_SET_STATION: Set station attributes for station identified by
* %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_NEW_STATION: Add a station with given attributes to the
* interface identified by %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_DEL_STATION: Remove a station identified by %NL80211_ATTR_MAC
* or, if no MAC address given, all stations, on the interface identified
* by %NL80211_ATTR_IFINDEX. For MLD station, MLD address is used in
* %NL80211_ATTR_MAC. %NL80211_ATTR_MGMT_SUBTYPE and
* %NL80211_ATTR_REASON_CODE can optionally be used to specify which type
* of disconnection indication should be sent to the station
* (Deauthentication or Disassociation frame and reason code for that
* frame). %NL80211_ATTR_MLO_LINK_ID can be used optionally to remove
* stations connected and using at least that link as one of its links.
*
* @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to
* destination %NL80211_ATTR_MAC on the interface identified by
* %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to
* destination %NL80211_ATTR_MAC on the interface identified by
* %NL80211_ATTR_IFINDEX.
* @NL80211_CMD_NEW_MPATH: Create a new mesh path for the destination given by
* %NL80211_ATTR_MAC via %NL80211_ATTR_MPATH_NEXT_HOP.
* @NL80211_CMD_DEL_MPATH: Delete a mesh path to the destination given by
* %NL80211_ATTR_MAC.
* @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by
* %NL80211_ATTR_IFINDEX.
*
* @NL80211_CMD_GET_REG: ask the wireless core to send us its currently set
* regulatory domain. If %NL80211_ATTR_WIPHY is specified and the device
* has a private regulatory domain, it will be returned. Otherwise, the
* global regdomain will be returned.
* A device will have a private regulatory domain if it uses the
* regulatory_hint() API. Even when a private regdomain is used the channel
* information will still be mended according to further hints from
* the regulatory core to help with compliance. A dump version of this API
* is now available which will returns the global regdomain as well as
* all private regdomains of present wiphys (for those that have it).
* If a wiphy is self-managed (%NL80211_ATTR_WIPHY_SELF_MANAGED_REG), then
* its private regdomain is the only valid one for it. The regulatory
* core is not used to help with compliance in this case.
* @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command
* after being queried by the kernel. CRDA replies by sending a regulatory
* domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our
* current alpha2 if it found a match. It also provides
* NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each
* regulatory rule is a nested set of attributes given by
* %NL80211_ATTR_REG_RULE_FREQ_[START|END] and
* %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by
* %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and
* %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP.
* @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain
* to the specified ISO/IEC 3166-1 alpha2 country code. The core will
* store this as a valid request and then query userspace for it.
*
* @NL80211_CMD_GET_MESH_CONFIG: Get mesh networking properties for the
* interface identified by %NL80211_ATTR_IFINDEX
*
* @NL80211_CMD_SET_MESH_CONFIG: Set mesh networking properties for the
* interface identified by %NL80211_ATTR_IFINDEX
*
* @NL80211_CMD_SET_MGMT_EXTRA_IE: Set extra IEs for management frames. The
* interface is identified with %NL80211_ATTR_IFINDEX and the management
* frame subtype with %NL80211_ATTR_MGMT_SUBTYPE. The extra IE data to be
* added to the end of the specified management frame is specified with
* %NL80211_ATTR_IE. If the command succeeds, the requested data will be
* added to all specified management frames generated by
* kernel/firmware/driver.
* Note: This command has been removed and it is only reserved at this
* point to avoid re-using existing command number. The functionality this
* command was planned for has been provided with cleaner design with the
* option to specify additional IEs in NL80211_CMD_TRIGGER_SCAN,
* NL80211_CMD_AUTHENTICATE, NL80211_CMD_ASSOCIATE,
* NL80211_CMD_DEAUTHENTICATE, and NL80211_CMD_DISASSOCIATE.
*
* @NL80211_CMD_GET_SCAN: get scan results
* @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
* %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
* probe requests at CCK rate or not. %NL80211_ATTR_BSSID can be used to
* specify a BSSID to scan for; if not included, the wildcard BSSID will
* be used.
* @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
* NL80211_CMD_GET_SCAN and on the "scan" multicast group)
* @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
* partial scan results may be available
*
* @NL80211_CMD_START_SCHED_SCAN: start a scheduled scan at certain
* intervals and certain number of cycles, as specified by
* %NL80211_ATTR_SCHED_SCAN_PLANS. If %NL80211_ATTR_SCHED_SCAN_PLANS is
* not specified and only %NL80211_ATTR_SCHED_SCAN_INTERVAL is specified,
* scheduled scan will run in an infinite loop with the specified interval.
* These attributes are mutually exclusive,
* i.e. NL80211_ATTR_SCHED_SCAN_INTERVAL must not be passed if
* NL80211_ATTR_SCHED_SCAN_PLANS is defined.
* If for some reason scheduled scan is aborted by the driver, all scan
* plans are canceled (including scan plans that did not start yet).
* Like with normal scans, if SSIDs (%NL80211_ATTR_SCAN_SSIDS)
* are passed, they are used in the probe requests. For
* broadcast, a broadcast SSID must be passed (ie. an empty
* string). If no SSID is passed, no probe requests are sent and
* a passive scan is performed. %NL80211_ATTR_SCAN_FREQUENCIES,
* if passed, define which channels should be scanned; if not
* passed, all channels allowed for the current regulatory domain
* are used. Extra IEs can also be passed from the userspace by
* using the %NL80211_ATTR_IE attribute. The first cycle of the
* scheduled scan can be delayed by %NL80211_ATTR_SCHED_SCAN_DELAY
* is supplied. If the device supports multiple concurrent scheduled
* scans, it will allow such when the caller provides the flag attribute
* %NL80211_ATTR_SCHED_SCAN_MULTI to indicate user-space support for it.
* @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT if
* scheduled scan is not running. The caller may assume that as soon
* as the call returns, it is safe to start a new scheduled scan again.
* @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
* results available.
* @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
* stopped. The driver may issue this event at any time during a
* scheduled scan. One reason for stopping the scan is if the hardware
* does not support starting an association or a normal scan while running
* a scheduled scan. This event is also sent when the
* %NL80211_CMD_STOP_SCHED_SCAN command is received or when the interface
* is brought down while a scheduled scan was running.
*
* @NL80211_CMD_GET_SURVEY: get survey results, e.g. channel occupation
* or noise level
* @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to
* NL80211_CMD_GET_SURVEY and on the "scan" multicast group)
*
* @NL80211_CMD_SET_PMKSA: Add a PMKSA cache entry using %NL80211_ATTR_MAC
* (for the BSSID), %NL80211_ATTR_PMKID, and optionally %NL80211_ATTR_PMK
* (PMK is used for PTKSA derivation in case of FILS shared key offload) or
* using %NL80211_ATTR_SSID, %NL80211_ATTR_FILS_CACHE_ID,
* %NL80211_ATTR_PMKID, and %NL80211_ATTR_PMK in case of FILS
* authentication where %NL80211_ATTR_FILS_CACHE_ID is the identifier
* advertised by a FILS capable AP identifying the scope of PMKSA in an
* ESS.
* @NL80211_CMD_DEL_PMKSA: Delete a PMKSA cache entry, using %NL80211_ATTR_MAC
* (for the BSSID) and %NL80211_ATTR_PMKID or using %NL80211_ATTR_SSID,
* %NL80211_ATTR_FILS_CACHE_ID, and %NL80211_ATTR_PMKID in case of FILS
* authentication. Additionally in case of SAE offload and OWE offloads
* PMKSA entry can be deleted using %NL80211_ATTR_SSID.
* @NL80211_CMD_FLUSH_PMKSA: Flush all PMKSA cache entries.
*
* @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain
* has been changed and provides details of the request information
* that caused the change such as who initiated the regulatory request
* (%NL80211_ATTR_REG_INITIATOR), the wiphy_idx
* (%NL80211_ATTR_REG_ALPHA2) on which the request was made from if
* the initiator was %NL80211_REGDOM_SET_BY_COUNTRY_IE or
* %NL80211_REGDOM_SET_BY_DRIVER, the type of regulatory domain
* set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is
* %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on
* to (%NL80211_ATTR_REG_ALPHA2).
* @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon
* has been found while world roaming thus enabling active scan or
* any mode of operation that initiates TX (beacons) on a channel
* where we would not have been able to do either before. As an example
* if you are world roaming (regulatory domain set to world or if your
* driver is using a custom world roaming regulatory domain) and while
* doing a passive scan on the 5 GHz band you find an AP there (if not
* on a DFS channel) you will now be able to actively scan for that AP
* or use AP mode on your card on that same channel. Note that this will
* never be used for channels 1-11 on the 2 GHz band as they are always
* enabled world wide. This beacon hint is only sent if your device had
* either disabled active scanning or beaconing on a channel. We send to
* userspace the wiphy on which we removed a restriction from
* (%NL80211_ATTR_WIPHY) and the channel on which this occurred
* before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER)
* the beacon hint was processed.
*
* @NL80211_CMD_AUTHENTICATE: authentication request and notification.
* This command is used both as a command (request to authenticate) and
* as an event on the "mlme" multicast group indicating completion of the
* authentication process.
* When used as a command, %NL80211_ATTR_IFINDEX is used to identify the
* interface. %NL80211_ATTR_MAC is used to specify PeerSTAAddress (and
* BSSID in case of station mode). %NL80211_ATTR_SSID is used to specify
* the SSID (mainly for association, but is included in authentication
* request, too, to help BSS selection. %NL80211_ATTR_WIPHY_FREQ +
* %NL80211_ATTR_WIPHY_FREQ_OFFSET is used to specify the frequency of the
* channel in MHz. %NL80211_ATTR_AUTH_TYPE is used to specify the
* authentication type. %NL80211_ATTR_IE is used to define IEs
* (VendorSpecificInfo, but also including RSN IE and FT IEs) to be added
* to the frame.
* When used as an event, this reports reception of an Authentication
* frame in station and IBSS modes when the local MLME processed the
* frame, i.e., it was for the local STA and was received in correct
* state. This is similar to MLME-AUTHENTICATE.confirm primitive in the
* MLME SAP interface (kernel providing MLME, userspace SME). The
* included %NL80211_ATTR_FRAME attribute contains the management frame
* (including both the header and frame body, but not FCS). This event is
* also used to indicate if the authentication attempt timed out. In that
* case the %NL80211_ATTR_FRAME attribute is replaced with a
* %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which
* pending authentication timed out).
* @NL80211_CMD_ASSOCIATE: association request and notification; like
* NL80211_CMD_AUTHENTICATE but for Association and Reassociation
* (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request,
* MLME-ASSOCIATE.confirm or MLME-REASSOCIATE.confirm primitives). The
* %NL80211_ATTR_PREV_BSSID attribute is used to specify whether the
* request is for the initial association to an ESS (that attribute not
* included) or for reassociation within the ESS (that attribute is
* included).
* @NL80211_CMD_DEAUTHENTICATE: deauthentication request and notification; like
* NL80211_CMD_AUTHENTICATE but for Deauthentication frames (similar to
* MLME-DEAUTHENTICATION.request and MLME-DEAUTHENTICATE.indication
* primitives).
* @NL80211_CMD_DISASSOCIATE: disassociation request and notification; like
* NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to
* MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives).
*
* @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael
* MIC (part of TKIP) failure; sent on the "mlme" multicast group; the
* event includes %NL80211_ATTR_MAC to describe the source MAC address of
* the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key
* type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and
* %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this
* event matches with MLME-MICHAELMICFAILURE.indication() primitive
*
* @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a
* FREQ attribute (for the initial frequency if no peer can be found)
* and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those
* should be fixed rather than automatically determined. Can only be
* executed on a network interface that is UP, and fixed BSSID/FREQ
* may be rejected. Another optional parameter is the beacon interval,
* given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not
* given defaults to 100 TU (102.4ms).
* @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is
* determined by the network interface.
*
* @NL80211_CMD_TESTMODE: testmode command, takes a wiphy (or ifindex) attribute
* to identify the device, and the TESTDATA blob attribute to pass through
* to the driver.
*
* @NL80211_CMD_CONNECT: connection request and notification; this command
* requests to connect to a specified network but without separating
* auth and assoc steps. For this, you need to specify the SSID in a
* %NL80211_ATTR_SSID attribute, and can optionally specify the association
* IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE,
* %NL80211_ATTR_USE_MFP, %NL80211_ATTR_MAC, %NL80211_ATTR_WIPHY_FREQ,
* %NL80211_ATTR_WIPHY_FREQ_OFFSET, %NL80211_ATTR_CONTROL_PORT,
* %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
* %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
* %NL80211_ATTR_CONTROL_PORT_OVER_NL80211, %NL80211_ATTR_MAC_HINT, and
* %NL80211_ATTR_WIPHY_FREQ_HINT.
* If included, %NL80211_ATTR_MAC and %NL80211_ATTR_WIPHY_FREQ are
* restrictions on BSS selection, i.e., they effectively prevent roaming
* within the ESS. %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT
* can be included to provide a recommendation of the initial BSS while
* allowing the driver to roam to other BSSes within the ESS and also to
* ignore this recommendation if the indicated BSS is not ideal. Only one
* set of BSSID,frequency parameters is used (i.e., either the enforcing
* %NL80211_ATTR_MAC,%NL80211_ATTR_WIPHY_FREQ or the less strict
* %NL80211_ATTR_MAC_HINT and %NL80211_ATTR_WIPHY_FREQ_HINT).
* Driver shall not modify the IEs specified through %NL80211_ATTR_IE if
* %NL80211_ATTR_MAC is included. However, if %NL80211_ATTR_MAC_HINT is
* included, these IEs through %NL80211_ATTR_IE are specified by the user
* space based on the best possible BSS selected. Thus, if the driver ends
* up selecting a different BSS, it can modify these IEs accordingly (e.g.
* userspace asks the driver to perform PMKSA caching with BSS1 and the
* driver ends up selecting BSS2 with different PMKSA cache entry; RSNIE
* has to get updated with the apt PMKID).
* %NL80211_ATTR_PREV_BSSID can be used to request a reassociation within
* the ESS in case the device is already associated and an association with
* a different BSS is desired.
* Background scan period can optionally be
* specified in %NL80211_ATTR_BG_SCAN_PERIOD,
* if not specified default background scan configuration
* in driver is used and if period value is 0, bg scan will be disabled.
* This attribute is ignored if driver does not support roam scan.
* It is also sent as an event, with the BSSID and response IEs when the
* connection is established or failed to be established. This can be
* determined by the %NL80211_ATTR_STATUS_CODE attribute (0 = success,
* non-zero = failure). If %NL80211_ATTR_TIMED_OUT is included in the
* event, the connection attempt failed due to not being able to initiate
* authentication/association or not receiving a response from the AP.
* Non-zero %NL80211_ATTR_STATUS_CODE value is indicated in that case as
* well to remain backwards compatible.
* @NL80211_CMD_ROAM: Notification indicating the card/driver roamed by itself.
* When a security association was established on an 802.1X network using
* fast transition, this event should be followed by an
* %NL80211_CMD_PORT_AUTHORIZED event.
* Following a %NL80211_CMD_ROAM event userspace can issue
* %NL80211_CMD_GET_SCAN in order to obtain the scan information for the
* new BSS the card/driver roamed to.
* @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
* userspace that a connection was dropped by the AP or due to other
* reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
* %NL80211_ATTR_REASON_CODE attributes are used.
*
* @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices
* associated with this wiphy must be down and will follow.
*
* @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified
* channel for the specified amount of time. This can be used to do
* off-channel operations like transmit a Public Action frame and wait for
* a response while being associated to an AP on another channel.
* %NL80211_ATTR_IFINDEX is used to specify which interface (and thus
* radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the
* frequency for the operation.
* %NL80211_ATTR_DURATION is used to specify the duration in milliseconds
* to remain on the channel. This command is also used as an event to
* notify when the requested duration starts (it may take a while for the
* driver to schedule this time due to other concurrent needs for the
* radio).
* When called, this operation returns a cookie (%NL80211_ATTR_COOKIE)
* that will be included with any events pertaining to this request;
* the cookie is also used to cancel the request.
* @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a
* pending remain-on-channel duration if the desired operation has been
* completed prior to expiration of the originally requested duration.
* %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the
* radio. The %NL80211_ATTR_COOKIE attribute must be given as well to
* uniquely identify the request.
* This command is also used as an event to notify when a requested
* remain-on-channel duration has expired.
*
* @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX
* rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
* and @NL80211_ATTR_TX_RATES the set of allowed rates.
*
* @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
* (via @NL80211_CMD_FRAME) for processing in userspace. This command
* requires an interface index, a frame type attribute (optional for
* backward compatibility reasons, if not given assumes action frames)
* and a match attribute containing the first few bytes of the frame
* that should match, e.g. a single byte for only a category match or
* four bytes for vendor frames including the OUI. The registration
* cannot be dropped, but is removed automatically when the netlink
* socket is closed. Multiple registrations can be made.
* The %NL80211_ATTR_RECEIVE_MULTICAST flag attribute can be given if
* %NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS is available, in which
* case the registration can also be modified to include/exclude the
* flag, rather than requiring unregistration to change it.
* @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
* backward compatibility
* @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
* command is used both as a request to transmit a management frame and
* as an event indicating reception of a frame that was not processed in
* kernel code, but is for us (i.e., which may need to be processed in a
* user space application). %NL80211_ATTR_FRAME is used to specify the
* frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used
* to indicate on which channel the frame is to be transmitted or was
* received. If this channel is not the current channel (remain-on-channel
* or the operational channel) the device will switch to the given channel
* and transmit the frame, optionally waiting for a response for the time
* specified using %NL80211_ATTR_DURATION. When called, this operation
* returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
* TX status event pertaining to the TX request.
* %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
* management frames at CCK rate or not in 2GHz band.
* %NL80211_ATTR_CSA_C_OFFSETS_TX is an array of offsets to CSA
* counters which will be updated to the current value. This attribute
* is used during CSA period.
* For TX on an MLD, the frequency can be omitted and the link ID be
* specified, or if transmitting to a known peer MLD (with MLD addresses
* in the frame) both can be omitted and the link will be selected by
* lower layers.
* For RX notification, %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
* indicate the frame RX timestamp and %NL80211_ATTR_TX_HW_TIMESTAMP may
* be included to indicate the ack TX timestamp.
* @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
* command may be used with the corresponding cookie to cancel the wait
* time if it is known that it is no longer necessary. This command is
* also sent as an event whenever the driver has completed the off-channel
* wait time.
* @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
* @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
* transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
* the TX command and %NL80211_ATTR_FRAME includes the contents of the
* frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
* the frame. %NL80211_ATTR_TX_HW_TIMESTAMP may be included to indicate the
* tx timestamp and %NL80211_ATTR_RX_HW_TIMESTAMP may be included to
* indicate the ack RX timestamp.
* @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
* backward compatibility.
*
* @NL80211_CMD_SET_POWER_SAVE: Set powersave, using %NL80211_ATTR_PS_STATE
* @NL80211_CMD_GET_POWER_SAVE: Get powersave status in %NL80211_ATTR_PS_STATE
*
* @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
* is used to configure connection quality monitoring notification trigger
* levels.
* @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
* command is used as an event to indicate the that a trigger level was
* reached.
* @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
* and the attributes determining channel width) the given interface
* (identified by %NL80211_ATTR_IFINDEX) shall operate on.
* In case multiple channels are supported by the device, the mechanism
* with which it switches channels is implementation-defined.
* When a monitor interface is given, it can only switch channel while
* no other interfaces are operating to avoid disturbing the operation
* of any other interfaces, and other interfaces will again take
* precedence when they are used.
*
* @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface
* (no longer supported).
*
* @NL80211_CMD_SET_MULTICAST_TO_UNICAST: Configure if this AP should perform
* multicast to unicast conversion. When enabled, all multicast packets
* with ethertype ARP, IPv4 or IPv6 (possibly within an 802.1Q header)
* will be sent out to each station once with the destination (multicast)
* MAC address replaced by the station's MAC address. Note that this may
* break certain expectations of the receiver, e.g. the ability to drop
* unicast IP packets encapsulated in multicast L2 frames, or the ability
* to not send destination unreachable messages in such cases.
* This can only be toggled per BSS. Configure this on an interface of
* type %NL80211_IFTYPE_AP. It applies to all its VLAN interfaces
* (%NL80211_IFTYPE_AP_VLAN), except for those in 4addr (WDS) mode.
* If %NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED is not present with this
* command, the feature is disabled.
*
* @NL80211_CMD_JOIN_MESH: Join a mesh. The mesh ID must be given, and initial
* mesh config parameters may be given.
* @NL80211_CMD_LEAVE_MESH: Leave the mesh network -- no special arguments, the
* network is determined by the network interface.
*
* @NL80211_CMD_UNPROT_DEAUTHENTICATE: Unprotected deauthentication frame
* notification. This event is used to indicate that an unprotected
* deauthentication frame was dropped when MFP is in use.
* @NL80211_CMD_UNPROT_DISASSOCIATE: Unprotected disassociation frame
* notification. This event is used to indicate that an unprotected
* disassociation frame was dropped when MFP is in use.
*
* @NL80211_CMD_NEW_PEER_CANDIDATE: Notification on the reception of a
* beacon or probe response from a compatible mesh peer. This is only
* sent while no station information (sta_info) exists for the new peer
* candidate and when @NL80211_MESH_SETUP_USERSPACE_AUTH,
* @NL80211_MESH_SETUP_USERSPACE_AMPE, or
* @NL80211_MESH_SETUP_USERSPACE_MPM is set. On reception of this
* notification, userspace may decide to create a new station
* (@NL80211_CMD_NEW_STATION). To stop this notification from
* reoccurring, the userspace authentication daemon may want to create the
* new station with the AUTHENTICATED flag unset and maybe change it later
* depending on the authentication result.
*
* @NL80211_CMD_GET_WOWLAN: get Wake-on-Wireless-LAN (WoWLAN) settings.
* @NL80211_CMD_SET_WOWLAN: set Wake-on-Wireless-LAN (WoWLAN) settings.
* Since wireless is more complex than wired ethernet, it supports
* various triggers. These triggers can be configured through this
* command with the %NL80211_ATTR_WOWLAN_TRIGGERS attribute. For
* more background information, see
* https://wireless.wiki.kernel.org/en/users/Documentation/WoWLAN.
* The @NL80211_CMD_SET_WOWLAN command can also be used as a notification
* from the driver reporting the wakeup reason. In this case, the
* @NL80211_ATTR_WOWLAN_TRIGGERS attribute will contain the reason
* for the wakeup, if it was caused by wireless. If it is not present
* in the wakeup notification, the wireless device didn't cause the
* wakeup but reports that it was woken up.
*
* @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
* the necessary information for supporting GTK rekey offload. This
* feature is typically used during WoWLAN. The configuration data
* is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
* contains the data in sub-attributes). After rekeying happened,
* this command may also be sent by the driver as an MLME event to
* inform userspace of the new replay counter.
*
* @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
* of PMKSA caching candidates.
*
* @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
* In addition, this can be used as an event to request userspace to take
* actions on TDLS links (set up a new link or tear down an existing one).
* In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested
* operation, %NL80211_ATTR_MAC contains the peer MAC address, and
* %NL80211_ATTR_REASON_CODE the reason code to be used (only with
* %NL80211_TDLS_TEARDOWN).
* @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. The
* %NL80211_ATTR_TDLS_ACTION attribute determines the type of frame to be
* sent. Public Action codes (802.11-2012 8.1.5.1) will be sent as
* 802.11 management frames, while TDLS action codes (802.11-2012
* 8.5.13.1) will be encapsulated and sent as data frames. The currently
* supported Public Action code is %WLAN_PUB_ACTION_TDLS_DISCOVER_RES
* and the currently supported TDLS actions codes are given in
* &enum ieee80211_tdls_actioncode.
*
* @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP
* (or GO) interface (i.e. hostapd) to ask for unexpected frames to
* implement sending deauth to stations that send unexpected class 3
* frames. Also used as the event sent by the kernel when such a frame
* is received.
* For the event, the %NL80211_ATTR_MAC attribute carries the TA and
* other attributes like the interface index are present.
* If used as the command it must have an interface index and you can
* only unsubscribe from the event by closing the socket. Subscription
* is also for %NL80211_CMD_UNEXPECTED_4ADDR_FRAME events.
*
* @NL80211_CMD_UNEXPECTED_4ADDR_FRAME: Sent as an event indicating that the
* associated station identified by %NL80211_ATTR_MAC sent a 4addr frame
* and wasn't already in a 4-addr VLAN. The event will be sent similarly
* to the %NL80211_CMD_UNEXPECTED_FRAME event, to the same listener.
*
* @NL80211_CMD_PROBE_CLIENT: Probe an associated station on an AP interface
* by sending a null data frame to it and reporting when the frame is
* acknowledged. This is used to allow timing out inactive clients. Uses
* %NL80211_ATTR_IFINDEX and %NL80211_ATTR_MAC. The command returns a
* direct reply with an %NL80211_ATTR_COOKIE that is later used to match
* up the event with the request. The event includes the same data and
* has %NL80211_ATTR_ACK set if the frame was ACKed.
*
* @NL80211_CMD_REGISTER_BEACONS: Register this socket to receive beacons from
* other BSSes when any interfaces are in AP mode. This helps implement
* OLBC handling in hostapd. Beacons are reported in %NL80211_CMD_FRAME
* messages. Note that per PHY only one application may register.
*
* @NL80211_CMD_SET_NOACK_MAP: sets a bitmap for the individual TIDs whether
* No Acknowledgement Policy should be applied.
*
* @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels
* independently of the userspace SME, send this event indicating
* %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the
* attributes determining channel width. This indication may also be
* sent when a remotely-initiated switch (e.g., when a STA receives a CSA
* from the remote AP) is completed;
*
* @NL80211_CMD_CH_SWITCH_STARTED_NOTIFY: Notify that a channel switch
* has been started on an interface, regardless of the initiator
* (ie. whether it was requested from a remote device or
* initiated on our own). It indicates that
* %NL80211_ATTR_IFINDEX will be on %NL80211_ATTR_WIPHY_FREQ
* after %NL80211_ATTR_CH_SWITCH_COUNT TBTT's. The userspace may
* decide to react to this indication by requesting other
* interfaces to change channel as well.
*
* @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by
* its %NL80211_ATTR_WDEV identifier. It must have been created with
* %NL80211_CMD_NEW_INTERFACE previously. After it has been started, the
* P2P Device can be used for P2P operations, e.g. remain-on-channel and
* public action frame TX.
* @NL80211_CMD_STOP_P2P_DEVICE: Stop the given P2P Device, identified by
* its %NL80211_ATTR_WDEV identifier.
*
* @NL80211_CMD_CONN_FAILED: connection request to an AP failed; used to
* notify userspace that AP has rejected the connection request from a
* station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON
* is used for this.
*
* @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames
* for IBSS or MESH vif.
*
* @NL80211_CMD_SET_MAC_ACL: sets ACL for MAC address based access control.
* This is to be used with the drivers advertising the support of MAC
* address based access control. List of MAC addresses is passed in
* %NL80211_ATTR_MAC_ADDRS and ACL policy is passed in
* %NL80211_ATTR_ACL_POLICY. Driver will enable ACL with this list, if it
* is not already done. The new list will replace any existing list. Driver
* will clear its ACL when the list of MAC addresses passed is empty. This
* command is used in AP/P2P GO mode. Driver has to make sure to clear its
* ACL list during %NL80211_CMD_STOP_AP.
*
* @NL80211_CMD_RADAR_DETECT: Start a Channel availability check (CAC). Once
* a radar is detected or the channel availability scan (CAC) has finished
* or was aborted, or a radar was detected, usermode will be notified with
* this event. This command is also used to notify userspace about radars
* while operating on this channel.
* %NL80211_ATTR_RADAR_EVENT is used to inform about the type of the
* event.
*
* @NL80211_CMD_GET_PROTOCOL_FEATURES: Get global nl80211 protocol features,
* i.e. features for the nl80211 protocol rather than device features.
* Returns the features in the %NL80211_ATTR_PROTOCOL_FEATURES bitmap.
*
* @NL80211_CMD_UPDATE_FT_IES: Pass down the most up-to-date Fast Transition
* Information Element to the WLAN driver
*
* @NL80211_CMD_FT_EVENT: Send a Fast transition event from the WLAN driver
* to the supplicant. This will carry the target AP's MAC address along
* with the relevant Information Elements. This event is used to report
* received FT IEs (MDIE, FTIE, RSN IE, TIE, RICIE).
*
* @NL80211_CMD_CRIT_PROTOCOL_START: Indicates user-space will start running
* a critical protocol that needs more reliability in the connection to
* complete.
*
* @NL80211_CMD_CRIT_PROTOCOL_STOP: Indicates the connection reliability can
* return back to normal.
*
* @NL80211_CMD_GET_COALESCE: Get currently supported coalesce rules.
* @NL80211_CMD_SET_COALESCE: Configure coalesce rules or clear existing rules.
*
* @NL80211_CMD_CHANNEL_SWITCH: Perform a channel switch by announcing the
* new channel information (Channel Switch Announcement - CSA)
* in the beacon for some time (as defined in the
* %NL80211_ATTR_CH_SWITCH_COUNT parameter) and then change to the
* new channel. Userspace provides the new channel information (using
* %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel
* width). %NL80211_ATTR_CH_SWITCH_BLOCK_TX may be supplied to inform
* other station that transmission must be blocked until the channel
* switch is complete.
*
* @NL80211_CMD_VENDOR: Vendor-specified command/event. The command is specified
* by the %NL80211_ATTR_VENDOR_ID attribute and a sub-command in
* %NL80211_ATTR_VENDOR_SUBCMD. Parameter(s) can be transported in
* %NL80211_ATTR_VENDOR_DATA.
* For feature advertisement, the %NL80211_ATTR_VENDOR_DATA attribute is
* used in the wiphy data as a nested attribute containing descriptions
* (&struct nl80211_vendor_cmd_info) of the supported vendor commands.
* This may also be sent as an event with the same attributes.
*
* @NL80211_CMD_SET_QOS_MAP: Set Interworking QoS mapping for IP DSCP values.
* The QoS mapping information is included in %NL80211_ATTR_QOS_MAP. If
* that attribute is not included, QoS mapping is disabled. Since this
* QoS mapping is relevant for IP packets, it is only valid during an
* association. This is cleared on disassociation and AP restart.
*
* @NL80211_CMD_ADD_TX_TS: Ask the kernel to add a traffic stream for the given
* %NL80211_ATTR_TSID and %NL80211_ATTR_MAC with %NL80211_ATTR_USER_PRIO
* and %NL80211_ATTR_ADMITTED_TIME parameters.
* Note that the action frame handshake with the AP shall be handled by
* userspace via the normal management RX/TX framework, this only sets
* up the TX TS in the driver/device.
* If the admitted time attribute is not added then the request just checks
* if a subsequent setup could be successful, the intent is to use this to
* avoid setting up a session with the AP when local restrictions would
* make that impossible. However, the subsequent "real" setup may still
* fail even if the check was successful.
* @NL80211_CMD_DEL_TX_TS: Remove an existing TS with the %NL80211_ATTR_TSID
* and %NL80211_ATTR_MAC parameters. It isn't necessary to call this
* before removing a station entry entirely, or before disassociating
* or similar, cleanup will happen in the driver/device in this case.
*
* @NL80211_CMD_GET_MPP: Get mesh path attributes for mesh proxy path to
* destination %NL80211_ATTR_MAC on the interface identified by
* %NL80211_ATTR_IFINDEX.
*
* @NL80211_CMD_JOIN_OCB: Join the OCB network. The center frequency and
* bandwidth of a channel must be given.
* @NL80211_CMD_LEAVE_OCB: Leave the OCB network -- no special arguments, the
* network is determined by the network interface.
*
* @NL80211_CMD_TDLS_CHANNEL_SWITCH: Start channel-switching with a TDLS peer,
* identified by the %NL80211_ATTR_MAC parameter. A target channel is
* provided via %NL80211_ATTR_WIPHY_FREQ and other attributes determining
* channel width/type. The target operating class is given via
* %NL80211_ATTR_OPER_CLASS.
* The driver is responsible for continually initiating channel-switching
* operations and returning to the base channel for communication with the
* AP.
* @NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH: Stop channel-switching with a TDLS
* peer given by %NL80211_ATTR_MAC. Both peers must be on the base channel
* when this command completes.
*
* @NL80211_CMD_WIPHY_REG_CHANGE: Similar to %NL80211_CMD_REG_CHANGE, but used
* as an event to indicate changes for devices with wiphy-specific regdom
* management.
*
* @NL80211_CMD_ABORT_SCAN: Stop an ongoing scan. Returns -ENOENT if a scan is
* not running. The driver indicates the status of the scan through
* cfg80211_scan_done().
*
* @NL80211_CMD_START_NAN: Start NAN operation, identified by its
* %NL80211_ATTR_WDEV interface. This interface must have been
* previously created with %NL80211_CMD_NEW_INTERFACE. After it
* has been started, the NAN interface will create or join a
* cluster. This command must have a valid
* %NL80211_ATTR_NAN_MASTER_PREF attribute and optional
* %NL80211_ATTR_BANDS attributes. If %NL80211_ATTR_BANDS is
* omitted or set to 0, it means don't-care and the device will
* decide what to use. Additional cluster configuration may be
* optionally provided with %NL80211_ATTR_NAN_CONFIG.
* After this command NAN functions can be added.
* @NL80211_CMD_STOP_NAN: Stop the NAN operation, identified by
* its %NL80211_ATTR_WDEV interface.
* @NL80211_CMD_ADD_NAN_FUNCTION: Add a NAN function. The function is defined
* with %NL80211_ATTR_NAN_FUNC nested attribute. When called, this
* operation returns the strictly positive and unique instance id
* (%NL80211_ATTR_NAN_FUNC_INST_ID) and a cookie (%NL80211_ATTR_COOKIE)
* of the function upon success.
* Since instance ID's can be re-used, this cookie is the right
* way to identify the function. This will avoid races when a termination
* event is handled by the user space after it has already added a new
* function that got the same instance id from the kernel as the one
* which just terminated.
* This cookie may be used in NAN events even before the command
* returns, so userspace shouldn't process NAN events until it processes
* the response to this command.
* Look at %NL80211_ATTR_SOCKET_OWNER as well.
* @NL80211_CMD_DEL_NAN_FUNCTION: Delete a NAN function by cookie.
* This command is also used as a notification sent when a NAN function is
* terminated. This will contain a %NL80211_ATTR_NAN_FUNC_INST_ID
* and %NL80211_ATTR_COOKIE attributes.
* @NL80211_CMD_CHANGE_NAN_CONFIG: Change current NAN
* configuration. NAN must be operational (%NL80211_CMD_START_NAN
* was executed). It must contain at least one of the following
* attributes: %NL80211_ATTR_NAN_MASTER_PREF,
* %NL80211_ATTR_BANDS. If %NL80211_ATTR_BANDS is omitted, the
* current configuration is not changed. If it is present but
* set to zero, the configuration is changed to don't-care
* (i.e. the device can decide what to do).
* Additional parameters may be provided with
* %NL80211_ATTR_NAN_CONFIG. User space should provide all previously
* configured nested attributes under %NL80211_ATTR_NAN_CONFIG, even if
* only a subset was changed.
* @NL80211_CMD_NAN_MATCH: Notification sent when a match is reported.
* This will contain a %NL80211_ATTR_NAN_MATCH nested attribute and
* %NL80211_ATTR_COOKIE.
*
* @NL80211_CMD_UPDATE_CONNECT_PARAMS: Update one or more connect parameters
* for subsequent roaming cases if the driver or firmware uses internal
* BSS selection. This command can be issued only while connected and it
* does not result in a change for the current association. Currently,
* only the %NL80211_ATTR_IE data is used and updated with this command.
*
* @NL80211_CMD_SET_PMK: For offloaded 4-Way handshake, set the PMK or PMK-R0
* for the given authenticator address (specified with %NL80211_ATTR_MAC).
* When %NL80211_ATTR_PMKR0_NAME is set, %NL80211_ATTR_PMK specifies the
* PMK-R0, otherwise it specifies the PMK.
* @NL80211_CMD_DEL_PMK: For offloaded 4-Way handshake, delete the previously
* configured PMK for the authenticator address identified by
* %NL80211_ATTR_MAC.
* @NL80211_CMD_PORT_AUTHORIZED: An event that indicates port is authorized and
* open for regular data traffic. For STA/P2P-client, this event is sent
* with AP MAC address and for AP/P2P-GO, the event carries the STA/P2P-
* client MAC address.
* Drivers that support 4 way handshake offload should send this event for
* STA/P2P-client after successful 4-way HS or after 802.1X FT following
* NL80211_CMD_CONNECT or NL80211_CMD_ROAM. Drivers using AP/P2P-GO 4-way
* handshake offload should send this event on successful completion of
* 4-way handshake with the peer (STA/P2P-client).
* @NL80211_CMD_CONTROL_PORT_FRAME: Control Port (e.g. PAE) frame TX request
* and RX notification. This command is used both as a request to transmit
* a control port frame and as a notification that a control port frame
* has been received. %NL80211_ATTR_FRAME is used to specify the
* frame contents. The frame is the raw EAPoL data, without ethernet or
* 802.11 headers.
* For an MLD transmitter, the %NL80211_ATTR_MLO_LINK_ID may be given and
* its effect will depend on the destination: If the destination is known
* to be an MLD, this will be used as a hint to select the link to transmit
* the frame on. If the destination is not an MLD, this will select both
* the link to transmit on and the source address will be set to the link
* address of that link.
* When used as an event indication %NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
* %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT and %NL80211_ATTR_MAC are added
* indicating the protocol type of the received frame; whether the frame
* was received unencrypted and the MAC address of the peer respectively.
*
* @NL80211_CMD_RELOAD_REGDB: Request that the regdb firmware file is reloaded.
*
* @NL80211_CMD_EXTERNAL_AUTH: This interface is exclusively defined for host
* drivers that do not define separate commands for authentication and
* association, but rely on user space for the authentication to happen.
* This interface acts both as the event request (driver to user space)
* to trigger the authentication and command response (userspace to
* driver) to indicate the authentication status.
*
* User space uses the %NL80211_CMD_CONNECT command to the host driver to
* trigger a connection. The host driver selects a BSS and further uses
* this interface to offload only the authentication part to the user
* space. Authentication frames are passed between the driver and user
* space through the %NL80211_CMD_FRAME interface. Host driver proceeds
* further with the association after getting successful authentication
* status. User space indicates the authentication status through
* %NL80211_ATTR_STATUS_CODE attribute in %NL80211_CMD_EXTERNAL_AUTH
* command interface.
*
* Host driver sends MLD address of the AP with %NL80211_ATTR_MLD_ADDR in
* %NL80211_CMD_EXTERNAL_AUTH event to indicate user space to enable MLO
* during the authentication offload in STA mode while connecting to MLD
* APs. Host driver should check %NL80211_ATTR_MLO_SUPPORT flag capability
* in %NL80211_CMD_CONNECT to know whether the user space supports enabling
* MLO during the authentication offload or not.
* User space should enable MLO during the authentication only when it
* receives the AP MLD address in authentication offload request. User
* space shouldn't enable MLO when the authentication offload request
* doesn't indicate the AP MLD address even if the AP is MLO capable.
* User space should use %NL80211_ATTR_MLD_ADDR as peer's MLD address and
* interface address identified by %NL80211_ATTR_IFINDEX as self MLD
* address. User space and host driver to use MLD addresses in RA, TA and
* BSSID fields of the frames between them, and host driver translates the
* MLD addresses to/from link addresses based on the link chosen for the
* authentication.
*
* Host driver reports this status on an authentication failure to the
* user space through the connect result as the user space would have
* initiated the connection through the connect request.
*
* @NL80211_CMD_STA_OPMODE_CHANGED: An event that notify station's
* ht opmode or vht opmode changes using any of %NL80211_ATTR_SMPS_MODE,
* %NL80211_ATTR_CHANNEL_WIDTH,%NL80211_ATTR_NSS attributes with its
* address(specified in %NL80211_ATTR_MAC).
*
* @NL80211_CMD_GET_FTM_RESPONDER_STATS: Retrieve FTM responder statistics, in
* the %NL80211_ATTR_FTM_RESPONDER_STATS attribute.
*
* @NL80211_CMD_PEER_MEASUREMENT_START: start a (set of) peer measurement(s)
* with the given parameters, which are encapsulated in the nested
* %NL80211_ATTR_PEER_MEASUREMENTS attribute. Optionally, MAC address
* randomization may be enabled and configured by specifying the
* %NL80211_ATTR_MAC and %NL80211_ATTR_MAC_MASK attributes.
* If a timeout is requested, use the %NL80211_ATTR_TIMEOUT attribute.
* A u64 cookie for further %NL80211_ATTR_COOKIE use is returned in
* the netlink extended ack message.
*
* To cancel a measurement, close the socket that requested it.
*
* Measurement results are reported to the socket that requested the
* measurement using @NL80211_CMD_PEER_MEASUREMENT_RESULT when they
* become available, so applications must ensure a large enough socket
* buffer size.
*
* Depending on driver support it may or may not be possible to start
* multiple concurrent measurements.
* @NL80211_CMD_PEER_MEASUREMENT_RESULT: This command number is used for the
* result notification from the driver to the requesting socket.
* @NL80211_CMD_PEER_MEASUREMENT_COMPLETE: Notification only, indicating that
* the measurement completed, using the measurement cookie
* (%NL80211_ATTR_COOKIE).
*
* @NL80211_CMD_NOTIFY_RADAR: Notify the kernel that a radar signal was
* detected and reported by a neighboring device on the channel
* indicated by %NL80211_ATTR_WIPHY_FREQ and other attributes
* determining the width and type.
*
* @NL80211_CMD_UPDATE_OWE_INFO: This interface allows the host driver to
* offload OWE processing to user space. This intends to support
* OWE AKM by the host drivers that implement SME but rely
* on the user space for the cryptographic/DH IE processing in AP mode.
*
* @NL80211_CMD_PROBE_MESH_LINK: The requirement for mesh link metric
* refreshing, is that from one mesh point we be able to send some data
* frames to other mesh points which are not currently selected as a
* primary traffic path, but which are only 1 hop away. The absence of
* the primary path to the chosen node makes it necessary to apply some
* form of marking on a chosen packet stream so that the packets can be
* properly steered to the selected node for testing, and not by the
* regular mesh path lookup. Further, the packets must be of type data
* so that the rate control (often embedded in firmware) is used for
* rate selection.
*
* Here attribute %NL80211_ATTR_MAC is used to specify connected mesh
* peer MAC address and %NL80211_ATTR_FRAME is used to specify the frame
* content. The frame is ethernet data.
*
* @NL80211_CMD_SET_TID_CONFIG: Data frame TID specific configuration
* is passed using %NL80211_ATTR_TID_CONFIG attribute.
*
* @NL80211_CMD_UNPROT_BEACON: Unprotected or incorrectly protected Beacon
* frame. This event is used to indicate that a received Beacon frame was
* dropped because it did not include a valid MME MIC while beacon
* protection was enabled (BIGTK configured in station mode).
*
* @NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS: Report TX status of a control
* port frame transmitted with %NL80211_CMD_CONTROL_PORT_FRAME.
* %NL80211_ATTR_COOKIE identifies the TX command and %NL80211_ATTR_FRAME
* includes the contents of the frame. %NL80211_ATTR_ACK flag is included
* if the recipient acknowledged the frame.
*
* @NL80211_CMD_SET_SAR_SPECS: SAR power limitation configuration is
* passed using %NL80211_ATTR_SAR_SPEC. %NL80211_ATTR_WIPHY is used to
* specify the wiphy index to be applied to.
*
* @NL80211_CMD_OBSS_COLOR_COLLISION: This notification is sent out whenever
* mac80211/drv detects a bss color collision.
*
* @NL80211_CMD_COLOR_CHANGE_REQUEST: This command is used to indicate that
* userspace wants to change the BSS color.
*
* @NL80211_CMD_COLOR_CHANGE_STARTED: Notify userland, that a color change has
* started
*
* @NL80211_CMD_COLOR_CHANGE_ABORTED: Notify userland, that the color change has
* been aborted
*
* @NL80211_CMD_COLOR_CHANGE_COMPLETED: Notify userland that the color change
* has completed
*
* @NL80211_CMD_SET_FILS_AAD: Set FILS AAD data to the driver using -
* &NL80211_ATTR_MAC - for STA MAC address
* &NL80211_ATTR_FILS_KEK - for KEK
* &NL80211_ATTR_FILS_NONCES - for FILS Nonces
* (STA Nonce 16 bytes followed by AP Nonce 16 bytes)
*
* @NL80211_CMD_ASSOC_COMEBACK: notification about an association
* temporal rejection with comeback. The event includes %NL80211_ATTR_MAC
* to describe the BSSID address of the AP and %NL80211_ATTR_TIMEOUT to
* specify the timeout value.
*
* @NL80211_CMD_ADD_LINK: Add a new link to an interface. The
* %NL80211_ATTR_MLO_LINK_ID attribute is used for the new link.
* @NL80211_CMD_REMOVE_LINK: Remove a link from an interface. This may come
* without %NL80211_ATTR_MLO_LINK_ID as an easy way to remove all links
* in preparation for e.g. roaming to a regular (non-MLO) AP.
*
* @NL80211_CMD_ADD_LINK_STA: Add a link to an MLD station
* @NL80211_CMD_MODIFY_LINK_STA: Modify a link of an MLD station
* @NL80211_CMD_REMOVE_LINK_STA: Remove a link of an MLD station
*
* @NL80211_CMD_SET_HW_TIMESTAMP: Enable/disable HW timestamping of Timing
* measurement and Fine timing measurement frames. If %NL80211_ATTR_MAC
* is included, enable/disable HW timestamping only for frames to/from the
* specified MAC address. Otherwise enable/disable HW timestamping for
* all TM/FTM frames (including ones that were enabled with specific MAC
* address). If %NL80211_ATTR_HW_TIMESTAMP_ENABLED is not included, disable
* HW timestamping.
* The number of peers that HW timestamping can be enabled for concurrently
* is indicated by %NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS.
*
* @NL80211_CMD_LINKS_REMOVED: Notify userspace about the removal of STA MLD
* setup links due to AP MLD removing the corresponding affiliated APs with
* Multi-Link reconfiguration. %NL80211_ATTR_MLO_LINKS is used to provide
* information about the removed STA MLD setup links.
*
* @NL80211_CMD_SET_TID_TO_LINK_MAPPING: Set the TID to Link Mapping for a
* non-AP MLD station. The %NL80211_ATTR_MLO_TTLM_DLINK and
* %NL80211_ATTR_MLO_TTLM_ULINK attributes are used to specify the
* TID to Link mapping for downlink/uplink traffic.
*
* @NL80211_CMD_ASSOC_MLO_RECONF: For a non-AP MLD station, request to
* add/remove links to/from the association. To indicate link
* reconfiguration request results from the driver, this command is also
* used as an event to notify userspace about the added links information.
* For notifying the removed links information, the existing
* %NL80211_CMD_LINKS_REMOVED command is used. This command is also used to
* notify userspace about newly added links for the current connection in
* case of AP-initiated link recommendation requests, received via
* a BTM (BSS Transition Management) request or a link reconfig notify
* frame, where the driver handles the link recommendation offload.
*
* @NL80211_CMD_EPCS_CFG: EPCS configuration for a station. Used by userland to
* control EPCS configuration. Used to notify userland on the current state
* of EPCS.
*
* @NL80211_CMD_NAN_NEXT_DW_NOTIFICATION: This command is used to notify
* user space about the next NAN Discovery Window (DW). User space may use
* it to prepare frames to be sent in the next DW.
* %NL80211_ATTR_WIPHY_FREQ is used to indicate the frequency of the next
* DW. SDF transmission should be requested with %NL80211_CMD_FRAME and
* the device/driver shall take care of the actual transmission timing.
* This notification is only sent to the NAN interface owning socket
* (see %NL80211_ATTR_SOCKET_OWNER flag).
* @NL80211_CMD_NAN_CLUSTER_JOINED: This command is used to notify
* user space that the NAN new cluster has been joined. The cluster ID is
* indicated by %NL80211_ATTR_MAC.
*
* @NL80211_CMD_MAX: highest used command number
* @__NL80211_CMD_AFTER_LAST: internal use
*/
enum nl80211_commands {
/* don't change the order or add anything between, this is ABI! */
NL80211_CMD_UNSPEC,
NL80211_CMD_GET_WIPHY, /* can dump */
NL80211_CMD_SET_WIPHY,
NL80211_CMD_NEW_WIPHY,
NL80211_CMD_DEL_WIPHY,
NL80211_CMD_GET_INTERFACE, /* can dump */
NL80211_CMD_SET_INTERFACE,
NL80211_CMD_NEW_INTERFACE,
NL80211_CMD_DEL_INTERFACE,
NL80211_CMD_GET_KEY,
NL80211_CMD_SET_KEY,
NL80211_CMD_NEW_KEY,
NL80211_CMD_DEL_KEY,
NL80211_CMD_GET_BEACON,
NL80211_CMD_SET_BEACON,
NL80211_CMD_START_AP,
NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP,
NL80211_CMD_STOP_AP,
NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP,
NL80211_CMD_GET_STATION,
NL80211_CMD_SET_STATION,
NL80211_CMD_NEW_STATION,
NL80211_CMD_DEL_STATION,
NL80211_CMD_GET_MPATH,
NL80211_CMD_SET_MPATH,
NL80211_CMD_NEW_MPATH,
NL80211_CMD_DEL_MPATH,
NL80211_CMD_SET_BSS,
NL80211_CMD_SET_REG,
NL80211_CMD_REQ_SET_REG,
NL80211_CMD_GET_MESH_CONFIG,
NL80211_CMD_SET_MESH_CONFIG,
NL80211_CMD_SET_MGMT_EXTRA_IE /* reserved; not used */,
NL80211_CMD_GET_REG,
NL80211_CMD_GET_SCAN,
NL80211_CMD_TRIGGER_SCAN,
NL80211_CMD_NEW_SCAN_RESULTS,
NL80211_CMD_SCAN_ABORTED,
NL80211_CMD_REG_CHANGE,
NL80211_CMD_AUTHENTICATE,
NL80211_CMD_ASSOCIATE,
NL80211_CMD_DEAUTHENTICATE,
NL80211_CMD_DISASSOCIATE,
NL80211_CMD_MICHAEL_MIC_FAILURE,
NL80211_CMD_REG_BEACON_HINT,
NL80211_CMD_JOIN_IBSS,
NL80211_CMD_LEAVE_IBSS,
NL80211_CMD_TESTMODE,
NL80211_CMD_CONNECT,
NL80211_CMD_ROAM,
NL80211_CMD_DISCONNECT,
NL80211_CMD_SET_WIPHY_NETNS,
NL80211_CMD_GET_SURVEY,
NL80211_CMD_NEW_SURVEY_RESULTS,
NL80211_CMD_SET_PMKSA,
NL80211_CMD_DEL_PMKSA,
NL80211_CMD_FLUSH_PMKSA,
NL80211_CMD_REMAIN_ON_CHANNEL,
NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL,
NL80211_CMD_SET_TX_BITRATE_MASK,
NL80211_CMD_REGISTER_FRAME,
NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
NL80211_CMD_FRAME,
NL80211_CMD_ACTION = NL80211_CMD_FRAME,
NL80211_CMD_FRAME_TX_STATUS,
NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
NL80211_CMD_SET_POWER_SAVE,
NL80211_CMD_GET_POWER_SAVE,
NL80211_CMD_SET_CQM,
NL80211_CMD_NOTIFY_CQM,
NL80211_CMD_SET_CHANNEL,
NL80211_CMD_SET_WDS_PEER,
NL80211_CMD_FRAME_WAIT_CANCEL,
NL80211_CMD_JOIN_MESH,
NL80211_CMD_LEAVE_MESH,
NL80211_CMD_UNPROT_DEAUTHENTICATE,
NL80211_CMD_UNPROT_DISASSOCIATE,
NL80211_CMD_NEW_PEER_CANDIDATE,
NL80211_CMD_GET_WOWLAN,
NL80211_CMD_SET_WOWLAN,
NL80211_CMD_START_SCHED_SCAN,
NL80211_CMD_STOP_SCHED_SCAN,
NL80211_CMD_SCHED_SCAN_RESULTS,
NL80211_CMD_SCHED_SCAN_STOPPED,
NL80211_CMD_SET_REKEY_OFFLOAD,
NL80211_CMD_PMKSA_CANDIDATE,
NL80211_CMD_TDLS_OPER,
NL80211_CMD_TDLS_MGMT,
NL80211_CMD_UNEXPECTED_FRAME,
NL80211_CMD_PROBE_CLIENT,
NL80211_CMD_REGISTER_BEACONS,
NL80211_CMD_UNEXPECTED_4ADDR_FRAME,
NL80211_CMD_SET_NOACK_MAP,
NL80211_CMD_CH_SWITCH_NOTIFY,
NL80211_CMD_START_P2P_DEVICE,
NL80211_CMD_STOP_P2P_DEVICE,
NL80211_CMD_CONN_FAILED,
NL80211_CMD_SET_MCAST_RATE,
NL80211_CMD_SET_MAC_ACL,
NL80211_CMD_RADAR_DETECT,
NL80211_CMD_GET_PROTOCOL_FEATURES,
NL80211_CMD_UPDATE_FT_IES,
NL80211_CMD_FT_EVENT,
NL80211_CMD_CRIT_PROTOCOL_START,
NL80211_CMD_CRIT_PROTOCOL_STOP,
NL80211_CMD_GET_COALESCE,
NL80211_CMD_SET_COALESCE,
NL80211_CMD_CHANNEL_SWITCH,
NL80211_CMD_VENDOR,
NL80211_CMD_SET_QOS_MAP,
NL80211_CMD_ADD_TX_TS,
NL80211_CMD_DEL_TX_TS,
NL80211_CMD_GET_MPP,
NL80211_CMD_JOIN_OCB,
NL80211_CMD_LEAVE_OCB,
NL80211_CMD_CH_SWITCH_STARTED_NOTIFY,
NL80211_CMD_TDLS_CHANNEL_SWITCH,
NL80211_CMD_TDLS_CANCEL_CHANNEL_SWITCH,
NL80211_CMD_WIPHY_REG_CHANGE,
NL80211_CMD_ABORT_SCAN,
NL80211_CMD_START_NAN,
NL80211_CMD_STOP_NAN,
NL80211_CMD_ADD_NAN_FUNCTION,
NL80211_CMD_DEL_NAN_FUNCTION,
NL80211_CMD_CHANGE_NAN_CONFIG,
NL80211_CMD_NAN_MATCH,
NL80211_CMD_SET_MULTICAST_TO_UNICAST,
NL80211_CMD_UPDATE_CONNECT_PARAMS,
NL80211_CMD_SET_PMK,
NL80211_CMD_DEL_PMK,
NL80211_CMD_PORT_AUTHORIZED,
NL80211_CMD_RELOAD_REGDB,
NL80211_CMD_EXTERNAL_AUTH,
NL80211_CMD_STA_OPMODE_CHANGED,
NL80211_CMD_CONTROL_PORT_FRAME,
NL80211_CMD_GET_FTM_RESPONDER_STATS,
NL80211_CMD_PEER_MEASUREMENT_START,
NL80211_CMD_PEER_MEASUREMENT_RESULT,
NL80211_CMD_PEER_MEASUREMENT_COMPLETE,
NL80211_CMD_NOTIFY_RADAR,
NL80211_CMD_UPDATE_OWE_INFO,
NL80211_CMD_PROBE_MESH_LINK,
NL80211_CMD_SET_TID_CONFIG,
NL80211_CMD_UNPROT_BEACON,
NL80211_CMD_CONTROL_PORT_FRAME_TX_STATUS,
NL80211_CMD_SET_SAR_SPECS,
NL80211_CMD_OBSS_COLOR_COLLISION,
NL80211_CMD_COLOR_CHANGE_REQUEST,
NL80211_CMD_COLOR_CHANGE_STARTED,
NL80211_CMD_COLOR_CHANGE_ABORTED,
NL80211_CMD_COLOR_CHANGE_COMPLETED,
NL80211_CMD_SET_FILS_AAD,
NL80211_CMD_ASSOC_COMEBACK,
NL80211_CMD_ADD_LINK,
NL80211_CMD_REMOVE_LINK,
NL80211_CMD_ADD_LINK_STA,
NL80211_CMD_MODIFY_LINK_STA,
NL80211_CMD_REMOVE_LINK_STA,
NL80211_CMD_SET_HW_TIMESTAMP,
NL80211_CMD_LINKS_REMOVED,
NL80211_CMD_SET_TID_TO_LINK_MAPPING,
NL80211_CMD_ASSOC_MLO_RECONF,
NL80211_CMD_EPCS_CFG,
NL80211_CMD_NAN_NEXT_DW_NOTIFICATION,
NL80211_CMD_NAN_CLUSTER_JOINED,
/* add new commands above here */
/* used to define NL80211_CMD_MAX below */
__NL80211_CMD_AFTER_LAST,
NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
};
/*
* Allow user space programs to use #ifdef on new commands by defining them
* here
*/
#define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS
#define NL80211_CMD_SET_MGMT_EXTRA_IE NL80211_CMD_SET_MGMT_EXTRA_IE
#define NL80211_CMD_REG_CHANGE NL80211_CMD_REG_CHANGE
#define NL80211_CMD_AUTHENTICATE NL80211_CMD_AUTHENTICATE
#define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE
#define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE
#define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE
#define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
/* source-level API compatibility */
#define NL80211_CMD_GET_MESH_PARAMS NL80211_CMD_GET_MESH_CONFIG
#define NL80211_CMD_SET_MESH_PARAMS NL80211_CMD_SET_MESH_CONFIG
#define NL80211_MESH_SETUP_VENDOR_PATH_SEL_IE NL80211_MESH_SETUP_IE
/**
* enum nl80211_attrs - nl80211 netlink attributes
*
* @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
*
* @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
* /sys/class/ieee80211//index
* @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
* @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters
* @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz,
* defines the channel together with the (deprecated)
* %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes
* %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1
* and %NL80211_ATTR_CENTER_FREQ2
* @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values
* of &enum nl80211_chan_width, describing the channel width. See the
* documentation of the enum for more information.
* @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the
* channel, used for anything but 20 MHz bandwidth. In S1G this is the
* operating channel center frequency.
* @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the
* channel, used only for 80+80 MHz bandwidth
* @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ
* if HT20 or HT40 are to be used (i.e., HT disabled if not included):
* NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including
* this attribute)
* NL80211_CHAN_HT20 = HT20 only
* NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel
* NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel
* This attribute is now deprecated.
* @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is
* less than or equal to the RTS threshold; allowed range: 1..255;
* dot11ShortRetryLimit; u8
* @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is
* greater than the RTS threshold; allowed range: 1..255;
* dot11ShortLongLimit; u8
* @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum
* length in octets for frames; allowed range: 256..8000, disable
* fragmentation with (u32)-1; dot11FragmentationThreshold; u32
* @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length
* larger than or equal to this use RTS/CTS handshake); allowed range:
* 0..65536, disable with (u32)-1; dot11RTSThreshold; u32
* @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11
* section 7.3.2.9; dot11CoverageClass; u8
*
* @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
* @NL80211_ATTR_IFNAME: network interface name
* @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
*
* @NL80211_ATTR_WDEV: wireless device identifier, used for pseudo-devices
* that don't have a netdev (u64)
*
* @NL80211_ATTR_MAC: MAC address (various uses)
*
* @NL80211_ATTR_KEY_DATA: (temporal) key data; for TKIP this consists of
* 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
* keys
* @NL80211_ATTR_KEY_IDX: key ID (u8, 0-3)
* @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
* section 7.3.2.25.1, e.g. 0x000FAC04)
* @NL80211_ATTR_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
* CCMP keys, each six bytes in little endian
* @NL80211_ATTR_KEY_DEFAULT: Flag attribute indicating the key is default key
* @NL80211_ATTR_KEY_DEFAULT_MGMT: Flag attribute indicating the key is the
* default management key
* @NL80211_ATTR_CIPHER_SUITES_PAIRWISE: For crypto settings for connect or
* other commands, indicates which pairwise cipher suites are used
* @NL80211_ATTR_CIPHER_SUITE_GROUP: For crypto settings for connect or
* other commands, indicates which group cipher suite is used
*
* @NL80211_ATTR_BEACON_INTERVAL: beacon interval in TU
* @NL80211_ATTR_DTIM_PERIOD: DTIM period for beaconing
* @NL80211_ATTR_BEACON_HEAD: portion of the beacon before the TIM IE
* @NL80211_ATTR_BEACON_TAIL: portion of the beacon after the TIM IE
*
* @NL80211_ATTR_STA_AID: Association ID for the station (u16)
* @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of
* &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2)
* @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by
* IEEE 802.11 7.3.1.6 (u16).
* @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported
* rates as defined by IEEE 802.11 7.3.2.2 but without the length
* restriction (at most %NL80211_MAX_SUPP_RATES).
* @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station
* to, or the AP interface the station was originally added to.
* @NL80211_ATTR_STA_INFO: information about a station, part of station info
* given for %NL80211_CMD_GET_STATION, nested attribute containing
* info as possible, see &enum nl80211_sta_info.
*
* @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
* consisting of a nested array.
*
* @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes).
* @NL80211_ATTR_STA_PLINK_ACTION: action to perform on the mesh peer link
* (see &enum nl80211_plink_action).
* @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path.
* @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path
* info given for %NL80211_CMD_GET_MPATH, nested attribute described at
* &enum nl80211_mpath_info.
*
* @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
* &enum nl80211_mntr_flags.
*
* @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the
* current regulatory domain should be set to or is already set to.
* For example, 'CR', for Costa Rica. This attribute is used by the kernel
* to query the CRDA to retrieve one regulatory domain. This attribute can
* also be used by userspace to query the kernel for the currently set
* regulatory domain. We chose an alpha2 as that is also used by the
* IEEE-802.11 country information element to identify a country.
* Users can also simply ask the wireless core to set regulatory domain
* to a specific alpha2.
* @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory
* rules.
*
* @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1)
* @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled
* (u8, 0 or 1)
* @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled
* (u8, 0 or 1)
* @NL80211_ATTR_BSS_BASIC_RATES: basic rates, array of basic
* rates in format defined by IEEE 802.11 7.3.2.2 but without the length
* restriction (at most %NL80211_MAX_SUPP_RATES).
*
* @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION)
*
* @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all
* supported interface types, each a flag attribute with the number
* of the interface mode.
*
* @NL80211_ATTR_MGMT_SUBTYPE: Management frame subtype for
* %NL80211_CMD_SET_MGMT_EXTRA_IE.
*
* @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
* %NL80211_CMD_SET_MGMT_EXTRA_IE).
*
* @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
* a single scan request, a wiphy attribute.
* @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
* scan with a single scheduled scan request, a wiphy attribute.
* @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
* that can be added to a scan request
* @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
* elements that can be added to a scheduled scan request
* @NL80211_ATTR_MAX_MATCH_SETS: maximum number of sets that can be
* used with @NL80211_ATTR_SCHED_SCAN_MATCH, a wiphy attribute.
*
* @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
* @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
* scanning and include a zero-length SSID (wildcard) for wildcard scan
* @NL80211_ATTR_BSS: scan result BSS
*
* @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain
* currently in effect. This could be any of the %NL80211_REGDOM_SET_BY_*
* @NL80211_ATTR_REG_TYPE: indicates the type of the regulatory domain currently
* set. This can be one of the nl80211_reg_type (%NL80211_REGDOM_TYPE_*)
*
* @NL80211_ATTR_SUPPORTED_COMMANDS: wiphy attribute that specifies
* an array of command numbers (i.e. a mapping index to command number)
* that the driver for the given wiphy supports.
*
* @NL80211_ATTR_FRAME: frame data (binary attribute), including frame header
* and body, but not FCS; used, e.g., with NL80211_CMD_AUTHENTICATE and
* NL80211_CMD_ASSOCIATE events
* @NL80211_ATTR_SSID: SSID (binary attribute, 0..32 octets)
* @NL80211_ATTR_AUTH_TYPE: AuthenticationType, see &enum nl80211_auth_type,
* represented as a u32
* @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and
* %NL80211_CMD_DISASSOCIATE, u16
*
* @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as
* a u32
*
* @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change
* due to considerations from a beacon hint. This attribute reflects
* the state of the channel _before_ the beacon hint processing. This
* attributes consists of a nested attribute containing
* NL80211_FREQUENCY_ATTR_*
* @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change
* due to considerations from a beacon hint. This attribute reflects
* the state of the channel _after_ the beacon hint processing. This
* attributes consists of a nested attribute containing
* NL80211_FREQUENCY_ATTR_*
*
* @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported
* cipher suites
*
* @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look
* for other networks on different channels
*
* @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this
* is used, e.g., with %NL80211_CMD_AUTHENTICATE event
*
* @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is
* used for the association (&enum nl80211_mfp, represented as a u32);
* this attribute can be used with %NL80211_CMD_ASSOCIATE and
* %NL80211_CMD_CONNECT requests. %NL80211_MFP_OPTIONAL is not allowed for
* %NL80211_CMD_ASSOCIATE since user space SME is expected and hence, it
* must have decided whether to use management frame protection or not.
* Setting %NL80211_MFP_OPTIONAL with a %NL80211_CMD_CONNECT request will
* let the driver (or the firmware) decide whether to use MFP or not.
*
* @NL80211_ATTR_STA_FLAGS2: Attribute containing a
* &struct nl80211_sta_flag_update.
*
* @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls
* IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in
* station mode. If the flag is included in %NL80211_CMD_ASSOCIATE
* request, the driver will assume that the port is unauthorized until
* authorized by user space. Otherwise, port is marked authorized by
* default in station mode.
* @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
* ethertype that will be used for key negotiation. It can be
* specified with the associate and connect commands. If it is not
* specified, the value defaults to 0x888E (PAE, 802.1X). This
* attribute is also used as a flag in the wiphy information to
* indicate that protocols other than PAE are supported.
* @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
* %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
* ethertype frames used for key negotiation must not be encrypted.
* @NL80211_ATTR_CONTROL_PORT_OVER_NL80211: A flag indicating whether control
* port frames (e.g. of type given in %NL80211_ATTR_CONTROL_PORT_ETHERTYPE)
* will be sent directly to the network interface or sent via the NL80211
* socket. If this attribute is missing, then legacy behavior of sending
* control port frames directly to the network interface is used. If the
* flag is included, then control port frames are sent over NL80211 instead
* using %CMD_CONTROL_PORT_FRAME. If control port routing over NL80211 is
* to be used then userspace must also use the %NL80211_ATTR_SOCKET_OWNER
* flag. When used with %NL80211_ATTR_CONTROL_PORT_NO_PREAUTH, pre-auth
* frames are not forwarded over the control port.
*
* @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
* We recommend using nested, driver-specific attributes within this.
*
* @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
* event was due to the AP disconnecting the station, and not due to
* a local disconnect request.
* @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
* event (u16)
* @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
* that protected APs should be used. This is also used with NEW_BEACON to
* indicate that the BSS is to use protection.
*
* @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
* indicate which WPA version(s) the AP we want to associate with is using
* (a u32 with flags from &enum nl80211_wpa_versions).
* @NL80211_ATTR_AKM_SUITES: Used with CONNECT, ASSOCIATE, and NEW_BEACON to
* indicate which key management algorithm(s) to use (an array of u32).
* This attribute is also sent in response to @NL80211_CMD_GET_WIPHY,
* indicating the supported AKM suites, intended for specific drivers which
* implement SME and have constraints on which AKMs are supported and also
* the cases where an AKM support is offloaded to the driver/firmware.
* If there is no such notification from the driver, user space should
* assume the driver supports all the AKM suites.
*
* @NL80211_ATTR_REQ_IE: (Re)association request information elements as
* sent out by the card, for ROAM and successful CONNECT events.
* @NL80211_ATTR_RESP_IE: (Re)association response information elements as
* sent by peer, for ROAM and successful CONNECT events.
*
* @NL80211_ATTR_PREV_BSSID: previous BSSID, to be used in ASSOCIATE and CONNECT
* commands to specify a request to reassociate within an ESS, i.e., to use
* Reassociate Request frame (with the value of this attribute in the
* Current AP address field) instead of Association Request frame which is
* used for the initial association to an ESS.
*
* @NL80211_ATTR_KEY: key information in a nested attribute with
* %NL80211_KEY_* sub-attributes
* @NL80211_ATTR_KEYS: array of keys for static WEP keys for connect()
* and join_ibss(), key information is in a nested attribute each
* with %NL80211_KEY_* sub-attributes
*
* @NL80211_ATTR_PID: Process ID of a network namespace.
* @NL80211_ATTR_NETNS_FD: File descriptor of a network namespace.
*
* @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for
* dumps. This number increases whenever the object list being
* dumped changes, and as such userspace can verify that it has
* obtained a complete and consistent snapshot by verifying that
* all dump messages contain the same generation number. If it
* changed then the list changed and the dump should be repeated
* completely from scratch.
*
* @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface
*
* @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of
* the survey response for %NL80211_CMD_GET_SURVEY, nested attribute
* containing info as possible, see &enum survey_info.
*
* @NL80211_ATTR_PMKID: PMK material for PMKSA caching.
* @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can
* cache, a wiphy attribute.
*
* @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32.
* @NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION: Device attribute that
* specifies the maximum duration that can be requested with the
* remain-on-channel operation, in milliseconds, u32.
*
* @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects.
*
* @NL80211_ATTR_TX_RATES: Nested set of attributes
* (enum nl80211_tx_rate_attributes) describing TX rates per band. The
* enum nl80211_band value is used as the index (nla_type() of the nested
* data. If a band is not included, it will be configured to allow all
* rates based on negotiated supported rates information. This attribute
* is used with %NL80211_CMD_SET_TX_BITRATE_MASK and with starting AP,
* and joining mesh networks (not IBSS yet). In the later case, it must
* specify just a single bitrate, which is to be used for the beacon.
* The driver must also specify support for this with the extended
* features NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
* NL80211_EXT_FEATURE_BEACON_RATE_HT,
* NL80211_EXT_FEATURE_BEACON_RATE_VHT,
* NL80211_EXT_FEATURE_BEACON_RATE_HE and
* NL80211_EXT_FEATURE_BEACON_RATE_EHT.
*
* @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
* at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
* @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
* @NL80211_CMD_REGISTER_FRAME command.
* @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
* nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
* information about which frame types can be transmitted with
* %NL80211_CMD_FRAME.
* @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
* nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
* information about which frame types can be registered for RX.
*
* @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
* acknowledged by the recipient.
* @NL80211_ATTR_ACK_SIGNAL: Station's ack signal strength (s32)
*
* @NL80211_ATTR_PS_STATE: powersave state, using &enum nl80211_ps_state values.
*
* @NL80211_ATTR_CQM: connection quality monitor configuration in a
* nested attribute with %NL80211_ATTR_CQM_* sub-attributes.
*
* @NL80211_ATTR_LOCAL_STATE_CHANGE: Flag attribute to indicate that a command
* is requesting a local authentication/association state change without
* invoking actual management frame exchange. This can be used with
* NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
* NL80211_CMD_DISASSOCIATE.
*
* @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
* connected to this BSS.
*
* @NL80211_ATTR_WIPHY_TX_POWER_SETTING: Transmit power setting type. See
* &enum nl80211_tx_power_setting for possible values.
* @NL80211_ATTR_WIPHY_TX_POWER_LEVEL: Transmit power level in signed mBm units.
* This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING
* for non-automatic settings.
*
* @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly
* means support for per-station GTKs.
*
* @NL80211_ATTR_WIPHY_ANTENNA_TX: Bitmap of allowed antennas for transmitting.
* This can be used to mask out antennas which are not attached or should
* not be used for transmitting. If an antenna is not selected in this
* bitmap the hardware is not allowed to transmit on this antenna.
*
* Each bit represents one antenna, starting with antenna 1 at the first
* bit. Depending on which antennas are selected in the bitmap, 802.11n
* drivers can derive which chainmasks to use (if all antennas belonging to
* a particular chain are disabled this chain should be disabled) and if
* a chain has diversity antennas whether diversity should be used or not.
* HT capabilities (STBC, TX Beamforming, Antenna selection) can be
* derived from the available chains after applying the antenna mask.
* Non-802.11n drivers can derive whether to use diversity or not.
* Drivers may reject configurations or RX/TX mask combinations they cannot
* support by returning -EINVAL.
*
* @NL80211_ATTR_WIPHY_ANTENNA_RX: Bitmap of allowed antennas for receiving.
* This can be used to mask out antennas which are not attached or should
* not be used for receiving. If an antenna is not selected in this bitmap
* the hardware should not be configured to receive on this antenna.
* For a more detailed description see @NL80211_ATTR_WIPHY_ANTENNA_TX.
*
* @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX: Bitmap of antennas which are available
* for configuration as TX antennas via the above parameters.
*
* @NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX: Bitmap of antennas which are available
* for configuration as RX antennas via the above parameters.
*
* @NL80211_ATTR_MCAST_RATE: Multicast tx rate (in 100 kbps) for IBSS
*
* @NL80211_ATTR_OFFCHANNEL_TX_OK: For management frame TX, the frame may be
* transmitted on another channel when the channel given doesn't match
* the current channel. If the current channel doesn't match and this
* flag isn't set, the frame will be rejected. This is also used as an
* nl80211 capability flag.
*
* @NL80211_ATTR_BSS_HT_OPMODE: HT operation mode (u16)
*
* @NL80211_ATTR_KEY_DEFAULT_TYPES: A nested attribute containing flags
* attributes, specifying what a key should be set as default as.
* See &enum nl80211_key_default_types.
*
* @NL80211_ATTR_MESH_SETUP: Optional mesh setup parameters. These cannot be
* changed once the mesh is active.
* @NL80211_ATTR_MESH_CONFIG: Mesh configuration parameters, a nested attribute
* containing attributes from &enum nl80211_meshconf_params.
* @NL80211_ATTR_SUPPORT_MESH_AUTH: Currently, this means the underlying driver
* allows auth frames in a mesh to be passed to userspace for processing via
* the @NL80211_MESH_SETUP_USERSPACE_AUTH flag.
* @NL80211_ATTR_STA_PLINK_STATE: The state of a mesh peer link as defined in
* &enum nl80211_plink_state. Used when userspace is driving the peer link
* management state machine. @NL80211_MESH_SETUP_USERSPACE_AMPE or
* @NL80211_MESH_SETUP_USERSPACE_MPM must be enabled.
*
* @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
* capabilities, the supported WoWLAN triggers
* @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
* indicate which WoW triggers should be enabled. This is also
* used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
* triggers.
*
* @NL80211_ATTR_SCHED_SCAN_INTERVAL: Interval between scheduled scan
* cycles, in msecs.
*
* @NL80211_ATTR_SCHED_SCAN_MATCH: Nested attribute with one or more
* sets of attributes to match during scheduled scans. Only BSSs
* that match any of the sets will be reported. These are
* pass-thru filter rules.
* For a match to succeed, the BSS must match all attributes of a
* set. Since not every hardware supports matching all types of
* attributes, there is no guarantee that the reported BSSs are
* fully complying with the match sets and userspace needs to be
* able to ignore them by itself.
* Thus, the implementation is somewhat hardware-dependent, but
* this is only an optimization and the userspace application
* needs to handle all the non-filtered results anyway.
* If the match attributes don't make sense when combined with
* the values passed in @NL80211_ATTR_SCAN_SSIDS (eg. if an SSID
* is included in the probe request, but the match attributes
* will never let it go through), -EINVAL may be returned.
* If omitted, no filtering is done.
*
* @NL80211_ATTR_INTERFACE_COMBINATIONS: Nested attribute listing the supported
* interface combinations. In each nested item, it contains attributes
* defined in &enum nl80211_if_combination_attrs.
* If the wiphy uses multiple radios (@NL80211_ATTR_WIPHY_RADIOS is set),
* this attribute contains the interface combinations of the first radio.
* See @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS for the global wiphy
* combinations for the sum of all radios.
* @NL80211_ATTR_SOFTWARE_IFTYPES: Nested attribute (just like
* %NL80211_ATTR_SUPPORTED_IFTYPES) containing the interface types that
* are managed in software: interfaces of these types aren't subject to
* any restrictions in their number or combinations.
*
* @NL80211_ATTR_REKEY_DATA: nested attribute containing the information
* necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
*
* @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
* nested array attribute containing an entry for each band, with the entry
* being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
* without the length restriction (at most %NL80211_MAX_SUPP_RATES).
*
* @NL80211_ATTR_HIDDEN_SSID: indicates whether SSID is to be hidden from Beacon
* and Probe Response (when response to wildcard Probe Request); see
* &enum nl80211_hidden_ssid, represented as a u32
*
* @NL80211_ATTR_IE_PROBE_RESP: Information element(s) for Probe Response frame.
* This is used with %NL80211_CMD_NEW_BEACON and %NL80211_CMD_SET_BEACON to
* provide extra IEs (e.g., WPS/P2P IE) into Probe Response frames when the
* driver (or firmware) replies to Probe Request frames.
* @NL80211_ATTR_IE_ASSOC_RESP: Information element(s) for (Re)Association
* Response frames. This is used with %NL80211_CMD_NEW_BEACON and
* %NL80211_CMD_SET_BEACON to provide extra IEs (e.g., WPS/P2P IE) into
* (Re)Association Response frames when the driver (or firmware) replies to
* (Re)Association Request frames.
*
* @NL80211_ATTR_STA_WME: Nested attribute containing the wme configuration
* of the station, see &enum nl80211_sta_wme_attr.
* @NL80211_ATTR_SUPPORT_AP_UAPSD: the device supports uapsd when working
* as AP.
*
* @NL80211_ATTR_ROAM_SUPPORT: Indicates whether the firmware is capable of
* roaming to another AP in the same ESS if the signal lever is low.
*
* @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
* candidate information, see &enum nl80211_pmksa_candidate_attr.
*
* @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
* for management frames transmission. In order to avoid p2p probe/action
* frames are being transmitted at CCK rate in 2GHz band, the user space
* applications use this attribute.
* This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
* %NL80211_CMD_FRAME commands.
*
* @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
* request, link setup confirm, link teardown, etc.). Values are
* described in the TDLS (802.11z) specification.
* @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
* TDLS conversation between two devices.
* @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
* &enum nl80211_tdls_operation, represented as a u8.
* @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
* as a TDLS peer sta.
* @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
* procedures should be performed by sending TDLS packets via
* %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
* used for asking the driver to perform a TDLS operation.
*
* @NL80211_ATTR_DEVICE_AP_SME: This u32 attribute may be listed for devices
* that have AP support to indicate that they have the AP SME integrated
* with support for the features listed in this attribute, see
* &enum nl80211_ap_sme_features.
*
* @NL80211_ATTR_DONT_WAIT_FOR_ACK: Used with %NL80211_CMD_FRAME, this tells
* the driver to not wait for an acknowledgement. Note that due to this,
* it will also not give a status callback nor return a cookie. This is
* mostly useful for probe responses to save airtime.
*
* @NL80211_ATTR_FEATURE_FLAGS: This u32 attribute contains flags from
* &enum nl80211_feature_flags and is advertised in wiphy information.
* @NL80211_ATTR_PROBE_RESP_OFFLOAD: Indicates that the HW responds to probe
* requests while operating in AP-mode.
* This attribute holds a bitmap of the supported protocols for
* offloading (see &enum nl80211_probe_resp_offload_support_attr).
*
* @NL80211_ATTR_PROBE_RESP: Probe Response template data. Contains the entire
* probe-response frame. The DA field in the 802.11 header is zero-ed out,
* to be filled by the FW.
* @NL80211_ATTR_DISABLE_HT: Force HT capable interfaces to disable
* this feature during association. This is a flag attribute.
* Currently only supported in mac80211 drivers.
* @NL80211_ATTR_DISABLE_VHT: Force VHT capable interfaces to disable
* this feature during association. This is a flag attribute.
* Currently only supported in mac80211 drivers.
* @NL80211_ATTR_DISABLE_HE: Force HE capable interfaces to disable
* this feature during association. This is a flag attribute.
* Currently only supported in mac80211 drivers.
* @NL80211_ATTR_DISABLE_EHT: Force EHT capable interfaces to disable
* this feature during association. This is a flag attribute.
* Currently only supported in mac80211 drivers.
* @NL80211_ATTR_HT_CAPABILITY_MASK: Specify which bits of the
* ATTR_HT_CAPABILITY to which attention should be paid.
* Currently, only mac80211 NICs support this feature.
* The values that may be configured are:
* MCS rates, MAX-AMSDU, HT-20-40 and HT_CAP_SGI_40
* AMPDU density and AMPDU factor.
* All values are treated as suggestions and may be ignored
* by the driver as required. The actual values may be seen in
* the station debugfs ht_caps file.
* @NL80211_ATTR_VHT_CAPABILITY_MASK: Specify which bits of the
* ATTR_VHT_CAPABILITY to which attention should be paid.
* Currently, only mac80211 NICs support this feature.
* All values are treated as suggestions and may be ignored
* by the driver as required. The actual values may be seen in
* the station debugfs vht_caps file.
*
* @NL80211_ATTR_DFS_REGION: region for regulatory rules which this country
* abides to when initiating radiation on DFS channels. A country maps
* to one DFS region.
*
* @NL80211_ATTR_NOACK_MAP: This u16 bitmap contains the No Ack Policy of
* up to 16 TIDs.
*
* @NL80211_ATTR_INACTIVITY_TIMEOUT: timeout value in seconds, this can be
* used by the drivers which has MLME in firmware and does not have support
* to report per station tx/rx activity to free up the station entry from
* the list. This needs to be used when the driver advertises the
* capability to timeout the stations.
*
* @NL80211_ATTR_RX_SIGNAL_DBM: signal strength in dBm (as a 32-bit int);
* this attribute is (depending on the driver capabilities) added to
* received frames indicated with %NL80211_CMD_FRAME.
*
* @NL80211_ATTR_BG_SCAN_PERIOD: Background scan period in seconds
* or 0 to disable background scan.
*
* @NL80211_ATTR_USER_REG_HINT_TYPE: type of regulatory hint passed from
* userspace. If unset it is assumed the hint comes directly from
* a user. If set code could specify exactly what type of source
* was used to provide the hint. For the different types of
* allowed user regulatory hints see nl80211_user_reg_hint_type.
*
* @NL80211_ATTR_CONN_FAILED_REASON: The reason for which AP has rejected
* the connection request from a station. nl80211_connect_failed_reason
* enum has different reasons of connection failure.
*
* @NL80211_ATTR_AUTH_DATA: Fields and elements in Authentication frames.
* This contains the authentication frame body (non-IE and IE data),
* excluding the Authentication algorithm number, i.e., starting at the
* Authentication transaction sequence number field. It is used with
* authentication algorithms that need special fields to be added into
* the frames (SAE and FILS). Currently, only the SAE cases use the
* initial two fields (Authentication transaction sequence number and
* Status code). However, those fields are included in the attribute data
* for all authentication algorithms to keep the attribute definition
* consistent.
*
* @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION)
*
* @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32)
*
* @NL80211_ATTR_P2P_CTWINDOW: P2P GO Client Traffic Window (u8), used with
* the START_AP and SET_BSS commands
* @NL80211_ATTR_P2P_OPPPS: P2P GO opportunistic PS (u8), used with the
* START_AP and SET_BSS commands. This can have the values 0 or 1;
* if not given in START_AP 0 is assumed, if not given in SET_BSS
* no change is made.
*
* @NL80211_ATTR_LOCAL_MESH_POWER_MODE: local mesh STA link-specific power mode
* defined in &enum nl80211_mesh_power_mode.
*
* @NL80211_ATTR_ACL_POLICY: ACL policy, see &enum nl80211_acl_policy,
* carried in a u32 attribute
*
* @NL80211_ATTR_MAC_ADDRS: Array of nested MAC addresses, used for
* MAC ACL.
*
* @NL80211_ATTR_MAC_ACL_MAX: u32 attribute to advertise the maximum
* number of MAC addresses that a device can support for MAC
* ACL.
*
* @NL80211_ATTR_RADAR_EVENT: Type of radar event for notification to userspace,
* contains a value of enum nl80211_radar_event (u32).
*
* @NL80211_ATTR_EXT_CAPA: 802.11 extended capabilities that the kernel driver
* has and handles. The format is the same as the IE contents. See
* 802.11-2012 8.4.2.29 for more information.
* @NL80211_ATTR_EXT_CAPA_MASK: Extended capabilities that the kernel driver
* has set in the %NL80211_ATTR_EXT_CAPA value, for multibit fields.
*
* @NL80211_ATTR_STA_CAPABILITY: Station capabilities (u16) are advertised to
* the driver, e.g., to enable TDLS power save (PU-APSD).
*
* @NL80211_ATTR_STA_EXT_CAPABILITY: Station extended capabilities are
* advertised to the driver, e.g., to enable TDLS off channel operations
* and PU-APSD.
*
* @NL80211_ATTR_PROTOCOL_FEATURES: global nl80211 feature flags, see
* &enum nl80211_protocol_features, the attribute is a u32.
*
* @NL80211_ATTR_SPLIT_WIPHY_DUMP: flag attribute, userspace supports
* receiving the data for a single wiphy split across multiple
* messages, given with wiphy dump message
*
* @NL80211_ATTR_MDID: Mobility Domain Identifier
*
* @NL80211_ATTR_IE_RIC: Resource Information Container Information
* Element
*
* @NL80211_ATTR_CRIT_PROT_ID: critical protocol identifier requiring increased
* reliability, see &enum nl80211_crit_proto_id (u16).
* @NL80211_ATTR_MAX_CRIT_PROT_DURATION: duration in milliseconds in which
* the connection should have increased reliability (u16).
*
* @NL80211_ATTR_PEER_AID: Association ID for the peer TDLS station (u16).
* This is similar to @NL80211_ATTR_STA_AID but with a difference of being
* allowed to be used with the first @NL80211_CMD_SET_STATION command to
* update a TDLS peer STA entry. For S1G interfaces, this is limited to
* 1600 for the current mac80211 implementation.
*
* @NL80211_ATTR_COALESCE_RULE: Coalesce rule information.
*
* @NL80211_ATTR_CH_SWITCH_COUNT: u32 attribute specifying the number of TBTT's
* until the channel switch event.
* @NL80211_ATTR_CH_SWITCH_BLOCK_TX: flag attribute specifying that transmission
* must be blocked on the current channel (before the channel switch
* operation). Also included in the channel switch started event if quiet
* was requested by the AP.
* @NL80211_ATTR_CSA_IES: Nested set of attributes containing the IE information
* for the time while performing a channel switch.
* @NL80211_ATTR_CNTDWN_OFFS_BEACON: An array of offsets (u16) to the channel
* switch or color change counters in the beacons tail (%NL80211_ATTR_BEACON_TAIL).
* @NL80211_ATTR_CNTDWN_OFFS_PRESP: An array of offsets (u16) to the channel
* switch or color change counters in the probe response (%NL80211_ATTR_PROBE_RESP).
*
* @NL80211_ATTR_RXMGMT_FLAGS: flags for nl80211_send_mgmt(), u32.
* As specified in the &enum nl80211_rxmgmt_flags.
*
* @NL80211_ATTR_STA_SUPPORTED_CHANNELS: array of supported channels.
*
* @NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES: array of supported
* operating classes.
*
* @NL80211_ATTR_HANDLE_DFS: A flag indicating whether user space
* controls DFS operation in IBSS mode. If the flag is included in
* %NL80211_CMD_JOIN_IBSS request, the driver will allow use of DFS
* channels and reports radar events to userspace. Userspace is required
* to react to radar events, e.g. initiate a channel switch or leave the
* IBSS network.
*
* @NL80211_ATTR_SUPPORT_5_MHZ: A flag indicating that the device supports
* 5 MHz channel bandwidth.
* @NL80211_ATTR_SUPPORT_10_MHZ: A flag indicating that the device supports
* 10 MHz channel bandwidth.
*
* @NL80211_ATTR_OPMODE_NOTIF: Operating mode field from Operating Mode
* Notification Element based on association request when used with
* %NL80211_CMD_NEW_STATION or %NL80211_CMD_SET_STATION (only when
* %NL80211_FEATURE_FULL_AP_CLIENT_STATE is supported, or with TDLS);
* u8 attribute.
*
* @NL80211_ATTR_VENDOR_ID: The vendor ID, either a 24-bit OUI or, if
* %NL80211_VENDOR_ID_IS_LINUX is set, a special Linux ID (not used yet)
* @NL80211_ATTR_VENDOR_SUBCMD: vendor sub-command
* @NL80211_ATTR_VENDOR_DATA: data for the vendor command, if any; this
* attribute is also used for vendor command feature advertisement
* @NL80211_ATTR_VENDOR_EVENTS: used for event list advertising in the wiphy
* info, containing a nested array of possible events
*
* @NL80211_ATTR_QOS_MAP: IP DSCP mapping for Interworking QoS mapping. This
* data is in the format defined for the payload of the QoS Map Set element
* in IEEE Std 802.11-2012, 8.4.2.97.
*
* @NL80211_ATTR_MAC_HINT: MAC address recommendation as initial BSS
* @NL80211_ATTR_WIPHY_FREQ_HINT: frequency of the recommended initial BSS
*
* @NL80211_ATTR_MAX_AP_ASSOC_STA: Device attribute that indicates how many
* associated stations are supported in AP mode (including P2P GO); u32.
* Since drivers may not have a fixed limit on the maximum number (e.g.,
* other concurrent operations may affect this), drivers are allowed to
* advertise values that cannot always be met. In such cases, an attempt
* to add a new station entry with @NL80211_CMD_NEW_STATION may fail.
*
* @NL80211_ATTR_CSA_C_OFFSETS_TX: An array of csa counter offsets (u16) which
* should be updated when the frame is transmitted.
* @NL80211_ATTR_MAX_CSA_COUNTERS: U8 attribute used to advertise the maximum
* supported number of csa counters.
*
* @NL80211_ATTR_TDLS_PEER_CAPABILITY: flags for TDLS peer capabilities, u32.
* As specified in the &enum nl80211_tdls_peer_capability.
*
* @NL80211_ATTR_SOCKET_OWNER: Flag attribute, if set during interface
* creation then the new interface will be owned by the netlink socket
* that created it and will be destroyed when the socket is closed.
* If set during scheduled scan start then the new scan req will be
* owned by the netlink socket that created it and the scheduled scan will
* be stopped when the socket is closed.
* If set during configuration of regulatory indoor operation then the
* regulatory indoor configuration would be owned by the netlink socket
* that configured the indoor setting, and the indoor operation would be
* cleared when the socket is closed.
* If set during NAN interface creation, the interface will be destroyed
* if the socket is closed just like any other interface. Moreover, NAN
* notifications will be sent in unicast to that socket. Without this
* attribute, the notifications will be sent to the %NL80211_MCGRP_NAN
* multicast group.
* If set during %NL80211_CMD_ASSOCIATE or %NL80211_CMD_CONNECT the
* station will deauthenticate when the socket is closed.
* If set during %NL80211_CMD_JOIN_IBSS the IBSS will be automatically
* torn down when the socket is closed.
* If set during %NL80211_CMD_JOIN_MESH the mesh setup will be
* automatically torn down when the socket is closed.
* If set during %NL80211_CMD_START_AP the AP will be automatically
* disabled when the socket is closed.
*
* @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is
* the TDLS link initiator.
*
* @NL80211_ATTR_USE_RRM: flag for indicating whether the current connection
* shall support Radio Resource Measurements (11k). This attribute can be
* used with %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests.
* User space applications are expected to use this flag only if the
* underlying device supports these minimal RRM features:
* %NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES,
* %NL80211_FEATURE_QUIET,
* Or, if global RRM is supported, see:
* %NL80211_EXT_FEATURE_RRM
* If this flag is used, driver must add the Power Capabilities IE to the
* association request. In addition, it must also set the RRM capability
* flag in the association request's Capability Info field.
*
* @NL80211_ATTR_WIPHY_DYN_ACK: flag attribute used to enable ACK timeout
* estimation algorithm (dynack). In order to activate dynack
* %NL80211_FEATURE_ACKTO_ESTIMATION feature flag must be set by lower
* drivers to indicate dynack capability. Dynack is automatically disabled
* setting valid value for coverage class.
*
* @NL80211_ATTR_TSID: a TSID value (u8 attribute)
* @NL80211_ATTR_USER_PRIO: user priority value (u8 attribute)
* @NL80211_ATTR_ADMITTED_TIME: admitted time in units of 32 microseconds
* (per second) (u16 attribute)
*
* @NL80211_ATTR_SMPS_MODE: SMPS mode to use (ap mode). see
* &enum nl80211_smps_mode.
*
* @NL80211_ATTR_OPER_CLASS: operating class
*
* @NL80211_ATTR_MAC_MASK: MAC address mask
*
* @NL80211_ATTR_WIPHY_SELF_MANAGED_REG: flag attribute indicating this device
* is self-managing its regulatory information and any regulatory domain
* obtained from it is coming from the device's wiphy and not the global
* cfg80211 regdomain.
*
* @NL80211_ATTR_EXT_FEATURES: extended feature flags contained in a byte
* array. The feature flags are identified by their bit index (see &enum
* nl80211_ext_feature_index). The bit index is ordered starting at the
* least-significant bit of the first byte in the array, ie. bit index 0
* is located at bit 0 of byte 0. bit index 25 would be located at bit 1
* of byte 3 (u8 array).
*
* @NL80211_ATTR_SURVEY_RADIO_STATS: Request overall radio statistics to be
* returned along with other survey data. If set, @NL80211_CMD_GET_SURVEY
* may return a survey entry without a channel indicating global radio
* statistics (only some values are valid and make sense.)
* For devices that don't return such an entry even then, the information
* should be contained in the result as the sum of the respective counters
* over all channels.
*
* @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a
* scheduled scan is started. Or the delay before a WoWLAN
* net-detect scan is started, counting from the moment the
* system is suspended. This value is a u32, in seconds.
*
* @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device
* is operating in an indoor environment.
*
* @NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS: maximum number of scan plans for
* scheduled scan supported by the device (u32), a wiphy attribute.
* @NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL: maximum interval (in seconds) for
* a scan plan (u32), a wiphy attribute.
* @NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS: maximum number of iterations in
* a scan plan (u32), a wiphy attribute.
* @NL80211_ATTR_SCHED_SCAN_PLANS: a list of scan plans for scheduled scan.
* Each scan plan defines the number of scan iterations and the interval
* between scans. The last scan plan will always run infinitely,
* thus it must not specify the number of iterations, only the interval
* between scans. The scan plans are executed sequentially.
* Each scan plan is a nested attribute of &enum nl80211_sched_scan_plan.
* @NL80211_ATTR_PBSS: flag attribute. If set it means operate
* in a PBSS. Specified in %NL80211_CMD_CONNECT to request
* connecting to a PCP, and in %NL80211_CMD_START_AP to start
* a PCP instead of AP. Relevant for DMG networks only.
* @NL80211_ATTR_BSS_SELECT: nested attribute for driver supporting the
* BSS selection feature. When used with %NL80211_CMD_GET_WIPHY it contains
* attributes according &enum nl80211_bss_select_attr to indicate what
* BSS selection behaviours are supported. When used with %NL80211_CMD_CONNECT
* it contains the behaviour-specific attribute containing the parameters for
* BSS selection to be done by driver and/or firmware.
*
* @NL80211_ATTR_STA_SUPPORT_P2P_PS: whether P2P PS mechanism supported
* or not. u8, one of the values of &enum nl80211_sta_p2p_ps_status
*
* @NL80211_ATTR_PAD: attribute used for padding for 64-bit alignment
*
* @NL80211_ATTR_IFTYPE_EXT_CAPA: Nested attribute of the following attributes:
* %NL80211_ATTR_IFTYPE, %NL80211_ATTR_EXT_CAPA,
* %NL80211_ATTR_EXT_CAPA_MASK, to specify the extended capabilities and
* other interface-type specific capabilities per interface type. For MLO,
* %NL80211_ATTR_EML_CAPABILITY and %NL80211_ATTR_MLD_CAPA_AND_OPS are
* present.
*
* @NL80211_ATTR_MU_MIMO_GROUP_DATA: array of 24 bytes that defines a MU-MIMO
* groupID for monitor mode.
* The first 8 bytes are a mask that defines the membership in each
* group (there are 64 groups, group 0 and 63 are reserved),
* each bit represents a group and set to 1 for being a member in
* that group and 0 for not being a member.
* The remaining 16 bytes define the position in each group: 2 bits for
* each group.
* (smaller group numbers represented on most significant bits and bigger
* group numbers on least significant bits.)
* This attribute is used only if all interfaces are in monitor mode.
* Set this attribute in order to monitor packets using the given MU-MIMO
* groupID data.
* to turn off that feature set all the bits of the groupID to zero.
* @NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR: mac address for the sniffer to follow
* when using MU-MIMO air sniffer.
* to turn that feature off set an invalid mac address
* (e.g. FF:FF:FF:FF:FF:FF)
*
* @NL80211_ATTR_SCAN_START_TIME_TSF: The time at which the scan was actually
* started (u64). The time is the TSF of the BSS the interface that
* requested the scan is connected to (if available, otherwise this
* attribute must not be included).
* @NL80211_ATTR_SCAN_START_TIME_TSF_BSSID: The BSS according to which
* %NL80211_ATTR_SCAN_START_TIME_TSF is set.
* @NL80211_ATTR_MEASUREMENT_DURATION: measurement duration in TUs (u16). If
* %NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY is not set, this is the
* maximum measurement duration allowed. This attribute is used with
* measurement requests. It can also be used with %NL80211_CMD_TRIGGER_SCAN
* if the scan is used for beacon report radio measurement.
* @NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY: flag attribute that indicates
* that the duration specified with %NL80211_ATTR_MEASUREMENT_DURATION is
* mandatory. If this flag is not set, the duration is the maximum duration
* and the actual measurement duration may be shorter.
*
* @NL80211_ATTR_MESH_PEER_AID: Association ID for the mesh peer (u16). This is
* used to pull the stored data for mesh peer in power save state.
*
* @NL80211_ATTR_NAN_MASTER_PREF: the master preference to be used by
* %NL80211_CMD_START_NAN and optionally with
* %NL80211_CMD_CHANGE_NAN_CONFIG. Its type is u8 and it can't be 0.
* Also, values 1 and 255 are reserved for certification purposes and
* should not be used during a normal device operation.
* @NL80211_ATTR_BANDS: operating bands configuration. This is a u32
* bitmask of BIT(NL80211_BAND_*) as described in %enum
* nl80211_band. For instance, for NL80211_BAND_2GHZ, bit 0
* would be set. This attribute is used with
* %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG, and
* it is optional. If no bands are set, it means don't-care and
* the device will decide what to use.
* @NL80211_ATTR_NAN_FUNC: a function that can be added to NAN. See
* &enum nl80211_nan_func_attributes for description of this nested
* attribute.
* @NL80211_ATTR_NAN_MATCH: used to report a match. This is a nested attribute.
* See &enum nl80211_nan_match_attributes.
* @NL80211_ATTR_FILS_KEK: KEK for FILS (Re)Association Request/Response frame
* protection.
* @NL80211_ATTR_FILS_NONCES: Nonces (part of AAD) for FILS (Re)Association
* Request/Response frame protection. This attribute contains the 16 octet
* STA Nonce followed by 16 octets of AP Nonce.
*
* @NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED: Indicates whether or not multicast
* packets should be send out as unicast to all stations (flag attribute).
*
* @NL80211_ATTR_BSSID: The BSSID of the AP. Note that %NL80211_ATTR_MAC is also
* used in various commands/events for specifying the BSSID.
*
* @NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI: Relative RSSI threshold by which
* other BSSs has to be better or slightly worse than the current
* connected BSS so that they get reported to user space.
* This will give an opportunity to userspace to consider connecting to
* other matching BSSs which have better or slightly worse RSSI than
* the current connected BSS by using an offloaded operation to avoid
* unnecessary wakeups.
*
* @NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST: When present the RSSI level for BSSs in
* the specified band is to be adjusted before doing
* %NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI based comparison to figure out
* better BSSs. The attribute value is a packed structure
* value as specified by &struct nl80211_bss_select_rssi_adjust.
*
* @NL80211_ATTR_TIMEOUT_REASON: The reason for which an operation timed out.
* u32 attribute with an &enum nl80211_timeout_reason value. This is used,
* e.g., with %NL80211_CMD_CONNECT event.
*
* @NL80211_ATTR_FILS_ERP_USERNAME: EAP Re-authentication Protocol (ERP)
* username part of NAI used to refer keys rRK and rIK. This is used with
* %NL80211_CMD_CONNECT.
*
* @NL80211_ATTR_FILS_ERP_REALM: EAP Re-authentication Protocol (ERP) realm part
* of NAI specifying the domain name of the ER server. This is used with
* %NL80211_CMD_CONNECT.
*
* @NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM: Unsigned 16-bit ERP next sequence number
* to use in ERP messages. This is used in generating the FILS wrapped data
* for FILS authentication and is used with %NL80211_CMD_CONNECT.
*
* @NL80211_ATTR_FILS_ERP_RRK: ERP re-authentication Root Key (rRK) for the
* NAI specified by %NL80211_ATTR_FILS_ERP_USERNAME and
* %NL80211_ATTR_FILS_ERP_REALM. This is used for generating rIK and rMSK
* from successful FILS authentication and is used with
* %NL80211_CMD_CONNECT.
*
* @NL80211_ATTR_FILS_CACHE_ID: A 2-octet identifier advertised by a FILS AP
* identifying the scope of PMKSAs. This is used with
* @NL80211_CMD_SET_PMKSA and @NL80211_CMD_DEL_PMKSA.
*
* @NL80211_ATTR_PMK: attribute for passing PMK key material. Used with
* %NL80211_CMD_SET_PMKSA for the PMKSA identified by %NL80211_ATTR_PMKID.
* For %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP it is used to provide
* PSK for offloading 4-way handshake for WPA/WPA2-PSK networks. For 802.1X
* authentication it is used with %NL80211_CMD_SET_PMK. For offloaded FT
* support this attribute specifies the PMK-R0 if NL80211_ATTR_PMKR0_NAME
* is included as well.
*
* @NL80211_ATTR_SCHED_SCAN_MULTI: flag attribute which user-space shall use to
* indicate that it supports multiple active scheduled scan requests.
* @NL80211_ATTR_SCHED_SCAN_MAX_REQS: indicates maximum number of scheduled
* scan request that may be active for the device (u32).
*
* @NL80211_ATTR_WANT_1X_4WAY_HS: flag attribute which user-space can include
* in %NL80211_CMD_CONNECT to indicate that for 802.1X authentication it
* wants to use the supported offload of the 4-way handshake.
* @NL80211_ATTR_PMKR0_NAME: PMK-R0 Name for offloaded FT.
* @NL80211_ATTR_PORT_AUTHORIZED: (reserved)
*
* @NL80211_ATTR_EXTERNAL_AUTH_ACTION: Identify the requested external
* authentication operation (u32 attribute with an
* &enum nl80211_external_auth_action value). This is used with the
* %NL80211_CMD_EXTERNAL_AUTH request event.
* @NL80211_ATTR_EXTERNAL_AUTH_SUPPORT: Flag attribute indicating that the user
* space supports external authentication. This attribute shall be used
* with %NL80211_CMD_CONNECT and %NL80211_CMD_START_AP request. The driver
* may offload authentication processing to user space if this capability
* is indicated in the respective requests from the user space. (This flag
* attribute deprecated for %NL80211_CMD_START_AP, use
* %NL80211_ATTR_AP_SETTINGS_FLAGS)
*
* @NL80211_ATTR_NSS: Station's New/updated RX_NSS value notified using this
* u8 attribute. This is used with %NL80211_CMD_STA_OPMODE_CHANGED.
*
* @NL80211_ATTR_TXQ_STATS: TXQ statistics (nested attribute, see &enum
* nl80211_txq_stats)
* @NL80211_ATTR_TXQ_LIMIT: Total packet limit for the TXQ queues for this phy.
* The smaller of this and the memory limit is enforced.
* @NL80211_ATTR_TXQ_MEMORY_LIMIT: Total memory limit (in bytes) for the
* TXQ queues for this phy. The smaller of this and the packet limit is
* enforced.
* @NL80211_ATTR_TXQ_QUANTUM: TXQ scheduler quantum (bytes). Number of bytes
* a flow is assigned on each round of the DRR scheduler.
* @NL80211_ATTR_HE_CAPABILITY: HE Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION). Can be set
* only if %NL80211_STA_FLAG_WME is set.
*
* @NL80211_ATTR_FTM_RESPONDER: nested attribute which user-space can include
* in %NL80211_CMD_START_AP or %NL80211_CMD_SET_BEACON for fine timing
* measurement (FTM) responder functionality and containing parameters as
* possible, see &enum nl80211_ftm_responder_attr
*
* @NL80211_ATTR_FTM_RESPONDER_STATS: Nested attribute with FTM responder
* statistics, see &enum nl80211_ftm_responder_stats.
*
* @NL80211_ATTR_TIMEOUT: Timeout for the given operation in milliseconds (u32),
* if the attribute is not given no timeout is requested. Note that 0 is an
* invalid value.
*
* @NL80211_ATTR_PEER_MEASUREMENTS: peer measurements request (and result)
* data, uses nested attributes specified in
* &enum nl80211_peer_measurement_attrs.
* This is also used for capability advertisement in the wiphy information,
* with the appropriate sub-attributes.
*
* @NL80211_ATTR_AIRTIME_WEIGHT: Station's weight when scheduled by the airtime
* scheduler.
*
* @NL80211_ATTR_STA_TX_POWER_SETTING: Transmit power setting type (u8) for
* station associated with the AP. See &enum nl80211_tx_power_setting for
* possible values.
* @NL80211_ATTR_STA_TX_POWER: Transmit power level (s16) in dBm units. This
* allows to set Tx power for a station. If this attribute is not included,
* the default per-interface tx power setting will be overriding. Driver
* should be picking up the lowest tx power, either tx power per-interface
* or per-station.
*
* @NL80211_ATTR_SAE_PASSWORD: attribute for passing SAE password material. It
* is used with %NL80211_CMD_CONNECT to provide password for offloading
* SAE authentication for WPA3-Personal networks.
*
* @NL80211_ATTR_TWT_RESPONDER: Enable target wait time responder support.
*
* @NL80211_ATTR_HE_OBSS_PD: nested attribute for OBSS Packet Detection
* functionality.
*
* @NL80211_ATTR_WIPHY_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
* channel(s) that are allowed to be used for EDMG transmissions.
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251. (u8 attribute)
* @NL80211_ATTR_WIPHY_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
* the allowed channel bandwidth configurations. (u8 attribute)
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
*
* @NL80211_ATTR_VLAN_ID: VLAN ID (1..4094) for the station and VLAN group key
* (u16).
*
* @NL80211_ATTR_HE_BSS_COLOR: nested attribute for BSS Color Settings.
*
* @NL80211_ATTR_IFTYPE_AKM_SUITES: nested array attribute, with each entry
* using attributes from &enum nl80211_iftype_akm_attributes. This
* attribute is sent in a response to %NL80211_CMD_GET_WIPHY indicating
* supported AKM suites capability per interface. AKMs advertised in
* %NL80211_ATTR_AKM_SUITES are default capabilities if AKM suites not
* advertised for a specific interface type.
*
* @NL80211_ATTR_TID_CONFIG: TID specific configuration in a
* nested attribute with &enum nl80211_tid_config_attr sub-attributes;
* on output (in wiphy attributes) it contains only the feature sub-
* attributes.
*
* @NL80211_ATTR_CONTROL_PORT_NO_PREAUTH: disable preauth frame rx on control
* port in order to forward/receive them as ordinary data frames.
*
* @NL80211_ATTR_PMK_LIFETIME: Maximum lifetime for PMKSA in seconds (u32,
* dot11RSNAConfigPMKReauthThreshold; 0 is not a valid value).
* An optional parameter configured through %NL80211_CMD_SET_PMKSA.
* Drivers that trigger roaming need to know the lifetime of the
* configured PMKSA for triggering the full vs. PMKSA caching based
* authentication. This timeout helps authentication methods like SAE,
* where PMK gets updated only by going through a full (new SAE)
* authentication instead of getting updated during an association for EAP
* authentication. No new full authentication within the PMK expiry shall
* result in a disassociation at the end of the lifetime.
*
* @NL80211_ATTR_PMK_REAUTH_THRESHOLD: Reauthentication threshold time, in
* terms of percentage of %NL80211_ATTR_PMK_LIFETIME
* (u8, dot11RSNAConfigPMKReauthThreshold, 1..100). This is an optional
* parameter configured through %NL80211_CMD_SET_PMKSA. Requests the
* driver to trigger a full authentication roam (without PMKSA caching)
* after the reauthentication threshold time, but before the PMK lifetime
* has expired.
*
* Authentication methods like SAE need to be able to generate a new PMKSA
* entry without having to force a disconnection after the PMK timeout. If
* no roaming occurs between the reauth threshold and PMK expiration,
* disassociation is still forced.
* @NL80211_ATTR_RECEIVE_MULTICAST: multicast flag for the
* %NL80211_CMD_REGISTER_FRAME command, see the description there.
* @NL80211_ATTR_WIPHY_FREQ_OFFSET: offset of the associated
* %NL80211_ATTR_WIPHY_FREQ in positive KHz. Only valid when supplied with
* an %NL80211_ATTR_WIPHY_FREQ_OFFSET.
* @NL80211_ATTR_CENTER_FREQ1_OFFSET: Center frequency offset in KHz for the
* first channel segment specified in %NL80211_ATTR_CENTER_FREQ1.
* @NL80211_ATTR_SCAN_FREQ_KHZ: nested attribute with KHz frequencies
*
* @NL80211_ATTR_HE_6GHZ_CAPABILITY: HE 6 GHz Band Capability element (from
* association request when used with NL80211_CMD_NEW_STATION).
*
* @NL80211_ATTR_FILS_DISCOVERY: Optional parameter to configure FILS
* discovery. It is a nested attribute, see
* &enum nl80211_fils_discovery_attributes. Userspace should pass an empty
* nested attribute to disable this feature and delete the templates.
*
* @NL80211_ATTR_UNSOL_BCAST_PROBE_RESP: Optional parameter to configure
* unsolicited broadcast probe response. It is a nested attribute, see
* &enum nl80211_unsol_bcast_probe_resp_attributes. Userspace should pass an empty
* nested attribute to disable this feature and delete the templates.
*
* @NL80211_ATTR_S1G_CAPABILITY: S1G Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION)
* @NL80211_ATTR_S1G_CAPABILITY_MASK: S1G Capability Information element
* override mask. Used with NL80211_ATTR_S1G_CAPABILITY in
* NL80211_CMD_ASSOCIATE or NL80211_CMD_CONNECT.
*
* @NL80211_ATTR_SAE_PWE: Indicates the mechanism(s) allowed for SAE PWE
* derivation in WPA3-Personal networks which are using SAE authentication.
* This is a u8 attribute that encapsulates one of the values from
* &enum nl80211_sae_pwe_mechanism.
*
* @NL80211_ATTR_SAR_SPEC: SAR power limitation specification when
* used with %NL80211_CMD_SET_SAR_SPECS. The message contains fields
* of %nl80211_sar_attrs which specifies the sar type and related
* sar specs. Sar specs contains array of %nl80211_sar_specs_attrs.
*
* @NL80211_ATTR_RECONNECT_REQUESTED: flag attribute, used with deauth and
* disassoc events to indicate that an immediate reconnect to the AP
* is desired.
*
* @NL80211_ATTR_OBSS_COLOR_BITMAP: bitmap of the u64 BSS colors for the
* %NL80211_CMD_OBSS_COLOR_COLLISION event.
*
* @NL80211_ATTR_COLOR_CHANGE_COUNT: u8 attribute specifying the number of TBTT's
* until the color switch event.
* @NL80211_ATTR_COLOR_CHANGE_COLOR: u8 attribute specifying the color that we are
* switching to
* @NL80211_ATTR_COLOR_CHANGE_ELEMS: Nested set of attributes containing the IE
* information for the time while performing a color switch.
*
* @NL80211_ATTR_MBSSID_CONFIG: Nested attribute for multiple BSSID
* advertisements (MBSSID) parameters in AP mode.
* Kernel uses this attribute to indicate the driver's support for MBSSID
* and enhanced multi-BSSID advertisements (EMA AP) to the userspace.
* Userspace should use this attribute to configure per interface MBSSID
* parameters.
* See &enum nl80211_mbssid_config_attributes for details.
*
* @NL80211_ATTR_MBSSID_ELEMS: Nested parameter to pass multiple BSSID elements.
* Mandatory parameter for the transmitting interface to enable MBSSID.
* Optional for the non-transmitting interfaces.
*
* @NL80211_ATTR_RADAR_BACKGROUND: Configure dedicated offchannel chain
* available for radar/CAC detection on some hw. This chain can't be used
* to transmit or receive frames and it is bounded to a running wdev.
* Background radar/CAC detection allows to avoid the CAC downtime
* switching on a different channel during CAC detection on the selected
* radar channel.
*
* @NL80211_ATTR_AP_SETTINGS_FLAGS: u32 attribute contains ap settings flags,
* enumerated in &enum nl80211_ap_settings_flags. This attribute shall be
* used with %NL80211_CMD_START_AP request.
*
* @NL80211_ATTR_EHT_CAPABILITY: EHT Capability information element (from
* association request when used with NL80211_CMD_NEW_STATION). Can be set
* only if %NL80211_STA_FLAG_WME is set.
*
* @NL80211_ATTR_MLO_LINK_ID: A (u8) link ID for use with MLO, to be used with
* various commands that need a link ID to operate.
* @NL80211_ATTR_MLO_LINKS: A nested array of links, each containing some
* per-link information and a link ID.
* @NL80211_ATTR_MLD_ADDR: An MLD address, used with various commands such as
* authenticate/associate.
*
* @NL80211_ATTR_MLO_SUPPORT: Flag attribute to indicate user space supports MLO
* connection. Used with %NL80211_CMD_CONNECT. If this attribute is not
* included in NL80211_CMD_CONNECT drivers must not perform MLO connection.
*
* @NL80211_ATTR_MAX_NUM_AKM_SUITES: U16 attribute. Indicates maximum number of
* AKM suites allowed for %NL80211_CMD_CONNECT, %NL80211_CMD_ASSOCIATE and
* %NL80211_CMD_START_AP in %NL80211_CMD_GET_WIPHY response. If this
* attribute is not present userspace shall consider maximum number of AKM
* suites allowed as %NL80211_MAX_NR_AKM_SUITES which is the legacy maximum
* number prior to the introduction of this attribute.
*
* @NL80211_ATTR_EML_CAPABILITY: EML Capability information (u16)
* @NL80211_ATTR_MLD_CAPA_AND_OPS: MLD Capabilities and Operations (u16)
*
* @NL80211_ATTR_TX_HW_TIMESTAMP: Hardware timestamp for TX operation in
* nanoseconds (u64). This is the device clock timestamp so it will
* probably reset when the device is stopped or the firmware is reset.
* When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the frame TX
* timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
* the ack TX timestamp.
* @NL80211_ATTR_RX_HW_TIMESTAMP: Hardware timestamp for RX operation in
* nanoseconds (u64). This is the device clock timestamp so it will
* probably reset when the device is stopped or the firmware is reset.
* When used with %NL80211_CMD_FRAME_TX_STATUS, indicates the ack RX
* timestamp. When used with %NL80211_CMD_FRAME RX notification, indicates
* the incoming frame RX timestamp.
* @NL80211_ATTR_TD_BITMAP: Transition Disable bitmap, for subsequent
* (re)associations.
*
* @NL80211_ATTR_PUNCT_BITMAP: (u32) Preamble puncturing bitmap, lowest
* bit corresponds to the lowest 20 MHz channel. Each bit set to 1
* indicates that the sub-channel is punctured. Higher 16 bits are
* reserved.
*
* @NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS: Maximum number of peers that HW
* timestamping can be enabled for concurrently (u16), a wiphy attribute.
* A value of 0xffff indicates setting for all peers (i.e. not specifying
* an address with %NL80211_CMD_SET_HW_TIMESTAMP) is supported.
* @NL80211_ATTR_HW_TIMESTAMP_ENABLED: Indicates whether HW timestamping should
* be enabled or not (flag attribute).
*
* @NL80211_ATTR_EMA_RNR_ELEMS: Optional nested attribute for
* reduced neighbor report (RNR) elements. This attribute can be used
* only when NL80211_MBSSID_CONFIG_ATTR_EMA is enabled.
* Userspace is responsible for splitting the RNR into multiple
* elements such that each element excludes the non-transmitting
* profiles already included in the MBSSID element
* (%NL80211_ATTR_MBSSID_ELEMS) at the same index. Each EMA beacon
* will be generated by adding MBSSID and RNR elements at the same
* index. If the userspace includes more RNR elements than number of
* MBSSID elements then these will be added in every EMA beacon.
*
* @NL80211_ATTR_MLO_LINK_DISABLED: Flag attribute indicating that the link is
* disabled.
*
* @NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA: Include BSS usage data, i.e.
* include BSSes that can only be used in restricted scenarios and/or
* cannot be used at all.
*
* @NL80211_ATTR_MLO_TTLM_DLINK: Binary attribute specifying the downlink TID to
* link mapping. The length is 8 * sizeof(u16). For each TID the link
* mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
* in Draft P802.11be_D4.0.
* @NL80211_ATTR_MLO_TTLM_ULINK: Binary attribute specifying the uplink TID to
* link mapping. The length is 8 * sizeof(u16). For each TID the link
* mapping is as defined in section 9.4.2.314 (TID-To-Link Mapping element)
* in Draft P802.11be_D4.0.
*
* @NL80211_ATTR_ASSOC_SPP_AMSDU: flag attribute used with
* %NL80211_CMD_ASSOCIATE indicating the SPP A-MSDUs
* are used on this connection
*
* @NL80211_ATTR_WIPHY_RADIOS: Nested attribute describing physical radios
* belonging to this wiphy. See &enum nl80211_wiphy_radio_attrs.
*
* @NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS: Nested attribute listing the
* supported interface combinations for all radios combined. In each
* nested item, it contains attributes defined in
* &enum nl80211_if_combination_attrs.
*
* @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32).
* A value of 0 means all radios.
*
* @NL80211_ATTR_SUPPORTED_SELECTORS: supported BSS Membership Selectors, array
* of supported selectors as defined by IEEE Std 802.11-2020 9.4.2.3 but
* without the length restriction (at most %NL80211_MAX_SUPP_SELECTORS).
* This can be used to provide a list of selectors that are implemented
* by the supplicant. If not given, support for SAE_H2E is assumed.
*
* @NL80211_ATTR_MLO_RECONF_REM_LINKS: (u16) A bitmask of the links requested
* to be removed from the MLO association.
*
* @NL80211_ATTR_EPCS: Flag attribute indicating that EPCS is enabled for a
* station interface.
*
* @NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS: Extended MLD capabilities and
* operations that userspace implements to use during association/ML
* link reconfig, currently only "BTM MLD Recommendation For Multiple
* APs Support". Drivers may set additional flags that they support
* in the kernel or device.
*
* @NL80211_ATTR_WIPHY_RADIO_INDEX: (int) Integer attribute denoting the index
* of the radio in interest. Internally a value of -1 is used to
* indicate that the radio id is not given in user-space. This means
* that all the attributes are applicable to all the radios. If there is
* a radio index provided in user-space, the attributes will be
* applicable to that specific radio only. If the radio id is greater
* thank the number of radios, error denoting invalid value is returned.
*
* @NL80211_ATTR_S1G_LONG_BEACON_PERIOD: (u8) Integer attribute that represents
* the number of beacon intervals between each long beacon transmission
* for an S1G BSS with short beaconing enabled. This is a required
* attribute for initialising an S1G short beaconing BSS. When updating
* the short beacon data, this is not required. It has a minimum value of
* 2 (i.e 2 beacon intervals).
*
* @NL80211_ATTR_S1G_SHORT_BEACON: Nested attribute containing the short beacon
* head and tail used to set or update the short beacon templates. When
* bringing up a new interface, %NL80211_ATTR_S1G_LONG_BEACON_PERIOD is
* required alongside this attribute. Refer to
* @enum nl80211_s1g_short_beacon_attrs for the attribute definitions.
*
* @NL80211_ATTR_BSS_PARAM: nested attribute used with %NL80211_CMD_GET_WIPHY
* which indicates which BSS parameters can be modified. The attribute can
* also be used as flag attribute by user-space in %NL80211_CMD_SET_BSS to
* indicate that it wants strict checking on the BSS parameters to be
* modified.
*
* @NL80211_ATTR_NAN_CONFIG: Nested attribute for
* extended NAN cluster configuration. This is used with
* %NL80211_CMD_START_NAN and %NL80211_CMD_CHANGE_NAN_CONFIG.
* See &enum nl80211_nan_conf_attributes for details.
* This attribute is optional.
* @NL80211_ATTR_NAN_NEW_CLUSTER: Flag attribute indicating that a new
* NAN cluster has been created. This is used with
* %NL80211_CMD_NAN_CLUSTER_JOINED
* @NL80211_ATTR_NAN_CAPABILITIES: Nested attribute for NAN capabilities.
* This is used with %NL80211_CMD_GET_WIPHY to indicate the NAN
* capabilities supported by the driver. See &enum nl80211_nan_capabilities
* for details.
*
* @NL80211_ATTR_S1G_PRIMARY_2MHZ: flag attribute indicating that the S1G
* primary channel is 2 MHz wide, and the control channel designates
* the 1 MHz primary subchannel within that 2 MHz primary.
*
* @NUM_NL80211_ATTR: total number of nl80211_attrs available
* @NL80211_ATTR_MAX: highest attribute number currently defined
* @__NL80211_ATTR_AFTER_LAST: internal use
*/
enum nl80211_attrs {
/* don't change the order or add anything between, this is ABI! */
NL80211_ATTR_UNSPEC,
NL80211_ATTR_WIPHY,
NL80211_ATTR_WIPHY_NAME,
NL80211_ATTR_IFINDEX,
NL80211_ATTR_IFNAME,
NL80211_ATTR_IFTYPE,
NL80211_ATTR_MAC,
NL80211_ATTR_KEY_DATA,
NL80211_ATTR_KEY_IDX,
NL80211_ATTR_KEY_CIPHER,
NL80211_ATTR_KEY_SEQ,
NL80211_ATTR_KEY_DEFAULT,
NL80211_ATTR_BEACON_INTERVAL,
NL80211_ATTR_DTIM_PERIOD,
NL80211_ATTR_BEACON_HEAD,
NL80211_ATTR_BEACON_TAIL,
NL80211_ATTR_STA_AID,
NL80211_ATTR_STA_FLAGS,
NL80211_ATTR_STA_LISTEN_INTERVAL,
NL80211_ATTR_STA_SUPPORTED_RATES,
NL80211_ATTR_STA_VLAN,
NL80211_ATTR_STA_INFO,
NL80211_ATTR_WIPHY_BANDS,
NL80211_ATTR_MNTR_FLAGS,
NL80211_ATTR_MESH_ID,
NL80211_ATTR_STA_PLINK_ACTION,
NL80211_ATTR_MPATH_NEXT_HOP,
NL80211_ATTR_MPATH_INFO,
NL80211_ATTR_BSS_CTS_PROT,
NL80211_ATTR_BSS_SHORT_PREAMBLE,
NL80211_ATTR_BSS_SHORT_SLOT_TIME,
NL80211_ATTR_HT_CAPABILITY,
NL80211_ATTR_SUPPORTED_IFTYPES,
NL80211_ATTR_REG_ALPHA2,
NL80211_ATTR_REG_RULES,
NL80211_ATTR_MESH_CONFIG,
NL80211_ATTR_BSS_BASIC_RATES,
NL80211_ATTR_WIPHY_TXQ_PARAMS,
NL80211_ATTR_WIPHY_FREQ,
NL80211_ATTR_WIPHY_CHANNEL_TYPE,
NL80211_ATTR_KEY_DEFAULT_MGMT,
NL80211_ATTR_MGMT_SUBTYPE,
NL80211_ATTR_IE,
NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
NL80211_ATTR_SCAN_FREQUENCIES,
NL80211_ATTR_SCAN_SSIDS,
NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */
NL80211_ATTR_BSS,
NL80211_ATTR_REG_INITIATOR,
NL80211_ATTR_REG_TYPE,
NL80211_ATTR_SUPPORTED_COMMANDS,
NL80211_ATTR_FRAME,
NL80211_ATTR_SSID,
NL80211_ATTR_AUTH_TYPE,
NL80211_ATTR_REASON_CODE,
NL80211_ATTR_KEY_TYPE,
NL80211_ATTR_MAX_SCAN_IE_LEN,
NL80211_ATTR_CIPHER_SUITES,
NL80211_ATTR_FREQ_BEFORE,
NL80211_ATTR_FREQ_AFTER,
NL80211_ATTR_FREQ_FIXED,
NL80211_ATTR_WIPHY_RETRY_SHORT,
NL80211_ATTR_WIPHY_RETRY_LONG,
NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
NL80211_ATTR_WIPHY_RTS_THRESHOLD,
NL80211_ATTR_TIMED_OUT,
NL80211_ATTR_USE_MFP,
NL80211_ATTR_STA_FLAGS2,
NL80211_ATTR_CONTROL_PORT,
NL80211_ATTR_TESTDATA,
NL80211_ATTR_PRIVACY,
NL80211_ATTR_DISCONNECTED_BY_AP,
NL80211_ATTR_STATUS_CODE,
NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
NL80211_ATTR_CIPHER_SUITE_GROUP,
NL80211_ATTR_WPA_VERSIONS,
NL80211_ATTR_AKM_SUITES,
NL80211_ATTR_REQ_IE,
NL80211_ATTR_RESP_IE,
NL80211_ATTR_PREV_BSSID,
NL80211_ATTR_KEY,
NL80211_ATTR_KEYS,
NL80211_ATTR_PID,
NL80211_ATTR_4ADDR,
NL80211_ATTR_SURVEY_INFO,
NL80211_ATTR_PMKID,
NL80211_ATTR_MAX_NUM_PMKIDS,
NL80211_ATTR_DURATION,
NL80211_ATTR_COOKIE,
NL80211_ATTR_WIPHY_COVERAGE_CLASS,
NL80211_ATTR_TX_RATES,
NL80211_ATTR_FRAME_MATCH,
NL80211_ATTR_ACK,
NL80211_ATTR_PS_STATE,
NL80211_ATTR_CQM,
NL80211_ATTR_LOCAL_STATE_CHANGE,
NL80211_ATTR_AP_ISOLATE,
NL80211_ATTR_WIPHY_TX_POWER_SETTING,
NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
NL80211_ATTR_TX_FRAME_TYPES,
NL80211_ATTR_RX_FRAME_TYPES,
NL80211_ATTR_FRAME_TYPE,
NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
NL80211_ATTR_SUPPORT_IBSS_RSN,
NL80211_ATTR_WIPHY_ANTENNA_TX,
NL80211_ATTR_WIPHY_ANTENNA_RX,
NL80211_ATTR_MCAST_RATE,
NL80211_ATTR_OFFCHANNEL_TX_OK,
NL80211_ATTR_BSS_HT_OPMODE,
NL80211_ATTR_KEY_DEFAULT_TYPES,
NL80211_ATTR_MAX_REMAIN_ON_CHANNEL_DURATION,
NL80211_ATTR_MESH_SETUP,
NL80211_ATTR_WIPHY_ANTENNA_AVAIL_TX,
NL80211_ATTR_WIPHY_ANTENNA_AVAIL_RX,
NL80211_ATTR_SUPPORT_MESH_AUTH,
NL80211_ATTR_STA_PLINK_STATE,
NL80211_ATTR_WOWLAN_TRIGGERS,
NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED,
NL80211_ATTR_SCHED_SCAN_INTERVAL,
NL80211_ATTR_INTERFACE_COMBINATIONS,
NL80211_ATTR_SOFTWARE_IFTYPES,
NL80211_ATTR_REKEY_DATA,
NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
NL80211_ATTR_SCAN_SUPP_RATES,
NL80211_ATTR_HIDDEN_SSID,
NL80211_ATTR_IE_PROBE_RESP,
NL80211_ATTR_IE_ASSOC_RESP,
NL80211_ATTR_STA_WME,
NL80211_ATTR_SUPPORT_AP_UAPSD,
NL80211_ATTR_ROAM_SUPPORT,
NL80211_ATTR_SCHED_SCAN_MATCH,
NL80211_ATTR_MAX_MATCH_SETS,
NL80211_ATTR_PMKSA_CANDIDATE,
NL80211_ATTR_TX_NO_CCK_RATE,
NL80211_ATTR_TDLS_ACTION,
NL80211_ATTR_TDLS_DIALOG_TOKEN,
NL80211_ATTR_TDLS_OPERATION,
NL80211_ATTR_TDLS_SUPPORT,
NL80211_ATTR_TDLS_EXTERNAL_SETUP,
NL80211_ATTR_DEVICE_AP_SME,
NL80211_ATTR_DONT_WAIT_FOR_ACK,
NL80211_ATTR_FEATURE_FLAGS,
NL80211_ATTR_PROBE_RESP_OFFLOAD,
NL80211_ATTR_PROBE_RESP,
NL80211_ATTR_DFS_REGION,
NL80211_ATTR_DISABLE_HT,
NL80211_ATTR_HT_CAPABILITY_MASK,
NL80211_ATTR_NOACK_MAP,
NL80211_ATTR_INACTIVITY_TIMEOUT,
NL80211_ATTR_RX_SIGNAL_DBM,
NL80211_ATTR_BG_SCAN_PERIOD,
NL80211_ATTR_WDEV,
NL80211_ATTR_USER_REG_HINT_TYPE,
NL80211_ATTR_CONN_FAILED_REASON,
NL80211_ATTR_AUTH_DATA,
NL80211_ATTR_VHT_CAPABILITY,
NL80211_ATTR_SCAN_FLAGS,
NL80211_ATTR_CHANNEL_WIDTH,
NL80211_ATTR_CENTER_FREQ1,
NL80211_ATTR_CENTER_FREQ2,
NL80211_ATTR_P2P_CTWINDOW,
NL80211_ATTR_P2P_OPPPS,
NL80211_ATTR_LOCAL_MESH_POWER_MODE,
NL80211_ATTR_ACL_POLICY,
NL80211_ATTR_MAC_ADDRS,
NL80211_ATTR_MAC_ACL_MAX,
NL80211_ATTR_RADAR_EVENT,
NL80211_ATTR_EXT_CAPA,
NL80211_ATTR_EXT_CAPA_MASK,
NL80211_ATTR_STA_CAPABILITY,
NL80211_ATTR_STA_EXT_CAPABILITY,
NL80211_ATTR_PROTOCOL_FEATURES,
NL80211_ATTR_SPLIT_WIPHY_DUMP,
NL80211_ATTR_DISABLE_VHT,
NL80211_ATTR_VHT_CAPABILITY_MASK,
NL80211_ATTR_MDID,
NL80211_ATTR_IE_RIC,
NL80211_ATTR_CRIT_PROT_ID,
NL80211_ATTR_MAX_CRIT_PROT_DURATION,
NL80211_ATTR_PEER_AID,
NL80211_ATTR_COALESCE_RULE,
NL80211_ATTR_CH_SWITCH_COUNT,
NL80211_ATTR_CH_SWITCH_BLOCK_TX,
NL80211_ATTR_CSA_IES,
NL80211_ATTR_CNTDWN_OFFS_BEACON,
NL80211_ATTR_CNTDWN_OFFS_PRESP,
NL80211_ATTR_RXMGMT_FLAGS,
NL80211_ATTR_STA_SUPPORTED_CHANNELS,
NL80211_ATTR_STA_SUPPORTED_OPER_CLASSES,
NL80211_ATTR_HANDLE_DFS,
NL80211_ATTR_SUPPORT_5_MHZ,
NL80211_ATTR_SUPPORT_10_MHZ,
NL80211_ATTR_OPMODE_NOTIF,
NL80211_ATTR_VENDOR_ID,
NL80211_ATTR_VENDOR_SUBCMD,
NL80211_ATTR_VENDOR_DATA,
NL80211_ATTR_VENDOR_EVENTS,
NL80211_ATTR_QOS_MAP,
NL80211_ATTR_MAC_HINT,
NL80211_ATTR_WIPHY_FREQ_HINT,
NL80211_ATTR_MAX_AP_ASSOC_STA,
NL80211_ATTR_TDLS_PEER_CAPABILITY,
NL80211_ATTR_SOCKET_OWNER,
NL80211_ATTR_CSA_C_OFFSETS_TX,
NL80211_ATTR_MAX_CSA_COUNTERS,
NL80211_ATTR_TDLS_INITIATOR,
NL80211_ATTR_USE_RRM,
NL80211_ATTR_WIPHY_DYN_ACK,
NL80211_ATTR_TSID,
NL80211_ATTR_USER_PRIO,
NL80211_ATTR_ADMITTED_TIME,
NL80211_ATTR_SMPS_MODE,
NL80211_ATTR_OPER_CLASS,
NL80211_ATTR_MAC_MASK,
NL80211_ATTR_WIPHY_SELF_MANAGED_REG,
NL80211_ATTR_EXT_FEATURES,
NL80211_ATTR_SURVEY_RADIO_STATS,
NL80211_ATTR_NETNS_FD,
NL80211_ATTR_SCHED_SCAN_DELAY,
NL80211_ATTR_REG_INDOOR,
NL80211_ATTR_MAX_NUM_SCHED_SCAN_PLANS,
NL80211_ATTR_MAX_SCAN_PLAN_INTERVAL,
NL80211_ATTR_MAX_SCAN_PLAN_ITERATIONS,
NL80211_ATTR_SCHED_SCAN_PLANS,
NL80211_ATTR_PBSS,
NL80211_ATTR_BSS_SELECT,
NL80211_ATTR_STA_SUPPORT_P2P_PS,
NL80211_ATTR_PAD,
NL80211_ATTR_IFTYPE_EXT_CAPA,
NL80211_ATTR_MU_MIMO_GROUP_DATA,
NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR,
NL80211_ATTR_SCAN_START_TIME_TSF,
NL80211_ATTR_SCAN_START_TIME_TSF_BSSID,
NL80211_ATTR_MEASUREMENT_DURATION,
NL80211_ATTR_MEASUREMENT_DURATION_MANDATORY,
NL80211_ATTR_MESH_PEER_AID,
NL80211_ATTR_NAN_MASTER_PREF,
NL80211_ATTR_BANDS,
NL80211_ATTR_NAN_FUNC,
NL80211_ATTR_NAN_MATCH,
NL80211_ATTR_FILS_KEK,
NL80211_ATTR_FILS_NONCES,
NL80211_ATTR_MULTICAST_TO_UNICAST_ENABLED,
NL80211_ATTR_BSSID,
NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI,
NL80211_ATTR_SCHED_SCAN_RSSI_ADJUST,
NL80211_ATTR_TIMEOUT_REASON,
NL80211_ATTR_FILS_ERP_USERNAME,
NL80211_ATTR_FILS_ERP_REALM,
NL80211_ATTR_FILS_ERP_NEXT_SEQ_NUM,
NL80211_ATTR_FILS_ERP_RRK,
NL80211_ATTR_FILS_CACHE_ID,
NL80211_ATTR_PMK,
NL80211_ATTR_SCHED_SCAN_MULTI,
NL80211_ATTR_SCHED_SCAN_MAX_REQS,
NL80211_ATTR_WANT_1X_4WAY_HS,
NL80211_ATTR_PMKR0_NAME,
NL80211_ATTR_PORT_AUTHORIZED,
NL80211_ATTR_EXTERNAL_AUTH_ACTION,
NL80211_ATTR_EXTERNAL_AUTH_SUPPORT,
NL80211_ATTR_NSS,
NL80211_ATTR_ACK_SIGNAL,
NL80211_ATTR_CONTROL_PORT_OVER_NL80211,
NL80211_ATTR_TXQ_STATS,
NL80211_ATTR_TXQ_LIMIT,
NL80211_ATTR_TXQ_MEMORY_LIMIT,
NL80211_ATTR_TXQ_QUANTUM,
NL80211_ATTR_HE_CAPABILITY,
NL80211_ATTR_FTM_RESPONDER,
NL80211_ATTR_FTM_RESPONDER_STATS,
NL80211_ATTR_TIMEOUT,
NL80211_ATTR_PEER_MEASUREMENTS,
NL80211_ATTR_AIRTIME_WEIGHT,
NL80211_ATTR_STA_TX_POWER_SETTING,
NL80211_ATTR_STA_TX_POWER,
NL80211_ATTR_SAE_PASSWORD,
NL80211_ATTR_TWT_RESPONDER,
NL80211_ATTR_HE_OBSS_PD,
NL80211_ATTR_WIPHY_EDMG_CHANNELS,
NL80211_ATTR_WIPHY_EDMG_BW_CONFIG,
NL80211_ATTR_VLAN_ID,
NL80211_ATTR_HE_BSS_COLOR,
NL80211_ATTR_IFTYPE_AKM_SUITES,
NL80211_ATTR_TID_CONFIG,
NL80211_ATTR_CONTROL_PORT_NO_PREAUTH,
NL80211_ATTR_PMK_LIFETIME,
NL80211_ATTR_PMK_REAUTH_THRESHOLD,
NL80211_ATTR_RECEIVE_MULTICAST,
NL80211_ATTR_WIPHY_FREQ_OFFSET,
NL80211_ATTR_CENTER_FREQ1_OFFSET,
NL80211_ATTR_SCAN_FREQ_KHZ,
NL80211_ATTR_HE_6GHZ_CAPABILITY,
NL80211_ATTR_FILS_DISCOVERY,
NL80211_ATTR_UNSOL_BCAST_PROBE_RESP,
NL80211_ATTR_S1G_CAPABILITY,
NL80211_ATTR_S1G_CAPABILITY_MASK,
NL80211_ATTR_SAE_PWE,
NL80211_ATTR_RECONNECT_REQUESTED,
NL80211_ATTR_SAR_SPEC,
NL80211_ATTR_DISABLE_HE,
NL80211_ATTR_OBSS_COLOR_BITMAP,
NL80211_ATTR_COLOR_CHANGE_COUNT,
NL80211_ATTR_COLOR_CHANGE_COLOR,
NL80211_ATTR_COLOR_CHANGE_ELEMS,
NL80211_ATTR_MBSSID_CONFIG,
NL80211_ATTR_MBSSID_ELEMS,
NL80211_ATTR_RADAR_BACKGROUND,
NL80211_ATTR_AP_SETTINGS_FLAGS,
NL80211_ATTR_EHT_CAPABILITY,
NL80211_ATTR_DISABLE_EHT,
NL80211_ATTR_MLO_LINKS,
NL80211_ATTR_MLO_LINK_ID,
NL80211_ATTR_MLD_ADDR,
NL80211_ATTR_MLO_SUPPORT,
NL80211_ATTR_MAX_NUM_AKM_SUITES,
NL80211_ATTR_EML_CAPABILITY,
NL80211_ATTR_MLD_CAPA_AND_OPS,
NL80211_ATTR_TX_HW_TIMESTAMP,
NL80211_ATTR_RX_HW_TIMESTAMP,
NL80211_ATTR_TD_BITMAP,
NL80211_ATTR_PUNCT_BITMAP,
NL80211_ATTR_MAX_HW_TIMESTAMP_PEERS,
NL80211_ATTR_HW_TIMESTAMP_ENABLED,
NL80211_ATTR_EMA_RNR_ELEMS,
NL80211_ATTR_MLO_LINK_DISABLED,
NL80211_ATTR_BSS_DUMP_INCLUDE_USE_DATA,
NL80211_ATTR_MLO_TTLM_DLINK,
NL80211_ATTR_MLO_TTLM_ULINK,
NL80211_ATTR_ASSOC_SPP_AMSDU,
NL80211_ATTR_WIPHY_RADIOS,
NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS,
NL80211_ATTR_VIF_RADIO_MASK,
NL80211_ATTR_SUPPORTED_SELECTORS,
NL80211_ATTR_MLO_RECONF_REM_LINKS,
NL80211_ATTR_EPCS,
NL80211_ATTR_ASSOC_MLD_EXT_CAPA_OPS,
NL80211_ATTR_WIPHY_RADIO_INDEX,
NL80211_ATTR_S1G_LONG_BEACON_PERIOD,
NL80211_ATTR_S1G_SHORT_BEACON,
NL80211_ATTR_BSS_PARAM,
NL80211_ATTR_NAN_CONFIG,
NL80211_ATTR_NAN_NEW_CLUSTER,
NL80211_ATTR_NAN_CAPABILITIES,
NL80211_ATTR_S1G_PRIMARY_2MHZ,
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
NUM_NL80211_ATTR = __NL80211_ATTR_AFTER_LAST,
NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
};
/* source-level API compatibility */
#define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION
#define NL80211_ATTR_MESH_PARAMS NL80211_ATTR_MESH_CONFIG
#define NL80211_ATTR_IFACE_SOCKET_OWNER NL80211_ATTR_SOCKET_OWNER
#define NL80211_ATTR_SAE_DATA NL80211_ATTR_AUTH_DATA
#define NL80211_ATTR_CSA_C_OFF_BEACON NL80211_ATTR_CNTDWN_OFFS_BEACON
#define NL80211_ATTR_CSA_C_OFF_PRESP NL80211_ATTR_CNTDWN_OFFS_PRESP
/*
* Allow user space programs to use #ifdef on new attributes by defining them
* here
*/
#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
#define NL80211_ATTR_WIPHY_FREQ NL80211_ATTR_WIPHY_FREQ
#define NL80211_ATTR_WIPHY_CHANNEL_TYPE NL80211_ATTR_WIPHY_CHANNEL_TYPE
#define NL80211_ATTR_MGMT_SUBTYPE NL80211_ATTR_MGMT_SUBTYPE
#define NL80211_ATTR_IE NL80211_ATTR_IE
#define NL80211_ATTR_REG_INITIATOR NL80211_ATTR_REG_INITIATOR
#define NL80211_ATTR_REG_TYPE NL80211_ATTR_REG_TYPE
#define NL80211_ATTR_FRAME NL80211_ATTR_FRAME
#define NL80211_ATTR_SSID NL80211_ATTR_SSID
#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
#define NL80211_ATTR_KEY NL80211_ATTR_KEY
#define NL80211_ATTR_KEYS NL80211_ATTR_KEYS
#define NL80211_ATTR_FEATURE_FLAGS NL80211_ATTR_FEATURE_FLAGS
#define NL80211_WIPHY_NAME_MAXLEN 64
#define NL80211_MAX_SUPP_RATES 32
#define NL80211_MAX_SUPP_SELECTORS 128
#define NL80211_MAX_SUPP_HT_RATES 77
#define NL80211_MAX_SUPP_REG_RULES 128
#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
#define NL80211_HT_CAPABILITY_LEN 26
#define NL80211_VHT_CAPABILITY_LEN 12
#define NL80211_HE_MIN_CAPABILITY_LEN 16
#define NL80211_HE_MAX_CAPABILITY_LEN 54
#define NL80211_MAX_NR_CIPHER_SUITES 5
/*
* NL80211_MAX_NR_AKM_SUITES is obsolete when %NL80211_ATTR_MAX_NUM_AKM_SUITES
* present in %NL80211_CMD_GET_WIPHY response.
*/
#define NL80211_MAX_NR_AKM_SUITES 2
#define NL80211_EHT_MIN_CAPABILITY_LEN 13
#define NL80211_EHT_MAX_CAPABILITY_LEN 51
#define NL80211_MIN_REMAIN_ON_CHANNEL_TIME 10
/* default RSSI threshold for scan results if none specified. */
#define NL80211_SCAN_RSSI_THOLD_OFF -300
#define NL80211_CQM_TXE_MAX_INTVL 1800
/**
* enum nl80211_iftype - (virtual) interface types
*
* @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
* @NL80211_IFTYPE_ADHOC: independent BSS member
* @NL80211_IFTYPE_STATION: managed BSS member
* @NL80211_IFTYPE_AP: access point
* @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points; VLAN interfaces
* are a bit special in that they must always be tied to a pre-existing
* AP type interface.
* @NL80211_IFTYPE_WDS: wireless distribution interface
* @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
* @NL80211_IFTYPE_MESH_POINT: mesh point
* @NL80211_IFTYPE_P2P_CLIENT: P2P client
* @NL80211_IFTYPE_P2P_GO: P2P group owner
* @NL80211_IFTYPE_P2P_DEVICE: P2P device interface type, this is not a netdev
* and therefore can't be created in the normal ways, use the
* %NL80211_CMD_START_P2P_DEVICE and %NL80211_CMD_STOP_P2P_DEVICE
* commands to create and destroy one
* @NL80211_IFTYPE_OCB: Outside Context of a BSS
* This mode corresponds to the MIB variable dot11OCBActivated=true
* @NL80211_IFTYPE_NAN: NAN device interface type (not a netdev)
* @NL80211_IFTYPE_MAX: highest interface type number currently defined
* @NUM_NL80211_IFTYPES: number of defined interface types
*
* These values are used with the %NL80211_ATTR_IFTYPE
* to set the type of an interface.
*
*/
enum nl80211_iftype {
NL80211_IFTYPE_UNSPECIFIED,
NL80211_IFTYPE_ADHOC,
NL80211_IFTYPE_STATION,
NL80211_IFTYPE_AP,
NL80211_IFTYPE_AP_VLAN,
NL80211_IFTYPE_WDS,
NL80211_IFTYPE_MONITOR,
NL80211_IFTYPE_MESH_POINT,
NL80211_IFTYPE_P2P_CLIENT,
NL80211_IFTYPE_P2P_GO,
NL80211_IFTYPE_P2P_DEVICE,
NL80211_IFTYPE_OCB,
NL80211_IFTYPE_NAN,
/* keep last */
NUM_NL80211_IFTYPES,
NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
};
/**
* enum nl80211_sta_flags - station flags
*
* Station flags. When a station is added to an AP interface, it is
* assumed to be already associated (and hence authenticated.)
*
* @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
* @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
* @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
* with short barker preamble
* @NL80211_STA_FLAG_WME: station is WME/QoS capable
* @NL80211_STA_FLAG_MFP: station uses management frame protection
* @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
* @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer -- this flag should
* only be used in managed mode (even in the flags mask). Note that the
* flag can't be changed, it is only valid while adding a station, and
* attempts to change it will silently be ignored (rather than rejected
* as errors.)
* @NL80211_STA_FLAG_ASSOCIATED: station is associated; used with drivers
* that support %NL80211_FEATURE_FULL_AP_CLIENT_STATE to transition a
* previously added station into associated state
* @NL80211_STA_FLAG_SPP_AMSDU: station supports SPP A-MSDUs
* @NL80211_STA_FLAG_MAX: highest station flag number currently defined
* @__NL80211_STA_FLAG_AFTER_LAST: internal use
*/
enum nl80211_sta_flags {
__NL80211_STA_FLAG_INVALID,
NL80211_STA_FLAG_AUTHORIZED,
NL80211_STA_FLAG_SHORT_PREAMBLE,
NL80211_STA_FLAG_WME,
NL80211_STA_FLAG_MFP,
NL80211_STA_FLAG_AUTHENTICATED,
NL80211_STA_FLAG_TDLS_PEER,
NL80211_STA_FLAG_ASSOCIATED,
NL80211_STA_FLAG_SPP_AMSDU,
/* keep last */
__NL80211_STA_FLAG_AFTER_LAST,
NL80211_STA_FLAG_MAX = __NL80211_STA_FLAG_AFTER_LAST - 1
};
/**
* enum nl80211_sta_p2p_ps_status - station support of P2P PS
*
* @NL80211_P2P_PS_UNSUPPORTED: station doesn't support P2P PS mechanism
* @NL80211_P2P_PS_SUPPORTED: station supports P2P PS mechanism
* @NUM_NL80211_P2P_PS_STATUS: number of values
*/
enum nl80211_sta_p2p_ps_status {
NL80211_P2P_PS_UNSUPPORTED = 0,
NL80211_P2P_PS_SUPPORTED,
NUM_NL80211_P2P_PS_STATUS,
};
#define NL80211_STA_FLAG_MAX_OLD_API NL80211_STA_FLAG_TDLS_PEER
/**
* struct nl80211_sta_flag_update - station flags mask/set
* @mask: mask of station flags to set
* @set: which values to set them to
*
* Both mask and set contain bits as per &enum nl80211_sta_flags.
*/
struct nl80211_sta_flag_update {
__u32 mask;
__u32 set;
} __attribute__((packed));
/**
* enum nl80211_he_gi - HE guard interval
* @NL80211_RATE_INFO_HE_GI_0_8: 0.8 usec
* @NL80211_RATE_INFO_HE_GI_1_6: 1.6 usec
* @NL80211_RATE_INFO_HE_GI_3_2: 3.2 usec
*/
enum nl80211_he_gi {
NL80211_RATE_INFO_HE_GI_0_8,
NL80211_RATE_INFO_HE_GI_1_6,
NL80211_RATE_INFO_HE_GI_3_2,
};
/**
* enum nl80211_he_ltf - HE long training field
* @NL80211_RATE_INFO_HE_1XLTF: 3.2 usec
* @NL80211_RATE_INFO_HE_2XLTF: 6.4 usec
* @NL80211_RATE_INFO_HE_4XLTF: 12.8 usec
*/
enum nl80211_he_ltf {
NL80211_RATE_INFO_HE_1XLTF,
NL80211_RATE_INFO_HE_2XLTF,
NL80211_RATE_INFO_HE_4XLTF,
};
/**
* enum nl80211_he_ru_alloc - HE RU allocation values
* @NL80211_RATE_INFO_HE_RU_ALLOC_26: 26-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_52: 52-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_106: 106-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_242: 242-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_484: 484-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_996: 996-tone RU allocation
* @NL80211_RATE_INFO_HE_RU_ALLOC_2x996: 2x996-tone RU allocation
*/
enum nl80211_he_ru_alloc {
NL80211_RATE_INFO_HE_RU_ALLOC_26,
NL80211_RATE_INFO_HE_RU_ALLOC_52,
NL80211_RATE_INFO_HE_RU_ALLOC_106,
NL80211_RATE_INFO_HE_RU_ALLOC_242,
NL80211_RATE_INFO_HE_RU_ALLOC_484,
NL80211_RATE_INFO_HE_RU_ALLOC_996,
NL80211_RATE_INFO_HE_RU_ALLOC_2x996,
};
/**
* enum nl80211_eht_gi - EHT guard interval
* @NL80211_RATE_INFO_EHT_GI_0_8: 0.8 usec
* @NL80211_RATE_INFO_EHT_GI_1_6: 1.6 usec
* @NL80211_RATE_INFO_EHT_GI_3_2: 3.2 usec
*/
enum nl80211_eht_gi {
NL80211_RATE_INFO_EHT_GI_0_8,
NL80211_RATE_INFO_EHT_GI_1_6,
NL80211_RATE_INFO_EHT_GI_3_2,
};
/**
* enum nl80211_eht_ltf - EHT long training field
* @NL80211_RATE_INFO_EHT_1XLTF: 3.2 usec
* @NL80211_RATE_INFO_EHT_2XLTF: 6.4 usec
* @NL80211_RATE_INFO_EHT_4XLTF: 12.8 usec
* @NL80211_RATE_INFO_EHT_6XLTF: 19.2 usec
* @NL80211_RATE_INFO_EHT_8XLTF: 25.6 usec
*/
enum nl80211_eht_ltf {
NL80211_RATE_INFO_EHT_1XLTF,
NL80211_RATE_INFO_EHT_2XLTF,
NL80211_RATE_INFO_EHT_4XLTF,
NL80211_RATE_INFO_EHT_6XLTF,
NL80211_RATE_INFO_EHT_8XLTF,
};
/**
* enum nl80211_eht_ru_alloc - EHT RU allocation values
* @NL80211_RATE_INFO_EHT_RU_ALLOC_26: 26-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_52: 52-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_52P26: 52+26-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_106: 106-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_106P26: 106+26 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_242: 242-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_484: 484-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_484P242: 484+242 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_996: 996-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484: 996+484 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242: 996+484+242 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996: 2x996-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484: 2x996+484 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996: 3x996-tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484: 3x996+484 tone RU allocation
* @NL80211_RATE_INFO_EHT_RU_ALLOC_4x996: 4x996-tone RU allocation
*/
enum nl80211_eht_ru_alloc {
NL80211_RATE_INFO_EHT_RU_ALLOC_26,
NL80211_RATE_INFO_EHT_RU_ALLOC_52,
NL80211_RATE_INFO_EHT_RU_ALLOC_52P26,
NL80211_RATE_INFO_EHT_RU_ALLOC_106,
NL80211_RATE_INFO_EHT_RU_ALLOC_106P26,
NL80211_RATE_INFO_EHT_RU_ALLOC_242,
NL80211_RATE_INFO_EHT_RU_ALLOC_484,
NL80211_RATE_INFO_EHT_RU_ALLOC_484P242,
NL80211_RATE_INFO_EHT_RU_ALLOC_996,
NL80211_RATE_INFO_EHT_RU_ALLOC_996P484,
NL80211_RATE_INFO_EHT_RU_ALLOC_996P484P242,
NL80211_RATE_INFO_EHT_RU_ALLOC_2x996,
NL80211_RATE_INFO_EHT_RU_ALLOC_2x996P484,
NL80211_RATE_INFO_EHT_RU_ALLOC_3x996,
NL80211_RATE_INFO_EHT_RU_ALLOC_3x996P484,
NL80211_RATE_INFO_EHT_RU_ALLOC_4x996,
};
/**
* enum nl80211_rate_info - bitrate information
*
* These attribute types are used with %NL80211_STA_INFO_TXRATE
* when getting information about the bitrate of a station.
* There are 2 attributes for bitrate, a legacy one that represents
* a 16-bit value, and new one that represents a 32-bit value.
* If the rate value fits into 16 bit, both attributes are reported
* with the same value. If the rate is too high to fit into 16 bits
* (>6.5535Gbps) only 32-bit attribute is included.
* User space tools encouraged to use the 32-bit attribute and fall
* back to the 16-bit one for compatibility with older kernels.
*
* @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved
* @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s)
* @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8)
* @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate
* @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval
* @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s)
* @NL80211_RATE_INFO_MAX: highest rate_info number currently defined
* @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8)
* @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8)
* @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate
* @NL80211_RATE_INFO_80P80_MHZ_WIDTH: unused - 80+80 is treated the
* same as 160 for purposes of the bitrates
* @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate
* @NL80211_RATE_INFO_10_MHZ_WIDTH: 10 MHz width - note that this is
* a legacy rate and will be reported as the actual bitrate, i.e.
* half the base (20 MHz) rate
* @NL80211_RATE_INFO_5_MHZ_WIDTH: 5 MHz width - note that this is
* a legacy rate and will be reported as the actual bitrate, i.e.
* a quarter of the base (20 MHz) rate
* @NL80211_RATE_INFO_HE_MCS: HE MCS index (u8, 0-11)
* @NL80211_RATE_INFO_HE_NSS: HE NSS value (u8, 1-8)
* @NL80211_RATE_INFO_HE_GI: HE guard interval identifier
* (u8, see &enum nl80211_he_gi)
* @NL80211_RATE_INFO_HE_DCM: HE DCM value (u8, 0/1)
* @NL80211_RATE_INFO_HE_RU_ALLOC: HE RU allocation, if not present then
* non-OFDMA was used (u8, see &enum nl80211_he_ru_alloc)
* @NL80211_RATE_INFO_320_MHZ_WIDTH: 320 MHz bitrate
* @NL80211_RATE_INFO_EHT_MCS: EHT MCS index (u8, 0-15)
* @NL80211_RATE_INFO_EHT_NSS: EHT NSS value (u8, 1-8)
* @NL80211_RATE_INFO_EHT_GI: EHT guard interval identifier
* (u8, see &enum nl80211_eht_gi)
* @NL80211_RATE_INFO_EHT_RU_ALLOC: EHT RU allocation, if not present then
* non-OFDMA was used (u8, see &enum nl80211_eht_ru_alloc)
* @NL80211_RATE_INFO_S1G_MCS: S1G MCS index (u8, 0-10)
* @NL80211_RATE_INFO_S1G_NSS: S1G NSS value (u8, 1-4)
* @NL80211_RATE_INFO_1_MHZ_WIDTH: 1 MHz S1G rate
* @NL80211_RATE_INFO_2_MHZ_WIDTH: 2 MHz S1G rate
* @NL80211_RATE_INFO_4_MHZ_WIDTH: 4 MHz S1G rate
* @NL80211_RATE_INFO_8_MHZ_WIDTH: 8 MHz S1G rate
* @NL80211_RATE_INFO_16_MHZ_WIDTH: 16 MHz S1G rate
* @__NL80211_RATE_INFO_AFTER_LAST: internal use
*/
enum nl80211_rate_info {
__NL80211_RATE_INFO_INVALID,
NL80211_RATE_INFO_BITRATE,
NL80211_RATE_INFO_MCS,
NL80211_RATE_INFO_40_MHZ_WIDTH,
NL80211_RATE_INFO_SHORT_GI,
NL80211_RATE_INFO_BITRATE32,
NL80211_RATE_INFO_VHT_MCS,
NL80211_RATE_INFO_VHT_NSS,
NL80211_RATE_INFO_80_MHZ_WIDTH,
NL80211_RATE_INFO_80P80_MHZ_WIDTH,
NL80211_RATE_INFO_160_MHZ_WIDTH,
NL80211_RATE_INFO_10_MHZ_WIDTH,
NL80211_RATE_INFO_5_MHZ_WIDTH,
NL80211_RATE_INFO_HE_MCS,
NL80211_RATE_INFO_HE_NSS,
NL80211_RATE_INFO_HE_GI,
NL80211_RATE_INFO_HE_DCM,
NL80211_RATE_INFO_HE_RU_ALLOC,
NL80211_RATE_INFO_320_MHZ_WIDTH,
NL80211_RATE_INFO_EHT_MCS,
NL80211_RATE_INFO_EHT_NSS,
NL80211_RATE_INFO_EHT_GI,
NL80211_RATE_INFO_EHT_RU_ALLOC,
NL80211_RATE_INFO_S1G_MCS,
NL80211_RATE_INFO_S1G_NSS,
NL80211_RATE_INFO_1_MHZ_WIDTH,
NL80211_RATE_INFO_2_MHZ_WIDTH,
NL80211_RATE_INFO_4_MHZ_WIDTH,
NL80211_RATE_INFO_8_MHZ_WIDTH,
NL80211_RATE_INFO_16_MHZ_WIDTH,
/* keep last */
__NL80211_RATE_INFO_AFTER_LAST,
NL80211_RATE_INFO_MAX = __NL80211_RATE_INFO_AFTER_LAST - 1
};
/**
* enum nl80211_sta_bss_param - BSS information collected by STA
*
* These attribute types are used with %NL80211_STA_INFO_BSS_PARAM
* when getting information about the bitrate of a station.
*
* @__NL80211_STA_BSS_PARAM_INVALID: attribute number 0 is reserved
* @NL80211_STA_BSS_PARAM_CTS_PROT: whether CTS protection is enabled (flag)
* @NL80211_STA_BSS_PARAM_SHORT_PREAMBLE: whether short preamble is enabled
* (flag)
* @NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME: whether short slot time is enabled
* (flag)
* @NL80211_STA_BSS_PARAM_DTIM_PERIOD: DTIM period for beaconing (u8)
* @NL80211_STA_BSS_PARAM_BEACON_INTERVAL: Beacon interval (u16)
* @NL80211_STA_BSS_PARAM_MAX: highest sta_bss_param number currently defined
* @__NL80211_STA_BSS_PARAM_AFTER_LAST: internal use
*/
enum nl80211_sta_bss_param {
__NL80211_STA_BSS_PARAM_INVALID,
NL80211_STA_BSS_PARAM_CTS_PROT,
NL80211_STA_BSS_PARAM_SHORT_PREAMBLE,
NL80211_STA_BSS_PARAM_SHORT_SLOT_TIME,
NL80211_STA_BSS_PARAM_DTIM_PERIOD,
NL80211_STA_BSS_PARAM_BEACON_INTERVAL,
/* keep last */
__NL80211_STA_BSS_PARAM_AFTER_LAST,
NL80211_STA_BSS_PARAM_MAX = __NL80211_STA_BSS_PARAM_AFTER_LAST - 1
};
/**
* enum nl80211_sta_info - station information
*
* These attribute types are used with %NL80211_ATTR_STA_INFO
* when getting information about a station.
*
* @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved
* @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs)
* @NL80211_STA_INFO_RX_BYTES: total received bytes (MPDU length)
* (u32, from this station)
* @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (MPDU length)
* (u32, to this station)
* @NL80211_STA_INFO_RX_BYTES64: total received bytes (MPDU length)
* (u64, from this station)
* @NL80211_STA_INFO_TX_BYTES64: total transmitted bytes (MPDU length)
* (u64, to this station)
* @NL80211_STA_INFO_SIGNAL: signal strength of last received PPDU (u8, dBm)
* @NL80211_STA_INFO_TX_BITRATE: current unicast tx rate, nested attribute
* containing info as possible, see &enum nl80211_rate_info
* @NL80211_STA_INFO_RX_PACKETS: total received packet (MSDUs and MMPDUs)
* (u32, from this station)
* @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (MSDUs and MMPDUs)
* (u32, to this station)
* @NL80211_STA_INFO_TX_RETRIES: total retries (MPDUs) (u32, to this station)
* @NL80211_STA_INFO_TX_FAILED: total failed packets (MPDUs)
* (u32, to this station)
* @NL80211_STA_INFO_SIGNAL_AVG: signal strength average (u8, dBm)
* @NL80211_STA_INFO_LLID: the station's mesh LLID
* @NL80211_STA_INFO_PLID: the station's mesh PLID
* @NL80211_STA_INFO_PLINK_STATE: peer link state for the station
* (see %enum nl80211_plink_state)
* @NL80211_STA_INFO_RX_BITRATE: last unicast data frame rx rate, nested
* attribute, like NL80211_STA_INFO_TX_BITRATE.
* @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
* containing info as possible, see &enum nl80211_sta_bss_param
* @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
* @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
* @NL80211_STA_INFO_BEACON_LOSS: count of times beacon loss was detected (u32)
* @NL80211_STA_INFO_T_OFFSET: timing offset with respect to this STA (s64)
* @NL80211_STA_INFO_LOCAL_PM: local mesh STA link-specific power mode
* @NL80211_STA_INFO_PEER_PM: peer mesh STA link-specific power mode
* @NL80211_STA_INFO_NONPEER_PM: neighbor mesh STA power save mode towards
* non-peer STA
* @NL80211_STA_INFO_CHAIN_SIGNAL: per-chain signal strength of last PPDU
* Contains a nested array of signal strength attributes (u8, dBm)
* @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
* Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
* @NL80211_STA_INFO_EXPECTED_THROUGHPUT: expected throughput considering also
* the 802.11 header (u32, kbps)
* @NL80211_STA_INFO_RX_DROP_MISC: RX packets dropped for unspecified reasons
* (u64)
* @NL80211_STA_INFO_BEACON_RX: number of beacons received from this peer (u64)
* @NL80211_STA_INFO_BEACON_SIGNAL_AVG: signal strength average
* for beacons only (u8, dBm)
* @NL80211_STA_INFO_TID_STATS: per-TID statistics (see &enum nl80211_tid_stats)
* This is a nested attribute where each the inner attribute number is the
* TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames;
* each one of those is again nested with &enum nl80211_tid_stats
* attributes carrying the actual values.
* @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames
* received from the station (u64, usec)
* @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
* @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
* @NL80211_STA_INFO_ACK_SIGNAL_AVG: avg signal strength of ACK frames (s8, dBm)
* @NL80211_STA_INFO_RX_MPDUS: total number of received packets (MPDUs)
* (u32, from this station)
* @NL80211_STA_INFO_FCS_ERROR_COUNT: total number of packets (MPDUs) received
* with an FCS error (u32, from this station). This count may not include
* some packets with an FCS error due to TA corruption. Hence this counter
* might not be fully accurate.
* @NL80211_STA_INFO_CONNECTED_TO_GATE: set to true if STA has a path to a
* mesh gate (u8, 0 or 1)
* @NL80211_STA_INFO_TX_DURATION: aggregate PPDU duration for all frames
* sent to the station (u64, usec)
* @NL80211_STA_INFO_AIRTIME_WEIGHT: current airtime weight for station (u16)
* @NL80211_STA_INFO_AIRTIME_LINK_METRIC: airtime link metric for mesh station
* @NL80211_STA_INFO_ASSOC_AT_BOOTTIME: Timestamp (CLOCK_BOOTTIME, nanoseconds)
* of STA's association
* @NL80211_STA_INFO_CONNECTED_TO_AS: set to true if STA has a path to a
* authentication server (u8, 0 or 1)
* @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
enum nl80211_sta_info {
__NL80211_STA_INFO_INVALID,
NL80211_STA_INFO_INACTIVE_TIME,
NL80211_STA_INFO_RX_BYTES,
NL80211_STA_INFO_TX_BYTES,
NL80211_STA_INFO_LLID,
NL80211_STA_INFO_PLID,
NL80211_STA_INFO_PLINK_STATE,
NL80211_STA_INFO_SIGNAL,
NL80211_STA_INFO_TX_BITRATE,
NL80211_STA_INFO_RX_PACKETS,
NL80211_STA_INFO_TX_PACKETS,
NL80211_STA_INFO_TX_RETRIES,
NL80211_STA_INFO_TX_FAILED,
NL80211_STA_INFO_SIGNAL_AVG,
NL80211_STA_INFO_RX_BITRATE,
NL80211_STA_INFO_BSS_PARAM,
NL80211_STA_INFO_CONNECTED_TIME,
NL80211_STA_INFO_STA_FLAGS,
NL80211_STA_INFO_BEACON_LOSS,
NL80211_STA_INFO_T_OFFSET,
NL80211_STA_INFO_LOCAL_PM,
NL80211_STA_INFO_PEER_PM,
NL80211_STA_INFO_NONPEER_PM,
NL80211_STA_INFO_RX_BYTES64,
NL80211_STA_INFO_TX_BYTES64,
NL80211_STA_INFO_CHAIN_SIGNAL,
NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
NL80211_STA_INFO_EXPECTED_THROUGHPUT,
NL80211_STA_INFO_RX_DROP_MISC,
NL80211_STA_INFO_BEACON_RX,
NL80211_STA_INFO_BEACON_SIGNAL_AVG,
NL80211_STA_INFO_TID_STATS,
NL80211_STA_INFO_RX_DURATION,
NL80211_STA_INFO_PAD,
NL80211_STA_INFO_ACK_SIGNAL,
NL80211_STA_INFO_ACK_SIGNAL_AVG,
NL80211_STA_INFO_RX_MPDUS,
NL80211_STA_INFO_FCS_ERROR_COUNT,
NL80211_STA_INFO_CONNECTED_TO_GATE,
NL80211_STA_INFO_TX_DURATION,
NL80211_STA_INFO_AIRTIME_WEIGHT,
NL80211_STA_INFO_AIRTIME_LINK_METRIC,
NL80211_STA_INFO_ASSOC_AT_BOOTTIME,
NL80211_STA_INFO_CONNECTED_TO_AS,
/* keep last */
__NL80211_STA_INFO_AFTER_LAST,
NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1
};
/* we renamed this - stay compatible */
#define NL80211_STA_INFO_DATA_ACK_SIGNAL_AVG NL80211_STA_INFO_ACK_SIGNAL_AVG
/**
* enum nl80211_tid_stats - per TID statistics attributes
* @__NL80211_TID_STATS_INVALID: attribute number 0 is reserved
* @NL80211_TID_STATS_RX_MSDU: number of MSDUs received (u64)
* @NL80211_TID_STATS_TX_MSDU: number of MSDUs transmitted (or
* attempted to transmit; u64)
* @NL80211_TID_STATS_TX_MSDU_RETRIES: number of retries for
* transmitted MSDUs (not counting the first attempt; u64)
* @NL80211_TID_STATS_TX_MSDU_FAILED: number of failed transmitted
* MSDUs (u64)
* @NL80211_TID_STATS_PAD: attribute used for padding for 64-bit alignment
* @NL80211_TID_STATS_TXQ_STATS: TXQ stats (nested attribute)
* @NUM_NL80211_TID_STATS: number of attributes here
* @NL80211_TID_STATS_MAX: highest numbered attribute here
*/
enum nl80211_tid_stats {
__NL80211_TID_STATS_INVALID,
NL80211_TID_STATS_RX_MSDU,
NL80211_TID_STATS_TX_MSDU,
NL80211_TID_STATS_TX_MSDU_RETRIES,
NL80211_TID_STATS_TX_MSDU_FAILED,
NL80211_TID_STATS_PAD,
NL80211_TID_STATS_TXQ_STATS,
/* keep last */
NUM_NL80211_TID_STATS,
NL80211_TID_STATS_MAX = NUM_NL80211_TID_STATS - 1
};
/**
* enum nl80211_txq_stats - per TXQ statistics attributes
* @__NL80211_TXQ_STATS_INVALID: attribute number 0 is reserved
* @NUM_NL80211_TXQ_STATS: number of attributes here
* @NL80211_TXQ_STATS_BACKLOG_BYTES: number of bytes currently backlogged
* @NL80211_TXQ_STATS_BACKLOG_PACKETS: number of packets currently
* backlogged
* @NL80211_TXQ_STATS_FLOWS: total number of new flows seen
* @NL80211_TXQ_STATS_DROPS: total number of packet drops
* @NL80211_TXQ_STATS_ECN_MARKS: total number of packet ECN marks
* @NL80211_TXQ_STATS_OVERLIMIT: number of drops due to queue space overflow
* @NL80211_TXQ_STATS_OVERMEMORY: number of drops due to memory limit overflow
* (only for per-phy stats)
* @NL80211_TXQ_STATS_COLLISIONS: number of hash collisions
* @NL80211_TXQ_STATS_TX_BYTES: total number of bytes dequeued from TXQ
* @NL80211_TXQ_STATS_TX_PACKETS: total number of packets dequeued from TXQ
* @NL80211_TXQ_STATS_MAX_FLOWS: number of flow buckets for PHY
* @NL80211_TXQ_STATS_MAX: highest numbered attribute here
*/
enum nl80211_txq_stats {
__NL80211_TXQ_STATS_INVALID,
NL80211_TXQ_STATS_BACKLOG_BYTES,
NL80211_TXQ_STATS_BACKLOG_PACKETS,
NL80211_TXQ_STATS_FLOWS,
NL80211_TXQ_STATS_DROPS,
NL80211_TXQ_STATS_ECN_MARKS,
NL80211_TXQ_STATS_OVERLIMIT,
NL80211_TXQ_STATS_OVERMEMORY,
NL80211_TXQ_STATS_COLLISIONS,
NL80211_TXQ_STATS_TX_BYTES,
NL80211_TXQ_STATS_TX_PACKETS,
NL80211_TXQ_STATS_MAX_FLOWS,
/* keep last */
NUM_NL80211_TXQ_STATS,
NL80211_TXQ_STATS_MAX = NUM_NL80211_TXQ_STATS - 1
};
/**
* enum nl80211_mpath_flags - nl80211 mesh path flags
*
* @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
* @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
* @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
* @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
* @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
*/
enum nl80211_mpath_flags {
NL80211_MPATH_FLAG_ACTIVE = 1<<0,
NL80211_MPATH_FLAG_RESOLVING = 1<<1,
NL80211_MPATH_FLAG_SN_VALID = 1<<2,
NL80211_MPATH_FLAG_FIXED = 1<<3,
NL80211_MPATH_FLAG_RESOLVED = 1<<4,
};
/**
* enum nl80211_mpath_info - mesh path information
*
* These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting
* information about a mesh path.
*
* @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
* @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
* @NL80211_MPATH_INFO_SN: destination sequence number
* @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
* @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
* @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
* &enum nl80211_mpath_flags;
* @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
* @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
* @NL80211_MPATH_INFO_HOP_COUNT: hop count to destination
* @NL80211_MPATH_INFO_PATH_CHANGE: total number of path changes to destination
* @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
* currently defined
* @__NL80211_MPATH_INFO_AFTER_LAST: internal use
*/
enum nl80211_mpath_info {
__NL80211_MPATH_INFO_INVALID,
NL80211_MPATH_INFO_FRAME_QLEN,
NL80211_MPATH_INFO_SN,
NL80211_MPATH_INFO_METRIC,
NL80211_MPATH_INFO_EXPTIME,
NL80211_MPATH_INFO_FLAGS,
NL80211_MPATH_INFO_DISCOVERY_TIMEOUT,
NL80211_MPATH_INFO_DISCOVERY_RETRIES,
NL80211_MPATH_INFO_HOP_COUNT,
NL80211_MPATH_INFO_PATH_CHANGE,
/* keep last */
__NL80211_MPATH_INFO_AFTER_LAST,
NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1
};
/**
* enum nl80211_band_iftype_attr - Interface type data attributes
*
* @__NL80211_BAND_IFTYPE_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_BAND_IFTYPE_ATTR_IFTYPES: nested attribute containing a flag attribute
* for each interface type that supports the band data
* @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC: HE MAC capabilities as in HE
* capabilities IE
* @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY: HE PHY capabilities as in HE
* capabilities IE
* @NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET: HE supported NSS/MCS as in HE
* capabilities IE
* @NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE: HE PPE thresholds information as
* defined in HE capabilities IE
* @NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA: HE 6GHz band capabilities (__le16),
* given for all 6 GHz band channels
* @NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS: vendor element capabilities that are
* advertised on this band/for this iftype (binary)
* @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC: EHT MAC capabilities as in EHT
* capabilities element
* @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY: EHT PHY capabilities as in EHT
* capabilities element
* @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET: EHT supported NSS/MCS as in EHT
* capabilities element
* @NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE: EHT PPE thresholds information as
* defined in EHT capabilities element
* @__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST: internal use
* @NL80211_BAND_IFTYPE_ATTR_MAX: highest band attribute currently defined
*/
enum nl80211_band_iftype_attr {
__NL80211_BAND_IFTYPE_ATTR_INVALID,
NL80211_BAND_IFTYPE_ATTR_IFTYPES,
NL80211_BAND_IFTYPE_ATTR_HE_CAP_MAC,
NL80211_BAND_IFTYPE_ATTR_HE_CAP_PHY,
NL80211_BAND_IFTYPE_ATTR_HE_CAP_MCS_SET,
NL80211_BAND_IFTYPE_ATTR_HE_CAP_PPE,
NL80211_BAND_IFTYPE_ATTR_HE_6GHZ_CAPA,
NL80211_BAND_IFTYPE_ATTR_VENDOR_ELEMS,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MAC,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PHY,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_MCS_SET,
NL80211_BAND_IFTYPE_ATTR_EHT_CAP_PPE,
/* keep last */
__NL80211_BAND_IFTYPE_ATTR_AFTER_LAST,
NL80211_BAND_IFTYPE_ATTR_MAX = __NL80211_BAND_IFTYPE_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_band_attr - band attributes
* @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
* an array of nested frequency attributes
* @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
* an array of nested bitrate attributes
* @NL80211_BAND_ATTR_HT_MCS_SET: 16-byte attribute containing the MCS set as
* defined in 802.11n
* @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
* @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
* @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
* @NL80211_BAND_ATTR_VHT_MCS_SET: 32-byte attribute containing the MCS set as
* defined in 802.11ac
* @NL80211_BAND_ATTR_VHT_CAPA: VHT capabilities, as in the HT information IE
* @NL80211_BAND_ATTR_IFTYPE_DATA: nested array attribute, with each entry using
* attributes from &enum nl80211_band_iftype_attr
* @NL80211_BAND_ATTR_EDMG_CHANNELS: bitmap that indicates the 2.16 GHz
* channel(s) that are allowed to be used for EDMG transmissions.
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251.
* @NL80211_BAND_ATTR_EDMG_BW_CONFIG: Channel BW Configuration subfield encodes
* the allowed channel bandwidth configurations.
* Defined by IEEE P802.11ay/D4.0 section 9.4.2.251, Table 13.
* @NL80211_BAND_ATTR_S1G_MCS_NSS_SET: S1G capabilities, supported S1G-MCS and NSS
* set subfield, as in the S1G information IE, 5 bytes
* @NL80211_BAND_ATTR_S1G_CAPA: S1G capabilities information subfield as in the
* S1G information IE, 10 bytes
* @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
* @__NL80211_BAND_ATTR_AFTER_LAST: internal use
*/
enum nl80211_band_attr {
__NL80211_BAND_ATTR_INVALID,
NL80211_BAND_ATTR_FREQS,
NL80211_BAND_ATTR_RATES,
NL80211_BAND_ATTR_HT_MCS_SET,
NL80211_BAND_ATTR_HT_CAPA,
NL80211_BAND_ATTR_HT_AMPDU_FACTOR,
NL80211_BAND_ATTR_HT_AMPDU_DENSITY,
NL80211_BAND_ATTR_VHT_MCS_SET,
NL80211_BAND_ATTR_VHT_CAPA,
NL80211_BAND_ATTR_IFTYPE_DATA,
NL80211_BAND_ATTR_EDMG_CHANNELS,
NL80211_BAND_ATTR_EDMG_BW_CONFIG,
NL80211_BAND_ATTR_S1G_MCS_NSS_SET,
NL80211_BAND_ATTR_S1G_CAPA,
/* keep last */
__NL80211_BAND_ATTR_AFTER_LAST,
NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
};
#define NL80211_BAND_ATTR_HT_CAPA NL80211_BAND_ATTR_HT_CAPA
/**
* enum nl80211_wmm_rule - regulatory wmm rule
*
* @__NL80211_WMMR_INVALID: attribute number 0 is reserved
* @NL80211_WMMR_CW_MIN: Minimum contention window slot.
* @NL80211_WMMR_CW_MAX: Maximum contention window slot.
* @NL80211_WMMR_AIFSN: Arbitration Inter Frame Space.
* @NL80211_WMMR_TXOP: Maximum allowed tx operation time.
* @NL80211_WMMR_MAX: highest possible wmm rule.
* @__NL80211_WMMR_LAST: Internal use.
*/
enum nl80211_wmm_rule {
__NL80211_WMMR_INVALID,
NL80211_WMMR_CW_MIN,
NL80211_WMMR_CW_MAX,
NL80211_WMMR_AIFSN,
NL80211_WMMR_TXOP,
/* keep last */
__NL80211_WMMR_LAST,
NL80211_WMMR_MAX = __NL80211_WMMR_LAST - 1
};
/**
* enum nl80211_frequency_attr - frequency attributes
* @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
* @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
* regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_IR: no mechanisms that initiate radiation
* are permitted on this channel, this includes sending probe
* requests, or modes of operation that require beaconing.
* @__NL80211_FREQUENCY_ATTR_NO_IBSS: obsolete, same as _NO_IR
* @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
* (100 * dBm).
* @NL80211_FREQUENCY_ATTR_DFS_STATE: current state for DFS
* (enum nl80211_dfs_state)
* @NL80211_FREQUENCY_ATTR_DFS_TIME: time in milliseconds for how long
* this channel is in this DFS state.
* @NL80211_FREQUENCY_ATTR_NO_HT40_MINUS: HT40- isn't possible with this
* channel as the control channel
* @NL80211_FREQUENCY_ATTR_NO_HT40_PLUS: HT40+ isn't possible with this
* channel as the control channel
* @NL80211_FREQUENCY_ATTR_NO_80MHZ: any 80 MHz channel using this channel
* as the primary or any of the secondary channels isn't possible,
* this includes 80+80 channels
* @NL80211_FREQUENCY_ATTR_NO_160MHZ: any 160 MHz (but not 80+80) channel
* using this channel as the primary or any of the secondary channels
* isn't possible
* @NL80211_FREQUENCY_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
* @NL80211_FREQUENCY_ATTR_INDOOR_ONLY: Only indoor use is permitted on this
* channel. A channel that has the INDOOR_ONLY attribute can only be
* used when there is a clear assessment that the device is operating in
* an indoor surroundings, i.e., it is connected to AC power (and not
* through portable DC inverters) or is under the control of a master
* that is acting as an AP and is connected to AC power.
* @NL80211_FREQUENCY_ATTR_IR_CONCURRENT: IR operation is allowed on this
* channel if it's connected concurrently to a BSS on the same channel on
* the 2 GHz band or to a channel in the same UNII band (on the 5 GHz
* band), and IEEE80211_CHAN_RADAR is not set. Instantiating a GO or TDLS
* off-channel on a channel that has the IR_CONCURRENT attribute set can be
* done when there is a clear assessment that the device is operating under
* the guidance of an authorized master, i.e., setting up a GO or TDLS
* off-channel while the device is also connected to an AP with DFS and
* radar detection on the UNII band (it is up to user-space, i.e.,
* wpa_supplicant to perform the required verifications). Using this
* attribute for IR is disallowed for master interfaces (IBSS, AP).
* @NL80211_FREQUENCY_ATTR_NO_20MHZ: 20 MHz operation is not allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_10MHZ: 10 MHz operation is not allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_WMM: this channel has wmm limitations.
* This is a nested attribute that contains the wmm limitation per AC.
* (see &enum nl80211_wmm_rule)
* @NL80211_FREQUENCY_ATTR_NO_HE: HE operation is not allowed on this channel
* in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_OFFSET: frequency offset in KHz
* @NL80211_FREQUENCY_ATTR_1MHZ: 1 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_2MHZ: 2 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_4MHZ: 4 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_8MHZ: 8 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_16MHZ: 16 MHz operation is allowed
* on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_320MHZ: any 320 MHz channel using this channel
* as the primary or any of the secondary channels isn't possible
* @NL80211_FREQUENCY_ATTR_NO_EHT: EHT operation is not allowed on this channel
* in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_PSD: Power spectral density (in dBm) that
* is allowed on this channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_DFS_CONCURRENT: Operation on this channel is
* allowed for peer-to-peer or adhoc communication under the control
* of a DFS master which operates on the same channel (FCC-594280 D01
* Section B.3). Should be used together with %NL80211_RRF_DFS only.
* @NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP
* not allowed using this channel
* @NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP
* not allowed using this channel
* @NL80211_FREQUENCY_ATTR_CAN_MONITOR: This channel can be used in monitor
* mode despite other (regulatory) restrictions, even if the channel is
* otherwise completely disabled.
* @NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP: This channel can be used for a
* very low power (VLP) AP, despite being NO_IR.
* @NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY: This channel can be active in
* 20 MHz bandwidth, despite being NO_IR.
* @NL80211_FREQUENCY_ATTR_NO_4MHZ: 4 MHz operation is not allowed on this
* channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_8MHZ: 8 MHz operation is not allowed on this
* channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_NO_16MHZ: 16 MHz operation is not allowed on this
* channel in current regulatory domain.
* @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
* currently defined
* @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
*
* See https://apps.fcc.gov/eas/comments/GetPublishedDocument.html?id=327&tn=528122
* for more information on the FCC description of the relaxations allowed
* by NL80211_FREQUENCY_ATTR_INDOOR_ONLY and
* NL80211_FREQUENCY_ATTR_IR_CONCURRENT.
*/
enum nl80211_frequency_attr {
__NL80211_FREQUENCY_ATTR_INVALID,
NL80211_FREQUENCY_ATTR_FREQ,
NL80211_FREQUENCY_ATTR_DISABLED,
NL80211_FREQUENCY_ATTR_NO_IR,
__NL80211_FREQUENCY_ATTR_NO_IBSS,
NL80211_FREQUENCY_ATTR_RADAR,
NL80211_FREQUENCY_ATTR_MAX_TX_POWER,
NL80211_FREQUENCY_ATTR_DFS_STATE,
NL80211_FREQUENCY_ATTR_DFS_TIME,
NL80211_FREQUENCY_ATTR_NO_HT40_MINUS,
NL80211_FREQUENCY_ATTR_NO_HT40_PLUS,
NL80211_FREQUENCY_ATTR_NO_80MHZ,
NL80211_FREQUENCY_ATTR_NO_160MHZ,
NL80211_FREQUENCY_ATTR_DFS_CAC_TIME,
NL80211_FREQUENCY_ATTR_INDOOR_ONLY,
NL80211_FREQUENCY_ATTR_IR_CONCURRENT,
NL80211_FREQUENCY_ATTR_NO_20MHZ,
NL80211_FREQUENCY_ATTR_NO_10MHZ,
NL80211_FREQUENCY_ATTR_WMM,
NL80211_FREQUENCY_ATTR_NO_HE,
NL80211_FREQUENCY_ATTR_OFFSET,
NL80211_FREQUENCY_ATTR_1MHZ,
NL80211_FREQUENCY_ATTR_2MHZ,
NL80211_FREQUENCY_ATTR_4MHZ,
NL80211_FREQUENCY_ATTR_8MHZ,
NL80211_FREQUENCY_ATTR_16MHZ,
NL80211_FREQUENCY_ATTR_NO_320MHZ,
NL80211_FREQUENCY_ATTR_NO_EHT,
NL80211_FREQUENCY_ATTR_PSD,
NL80211_FREQUENCY_ATTR_DFS_CONCURRENT,
NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT,
NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT,
NL80211_FREQUENCY_ATTR_CAN_MONITOR,
NL80211_FREQUENCY_ATTR_ALLOW_6GHZ_VLP_AP,
NL80211_FREQUENCY_ATTR_ALLOW_20MHZ_ACTIVITY,
NL80211_FREQUENCY_ATTR_NO_4MHZ,
NL80211_FREQUENCY_ATTR_NO_8MHZ,
NL80211_FREQUENCY_ATTR_NO_16MHZ,
/* keep last */
__NL80211_FREQUENCY_ATTR_AFTER_LAST,
NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
};
#define NL80211_FREQUENCY_ATTR_MAX_TX_POWER NL80211_FREQUENCY_ATTR_MAX_TX_POWER
#define NL80211_FREQUENCY_ATTR_PASSIVE_SCAN NL80211_FREQUENCY_ATTR_NO_IR
#define NL80211_FREQUENCY_ATTR_NO_IBSS NL80211_FREQUENCY_ATTR_NO_IR
#define NL80211_FREQUENCY_ATTR_NO_IR NL80211_FREQUENCY_ATTR_NO_IR
#define NL80211_FREQUENCY_ATTR_GO_CONCURRENT \
NL80211_FREQUENCY_ATTR_IR_CONCURRENT
#define NL80211_FREQUENCY_ATTR_NO_UHB_VLP_CLIENT \
NL80211_FREQUENCY_ATTR_NO_6GHZ_VLP_CLIENT
#define NL80211_FREQUENCY_ATTR_NO_UHB_AFC_CLIENT \
NL80211_FREQUENCY_ATTR_NO_6GHZ_AFC_CLIENT
/**
* enum nl80211_bitrate_attr - bitrate attributes
* @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
* @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
* in 2.4 GHz band.
* @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
* currently defined
* @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
*/
enum nl80211_bitrate_attr {
__NL80211_BITRATE_ATTR_INVALID,
NL80211_BITRATE_ATTR_RATE,
NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
/* keep last */
__NL80211_BITRATE_ATTR_AFTER_LAST,
NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_reg_initiator - Indicates the initiator of a reg domain request
* @NL80211_REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world
* regulatory domain.
* @NL80211_REGDOM_SET_BY_USER: User asked the wireless core to set the
* regulatory domain.
* @NL80211_REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the
* wireless core it thinks its knows the regulatory domain we should be in.
* @NL80211_REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an
* 802.11 country information element with regulatory information it
* thinks we should consider. cfg80211 only processes the country
* code from the IE, and relies on the regulatory domain information
* structure passed by userspace (CRDA) from our wireless-regdb.
* If a channel is enabled but the country code indicates it should
* be disabled we disable the channel and re-enable it upon disassociation.
*/
enum nl80211_reg_initiator {
NL80211_REGDOM_SET_BY_CORE,
NL80211_REGDOM_SET_BY_USER,
NL80211_REGDOM_SET_BY_DRIVER,
NL80211_REGDOM_SET_BY_COUNTRY_IE,
};
/**
* enum nl80211_reg_type - specifies the type of regulatory domain
* @NL80211_REGDOM_TYPE_COUNTRY: the regulatory domain set is one that pertains
* to a specific country. When this is set you can count on the
* ISO / IEC 3166 alpha2 country code being valid.
* @NL80211_REGDOM_TYPE_WORLD: the regulatory set domain is the world regulatory
* domain.
* @NL80211_REGDOM_TYPE_CUSTOM_WORLD: the regulatory domain set is a custom
* driver specific world regulatory domain. These do not apply system-wide
* and are only applicable to the individual devices which have requested
* them to be applied.
* @NL80211_REGDOM_TYPE_INTERSECTION: the regulatory domain set is the product
* of an intersection between two regulatory domains -- the previously
* set regulatory domain on the system and the last accepted regulatory
* domain request to be processed.
*/
enum nl80211_reg_type {
NL80211_REGDOM_TYPE_COUNTRY,
NL80211_REGDOM_TYPE_WORLD,
NL80211_REGDOM_TYPE_CUSTOM_WORLD,
NL80211_REGDOM_TYPE_INTERSECTION,
};
/**
* enum nl80211_reg_rule_attr - regulatory rule attributes
* @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
* considerations for a given frequency range. These are the
* &enum nl80211_reg_rule_flags.
* @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory
* rule in KHz. This is not a center of frequency but an actual regulatory
* band edge.
* @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule
* in KHz. This is not a center a frequency but an actual regulatory
* band edge.
* @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this
* frequency range, in KHz.
* @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain
* for a given frequency range. The value is in mBi (100 * dBi).
* If you don't have one then don't send this.
* @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
* a given frequency range. The value is in mBm (100 * dBm).
* @NL80211_ATTR_DFS_CAC_TIME: DFS CAC time in milliseconds.
* If not present or 0 default CAC time will be used.
* @NL80211_ATTR_POWER_RULE_PSD: power spectral density (in dBm).
* This could be negative.
* @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
* currently defined
* @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
*/
enum nl80211_reg_rule_attr {
__NL80211_REG_RULE_ATTR_INVALID,
NL80211_ATTR_REG_RULE_FLAGS,
NL80211_ATTR_FREQ_RANGE_START,
NL80211_ATTR_FREQ_RANGE_END,
NL80211_ATTR_FREQ_RANGE_MAX_BW,
NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN,
NL80211_ATTR_POWER_RULE_MAX_EIRP,
NL80211_ATTR_DFS_CAC_TIME,
NL80211_ATTR_POWER_RULE_PSD,
/* keep last */
__NL80211_REG_RULE_ATTR_AFTER_LAST,
NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_sched_scan_match_attr - scheduled scan match attributes
* @__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID: attribute number 0 is reserved
* @NL80211_SCHED_SCAN_MATCH_ATTR_SSID: SSID to be used for matching,
* only report BSS with matching SSID.
* (This cannot be used together with BSSID.)
* @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI: RSSI threshold (in dBm) for reporting a
* BSS in scan results. Filtering is turned off if not specified. Note that
* if this attribute is in a match set of its own, then it is treated as
* the default value for all matchsets with an SSID, rather than being a
* matchset of its own without an RSSI filter. This is due to problems with
* how this API was implemented in the past. Also, due to the same problem,
* the only way to create a matchset with only an RSSI filter (with this
* attribute) is if there's only a single matchset with the RSSI attribute.
* @NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI: Flag indicating whether
* %NL80211_SCHED_SCAN_MATCH_ATTR_RSSI to be used as absolute RSSI or
* relative to current bss's RSSI.
* @NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST: When present the RSSI level for
* BSS-es in the specified band is to be adjusted before doing
* RSSI-based BSS selection. The attribute value is a packed structure
* value as specified by &struct nl80211_bss_select_rssi_adjust.
* @NL80211_SCHED_SCAN_MATCH_ATTR_BSSID: BSSID to be used for matching
* (this cannot be used together with SSID).
* @NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI: Obsolete
* @NL80211_SCHED_SCAN_MATCH_ATTR_MAX: highest scheduled scan filter
* attribute number currently defined
* @__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST: internal use
*/
enum nl80211_sched_scan_match_attr {
__NL80211_SCHED_SCAN_MATCH_ATTR_INVALID,
NL80211_SCHED_SCAN_MATCH_ATTR_SSID,
NL80211_SCHED_SCAN_MATCH_ATTR_RSSI,
NL80211_SCHED_SCAN_MATCH_ATTR_RELATIVE_RSSI,
NL80211_SCHED_SCAN_MATCH_ATTR_RSSI_ADJUST,
NL80211_SCHED_SCAN_MATCH_ATTR_BSSID,
NL80211_SCHED_SCAN_MATCH_PER_BAND_RSSI, /* obsolete */
/* keep last */
__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST,
NL80211_SCHED_SCAN_MATCH_ATTR_MAX =
__NL80211_SCHED_SCAN_MATCH_ATTR_AFTER_LAST - 1
};
/* only for backward compatibility */
#define NL80211_ATTR_SCHED_SCAN_MATCH_SSID NL80211_SCHED_SCAN_MATCH_ATTR_SSID
/**
* enum nl80211_reg_rule_flags - regulatory rule flags
*
* @NL80211_RRF_NO_OFDM: OFDM modulation not allowed
* @NL80211_RRF_NO_CCK: CCK modulation not allowed
* @NL80211_RRF_NO_INDOOR: indoor operation not allowed
* @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed
* @NL80211_RRF_DFS: DFS support is required to be used
* @NL80211_RRF_PTP_ONLY: this is only for Point To Point links
* @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links
* @NL80211_RRF_NO_IR: no mechanisms that initiate radiation are allowed,
* this includes probe requests or modes of operation that require
* beaconing.
* @__NL80211_RRF_NO_IBSS: obsolete, same as NO_IR
* @NL80211_RRF_AUTO_BW: maximum available bandwidth should be calculated
* base on contiguous rules and wider channels will be allowed to cross
* multiple contiguous/overlapping frequency ranges.
* @NL80211_RRF_IR_CONCURRENT: See %NL80211_FREQUENCY_ATTR_IR_CONCURRENT
* @NL80211_RRF_NO_HT40MINUS: channels can't be used in HT40- operation
* @NL80211_RRF_NO_HT40PLUS: channels can't be used in HT40+ operation
* @NL80211_RRF_NO_80MHZ: 80MHz operation not allowed
* @NL80211_RRF_NO_160MHZ: 160MHz operation not allowed
* @NL80211_RRF_NO_HE: HE operation not allowed
* @NL80211_RRF_NO_320MHZ: 320MHz operation not allowed
* @NL80211_RRF_NO_EHT: EHT operation not allowed
* @NL80211_RRF_PSD: Ruleset has power spectral density value
* @NL80211_RRF_DFS_CONCURRENT: Operation on this channel is allowed for
* peer-to-peer or adhoc communication under the control of a DFS master
* which operates on the same channel (FCC-594280 D01 Section B.3).
* Should be used together with %NL80211_RRF_DFS only.
* @NL80211_RRF_NO_6GHZ_VLP_CLIENT: Client connection to VLP AP not allowed
* @NL80211_RRF_NO_6GHZ_AFC_CLIENT: Client connection to AFC AP not allowed
* @NL80211_RRF_ALLOW_6GHZ_VLP_AP: Very low power (VLP) AP can be permitted
* despite NO_IR configuration.
* @NL80211_RRF_ALLOW_20MHZ_ACTIVITY: Allow activity in 20 MHz bandwidth,
* despite NO_IR configuration.
*/
enum nl80211_reg_rule_flags {
NL80211_RRF_NO_OFDM = 1 << 0,
NL80211_RRF_NO_CCK = 1 << 1,
NL80211_RRF_NO_INDOOR = 1 << 2,
NL80211_RRF_NO_OUTDOOR = 1 << 3,
NL80211_RRF_DFS = 1 << 4,
NL80211_RRF_PTP_ONLY = 1 << 5,
NL80211_RRF_PTMP_ONLY = 1 << 6,
NL80211_RRF_NO_IR = 1 << 7,
__NL80211_RRF_NO_IBSS = 1 << 8,
NL80211_RRF_AUTO_BW = 1 << 11,
NL80211_RRF_IR_CONCURRENT = 1 << 12,
NL80211_RRF_NO_HT40MINUS = 1 << 13,
NL80211_RRF_NO_HT40PLUS = 1 << 14,
NL80211_RRF_NO_80MHZ = 1 << 15,
NL80211_RRF_NO_160MHZ = 1 << 16,
NL80211_RRF_NO_HE = 1 << 17,
NL80211_RRF_NO_320MHZ = 1 << 18,
NL80211_RRF_NO_EHT = 1 << 19,
NL80211_RRF_PSD = 1 << 20,
NL80211_RRF_DFS_CONCURRENT = 1 << 21,
NL80211_RRF_NO_6GHZ_VLP_CLIENT = 1 << 22,
NL80211_RRF_NO_6GHZ_AFC_CLIENT = 1 << 23,
NL80211_RRF_ALLOW_6GHZ_VLP_AP = 1 << 24,
NL80211_RRF_ALLOW_20MHZ_ACTIVITY = 1 << 25,
};
#define NL80211_RRF_PASSIVE_SCAN NL80211_RRF_NO_IR
#define NL80211_RRF_NO_IBSS NL80211_RRF_NO_IR
#define NL80211_RRF_NO_IR NL80211_RRF_NO_IR
#define NL80211_RRF_NO_HT40 (NL80211_RRF_NO_HT40MINUS |\
NL80211_RRF_NO_HT40PLUS)
#define NL80211_RRF_GO_CONCURRENT NL80211_RRF_IR_CONCURRENT
#define NL80211_RRF_NO_UHB_VLP_CLIENT NL80211_RRF_NO_6GHZ_VLP_CLIENT
#define NL80211_RRF_NO_UHB_AFC_CLIENT NL80211_RRF_NO_6GHZ_AFC_CLIENT
/* For backport compatibility with older userspace */
#define NL80211_RRF_NO_IR_ALL (NL80211_RRF_NO_IR | __NL80211_RRF_NO_IBSS)
/**
* enum nl80211_dfs_regions - regulatory DFS regions
*
* @NL80211_DFS_UNSET: Country has no DFS master region specified
* @NL80211_DFS_FCC: Country follows DFS master rules from FCC
* @NL80211_DFS_ETSI: Country follows DFS master rules from ETSI
* @NL80211_DFS_JP: Country follows DFS master rules from JP/MKK/Telec
*/
enum nl80211_dfs_regions {
NL80211_DFS_UNSET = 0,
NL80211_DFS_FCC = 1,
NL80211_DFS_ETSI = 2,
NL80211_DFS_JP = 3,
};
/**
* enum nl80211_user_reg_hint_type - type of user regulatory hint
*
* @NL80211_USER_REG_HINT_USER: a user sent the hint. This is always
* assumed if the attribute is not set.
* @NL80211_USER_REG_HINT_CELL_BASE: the hint comes from a cellular
* base station. Device drivers that have been tested to work
* properly to support this type of hint can enable these hints
* by setting the NL80211_FEATURE_CELL_BASE_REG_HINTS feature
* capability on the struct wiphy. The wireless core will
* ignore all cell base station hints until at least one device
* present has been registered with the wireless core that
* has listed NL80211_FEATURE_CELL_BASE_REG_HINTS as a
* supported feature.
* @NL80211_USER_REG_HINT_INDOOR: a user sent an hint indicating that the
* platform is operating in an indoor environment.
*/
enum nl80211_user_reg_hint_type {
NL80211_USER_REG_HINT_USER = 0,
NL80211_USER_REG_HINT_CELL_BASE = 1,
NL80211_USER_REG_HINT_INDOOR = 2,
};
/**
* enum nl80211_survey_info - survey information
*
* These attribute types are used with %NL80211_ATTR_SURVEY_INFO
* when getting information about a survey.
*
* @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
* @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
* @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
* @NL80211_SURVEY_INFO_IN_USE: channel is currently being used
* @NL80211_SURVEY_INFO_TIME: amount of time (in ms) that the radio
* was turned on (on channel or globally)
* @NL80211_SURVEY_INFO_TIME_BUSY: amount of the time the primary
* channel was sensed busy (either due to activity or energy detect)
* @NL80211_SURVEY_INFO_TIME_EXT_BUSY: amount of time the extension
* channel was sensed busy
* @NL80211_SURVEY_INFO_TIME_RX: amount of time the radio spent
* receiving data (on channel or globally)
* @NL80211_SURVEY_INFO_TIME_TX: amount of time the radio spent
* transmitting data (on channel or globally)
* @NL80211_SURVEY_INFO_TIME_SCAN: time the radio spent for scan
* (on this channel or globally)
* @NL80211_SURVEY_INFO_PAD: attribute used for padding for 64-bit alignment
* @NL80211_SURVEY_INFO_TIME_BSS_RX: amount of time the radio spent
* receiving frames destined to the local BSS
* @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
* currently defined
* @NL80211_SURVEY_INFO_FREQUENCY_OFFSET: center frequency offset in KHz
* @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
*/
enum nl80211_survey_info {
__NL80211_SURVEY_INFO_INVALID,
NL80211_SURVEY_INFO_FREQUENCY,
NL80211_SURVEY_INFO_NOISE,
NL80211_SURVEY_INFO_IN_USE,
NL80211_SURVEY_INFO_TIME,
NL80211_SURVEY_INFO_TIME_BUSY,
NL80211_SURVEY_INFO_TIME_EXT_BUSY,
NL80211_SURVEY_INFO_TIME_RX,
NL80211_SURVEY_INFO_TIME_TX,
NL80211_SURVEY_INFO_TIME_SCAN,
NL80211_SURVEY_INFO_PAD,
NL80211_SURVEY_INFO_TIME_BSS_RX,
NL80211_SURVEY_INFO_FREQUENCY_OFFSET,
/* keep last */
__NL80211_SURVEY_INFO_AFTER_LAST,
NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1
};
/* keep old names for compatibility */
#define NL80211_SURVEY_INFO_CHANNEL_TIME NL80211_SURVEY_INFO_TIME
#define NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY NL80211_SURVEY_INFO_TIME_BUSY
#define NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY NL80211_SURVEY_INFO_TIME_EXT_BUSY
#define NL80211_SURVEY_INFO_CHANNEL_TIME_RX NL80211_SURVEY_INFO_TIME_RX
#define NL80211_SURVEY_INFO_CHANNEL_TIME_TX NL80211_SURVEY_INFO_TIME_TX
/**
* enum nl80211_mntr_flags - monitor configuration flags
*
* Monitor configuration flags.
*
* @__NL80211_MNTR_FLAG_INVALID: reserved
*
* @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
* @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
* @NL80211_MNTR_FLAG_CONTROL: pass control frames
* @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
* @NL80211_MNTR_FLAG_COOK_FRAMES: deprecated
* will unconditionally be refused
* @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
* and ACK incoming unicast packets.
* @NL80211_MNTR_FLAG_SKIP_TX: do not pass local tx packets
*
* @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
* @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
*/
enum nl80211_mntr_flags {
__NL80211_MNTR_FLAG_INVALID,
NL80211_MNTR_FLAG_FCSFAIL,
NL80211_MNTR_FLAG_PLCPFAIL,
NL80211_MNTR_FLAG_CONTROL,
NL80211_MNTR_FLAG_OTHER_BSS,
NL80211_MNTR_FLAG_COOK_FRAMES,
NL80211_MNTR_FLAG_ACTIVE,
NL80211_MNTR_FLAG_SKIP_TX,
/* keep last */
__NL80211_MNTR_FLAG_AFTER_LAST,
NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
};
/**
* enum nl80211_mesh_power_mode - mesh power save modes
*
* @NL80211_MESH_POWER_UNKNOWN: The mesh power mode of the mesh STA is
* not known or has not been set yet.
* @NL80211_MESH_POWER_ACTIVE: Active mesh power mode. The mesh STA is
* in Awake state all the time.
* @NL80211_MESH_POWER_LIGHT_SLEEP: Light sleep mode. The mesh STA will
* alternate between Active and Doze states, but will wake up for
* neighbor's beacons.
* @NL80211_MESH_POWER_DEEP_SLEEP: Deep sleep mode. The mesh STA will
* alternate between Active and Doze states, but may not wake up
* for neighbor's beacons.
*
* @__NL80211_MESH_POWER_AFTER_LAST: internal use
* @NL80211_MESH_POWER_MAX: highest possible power save level
*/
enum nl80211_mesh_power_mode {
NL80211_MESH_POWER_UNKNOWN,
NL80211_MESH_POWER_ACTIVE,
NL80211_MESH_POWER_LIGHT_SLEEP,
NL80211_MESH_POWER_DEEP_SLEEP,
__NL80211_MESH_POWER_AFTER_LAST,
NL80211_MESH_POWER_MAX = __NL80211_MESH_POWER_AFTER_LAST - 1
};
/**
* enum nl80211_meshconf_params - mesh configuration parameters
*
* Mesh configuration parameters. These can be changed while the mesh is
* active.
*
* @__NL80211_MESHCONF_INVALID: internal use
*
* @NL80211_MESHCONF_RETRY_TIMEOUT: specifies the initial retry timeout in
* millisecond units, used by the Peer Link Open message
*
* @NL80211_MESHCONF_CONFIRM_TIMEOUT: specifies the initial confirm timeout, in
* millisecond units, used by the peer link management to close a peer link
*
* @NL80211_MESHCONF_HOLDING_TIMEOUT: specifies the holding timeout, in
* millisecond units
*
* @NL80211_MESHCONF_MAX_PEER_LINKS: maximum number of peer links allowed
* on this mesh interface
*
* @NL80211_MESHCONF_MAX_RETRIES: specifies the maximum number of peer link
* open retries that can be sent to establish a new peer link instance in a
* mesh
*
* @NL80211_MESHCONF_TTL: specifies the value of TTL field set at a source mesh
* point.
*
* @NL80211_MESHCONF_AUTO_OPEN_PLINKS: whether we should automatically open
* peer links when we detect compatible mesh peers. Disabled if
* @NL80211_MESH_SETUP_USERSPACE_MPM or @NL80211_MESH_SETUP_USERSPACE_AMPE are
* set.
*
* @NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES: the number of action frames
* containing a PREQ that an MP can send to a particular destination (path
* target)
*
* @NL80211_MESHCONF_PATH_REFRESH_TIME: how frequently to refresh mesh paths
* (in milliseconds)
*
* @NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT: minimum length of time to wait
* until giving up on a path discovery (in milliseconds)
*
* @NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT: The time (in TUs) for which mesh
* points receiving a PREQ shall consider the forwarding information from
* the root to be valid. (TU = time unit)
*
* @NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL: The minimum interval of time (in
* TUs) during which an MP can send only one action frame containing a PREQ
* reference element
*
* @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
* that it takes for an HWMP information element to propagate across the
* mesh
*
* @NL80211_MESHCONF_HWMP_ROOTMODE: whether root mode is enabled or not
*
* @NL80211_MESHCONF_ELEMENT_TTL: specifies the value of TTL field set at a
* source mesh point for path selection elements.
*
* @NL80211_MESHCONF_HWMP_RANN_INTERVAL: The interval of time (in TUs) between
* root announcements are transmitted.
*
* @NL80211_MESHCONF_GATE_ANNOUNCEMENTS: Advertise that this mesh station has
* access to a broader network beyond the MBSS. This is done via Root
* Announcement frames.
*
* @NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL: The minimum interval of time (in
* TUs) during which a mesh STA can send only one Action frame containing a
* PERR element.
*
* @NL80211_MESHCONF_FORWARDING: set Mesh STA as forwarding or non-forwarding
* or forwarding entity (default is TRUE - forwarding entity)
*
* @NL80211_MESHCONF_RSSI_THRESHOLD: RSSI threshold in dBm. This specifies the
* threshold for average signal strength of candidate station to establish
* a peer link.
*
* @NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR: maximum number of neighbors
* to synchronize to for 11s default synchronization method
* (see 11C.12.2.2)
*
* @NL80211_MESHCONF_HT_OPMODE: set mesh HT protection mode.
*
* @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
*
* @NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT: The time (in TUs) for
* which mesh STAs receiving a proactive PREQ shall consider the forwarding
* information to the root mesh STA to be valid.
*
* @NL80211_MESHCONF_HWMP_ROOT_INTERVAL: The interval of time (in TUs) between
* proactive PREQs are transmitted.
*
* @NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL: The minimum interval of time
* (in TUs) during which a mesh STA can send only one Action frame
* containing a PREQ element for root path confirmation.
*
* @NL80211_MESHCONF_POWER_MODE: Default mesh power mode for new peer links.
* type &enum nl80211_mesh_power_mode (u32)
*
* @NL80211_MESHCONF_AWAKE_WINDOW: awake window duration (in TUs)
*
* @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've
* established peering with for longer than this time (in seconds), then
* remove it from the STA's list of peers. You may set this to 0 to disable
* the removal of the STA. Default is 30 minutes.
*
* @NL80211_MESHCONF_CONNECTED_TO_GATE: If set to true then this mesh STA
* will advertise that it is connected to a gate in the mesh formation
* field. If left unset then the mesh formation field will only
* advertise such if there is an active root mesh path.
*
* @NL80211_MESHCONF_NOLEARN: Try to avoid multi-hop path discovery (e.g.
* PREQ/PREP for HWMP) if the destination is a direct neighbor. Note that
* this might not be the optimal decision as a multi-hop route might be
* better. So if using this setting you will likely also want to disable
* dot11MeshForwarding and use another mesh routing protocol on top.
*
* @NL80211_MESHCONF_CONNECTED_TO_AS: If set to true then this mesh STA
* will advertise that it is connected to a authentication server
* in the mesh formation field.
*
* @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
*/
enum nl80211_meshconf_params {
__NL80211_MESHCONF_INVALID,
NL80211_MESHCONF_RETRY_TIMEOUT,
NL80211_MESHCONF_CONFIRM_TIMEOUT,
NL80211_MESHCONF_HOLDING_TIMEOUT,
NL80211_MESHCONF_MAX_PEER_LINKS,
NL80211_MESHCONF_MAX_RETRIES,
NL80211_MESHCONF_TTL,
NL80211_MESHCONF_AUTO_OPEN_PLINKS,
NL80211_MESHCONF_HWMP_MAX_PREQ_RETRIES,
NL80211_MESHCONF_PATH_REFRESH_TIME,
NL80211_MESHCONF_MIN_DISCOVERY_TIMEOUT,
NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
NL80211_MESHCONF_HWMP_ROOTMODE,
NL80211_MESHCONF_ELEMENT_TTL,
NL80211_MESHCONF_HWMP_RANN_INTERVAL,
NL80211_MESHCONF_GATE_ANNOUNCEMENTS,
NL80211_MESHCONF_HWMP_PERR_MIN_INTERVAL,
NL80211_MESHCONF_FORWARDING,
NL80211_MESHCONF_RSSI_THRESHOLD,
NL80211_MESHCONF_SYNC_OFFSET_MAX_NEIGHBOR,
NL80211_MESHCONF_HT_OPMODE,
NL80211_MESHCONF_HWMP_PATH_TO_ROOT_TIMEOUT,
NL80211_MESHCONF_HWMP_ROOT_INTERVAL,
NL80211_MESHCONF_HWMP_CONFIRMATION_INTERVAL,
NL80211_MESHCONF_POWER_MODE,
NL80211_MESHCONF_AWAKE_WINDOW,
NL80211_MESHCONF_PLINK_TIMEOUT,
NL80211_MESHCONF_CONNECTED_TO_GATE,
NL80211_MESHCONF_NOLEARN,
NL80211_MESHCONF_CONNECTED_TO_AS,
/* keep last */
__NL80211_MESHCONF_ATTR_AFTER_LAST,
NL80211_MESHCONF_ATTR_MAX = __NL80211_MESHCONF_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_mesh_setup_params - mesh setup parameters
*
* Mesh setup parameters. These are used to start/join a mesh and cannot be
* changed while the mesh is active.
*
* @__NL80211_MESH_SETUP_INVALID: Internal use
*
* @NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL: Enable this option to use a
* vendor specific path selection algorithm or disable it to use the
* default HWMP.
*
* @NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC: Enable this option to use a
* vendor specific path metric or disable it to use the default Airtime
* metric.
*
* @NL80211_MESH_SETUP_IE: Information elements for this mesh, for instance, a
* robust security network ie, or a vendor specific information element
* that vendors will use to identify the path selection methods and
* metrics in use.
*
* @NL80211_MESH_SETUP_USERSPACE_AUTH: Enable this option if an authentication
* daemon will be authenticating mesh candidates.
*
* @NL80211_MESH_SETUP_USERSPACE_AMPE: Enable this option if an authentication
* daemon will be securing peer link frames. AMPE is a secured version of
* Mesh Peering Management (MPM) and is implemented with the assistance of
* a userspace daemon. When this flag is set, the kernel will send peer
* management frames to a userspace daemon that will implement AMPE
* functionality (security capabilities selection, key confirmation, and
* key management). When the flag is unset (default), the kernel can
* autonomously complete (unsecured) mesh peering without the need of a
* userspace daemon.
*
* @NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC: Enable this option to use a
* vendor specific synchronization method or disable it to use the default
* neighbor offset synchronization
*
* @NL80211_MESH_SETUP_USERSPACE_MPM: Enable this option if userspace will
* implement an MPM which handles peer allocation and state.
*
* @NL80211_MESH_SETUP_AUTH_PROTOCOL: Inform the kernel of the authentication
* method (u8, as defined in IEEE 8.4.2.100.6, e.g. 0x1 for SAE).
* Default is no authentication method required.
*
* @NL80211_MESH_SETUP_ATTR_MAX: highest possible mesh setup attribute number
*
* @__NL80211_MESH_SETUP_ATTR_AFTER_LAST: Internal use
*/
enum nl80211_mesh_setup_params {
__NL80211_MESH_SETUP_INVALID,
NL80211_MESH_SETUP_ENABLE_VENDOR_PATH_SEL,
NL80211_MESH_SETUP_ENABLE_VENDOR_METRIC,
NL80211_MESH_SETUP_IE,
NL80211_MESH_SETUP_USERSPACE_AUTH,
NL80211_MESH_SETUP_USERSPACE_AMPE,
NL80211_MESH_SETUP_ENABLE_VENDOR_SYNC,
NL80211_MESH_SETUP_USERSPACE_MPM,
NL80211_MESH_SETUP_AUTH_PROTOCOL,
/* keep last */
__NL80211_MESH_SETUP_ATTR_AFTER_LAST,
NL80211_MESH_SETUP_ATTR_MAX = __NL80211_MESH_SETUP_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_txq_attr - TX queue parameter attributes
* @__NL80211_TXQ_ATTR_INVALID: Attribute number 0 is reserved
* @NL80211_TXQ_ATTR_AC: AC identifier (NL80211_AC_*)
* @NL80211_TXQ_ATTR_TXOP: Maximum burst time in units of 32 usecs, 0 meaning
* disabled
* @NL80211_TXQ_ATTR_CWMIN: Minimum contention window [a value of the form
* 2^n-1 in the range 1..32767]
* @NL80211_TXQ_ATTR_CWMAX: Maximum contention window [a value of the form
* 2^n-1 in the range 1..32767]
* @NL80211_TXQ_ATTR_AIFS: Arbitration interframe space [0..255]
* @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
* @NL80211_TXQ_ATTR_MAX: Maximum TXQ attribute number
*/
enum nl80211_txq_attr {
__NL80211_TXQ_ATTR_INVALID,
NL80211_TXQ_ATTR_AC,
NL80211_TXQ_ATTR_TXOP,
NL80211_TXQ_ATTR_CWMIN,
NL80211_TXQ_ATTR_CWMAX,
NL80211_TXQ_ATTR_AIFS,
/* keep last */
__NL80211_TXQ_ATTR_AFTER_LAST,
NL80211_TXQ_ATTR_MAX = __NL80211_TXQ_ATTR_AFTER_LAST - 1
};
enum nl80211_ac {
NL80211_AC_VO,
NL80211_AC_VI,
NL80211_AC_BE,
NL80211_AC_BK,
NL80211_NUM_ACS
};
/* backward compat */
#define NL80211_TXQ_ATTR_QUEUE NL80211_TXQ_ATTR_AC
#define NL80211_TXQ_Q_VO NL80211_AC_VO
#define NL80211_TXQ_Q_VI NL80211_AC_VI
#define NL80211_TXQ_Q_BE NL80211_AC_BE
#define NL80211_TXQ_Q_BK NL80211_AC_BK
/**
* enum nl80211_channel_type - channel type
* @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel
* @NL80211_CHAN_HT20: 20 MHz HT channel
* @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel
* below the control channel
* @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel
* above the control channel
*/
enum nl80211_channel_type {
NL80211_CHAN_NO_HT,
NL80211_CHAN_HT20,
NL80211_CHAN_HT40MINUS,
NL80211_CHAN_HT40PLUS
};
/**
* enum nl80211_key_mode - Key mode
*
* @NL80211_KEY_RX_TX: (Default)
* Key can be used for Rx and Tx immediately
*
* The following modes can only be selected for unicast keys and when the
* driver supports @NL80211_EXT_FEATURE_EXT_KEY_ID:
*
* @NL80211_KEY_NO_TX: Only allowed in combination with @NL80211_CMD_NEW_KEY:
* Unicast key can only be used for Rx, Tx not allowed, yet
* @NL80211_KEY_SET_TX: Only allowed in combination with @NL80211_CMD_SET_KEY:
* The unicast key identified by idx and mac is cleared for Tx and becomes
* the preferred Tx key for the station.
*/
enum nl80211_key_mode {
NL80211_KEY_RX_TX,
NL80211_KEY_NO_TX,
NL80211_KEY_SET_TX
};
/**
* enum nl80211_chan_width - channel width definitions
*
* These values are used with the %NL80211_ATTR_CHANNEL_WIDTH
* attribute.
*
* @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel
* @NL80211_CHAN_WIDTH_20: 20 MHz HT channel
* @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* attribute must be provided as well
* @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* attribute must be provided as well
* @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well
* @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* attribute must be provided as well
* @NL80211_CHAN_WIDTH_5: 5 MHz OFDM channel
* @NL80211_CHAN_WIDTH_10: 10 MHz OFDM channel
* @NL80211_CHAN_WIDTH_1: 1 MHz OFDM channel
* @NL80211_CHAN_WIDTH_2: 2 MHz OFDM channel
* @NL80211_CHAN_WIDTH_4: 4 MHz OFDM channel
* @NL80211_CHAN_WIDTH_8: 8 MHz OFDM channel
* @NL80211_CHAN_WIDTH_16: 16 MHz OFDM channel
* @NL80211_CHAN_WIDTH_320: 320 MHz channel, the %NL80211_ATTR_CENTER_FREQ1
* attribute must be provided as well
*/
enum nl80211_chan_width {
NL80211_CHAN_WIDTH_20_NOHT,
NL80211_CHAN_WIDTH_20,
NL80211_CHAN_WIDTH_40,
NL80211_CHAN_WIDTH_80,
NL80211_CHAN_WIDTH_80P80,
NL80211_CHAN_WIDTH_160,
NL80211_CHAN_WIDTH_5,
NL80211_CHAN_WIDTH_10,
NL80211_CHAN_WIDTH_1,
NL80211_CHAN_WIDTH_2,
NL80211_CHAN_WIDTH_4,
NL80211_CHAN_WIDTH_8,
NL80211_CHAN_WIDTH_16,
NL80211_CHAN_WIDTH_320,
};
/**
* enum nl80211_bss_scan_width - control channel width for a BSS
*
* These values are used with the %NL80211_BSS_CHAN_WIDTH attribute.
*
* @NL80211_BSS_CHAN_WIDTH_20: control channel is 20 MHz wide or compatible
* @NL80211_BSS_CHAN_WIDTH_10: control channel is 10 MHz wide
* @NL80211_BSS_CHAN_WIDTH_5: control channel is 5 MHz wide
* @NL80211_BSS_CHAN_WIDTH_1: control channel is 1 MHz wide
* @NL80211_BSS_CHAN_WIDTH_2: control channel is 2 MHz wide
*/
enum nl80211_bss_scan_width {
NL80211_BSS_CHAN_WIDTH_20,
NL80211_BSS_CHAN_WIDTH_10,
NL80211_BSS_CHAN_WIDTH_5,
NL80211_BSS_CHAN_WIDTH_1,
NL80211_BSS_CHAN_WIDTH_2,
};
/**
* enum nl80211_bss_use_for - bitmap indicating possible BSS use
* @NL80211_BSS_USE_FOR_NORMAL: Use this BSS for normal "connection",
* including IBSS/MBSS depending on the type.
* @NL80211_BSS_USE_FOR_MLD_LINK: This BSS can be used as a link in an
* MLO connection. Note that for an MLO connection, all links including
* the assoc link must have this flag set, and the assoc link must
* additionally have %NL80211_BSS_USE_FOR_NORMAL set.
*/
enum nl80211_bss_use_for {
NL80211_BSS_USE_FOR_NORMAL = 1 << 0,
NL80211_BSS_USE_FOR_MLD_LINK = 1 << 1,
};
/**
* enum nl80211_bss_cannot_use_reasons - reason(s) connection to a
* BSS isn't possible
* @NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY: NSTR nonprimary links aren't
* supported by the device, and this BSS entry represents one.
* @NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH: STA is not supporting
* the AP power type (SP, VLP, AP) that the AP uses.
*/
enum nl80211_bss_cannot_use_reasons {
NL80211_BSS_CANNOT_USE_NSTR_NONPRIMARY = 1 << 0,
NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH = 1 << 1,
};
#define NL80211_BSS_CANNOT_USE_UHB_PWR_MISMATCH \
NL80211_BSS_CANNOT_USE_6GHZ_PWR_MISMATCH
/**
* enum nl80211_bss - netlink attributes for a BSS
*
* @__NL80211_BSS_INVALID: invalid
* @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
* @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
* @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
* (if @NL80211_BSS_PRESP_DATA is present then this is known to be
* from a probe response, otherwise it may be from the same beacon
* that the NL80211_BSS_BEACON_TSF will be from)
* @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
* @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
* @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
* raw information elements from the probe response/beacon (bin);
* if the %NL80211_BSS_BEACON_IES attribute is present and the data is
* different then the IEs here are from a Probe Response frame; otherwise
* they are from a Beacon frame.
* However, if the driver does not indicate the source of the IEs, these
* IEs may be from either frame subtype.
* If present, the @NL80211_BSS_PRESP_DATA attribute indicates that the
* data here is known to be from a probe response, without any heuristics.
* @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
* in mBm (100 * dBm) (s32)
* @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
* in unspecified units, scaled to 0..100 (u8)
* @NL80211_BSS_STATUS: status, if this BSS is "used"
* @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms
* @NL80211_BSS_BEACON_IES: binary attribute containing the raw information
* elements from a Beacon frame (bin); not present if no Beacon frame has
* yet been received
* @NL80211_BSS_CHAN_WIDTH: channel width of the control channel
* (u32, enum nl80211_bss_scan_width) - No longer used!
* @NL80211_BSS_BEACON_TSF: TSF of the last received beacon (u64)
* (not present if no beacon frame has been received yet)
* @NL80211_BSS_PRESP_DATA: the data in @NL80211_BSS_INFORMATION_ELEMENTS and
* @NL80211_BSS_TSF is known to be from a probe response (flag attribute)
* @NL80211_BSS_LAST_SEEN_BOOTTIME: CLOCK_BOOTTIME timestamp when this entry
* was last updated by a received frame. The value is expected to be
* accurate to about 10ms. (u64, nanoseconds)
* @NL80211_BSS_PAD: attribute used for padding for 64-bit alignment
* @NL80211_BSS_PARENT_TSF: the time at the start of reception of the first
* octet of the timestamp field of the last beacon/probe received for
* this BSS. The time is the TSF of the BSS specified by
* @NL80211_BSS_PARENT_BSSID. (u64).
* @NL80211_BSS_PARENT_BSSID: the BSS according to which @NL80211_BSS_PARENT_TSF
* is set.
* @NL80211_BSS_CHAIN_SIGNAL: per-chain signal strength of last BSS update.
* Contains a nested array of signal strength attributes (u8, dBm),
* using the nesting index as the antenna number.
* @NL80211_BSS_FREQUENCY_OFFSET: frequency offset in KHz
* @NL80211_BSS_MLO_LINK_ID: MLO link ID of the BSS (u8).
* @NL80211_BSS_MLD_ADDR: MLD address of this BSS if connected to it.
* @NL80211_BSS_USE_FOR: u32 bitmap attribute indicating what the BSS can be
* used for, see &enum nl80211_bss_use_for.
* @NL80211_BSS_CANNOT_USE_REASONS: Indicates the reason that this BSS cannot
* be used for all or some of the possible uses by the device reporting it,
* even though its presence was detected.
* This is a u64 attribute containing a bitmap of values from
* &enum nl80211_cannot_use_reasons, note that the attribute may be missing
* if no reasons are specified.
* @__NL80211_BSS_AFTER_LAST: internal
* @NL80211_BSS_MAX: highest BSS attribute
*/
enum nl80211_bss {
__NL80211_BSS_INVALID,
NL80211_BSS_BSSID,
NL80211_BSS_FREQUENCY,
NL80211_BSS_TSF,
NL80211_BSS_BEACON_INTERVAL,
NL80211_BSS_CAPABILITY,
NL80211_BSS_INFORMATION_ELEMENTS,
NL80211_BSS_SIGNAL_MBM,
NL80211_BSS_SIGNAL_UNSPEC,
NL80211_BSS_STATUS,
NL80211_BSS_SEEN_MS_AGO,
NL80211_BSS_BEACON_IES,
NL80211_BSS_CHAN_WIDTH,
NL80211_BSS_BEACON_TSF,
NL80211_BSS_PRESP_DATA,
NL80211_BSS_LAST_SEEN_BOOTTIME,
NL80211_BSS_PAD,
NL80211_BSS_PARENT_TSF,
NL80211_BSS_PARENT_BSSID,
NL80211_BSS_CHAIN_SIGNAL,
NL80211_BSS_FREQUENCY_OFFSET,
NL80211_BSS_MLO_LINK_ID,
NL80211_BSS_MLD_ADDR,
NL80211_BSS_USE_FOR,
NL80211_BSS_CANNOT_USE_REASONS,
/* keep last */
__NL80211_BSS_AFTER_LAST,
NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
};
/**
* enum nl80211_bss_status - BSS "status"
* @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
* Note that this is no longer used since cfg80211 no longer
* keeps track of whether or not authentication was done with
* a given BSS.
* @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
* @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
*
* The BSS status is a BSS attribute in scan dumps, which
* indicates the status the interface has wrt. this BSS.
*/
enum nl80211_bss_status {
NL80211_BSS_STATUS_AUTHENTICATED,
NL80211_BSS_STATUS_ASSOCIATED,
NL80211_BSS_STATUS_IBSS_JOINED,
};
/**
* enum nl80211_auth_type - AuthenticationType
*
* @NL80211_AUTHTYPE_OPEN_SYSTEM: Open System authentication
* @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
* @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
* @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
* @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals
* @NL80211_AUTHTYPE_FILS_SK: Fast Initial Link Setup shared key
* @NL80211_AUTHTYPE_FILS_SK_PFS: Fast Initial Link Setup shared key with PFS
* @NL80211_AUTHTYPE_FILS_PK: Fast Initial Link Setup public key
* @__NL80211_AUTHTYPE_NUM: internal
* @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
* @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
* trying multiple times); this is invalid in netlink -- leave out
* the attribute for this on CONNECT commands.
*/
enum nl80211_auth_type {
NL80211_AUTHTYPE_OPEN_SYSTEM,
NL80211_AUTHTYPE_SHARED_KEY,
NL80211_AUTHTYPE_FT,
NL80211_AUTHTYPE_NETWORK_EAP,
NL80211_AUTHTYPE_SAE,
NL80211_AUTHTYPE_FILS_SK,
NL80211_AUTHTYPE_FILS_SK_PFS,
NL80211_AUTHTYPE_FILS_PK,
/* keep last */
__NL80211_AUTHTYPE_NUM,
NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
NL80211_AUTHTYPE_AUTOMATIC
};
/**
* enum nl80211_key_type - Key Type
* @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key
* @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key
* @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS)
* @NUM_NL80211_KEYTYPES: number of defined key types
*/
enum nl80211_key_type {
NL80211_KEYTYPE_GROUP,
NL80211_KEYTYPE_PAIRWISE,
NL80211_KEYTYPE_PEERKEY,
NUM_NL80211_KEYTYPES
};
/**
* enum nl80211_mfp - Management frame protection state
* @NL80211_MFP_NO: Management frame protection not used
* @NL80211_MFP_REQUIRED: Management frame protection required
* @NL80211_MFP_OPTIONAL: Management frame protection is optional
*/
enum nl80211_mfp {
NL80211_MFP_NO,
NL80211_MFP_REQUIRED,
NL80211_MFP_OPTIONAL,
};
enum nl80211_wpa_versions {
NL80211_WPA_VERSION_1 = 1 << 0,
NL80211_WPA_VERSION_2 = 1 << 1,
NL80211_WPA_VERSION_3 = 1 << 2,
};
/**
* enum nl80211_key_default_types - key default types
* @__NL80211_KEY_DEFAULT_TYPE_INVALID: invalid
* @NL80211_KEY_DEFAULT_TYPE_UNICAST: key should be used as default
* unicast key
* @NL80211_KEY_DEFAULT_TYPE_MULTICAST: key should be used as default
* multicast key
* @NUM_NL80211_KEY_DEFAULT_TYPES: number of default types
*/
enum nl80211_key_default_types {
__NL80211_KEY_DEFAULT_TYPE_INVALID,
NL80211_KEY_DEFAULT_TYPE_UNICAST,
NL80211_KEY_DEFAULT_TYPE_MULTICAST,
NUM_NL80211_KEY_DEFAULT_TYPES
};
/**
* enum nl80211_key_attributes - key attributes
* @__NL80211_KEY_INVALID: invalid
* @NL80211_KEY_DATA: (temporal) key data; for TKIP this consists of
* 16 bytes encryption key followed by 8 bytes each for TX and RX MIC
* keys
* @NL80211_KEY_IDX: key ID (u8, 0-3)
* @NL80211_KEY_CIPHER: key cipher suite (u32, as defined by IEEE 802.11
* section 7.3.2.25.1, e.g. 0x000FAC04)
* @NL80211_KEY_SEQ: transmit key sequence number (IV/PN) for TKIP and
* CCMP keys, each six bytes in little endian
* @NL80211_KEY_DEFAULT: flag indicating default key
* @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key
* @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not
* specified the default depends on whether a MAC address was
* given with the command using the key or not (u32)
* @NL80211_KEY_DEFAULT_TYPES: A nested attribute containing flags
* attributes, specifying what a key should be set as default as.
* See &enum nl80211_key_default_types.
* @NL80211_KEY_MODE: the mode from enum nl80211_key_mode.
* Defaults to @NL80211_KEY_RX_TX.
* @NL80211_KEY_DEFAULT_BEACON: flag indicating default Beacon frame key
*
* @__NL80211_KEY_AFTER_LAST: internal
* @NL80211_KEY_MAX: highest key attribute
*/
enum nl80211_key_attributes {
__NL80211_KEY_INVALID,
NL80211_KEY_DATA,
NL80211_KEY_IDX,
NL80211_KEY_CIPHER,
NL80211_KEY_SEQ,
NL80211_KEY_DEFAULT,
NL80211_KEY_DEFAULT_MGMT,
NL80211_KEY_TYPE,
NL80211_KEY_DEFAULT_TYPES,
NL80211_KEY_MODE,
NL80211_KEY_DEFAULT_BEACON,
/* keep last */
__NL80211_KEY_AFTER_LAST,
NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1
};
/**
* enum nl80211_tx_rate_attributes - TX rate set attributes
* @__NL80211_TXRATE_INVALID: invalid
* @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection
* in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with
* 1 = 500 kbps) but without the IE length restriction (at most
* %NL80211_MAX_SUPP_RATES in a single array).
* @NL80211_TXRATE_HT: HT (MCS) rates allowed for TX rate selection
* in an array of MCS numbers.
* @NL80211_TXRATE_VHT: VHT rates allowed for TX rate selection,
* see &struct nl80211_txrate_vht
* @NL80211_TXRATE_GI: configure GI, see &enum nl80211_txrate_gi
* @NL80211_TXRATE_HE: HE rates allowed for TX rate selection,
* see &struct nl80211_txrate_he
* @NL80211_TXRATE_HE_GI: configure HE GI, 0.8us, 1.6us and 3.2us.
* @NL80211_TXRATE_HE_LTF: configure HE LTF, 1XLTF, 2XLTF and 4XLTF.
* @NL80211_TXRATE_EHT: EHT rates allowed for TX rate selection,
* see &struct nl80211_txrate_eht
* @NL80211_TXRATE_EHT_GI: configure EHT GI, (u8, see &enum nl80211_eht_gi)
* @NL80211_TXRATE_EHT_LTF: configure EHT LTF, (u8, see &enum nl80211_eht_ltf)
* @__NL80211_TXRATE_AFTER_LAST: internal
* @NL80211_TXRATE_MAX: highest TX rate attribute
*/
enum nl80211_tx_rate_attributes {
__NL80211_TXRATE_INVALID,
NL80211_TXRATE_LEGACY,
NL80211_TXRATE_HT,
NL80211_TXRATE_VHT,
NL80211_TXRATE_GI,
NL80211_TXRATE_HE,
NL80211_TXRATE_HE_GI,
NL80211_TXRATE_HE_LTF,
NL80211_TXRATE_EHT,
NL80211_TXRATE_EHT_GI,
NL80211_TXRATE_EHT_LTF,
/* keep last */
__NL80211_TXRATE_AFTER_LAST,
NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1
};
#define NL80211_TXRATE_MCS NL80211_TXRATE_HT
#define NL80211_VHT_NSS_MAX 8
/**
* struct nl80211_txrate_vht - VHT MCS/NSS txrate bitmap
* @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
*/
struct nl80211_txrate_vht {
__u16 mcs[NL80211_VHT_NSS_MAX];
};
#define NL80211_HE_NSS_MAX 8
/**
* struct nl80211_txrate_he - HE MCS/NSS txrate bitmap
* @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
*/
struct nl80211_txrate_he {
__u16 mcs[NL80211_HE_NSS_MAX];
};
enum nl80211_txrate_gi {
NL80211_TXRATE_DEFAULT_GI,
NL80211_TXRATE_FORCE_SGI,
NL80211_TXRATE_FORCE_LGI,
};
#define NL80211_EHT_NSS_MAX 16
/**
* struct nl80211_txrate_eht - EHT MCS/NSS txrate bitmap
* @mcs: MCS bitmap table for each NSS (array index 0 for 1 stream, etc.)
*/
struct nl80211_txrate_eht {
__u16 mcs[NL80211_EHT_NSS_MAX];
};
/**
* enum nl80211_band - Frequency band
* @NL80211_BAND_2GHZ: 2.4 GHz ISM band
* @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
* @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
* @NL80211_BAND_S1GHZ: around 900MHz, supported by S1G PHYs
* @NL80211_BAND_LC: light communication band (placeholder)
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
* since newer kernel versions may support more bands
*/
enum nl80211_band {
NL80211_BAND_2GHZ,
NL80211_BAND_5GHZ,
NL80211_BAND_60GHZ,
NL80211_BAND_6GHZ,
NL80211_BAND_S1GHZ,
NL80211_BAND_LC,
NUM_NL80211_BANDS,
};
/**
* enum nl80211_ps_state - powersave state
* @NL80211_PS_DISABLED: powersave is disabled
* @NL80211_PS_ENABLED: powersave is enabled
*/
enum nl80211_ps_state {
NL80211_PS_DISABLED,
NL80211_PS_ENABLED,
};
/**
* enum nl80211_attr_cqm - connection quality monitor attributes
* @__NL80211_ATTR_CQM_INVALID: invalid
* @NL80211_ATTR_CQM_RSSI_THOLD: RSSI threshold in dBm. This value specifies
* the threshold for the RSSI level at which an event will be sent. Zero
* to disable. Alternatively, if %NL80211_EXT_FEATURE_CQM_RSSI_LIST is
* set, multiple values can be supplied as a low-to-high sorted array of
* threshold values in dBm. Events will be sent when the RSSI value
* crosses any of the thresholds.
* @NL80211_ATTR_CQM_RSSI_HYST: RSSI hysteresis in dBm. This value specifies
* the minimum amount the RSSI level must change after an event before a
* new event may be issued (to reduce effects of RSSI oscillation).
* @NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT: RSSI threshold event
* @NL80211_ATTR_CQM_PKT_LOSS_EVENT: a u32 value indicating that this many
* consecutive packets were not acknowledged by the peer
* @NL80211_ATTR_CQM_TXE_RATE: TX error rate in %. Minimum % of TX failures
* during the given %NL80211_ATTR_CQM_TXE_INTVL before an
* %NL80211_CMD_NOTIFY_CQM with reported %NL80211_ATTR_CQM_TXE_RATE and
* %NL80211_ATTR_CQM_TXE_PKTS is generated.
* @NL80211_ATTR_CQM_TXE_PKTS: number of attempted packets in a given
* %NL80211_ATTR_CQM_TXE_INTVL before %NL80211_ATTR_CQM_TXE_RATE is
* checked.
* @NL80211_ATTR_CQM_TXE_INTVL: interval in seconds. Specifies the periodic
* interval in which %NL80211_ATTR_CQM_TXE_PKTS and
* %NL80211_ATTR_CQM_TXE_RATE must be satisfied before generating an
* %NL80211_CMD_NOTIFY_CQM. Set to 0 to turn off TX error reporting.
* @NL80211_ATTR_CQM_BEACON_LOSS_EVENT: flag attribute that's set in a beacon
* loss event
* @NL80211_ATTR_CQM_RSSI_LEVEL: the RSSI value in dBm that triggered the
* RSSI threshold event.
* @__NL80211_ATTR_CQM_AFTER_LAST: internal
* @NL80211_ATTR_CQM_MAX: highest key attribute
*/
enum nl80211_attr_cqm {
__NL80211_ATTR_CQM_INVALID,
NL80211_ATTR_CQM_RSSI_THOLD,
NL80211_ATTR_CQM_RSSI_HYST,
NL80211_ATTR_CQM_RSSI_THRESHOLD_EVENT,
NL80211_ATTR_CQM_PKT_LOSS_EVENT,
NL80211_ATTR_CQM_TXE_RATE,
NL80211_ATTR_CQM_TXE_PKTS,
NL80211_ATTR_CQM_TXE_INTVL,
NL80211_ATTR_CQM_BEACON_LOSS_EVENT,
NL80211_ATTR_CQM_RSSI_LEVEL,
/* keep last */
__NL80211_ATTR_CQM_AFTER_LAST,
NL80211_ATTR_CQM_MAX = __NL80211_ATTR_CQM_AFTER_LAST - 1
};
/**
* enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
* @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
* configured threshold
* @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
* configured threshold
* @NL80211_CQM_RSSI_BEACON_LOSS_EVENT: (reserved, never sent)
*/
enum nl80211_cqm_rssi_threshold_event {
NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW,
NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH,
NL80211_CQM_RSSI_BEACON_LOSS_EVENT,
};
/**
* enum nl80211_tx_power_setting - TX power adjustment
* @NL80211_TX_POWER_AUTOMATIC: automatically determine transmit power
* @NL80211_TX_POWER_LIMITED: limit TX power by the mBm parameter
* @NL80211_TX_POWER_FIXED: fix TX power to the mBm parameter
*/
enum nl80211_tx_power_setting {
NL80211_TX_POWER_AUTOMATIC,
NL80211_TX_POWER_LIMITED,
NL80211_TX_POWER_FIXED,
};
/**
* enum nl80211_tid_config - TID config state
* @NL80211_TID_CONFIG_ENABLE: Enable config for the TID
* @NL80211_TID_CONFIG_DISABLE: Disable config for the TID
*/
enum nl80211_tid_config {
NL80211_TID_CONFIG_ENABLE,
NL80211_TID_CONFIG_DISABLE,
};
/* enum nl80211_tx_rate_setting - TX rate configuration type
* @NL80211_TX_RATE_AUTOMATIC: automatically determine TX rate
* @NL80211_TX_RATE_LIMITED: limit the TX rate by the TX rate parameter
* @NL80211_TX_RATE_FIXED: fix TX rate to the TX rate parameter
*/
enum nl80211_tx_rate_setting {
NL80211_TX_RATE_AUTOMATIC,
NL80211_TX_RATE_LIMITED,
NL80211_TX_RATE_FIXED,
};
/* enum nl80211_tid_config_attr - TID specific configuration.
* @NL80211_TID_CONFIG_ATTR_PAD: pad attribute for 64-bit values
* @NL80211_TID_CONFIG_ATTR_VIF_SUPP: a bitmap (u64) of attributes supported
* for per-vif configuration; doesn't list the ones that are generic
* (%NL80211_TID_CONFIG_ATTR_TIDS, %NL80211_TID_CONFIG_ATTR_OVERRIDE).
* @NL80211_TID_CONFIG_ATTR_PEER_SUPP: same as the previous per-vif one, but
* per peer instead.
* @NL80211_TID_CONFIG_ATTR_OVERRIDE: flag attribute, if set indicates
* that the new configuration overrides all previous peer
* configurations, otherwise previous peer specific configurations
* should be left untouched.
* @NL80211_TID_CONFIG_ATTR_TIDS: a bitmask value of TIDs (bit 0 to 7)
* Its type is u16.
* @NL80211_TID_CONFIG_ATTR_NOACK: Configure ack policy for the TID.
* specified in %NL80211_TID_CONFIG_ATTR_TID. see %enum nl80211_tid_config.
* Its type is u8.
* @NL80211_TID_CONFIG_ATTR_RETRY_SHORT: Number of retries used with data frame
* transmission, user-space sets this configuration in
* &NL80211_CMD_SET_TID_CONFIG. It is u8 type, min value is 1 and
* the max value is advertised by the driver in this attribute on
* output in wiphy capabilities.
* @NL80211_TID_CONFIG_ATTR_RETRY_LONG: Number of retries used with data frame
* transmission, user-space sets this configuration in
* &NL80211_CMD_SET_TID_CONFIG. Its type is u8, min value is 1 and
* the max value is advertised by the driver in this attribute on
* output in wiphy capabilities.
* @NL80211_TID_CONFIG_ATTR_AMPDU_CTRL: Enable/Disable MPDU aggregation
* for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS.
* Its type is u8, using the values from &nl80211_tid_config.
* @NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL: Enable/Disable RTS_CTS for the TIDs
* specified in %NL80211_TID_CONFIG_ATTR_TIDS. It is u8 type, using
* the values from &nl80211_tid_config.
* @NL80211_TID_CONFIG_ATTR_AMSDU_CTRL: Enable/Disable MSDU aggregation
* for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS.
* Its type is u8, using the values from &nl80211_tid_config.
* @NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE: This attribute will be useful
* to notfiy the driver that what type of txrate should be used
* for the TIDs specified in %NL80211_TID_CONFIG_ATTR_TIDS. using
* the values form &nl80211_tx_rate_setting.
* @NL80211_TID_CONFIG_ATTR_TX_RATE: Data frame TX rate mask should be applied
* with the parameters passed through %NL80211_ATTR_TX_RATES.
* configuration is applied to the data frame for the tid to that connected
* station.
*/
enum nl80211_tid_config_attr {
__NL80211_TID_CONFIG_ATTR_INVALID,
NL80211_TID_CONFIG_ATTR_PAD,
NL80211_TID_CONFIG_ATTR_VIF_SUPP,
NL80211_TID_CONFIG_ATTR_PEER_SUPP,
NL80211_TID_CONFIG_ATTR_OVERRIDE,
NL80211_TID_CONFIG_ATTR_TIDS,
NL80211_TID_CONFIG_ATTR_NOACK,
NL80211_TID_CONFIG_ATTR_RETRY_SHORT,
NL80211_TID_CONFIG_ATTR_RETRY_LONG,
NL80211_TID_CONFIG_ATTR_AMPDU_CTRL,
NL80211_TID_CONFIG_ATTR_RTSCTS_CTRL,
NL80211_TID_CONFIG_ATTR_AMSDU_CTRL,
NL80211_TID_CONFIG_ATTR_TX_RATE_TYPE,
NL80211_TID_CONFIG_ATTR_TX_RATE,
/* keep last */
__NL80211_TID_CONFIG_ATTR_AFTER_LAST,
NL80211_TID_CONFIG_ATTR_MAX = __NL80211_TID_CONFIG_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_packet_pattern_attr - packet pattern attribute
* @__NL80211_PKTPAT_INVALID: invalid number for nested attribute
* @NL80211_PKTPAT_PATTERN: the pattern, values where the mask has
* a zero bit are ignored
* @NL80211_PKTPAT_MASK: pattern mask, must be long enough to have
* a bit for each byte in the pattern. The lowest-order bit corresponds
* to the first byte of the pattern, but the bytes of the pattern are
* in a little-endian-like format, i.e. the 9th byte of the pattern
* corresponds to the lowest-order bit in the second byte of the mask.
* For example: The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where
* xx indicates "don't care") would be represented by a pattern of
* twelve zero bytes, and a mask of "0xed,0x01".
* Note that the pattern matching is done as though frames were not
* 802.11 frames but 802.3 frames, i.e. the frame is fully unpacked
* first (including SNAP header unpacking) and then matched.
* @NL80211_PKTPAT_OFFSET: packet offset, pattern is matched after
* these fixed number of bytes of received packet
* @NUM_NL80211_PKTPAT: number of attributes
* @MAX_NL80211_PKTPAT: max attribute number
*/
enum nl80211_packet_pattern_attr {
__NL80211_PKTPAT_INVALID,
NL80211_PKTPAT_MASK,
NL80211_PKTPAT_PATTERN,
NL80211_PKTPAT_OFFSET,
NUM_NL80211_PKTPAT,
MAX_NL80211_PKTPAT = NUM_NL80211_PKTPAT - 1,
};
/**
* struct nl80211_pattern_support - packet pattern support information
* @max_patterns: maximum number of patterns supported
* @min_pattern_len: minimum length of each pattern
* @max_pattern_len: maximum length of each pattern
* @max_pkt_offset: maximum Rx packet offset
*
* This struct is carried in %NL80211_WOWLAN_TRIG_PKT_PATTERN when
* that is part of %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED or in
* %NL80211_ATTR_COALESCE_RULE_PKT_PATTERN when that is part of
* %NL80211_ATTR_COALESCE_RULE in the capability information given
* by the kernel to userspace.
*/
struct nl80211_pattern_support {
__u32 max_patterns;
__u32 min_pattern_len;
__u32 max_pattern_len;
__u32 max_pkt_offset;
} __attribute__((packed));
/* only for backward compatibility */
#define __NL80211_WOWLAN_PKTPAT_INVALID __NL80211_PKTPAT_INVALID
#define NL80211_WOWLAN_PKTPAT_MASK NL80211_PKTPAT_MASK
#define NL80211_WOWLAN_PKTPAT_PATTERN NL80211_PKTPAT_PATTERN
#define NL80211_WOWLAN_PKTPAT_OFFSET NL80211_PKTPAT_OFFSET
#define NUM_NL80211_WOWLAN_PKTPAT NUM_NL80211_PKTPAT
#define MAX_NL80211_WOWLAN_PKTPAT MAX_NL80211_PKTPAT
#define nl80211_wowlan_pattern_support nl80211_pattern_support
/**
* enum nl80211_wowlan_triggers - WoWLAN trigger definitions
* @__NL80211_WOWLAN_TRIG_INVALID: invalid number for nested attributes
* @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put
* the chip into a special state -- works best with chips that have
* support for low-power operation already (flag)
* Note that this mode is incompatible with all of the others, if
* any others are even supported by the device.
* @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect
* is detected is implementation-specific (flag)
* @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed
* by 16 repetitions of MAC addr, anywhere in payload) (flag)
* @NL80211_WOWLAN_TRIG_PKT_PATTERN: wake up on the specified packet patterns
* which are passed in an array of nested attributes, each nested attribute
* defining a with attributes from &struct nl80211_wowlan_trig_pkt_pattern.
* Each pattern defines a wakeup packet. Packet offset is associated with
* each pattern which is used while matching the pattern. The matching is
* done on the MSDU, i.e. as though the packet was an 802.3 packet, so the
* pattern matching is done after the packet is converted to the MSDU.
*
* In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
* carrying a &struct nl80211_pattern_support.
*
* When reporting wakeup. it is a u32 attribute containing the 0-based
* index of the pattern that caused the wakeup, in the patterns passed
* to the kernel when configuring.
* @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
* used when setting, used only to indicate that GTK rekeying is supported
* by the device (flag)
* @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
* done by the device) (flag)
* @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
* packet (flag)
* @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
* @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
* (on devices that have rfkill in the device) (flag)
* @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211: For wakeup reporting only, contains
* the 802.11 packet that caused the wakeup, e.g. a deauth frame. The frame
* may be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN
* attribute contains the original length.
* @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN: Original length of the 802.11
* packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211
* attribute if the packet was truncated somewhere.
* @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023: For wakeup reporting only, contains the
* 802.11 packet that caused the wakeup, e.g. a magic packet. The frame may
* be truncated, the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN attribute
* contains the original length.
* @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN: Original length of the 802.3
* packet, may be bigger than the @NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023
* attribute if the packet was truncated somewhere.
* @NL80211_WOWLAN_TRIG_TCP_CONNECTION: TCP connection wake, see DOC section
* "TCP connection wakeup" for more details. This is a nested attribute
* containing the exact information for establishing and keeping alive
* the TCP connection.
* @NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH: For wakeup reporting only, the
* wakeup packet was received on the TCP connection
* @NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST: For wakeup reporting only, the
* TCP connection was lost or failed to be established
* @NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS: For wakeup reporting only,
* the TCP connection ran out of tokens to use for data to send to the
* service
* @NL80211_WOWLAN_TRIG_NET_DETECT: wake up when a configured network
* is detected. This is a nested attribute that contains the
* same attributes used with @NL80211_CMD_START_SCHED_SCAN. It
* specifies how the scan is performed (e.g. the interval, the
* channels to scan and the initial delay) as well as the scan
* results that will trigger a wake (i.e. the matchsets). This
* attribute is also sent in a response to
* @NL80211_CMD_GET_WIPHY, indicating the number of match sets
* supported by the driver (u32).
* @NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS: nested attribute
* containing an array with information about what triggered the
* wake up. If no elements are present in the array, it means
* that the information is not available. If more than one
* element is present, it means that more than one match
* occurred.
* Each element in the array is a nested attribute that contains
* one optional %NL80211_ATTR_SSID attribute and one optional
* %NL80211_ATTR_SCAN_FREQUENCIES attribute. At least one of
* these attributes must be present. If
* %NL80211_ATTR_SCAN_FREQUENCIES contains more than one
* frequency, it means that the match occurred in more than one
* channel.
* @NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC: For wakeup reporting only.
* Wake up happened due to unprotected deauth or disassoc frame in MFP.
* @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
* @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
*
* These nested attributes are used to configure the wakeup triggers and
* to report the wakeup reason(s).
*/
enum nl80211_wowlan_triggers {
__NL80211_WOWLAN_TRIG_INVALID,
NL80211_WOWLAN_TRIG_ANY,
NL80211_WOWLAN_TRIG_DISCONNECT,
NL80211_WOWLAN_TRIG_MAGIC_PKT,
NL80211_WOWLAN_TRIG_PKT_PATTERN,
NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_80211_LEN,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023,
NL80211_WOWLAN_TRIG_WAKEUP_PKT_8023_LEN,
NL80211_WOWLAN_TRIG_TCP_CONNECTION,
NL80211_WOWLAN_TRIG_WAKEUP_TCP_MATCH,
NL80211_WOWLAN_TRIG_WAKEUP_TCP_CONNLOST,
NL80211_WOWLAN_TRIG_WAKEUP_TCP_NOMORETOKENS,
NL80211_WOWLAN_TRIG_NET_DETECT,
NL80211_WOWLAN_TRIG_NET_DETECT_RESULTS,
NL80211_WOWLAN_TRIG_UNPROTECTED_DEAUTH_DISASSOC,
/* keep last */
NUM_NL80211_WOWLAN_TRIG,
MAX_NL80211_WOWLAN_TRIG = NUM_NL80211_WOWLAN_TRIG - 1
};
/**
* DOC: TCP connection wakeup
*
* Some devices can establish a TCP connection in order to be woken up by a
* packet coming in from outside their network segment, or behind NAT. If
* configured, the device will establish a TCP connection to the given
* service, and periodically send data to that service. The first data
* packet is usually transmitted after SYN/ACK, also ACKing the SYN/ACK.
* The data packets can optionally include a (little endian) sequence
* number (in the TCP payload!) that is generated by the device, and, also
* optionally, a token from a list of tokens. This serves as a keep-alive
* with the service, and for NATed connections, etc.
*
* During this keep-alive period, the server doesn't send any data to the
* client. When receiving data, it is compared against the wakeup pattern
* (and mask) and if it matches, the host is woken up. Similarly, if the
* connection breaks or cannot be established to start with, the host is
* also woken up.
*
* Developer's note: ARP offload is required for this, otherwise TCP
* response packets might not go through correctly.
*/
/**
* struct nl80211_wowlan_tcp_data_seq - WoWLAN TCP data sequence
* @start: starting value
* @offset: offset of sequence number in packet
* @len: length of the sequence value to write, 1 through 4
*
* Note: don't confuse with the TCP sequence number(s), this is for the
* keepalive packet payload. The actual value is written into the packet
* in little endian.
*/
struct nl80211_wowlan_tcp_data_seq {
__u32 start, offset, len;
};
/**
* struct nl80211_wowlan_tcp_data_token - WoWLAN TCP data token config
* @offset: offset of token in packet
* @len: length of each token
* @token_stream: stream of data to be used for the tokens, the length must
* be a multiple of @len for this to make sense
*/
struct nl80211_wowlan_tcp_data_token {
__u32 offset, len;
__u8 token_stream[];
};
/**
* struct nl80211_wowlan_tcp_data_token_feature - data token features
* @min_len: minimum token length
* @max_len: maximum token length
* @bufsize: total available token buffer size (max size of @token_stream)
*/
struct nl80211_wowlan_tcp_data_token_feature {
__u32 min_len, max_len, bufsize;
};
/**
* enum nl80211_wowlan_tcp_attrs - WoWLAN TCP connection parameters
* @__NL80211_WOWLAN_TCP_INVALID: invalid number for nested attributes
* @NL80211_WOWLAN_TCP_SRC_IPV4: source IPv4 address (in network byte order)
* @NL80211_WOWLAN_TCP_DST_IPV4: destination IPv4 address
* (in network byte order)
* @NL80211_WOWLAN_TCP_DST_MAC: destination MAC address, this is given because
* route lookup when configured might be invalid by the time we suspend,
* and doing a route lookup when suspending is no longer possible as it
* might require ARP querying.
* @NL80211_WOWLAN_TCP_SRC_PORT: source port (u16); optional, if not given a
* socket and port will be allocated
* @NL80211_WOWLAN_TCP_DST_PORT: destination port (u16)
* @NL80211_WOWLAN_TCP_DATA_PAYLOAD: data packet payload, at least one byte.
* For feature advertising, a u32 attribute holding the maximum length
* of the data payload.
* @NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ: data packet sequence configuration
* (if desired), a &struct nl80211_wowlan_tcp_data_seq. For feature
* advertising it is just a flag
* @NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN: data packet token configuration,
* see &struct nl80211_wowlan_tcp_data_token and for advertising see
* &struct nl80211_wowlan_tcp_data_token_feature.
* @NL80211_WOWLAN_TCP_DATA_INTERVAL: data interval in seconds, maximum
* interval in feature advertising (u32)
* @NL80211_WOWLAN_TCP_WAKE_PAYLOAD: wake packet payload, for advertising a
* u32 attribute holding the maximum length
* @NL80211_WOWLAN_TCP_WAKE_MASK: Wake packet payload mask, not used for
* feature advertising. The mask works like @NL80211_PKTPAT_MASK
* but on the TCP payload only.
* @NUM_NL80211_WOWLAN_TCP: number of TCP attributes
* @MAX_NL80211_WOWLAN_TCP: highest attribute number
*/
enum nl80211_wowlan_tcp_attrs {
__NL80211_WOWLAN_TCP_INVALID,
NL80211_WOWLAN_TCP_SRC_IPV4,
NL80211_WOWLAN_TCP_DST_IPV4,
NL80211_WOWLAN_TCP_DST_MAC,
NL80211_WOWLAN_TCP_SRC_PORT,
NL80211_WOWLAN_TCP_DST_PORT,
NL80211_WOWLAN_TCP_DATA_PAYLOAD,
NL80211_WOWLAN_TCP_DATA_PAYLOAD_SEQ,
NL80211_WOWLAN_TCP_DATA_PAYLOAD_TOKEN,
NL80211_WOWLAN_TCP_DATA_INTERVAL,
NL80211_WOWLAN_TCP_WAKE_PAYLOAD,
NL80211_WOWLAN_TCP_WAKE_MASK,
/* keep last */
NUM_NL80211_WOWLAN_TCP,
MAX_NL80211_WOWLAN_TCP = NUM_NL80211_WOWLAN_TCP - 1
};
/**
* struct nl80211_coalesce_rule_support - coalesce rule support information
* @max_rules: maximum number of rules supported
* @pat: packet pattern support information
* @max_delay: maximum supported coalescing delay in msecs
*
* This struct is carried in %NL80211_ATTR_COALESCE_RULE in the
* capability information given by the kernel to userspace.
*/
struct nl80211_coalesce_rule_support {
__u32 max_rules;
struct nl80211_pattern_support pat;
__u32 max_delay;
} __attribute__((packed));
/**
* enum nl80211_attr_coalesce_rule - coalesce rule attribute
* @__NL80211_COALESCE_RULE_INVALID: invalid number for nested attribute
* @NL80211_ATTR_COALESCE_RULE_DELAY: delay in msecs used for packet coalescing
* @NL80211_ATTR_COALESCE_RULE_CONDITION: condition for packet coalescence,
* see &enum nl80211_coalesce_condition.
* @NL80211_ATTR_COALESCE_RULE_PKT_PATTERN: packet offset, pattern is matched
* after these fixed number of bytes of received packet
* @NUM_NL80211_ATTR_COALESCE_RULE: number of attributes
* @NL80211_ATTR_COALESCE_RULE_MAX: max attribute number
*/
enum nl80211_attr_coalesce_rule {
__NL80211_COALESCE_RULE_INVALID,
NL80211_ATTR_COALESCE_RULE_DELAY,
NL80211_ATTR_COALESCE_RULE_CONDITION,
NL80211_ATTR_COALESCE_RULE_PKT_PATTERN,
/* keep last */
NUM_NL80211_ATTR_COALESCE_RULE,
NL80211_ATTR_COALESCE_RULE_MAX = NUM_NL80211_ATTR_COALESCE_RULE - 1
};
/**
* enum nl80211_coalesce_condition - coalesce rule conditions
* @NL80211_COALESCE_CONDITION_MATCH: coalesce Rx packets when patterns
* in a rule are matched.
* @NL80211_COALESCE_CONDITION_NO_MATCH: coalesce Rx packets when patterns
* in a rule are not matched.
*/
enum nl80211_coalesce_condition {
NL80211_COALESCE_CONDITION_MATCH,
NL80211_COALESCE_CONDITION_NO_MATCH
};
/**
* enum nl80211_iface_limit_attrs - limit attributes
* @NL80211_IFACE_LIMIT_UNSPEC: (reserved)
* @NL80211_IFACE_LIMIT_MAX: maximum number of interfaces that
* can be chosen from this set of interface types (u32)
* @NL80211_IFACE_LIMIT_TYPES: nested attribute containing a
* flag attribute for each interface type in this set
* @NUM_NL80211_IFACE_LIMIT: number of attributes
* @MAX_NL80211_IFACE_LIMIT: highest attribute number
*/
enum nl80211_iface_limit_attrs {
NL80211_IFACE_LIMIT_UNSPEC,
NL80211_IFACE_LIMIT_MAX,
NL80211_IFACE_LIMIT_TYPES,
/* keep last */
NUM_NL80211_IFACE_LIMIT,
MAX_NL80211_IFACE_LIMIT = NUM_NL80211_IFACE_LIMIT - 1
};
/**
* enum nl80211_if_combination_attrs -- interface combination attributes
*
* @NL80211_IFACE_COMB_UNSPEC: (reserved)
* @NL80211_IFACE_COMB_LIMITS: Nested attributes containing the limits
* for given interface types, see &enum nl80211_iface_limit_attrs.
* @NL80211_IFACE_COMB_MAXNUM: u32 attribute giving the total number of
* interfaces that can be created in this group. This number doesn't
* apply to interfaces purely managed in software, which are listed
* in a separate attribute %NL80211_ATTR_INTERFACES_SOFTWARE.
* @NL80211_IFACE_COMB_STA_AP_BI_MATCH: flag attribute specifying that
* beacon intervals within this group must be all the same even for
* infrastructure and AP/GO combinations, i.e. the GO(s) must adopt
* the infrastructure network's beacon interval.
* @NL80211_IFACE_COMB_NUM_CHANNELS: u32 attribute specifying how many
* different channels may be used within this group.
* @NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS: u32 attribute containing the bitmap
* of supported channel widths for radar detection.
* @NL80211_IFACE_COMB_RADAR_DETECT_REGIONS: u32 attribute containing the bitmap
* of supported regulatory regions for radar detection.
* @NL80211_IFACE_COMB_BI_MIN_GCD: u32 attribute specifying the minimum GCD of
* different beacon intervals supported by all the interface combinations
* in this group (if not present, all beacon intervals be identical).
* @NUM_NL80211_IFACE_COMB: number of attributes
* @MAX_NL80211_IFACE_COMB: highest attribute number
*
* Examples:
* limits = [ #{STA} <= 1, #{AP} <= 1 ], matching BI, channels = 1, max = 2
* => allows an AP and a STA that must match BIs
*
* numbers = [ #{AP, P2P-GO} <= 8 ], BI min gcd, channels = 1, max = 8,
* => allows 8 of AP/GO that can have BI gcd >= min gcd
*
* numbers = [ #{STA} <= 2 ], channels = 2, max = 2
* => allows two STAs on the same or on different channels
*
* numbers = [ #{STA} <= 1, #{P2P-client,P2P-GO} <= 3 ], max = 4
* => allows a STA plus three P2P interfaces
*
* The list of these four possibilities could completely be contained
* within the %NL80211_ATTR_INTERFACE_COMBINATIONS attribute to indicate
* that any of these groups must match.
*
* "Combinations" of just a single interface will not be listed here,
* a single interface of any valid interface type is assumed to always
* be possible by itself. This means that implicitly, for each valid
* interface type, the following group always exists:
* numbers = [ #{} <= 1 ], channels = 1, max = 1
*/
enum nl80211_if_combination_attrs {
NL80211_IFACE_COMB_UNSPEC,
NL80211_IFACE_COMB_LIMITS,
NL80211_IFACE_COMB_MAXNUM,
NL80211_IFACE_COMB_STA_AP_BI_MATCH,
NL80211_IFACE_COMB_NUM_CHANNELS,
NL80211_IFACE_COMB_RADAR_DETECT_WIDTHS,
NL80211_IFACE_COMB_RADAR_DETECT_REGIONS,
NL80211_IFACE_COMB_BI_MIN_GCD,
/* keep last */
NUM_NL80211_IFACE_COMB,
MAX_NL80211_IFACE_COMB = NUM_NL80211_IFACE_COMB - 1
};
/**
* enum nl80211_plink_state - state of a mesh peer link finite state machine
*
* @NL80211_PLINK_LISTEN: initial state, considered the implicit
* state of non-existent mesh peer links
* @NL80211_PLINK_OPN_SNT: mesh plink open frame has been sent to
* this mesh peer
* @NL80211_PLINK_OPN_RCVD: mesh plink open frame has been received
* from this mesh peer
* @NL80211_PLINK_CNF_RCVD: mesh plink confirm frame has been
* received from this mesh peer
* @NL80211_PLINK_ESTAB: mesh peer link is established
* @NL80211_PLINK_HOLDING: mesh peer link is being closed or cancelled
* @NL80211_PLINK_BLOCKED: all frames transmitted from this mesh
* plink are discarded, except for authentication frames
* @NUM_NL80211_PLINK_STATES: number of peer link states
* @MAX_NL80211_PLINK_STATES: highest numerical value of plink states
*/
enum nl80211_plink_state {
NL80211_PLINK_LISTEN,
NL80211_PLINK_OPN_SNT,
NL80211_PLINK_OPN_RCVD,
NL80211_PLINK_CNF_RCVD,
NL80211_PLINK_ESTAB,
NL80211_PLINK_HOLDING,
NL80211_PLINK_BLOCKED,
/* keep last */
NUM_NL80211_PLINK_STATES,
MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
};
/**
* enum nl80211_plink_action - actions to perform in mesh peers
*
* @NL80211_PLINK_ACTION_NO_ACTION: perform no action
* @NL80211_PLINK_ACTION_OPEN: start mesh peer link establishment
* @NL80211_PLINK_ACTION_BLOCK: block traffic from this mesh peer
* @NUM_NL80211_PLINK_ACTIONS: number of possible actions
*/
enum nl80211_plink_action {
NL80211_PLINK_ACTION_NO_ACTION,
NL80211_PLINK_ACTION_OPEN,
NL80211_PLINK_ACTION_BLOCK,
NUM_NL80211_PLINK_ACTIONS,
};
#define NL80211_KCK_LEN 16
#define NL80211_KEK_LEN 16
#define NL80211_KCK_EXT_LEN 24
#define NL80211_KEK_EXT_LEN 32
#define NL80211_KCK_EXT_LEN_32 32
#define NL80211_REPLAY_CTR_LEN 8
/**
* enum nl80211_rekey_data - attributes for GTK rekey offload
* @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
* @NL80211_REKEY_DATA_KEK: key encryption key (binary)
* @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
* @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
* @NL80211_REKEY_DATA_AKM: AKM data (OUI, suite type)
* @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
* @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
*/
enum nl80211_rekey_data {
__NL80211_REKEY_DATA_INVALID,
NL80211_REKEY_DATA_KEK,
NL80211_REKEY_DATA_KCK,
NL80211_REKEY_DATA_REPLAY_CTR,
NL80211_REKEY_DATA_AKM,
/* keep last */
NUM_NL80211_REKEY_DATA,
MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
};
/**
* enum nl80211_hidden_ssid - values for %NL80211_ATTR_HIDDEN_SSID
* @NL80211_HIDDEN_SSID_NOT_IN_USE: do not hide SSID (i.e., broadcast it in
* Beacon frames)
* @NL80211_HIDDEN_SSID_ZERO_LEN: hide SSID by using zero-length SSID element
* in Beacon frames
* @NL80211_HIDDEN_SSID_ZERO_CONTENTS: hide SSID by using correct length of SSID
* element in Beacon frames but zero out each byte in the SSID
*/
enum nl80211_hidden_ssid {
NL80211_HIDDEN_SSID_NOT_IN_USE,
NL80211_HIDDEN_SSID_ZERO_LEN,
NL80211_HIDDEN_SSID_ZERO_CONTENTS
};
/**
* enum nl80211_sta_wme_attr - station WME attributes
* @__NL80211_STA_WME_INVALID: invalid number for nested attribute
* @NL80211_STA_WME_UAPSD_QUEUES: bitmap of uapsd queues. the format
* is the same as the AC bitmap in the QoS info field.
* @NL80211_STA_WME_MAX_SP: max service period. the format is the same
* as the MAX_SP field in the QoS info field (but already shifted down).
* @__NL80211_STA_WME_AFTER_LAST: internal
* @NL80211_STA_WME_MAX: highest station WME attribute
*/
enum nl80211_sta_wme_attr {
__NL80211_STA_WME_INVALID,
NL80211_STA_WME_UAPSD_QUEUES,
NL80211_STA_WME_MAX_SP,
/* keep last */
__NL80211_STA_WME_AFTER_LAST,
NL80211_STA_WME_MAX = __NL80211_STA_WME_AFTER_LAST - 1
};
/**
* enum nl80211_pmksa_candidate_attr - attributes for PMKSA caching candidates
* @__NL80211_PMKSA_CANDIDATE_INVALID: invalid number for nested attributes
* @NL80211_PMKSA_CANDIDATE_INDEX: candidate index (u32; the smaller, the higher
* priority)
* @NL80211_PMKSA_CANDIDATE_BSSID: candidate BSSID (6 octets)
* @NL80211_PMKSA_CANDIDATE_PREAUTH: RSN pre-authentication supported (flag)
* @NUM_NL80211_PMKSA_CANDIDATE: number of PMKSA caching candidate attributes
* (internal)
* @MAX_NL80211_PMKSA_CANDIDATE: highest PMKSA caching candidate attribute
* (internal)
*/
enum nl80211_pmksa_candidate_attr {
__NL80211_PMKSA_CANDIDATE_INVALID,
NL80211_PMKSA_CANDIDATE_INDEX,
NL80211_PMKSA_CANDIDATE_BSSID,
NL80211_PMKSA_CANDIDATE_PREAUTH,
/* keep last */
NUM_NL80211_PMKSA_CANDIDATE,
MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
};
/**
* enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
* @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
* @NL80211_TDLS_SETUP: Setup TDLS link
* @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
* @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
* @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
*/
enum nl80211_tdls_operation {
NL80211_TDLS_DISCOVERY_REQ,
NL80211_TDLS_SETUP,
NL80211_TDLS_TEARDOWN,
NL80211_TDLS_ENABLE_LINK,
NL80211_TDLS_DISABLE_LINK,
};
/**
* enum nl80211_ap_sme_features - device-integrated AP features
* @NL80211_AP_SME_SA_QUERY_OFFLOAD: SA Query procedures offloaded to driver
* when user space indicates support for SA Query procedures offload during
* "start ap" with %NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT.
*/
enum nl80211_ap_sme_features {
NL80211_AP_SME_SA_QUERY_OFFLOAD = 1 << 0,
};
/**
* enum nl80211_feature_flags - device/driver features
* @NL80211_FEATURE_SK_TX_STATUS: This driver supports reflecting back
* TX status to the socket error queue when requested with the
* socket option.
* @NL80211_FEATURE_HT_IBSS: This driver supports IBSS with HT datarates.
* @NL80211_FEATURE_INACTIVITY_TIMER: This driver takes care of freeing up
* the connected inactive stations in AP mode.
* @NL80211_FEATURE_CELL_BASE_REG_HINTS: This driver has been tested
* to work properly to support receiving regulatory hints from
* cellular base stations.
* @NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL: (no longer available, only
* here to reserve the value for API/ABI compatibility)
* @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of
* equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station
* mode
* @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan
* @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported
* @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif
* @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting
* @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform
* OBSS scans and generate 20/40 BSS coex reports. This flag is used only
* for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied.
* @NL80211_FEATURE_P2P_GO_CTWIN: P2P GO implementation supports CT Window
* setting
* @NL80211_FEATURE_P2P_GO_OPPPS: P2P GO implementation supports opportunistic
* powersave
* @NL80211_FEATURE_FULL_AP_CLIENT_STATE: The driver supports full state
* transitions for AP clients. Without this flag (and if the driver
* doesn't have the AP SME in the device) the driver supports adding
* stations only when they're associated and adds them in associated
* state (to later be transitioned into authorized), with this flag
* they should be added before even sending the authentication reply
* and then transitioned into authenticated, associated and authorized
* states using station flags.
* Note that even for drivers that support this, the default is to add
* stations in authenticated/associated state, so to add unauthenticated
* stations the authenticated/associated bits have to be set in the mask.
* @NL80211_FEATURE_ADVERTISE_CHAN_LIMITS: cfg80211 advertises channel limits
* (HT40, VHT 80/160 MHz) if this flag is set
* @NL80211_FEATURE_USERSPACE_MPM: This driver supports a userspace Mesh
* Peering Management entity which may be implemented by registering for
* beacons or NL80211_CMD_NEW_PEER_CANDIDATE events. The mesh beacon is
* still generated by the driver.
* @NL80211_FEATURE_ACTIVE_MONITOR: This driver supports an active monitor
* interface. An active monitor interface behaves like a normal monitor
* interface, but gets added to the driver. It ensures that incoming
* unicast packets directed at the configured interface address get ACKed.
* @NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE: This driver supports dynamic
* channel bandwidth change (e.g., HT 20 <-> 40 MHz channel) during the
* lifetime of a BSS.
* @NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES: This device adds a DS Parameter
* Set IE to probe requests.
* @NL80211_FEATURE_WFA_TPC_IE_IN_PROBES: This device adds a WFA TPC Report IE
* to probe requests.
* @NL80211_FEATURE_QUIET: This device, in client mode, supports Quiet Period
* requests sent to it by an AP.
* @NL80211_FEATURE_TX_POWER_INSERTION: This device is capable of inserting the
* current tx power value into the TPC Report IE in the spectrum
* management TPC Report action frame, and in the Radio Measurement Link
* Measurement Report action frame.
* @NL80211_FEATURE_ACKTO_ESTIMATION: This driver supports dynamic ACK timeout
* estimation (dynack). %NL80211_ATTR_WIPHY_DYN_ACK flag attribute is used
* to enable dynack.
* @NL80211_FEATURE_STATIC_SMPS: Device supports static spatial
* multiplexing powersave, ie. can turn off all but one chain
* even on HT connections that should be using more chains.
* @NL80211_FEATURE_DYNAMIC_SMPS: Device supports dynamic spatial
* multiplexing powersave, ie. can turn off all but one chain
* and then wake the rest up as required after, for example,
* rts/cts handshake.
* @NL80211_FEATURE_SUPPORTS_WMM_ADMISSION: the device supports setting up WMM
* TSPEC sessions (TID aka TSID 0-7) with the %NL80211_CMD_ADD_TX_TS
* command. Standard IEEE 802.11 TSPEC setup is not yet supported, it
* needs to be able to handle Block-Ack agreements and other things.
* @NL80211_FEATURE_MAC_ON_CREATE: Device supports configuring
* the vif's MAC address upon creation.
* See 'macaddr' field in the vif_params (cfg80211.h).
* @NL80211_FEATURE_TDLS_CHANNEL_SWITCH: Driver supports channel switching when
* operating as a TDLS peer.
* @NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR: This device/driver supports using a
* random MAC address during scan (if the device is unassociated); the
* %NL80211_SCAN_FLAG_RANDOM_ADDR flag may be set for scans and the MAC
* address mask/value will be used.
* @NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR: This device/driver supports
* using a random MAC address for every scan iteration during scheduled
* scan (while not associated), the %NL80211_SCAN_FLAG_RANDOM_ADDR may
* be set for scheduled scan and the MAC address mask/value will be used.
* @NL80211_FEATURE_ND_RANDOM_MAC_ADDR: This device/driver supports using a
* random MAC address for every scan iteration during "net detect", i.e.
* scan in unassociated WoWLAN, the %NL80211_SCAN_FLAG_RANDOM_ADDR may
* be set for scheduled scan and the MAC address mask/value will be used.
*/
enum nl80211_feature_flags {
NL80211_FEATURE_SK_TX_STATUS = 1 << 0,
NL80211_FEATURE_HT_IBSS = 1 << 1,
NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2,
NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3,
NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4,
NL80211_FEATURE_SAE = 1 << 5,
NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6,
NL80211_FEATURE_SCAN_FLUSH = 1 << 7,
NL80211_FEATURE_AP_SCAN = 1 << 8,
NL80211_FEATURE_VIF_TXPOWER = 1 << 9,
NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10,
NL80211_FEATURE_P2P_GO_CTWIN = 1 << 11,
NL80211_FEATURE_P2P_GO_OPPPS = 1 << 12,
/* bit 13 is reserved */
NL80211_FEATURE_ADVERTISE_CHAN_LIMITS = 1 << 14,
NL80211_FEATURE_FULL_AP_CLIENT_STATE = 1 << 15,
NL80211_FEATURE_USERSPACE_MPM = 1 << 16,
NL80211_FEATURE_ACTIVE_MONITOR = 1 << 17,
NL80211_FEATURE_AP_MODE_CHAN_WIDTH_CHANGE = 1 << 18,
NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES = 1 << 19,
NL80211_FEATURE_WFA_TPC_IE_IN_PROBES = 1 << 20,
NL80211_FEATURE_QUIET = 1 << 21,
NL80211_FEATURE_TX_POWER_INSERTION = 1 << 22,
NL80211_FEATURE_ACKTO_ESTIMATION = 1 << 23,
NL80211_FEATURE_STATIC_SMPS = 1 << 24,
NL80211_FEATURE_DYNAMIC_SMPS = 1 << 25,
NL80211_FEATURE_SUPPORTS_WMM_ADMISSION = 1 << 26,
NL80211_FEATURE_MAC_ON_CREATE = 1 << 27,
NL80211_FEATURE_TDLS_CHANNEL_SWITCH = 1 << 28,
NL80211_FEATURE_SCAN_RANDOM_MAC_ADDR = 1 << 29,
NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR = 1 << 30,
NL80211_FEATURE_ND_RANDOM_MAC_ADDR = (int)0x80000000, // Note: 1U << 31 causes compiler warning.
};
/**
* enum nl80211_ext_feature_index - bit index of extended features.
* @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates.
* @NL80211_EXT_FEATURE_RRM: This driver supports RRM. When featured, user can
* request to use RRM (see %NL80211_ATTR_USE_RRM) with
* %NL80211_CMD_ASSOCIATE and %NL80211_CMD_CONNECT requests, which will set
* the ASSOC_REQ_USE_RRM flag in the association request even if
* NL80211_FEATURE_QUIET is not advertised.
* @NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER: This device supports MU-MIMO air
* sniffer which means that it can be configured to hear packets from
* certain groups which can be configured by the
* %NL80211_ATTR_MU_MIMO_GROUP_DATA attribute,
* or can be configured to follow a station by configuring the
* %NL80211_ATTR_MU_MIMO_FOLLOW_MAC_ADDR attribute.
* @NL80211_EXT_FEATURE_SCAN_START_TIME: This driver includes the actual
* time the scan started in scan results event. The time is the TSF of
* the BSS that the interface that requested the scan is connected to
* (if available).
* @NL80211_EXT_FEATURE_BSS_PARENT_TSF: Per BSS, this driver reports the
* time the last beacon/probe was received. For a non-MLO connection, the
* time is the TSF of the BSS that the interface that requested the scan is
* connected to (if available). For an MLO connection, the time is the TSF
* of the BSS corresponding with link ID specified in the scan request (if
* specified).
* @NL80211_EXT_FEATURE_SET_SCAN_DWELL: This driver supports configuration of
* channel dwell time.
* @NL80211_EXT_FEATURE_BEACON_RATE_LEGACY: Driver supports beacon rate
* configuration (AP/mesh), supporting a legacy (non-HT/VHT) rate.
* @NL80211_EXT_FEATURE_BEACON_RATE_HT: Driver supports beacon rate
* configuration (AP/mesh) with HT rates.
* @NL80211_EXT_FEATURE_BEACON_RATE_VHT: Driver supports beacon rate
* configuration (AP/mesh) with VHT rates.
* @NL80211_EXT_FEATURE_FILS_STA: This driver supports Fast Initial Link Setup
* with user space SME (NL80211_CMD_AUTHENTICATE) in station mode.
* @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA: This driver supports randomized TA
* in @NL80211_CMD_FRAME while not associated.
* @NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED: This driver supports
* randomized TA in @NL80211_CMD_FRAME while associated.
* @NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI: The driver supports sched_scan
* for reporting BSSs with better RSSI than the current connected BSS
* (%NL80211_ATTR_SCHED_SCAN_RELATIVE_RSSI).
* @NL80211_EXT_FEATURE_CQM_RSSI_LIST: With this driver the
* %NL80211_ATTR_CQM_RSSI_THOLD attribute accepts a list of zero or more
* RSSI threshold values to monitor rather than exactly one threshold.
* @NL80211_EXT_FEATURE_FILS_SK_OFFLOAD: Driver SME supports FILS shared key
* authentication with %NL80211_CMD_CONNECT.
* @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK: Device wants to do 4-way
* handshake with PSK in station mode (PSK is passed as part of the connect
* and associate commands), doing it in the host might not be supported.
* @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X: Device wants to do doing 4-way
* handshake with 802.1X in station mode (will pass EAP frames to the host
* and accept the set_pmk/del_pmk commands), doing it in the host might not
* be supported.
* @NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME: Driver is capable of overriding
* the max channel attribute in the FILS request params IE with the
* actual dwell time.
* @NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP: Driver accepts broadcast probe
* response
* @NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE: Driver supports sending
* the first probe request in each channel at rate of at least 5.5Mbps.
* @NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: Driver supports
* probe request tx deferral and suppression
* @NL80211_EXT_FEATURE_MFP_OPTIONAL: Driver supports the %NL80211_MFP_OPTIONAL
* value in %NL80211_ATTR_USE_MFP.
* @NL80211_EXT_FEATURE_LOW_SPAN_SCAN: Driver supports low span scan.
* @NL80211_EXT_FEATURE_LOW_POWER_SCAN: Driver supports low power scan.
* @NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN: Driver supports high accuracy scan.
* @NL80211_EXT_FEATURE_DFS_OFFLOAD: HW/driver will offload DFS actions.
* Device or driver will do all DFS-related actions by itself,
* informing user-space about CAC progress, radar detection event,
* channel change triggered by radar detection event.
* No need to start CAC from user-space, no need to react to
* "radar detected" event.
* @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211: Driver supports sending and
* receiving control port frames over nl80211 instead of the netdevice.
* @NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT: This driver/device supports
* (average) ACK signal strength reporting.
* @NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT: Backward-compatible ID
* @NL80211_EXT_FEATURE_TXQS: Driver supports FQ-CoDel-enabled intermediate
* TXQs.
* @NL80211_EXT_FEATURE_SCAN_RANDOM_SN: Driver/device supports randomizing the
* SN in probe request frames if requested by %NL80211_SCAN_FLAG_RANDOM_SN.
* @NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT: Driver/device can omit all data
* except for supported rates from the probe request content if requested
* by the %NL80211_SCAN_FLAG_MIN_PREQ_CONTENT flag.
* @NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER: Driver supports enabling fine
* timing measurement responder role.
*
* @NL80211_EXT_FEATURE_CAN_REPLACE_PTK0: Driver/device confirm that they are
* able to rekey an in-use key correctly. Userspace must not rekey PTK keys
* if this flag is not set. Ignoring this can leak clear text packets and/or
* freeze the connection.
* @NL80211_EXT_FEATURE_EXT_KEY_ID: Driver supports "Extended Key ID for
* Individually Addressed Frames" from IEEE802.11-2016.
*
* @NL80211_EXT_FEATURE_AIRTIME_FAIRNESS: Driver supports getting airtime
* fairness for transmitted packets and has enabled airtime fairness
* scheduling.
*
* @NL80211_EXT_FEATURE_AP_PMKSA_CACHING: Driver/device supports PMKSA caching
* (set/del PMKSA operations) in AP mode.
*
* @NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD: Obsolete
*
* @NL80211_EXT_FEATURE_STA_TX_PWR: This driver supports controlling tx power
* to a station.
*
* @NL80211_EXT_FEATURE_SAE_OFFLOAD: Device wants to do SAE authentication in
* station mode (SAE password is passed as part of the connect command).
*
* @NL80211_EXT_FEATURE_VLAN_OFFLOAD: The driver supports a single netdev
* with VLAN tagged frames and separate VLAN-specific netdevs added using
* vconfig similarly to the Ethernet case.
*
* @NL80211_EXT_FEATURE_AQL: The driver supports the Airtime Queue Limit (AQL)
* feature, which prevents bufferbloat by using the expected transmission
* time to limit the amount of data buffered in the hardware.
*
* @NL80211_EXT_FEATURE_BEACON_PROTECTION: The driver supports Beacon protection
* and can receive key configuration for BIGTK using key indexes 6 and 7.
* @NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT: The driver supports Beacon
* protection as a client only and cannot transmit protected beacons.
*
* @NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH: The driver can disable the
* forwarding of preauth frames over the control port. They are then
* handled as ordinary data frames.
*
* @NL80211_EXT_FEATURE_PROTECTED_TWT: Driver supports protected TWT frames
*
* @NL80211_EXT_FEATURE_DEL_IBSS_STA: The driver supports removing stations
* in IBSS mode, essentially by dropping their state.
*
* @NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS: management frame registrations
* are possible for multicast frames and those will be reported properly.
*
* @NL80211_EXT_FEATURE_SCAN_FREQ_KHZ: This driver supports receiving and
* reporting scan request with %NL80211_ATTR_SCAN_FREQ_KHZ. In order to
* report %NL80211_ATTR_SCAN_FREQ_KHZ, %NL80211_SCAN_FLAG_FREQ_KHZ must be
* included in the scan request.
*
* @NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS: The driver
* can report tx status for control port over nl80211 tx operations.
*
* @NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION: Driver supports Operating
* Channel Validation (OCV) when using driver's SME for RSNA handshakes.
*
* @NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK: Device wants to do 4-way
* handshake with PSK in AP mode (PSK is passed as part of the start AP
* command).
*
* @NL80211_EXT_FEATURE_SAE_OFFLOAD_AP: Device wants to do SAE authentication
* in AP mode (SAE password is passed as part of the start AP command).
*
* @NL80211_EXT_FEATURE_FILS_DISCOVERY: Driver/device supports FILS discovery
* frames transmission
*
* @NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP: Driver/device supports
* unsolicited broadcast probe response transmission
*
* @NL80211_EXT_FEATURE_BEACON_RATE_HE: Driver supports beacon rate
* configuration (AP/mesh) with HE rates.
*
* @NL80211_EXT_FEATURE_SECURE_LTF: Device supports secure LTF measurement
* exchange protocol.
*
* @NL80211_EXT_FEATURE_SECURE_RTT: Device supports secure RTT measurement
* exchange protocol.
*
* @NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE: Device supports management
* frame protection for all management frames exchanged during the
* negotiation and range measurement procedure.
*
* @NL80211_EXT_FEATURE_BSS_COLOR: The driver supports BSS color collision
* detection and change announcemnts.
*
* @NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD: Driver running in AP mode supports
* FILS encryption and decryption for (Re)Association Request and Response
* frames. Userspace has to share FILS AAD details to the driver by using
* @NL80211_CMD_SET_FILS_AAD.
*
* @NL80211_EXT_FEATURE_RADAR_BACKGROUND: Device supports background radar/CAC
* detection.
*
* @NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE: Device can perform a MAC address
* change without having to bring the underlying network device down
* first. For example, in station mode this can be used to vary the
* origin MAC address prior to a connection to a new AP for privacy
* or other reasons. Note that certain driver specific restrictions
* might apply, e.g. no scans in progress, no offchannel operations
* in progress, and no active connections.
*
* @NL80211_EXT_FEATURE_PUNCT: Driver supports preamble puncturing in AP mode.
*
* @NL80211_EXT_FEATURE_SECURE_NAN: Device supports NAN Pairing which enables
* authentication, data encryption and message integrity.
*
* @NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA: Device supports randomized TA
* in authentication and deauthentication frames sent to unassociated peer
* using @NL80211_CMD_FRAME.
*
* @NL80211_EXT_FEATURE_OWE_OFFLOAD: Driver/Device wants to do OWE DH IE
* handling in station mode.
*
* @NL80211_EXT_FEATURE_OWE_OFFLOAD_AP: Driver/Device wants to do OWE DH IE
* handling in AP mode.
*
* @NL80211_EXT_FEATURE_DFS_CONCURRENT: The device supports peer-to-peer or
* ad hoc operation on DFS channels under the control of a concurrent
* DFS master on the same channel as described in FCC-594280 D01
* (Section B.3). This, for example, allows P2P GO and P2P clients to
* operate on DFS channels as long as there's a concurrent BSS connection.
*
* @NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT: The driver has support for SPP
* (signaling and payload protected) A-MSDUs and this shall be advertised
* in the RSNXE.
*
* @NL80211_EXT_FEATURE_BEACON_RATE_EHT: Driver supports beacon rate
* configuration (AP/mesh) with EHT rates.
*
* @NUM_NL80211_EXT_FEATURES: number of extended features.
* @MAX_NL80211_EXT_FEATURES: highest extended feature index.
*/
enum nl80211_ext_feature_index {
NL80211_EXT_FEATURE_VHT_IBSS,
NL80211_EXT_FEATURE_RRM,
NL80211_EXT_FEATURE_MU_MIMO_AIR_SNIFFER,
NL80211_EXT_FEATURE_SCAN_START_TIME,
NL80211_EXT_FEATURE_BSS_PARENT_TSF,
NL80211_EXT_FEATURE_SET_SCAN_DWELL,
NL80211_EXT_FEATURE_BEACON_RATE_LEGACY,
NL80211_EXT_FEATURE_BEACON_RATE_HT,
NL80211_EXT_FEATURE_BEACON_RATE_VHT,
NL80211_EXT_FEATURE_FILS_STA,
NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA,
NL80211_EXT_FEATURE_MGMT_TX_RANDOM_TA_CONNECTED,
NL80211_EXT_FEATURE_SCHED_SCAN_RELATIVE_RSSI,
NL80211_EXT_FEATURE_CQM_RSSI_LIST,
NL80211_EXT_FEATURE_FILS_SK_OFFLOAD,
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_PSK,
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_STA_1X,
NL80211_EXT_FEATURE_FILS_MAX_CHANNEL_TIME,
NL80211_EXT_FEATURE_ACCEPT_BCAST_PROBE_RESP,
NL80211_EXT_FEATURE_OCE_PROBE_REQ_HIGH_TX_RATE,
NL80211_EXT_FEATURE_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION,
NL80211_EXT_FEATURE_MFP_OPTIONAL,
NL80211_EXT_FEATURE_LOW_SPAN_SCAN,
NL80211_EXT_FEATURE_LOW_POWER_SCAN,
NL80211_EXT_FEATURE_HIGH_ACCURACY_SCAN,
NL80211_EXT_FEATURE_DFS_OFFLOAD,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211,
NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
/* we renamed this - stay compatible */
NL80211_EXT_FEATURE_DATA_ACK_SIGNAL_SUPPORT = NL80211_EXT_FEATURE_ACK_SIGNAL_SUPPORT,
NL80211_EXT_FEATURE_TXQS,
NL80211_EXT_FEATURE_SCAN_RANDOM_SN,
NL80211_EXT_FEATURE_SCAN_MIN_PREQ_CONTENT,
NL80211_EXT_FEATURE_CAN_REPLACE_PTK0,
NL80211_EXT_FEATURE_ENABLE_FTM_RESPONDER,
NL80211_EXT_FEATURE_AIRTIME_FAIRNESS,
NL80211_EXT_FEATURE_AP_PMKSA_CACHING,
NL80211_EXT_FEATURE_SCHED_SCAN_BAND_SPECIFIC_RSSI_THOLD, /* obsolete */
NL80211_EXT_FEATURE_EXT_KEY_ID,
NL80211_EXT_FEATURE_STA_TX_PWR,
NL80211_EXT_FEATURE_SAE_OFFLOAD,
NL80211_EXT_FEATURE_VLAN_OFFLOAD,
NL80211_EXT_FEATURE_AQL,
NL80211_EXT_FEATURE_BEACON_PROTECTION,
NL80211_EXT_FEATURE_CONTROL_PORT_NO_PREAUTH,
NL80211_EXT_FEATURE_PROTECTED_TWT,
NL80211_EXT_FEATURE_DEL_IBSS_STA,
NL80211_EXT_FEATURE_MULTICAST_REGISTRATIONS,
NL80211_EXT_FEATURE_BEACON_PROTECTION_CLIENT,
NL80211_EXT_FEATURE_SCAN_FREQ_KHZ,
NL80211_EXT_FEATURE_CONTROL_PORT_OVER_NL80211_TX_STATUS,
NL80211_EXT_FEATURE_OPERATING_CHANNEL_VALIDATION,
NL80211_EXT_FEATURE_4WAY_HANDSHAKE_AP_PSK,
NL80211_EXT_FEATURE_SAE_OFFLOAD_AP,
NL80211_EXT_FEATURE_FILS_DISCOVERY,
NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP,
NL80211_EXT_FEATURE_BEACON_RATE_HE,
NL80211_EXT_FEATURE_SECURE_LTF,
NL80211_EXT_FEATURE_SECURE_RTT,
NL80211_EXT_FEATURE_PROT_RANGE_NEGO_AND_MEASURE,
NL80211_EXT_FEATURE_BSS_COLOR,
NL80211_EXT_FEATURE_FILS_CRYPTO_OFFLOAD,
NL80211_EXT_FEATURE_RADAR_BACKGROUND,
NL80211_EXT_FEATURE_POWERED_ADDR_CHANGE,
NL80211_EXT_FEATURE_PUNCT,
NL80211_EXT_FEATURE_SECURE_NAN,
NL80211_EXT_FEATURE_AUTH_AND_DEAUTH_RANDOM_TA,
NL80211_EXT_FEATURE_OWE_OFFLOAD,
NL80211_EXT_FEATURE_OWE_OFFLOAD_AP,
NL80211_EXT_FEATURE_DFS_CONCURRENT,
NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT,
NL80211_EXT_FEATURE_BEACON_RATE_EHT,
/* add new features before the definition below */
NUM_NL80211_EXT_FEATURES,
MAX_NL80211_EXT_FEATURES = NUM_NL80211_EXT_FEATURES - 1
};
/**
* enum nl80211_probe_resp_offload_support_attr - optional supported
* protocols for probe-response offloading by the driver/FW.
* To be used with the %NL80211_ATTR_PROBE_RESP_OFFLOAD attribute.
* Each enum value represents a bit in the bitmap of supported
* protocols. Typically a subset of probe-requests belonging to a
* supported protocol will be excluded from offload and uploaded
* to the host.
*
* @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS: Support for WPS ver. 1
* @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2: Support for WPS ver. 2
* @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P: Support for P2P
* @NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U: Support for 802.11u
*/
enum nl80211_probe_resp_offload_support_attr {
NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS = 1<<0,
NL80211_PROBE_RESP_OFFLOAD_SUPPORT_WPS2 = 1<<1,
NL80211_PROBE_RESP_OFFLOAD_SUPPORT_P2P = 1<<2,
NL80211_PROBE_RESP_OFFLOAD_SUPPORT_80211U = 1<<3,
};
/**
* enum nl80211_connect_failed_reason - connection request failed reasons
* @NL80211_CONN_FAIL_MAX_CLIENTS: Maximum number of clients that can be
* handled by the AP is reached.
* @NL80211_CONN_FAIL_BLOCKED_CLIENT: Connection request is rejected due to ACL.
*/
enum nl80211_connect_failed_reason {
NL80211_CONN_FAIL_MAX_CLIENTS,
NL80211_CONN_FAIL_BLOCKED_CLIENT,
};
/**
* enum nl80211_timeout_reason - timeout reasons
*
* @NL80211_TIMEOUT_UNSPECIFIED: Timeout reason unspecified.
* @NL80211_TIMEOUT_SCAN: Scan (AP discovery) timed out.
* @NL80211_TIMEOUT_AUTH: Authentication timed out.
* @NL80211_TIMEOUT_ASSOC: Association timed out.
*/
enum nl80211_timeout_reason {
NL80211_TIMEOUT_UNSPECIFIED,
NL80211_TIMEOUT_SCAN,
NL80211_TIMEOUT_AUTH,
NL80211_TIMEOUT_ASSOC,
};
/**
* enum nl80211_scan_flags - scan request control flags
*
* Scan request control flags are used to control the handling
* of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN
* requests.
*
* NL80211_SCAN_FLAG_LOW_SPAN, NL80211_SCAN_FLAG_LOW_POWER, and
* NL80211_SCAN_FLAG_HIGH_ACCURACY flags are exclusive of each other, i.e., only
* one of them can be used in the request.
*
* @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority
* @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning
* @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured
* as AP and the beaconing has already been configured. This attribute is
* dangerous because will destroy stations performance as a lot of frames
* will be lost while scanning off-channel, therefore it must be used only
* when really needed
* @NL80211_SCAN_FLAG_RANDOM_ADDR: use a random MAC address for this scan (or
* for scheduled scan: a different one for every scan iteration). When the
* flag is set, depending on device capabilities the @NL80211_ATTR_MAC and
* @NL80211_ATTR_MAC_MASK attributes may also be given in which case only
* the masked bits will be preserved from the MAC address and the remainder
* randomised. If the attributes are not given full randomisation (46 bits,
* locally administered 1, multicast 0) is assumed.
* This flag must not be requested when the feature isn't supported, check
* the nl80211 feature flags for the device.
* @NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME: fill the dwell time in the FILS
* request parameters IE in the probe request
* @NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP: accept broadcast probe responses
* @NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE: send probe request frames at
* rate of at least 5.5M. In case non-OCE AP is discovered in the channel,
* only the first probe req in the channel will be sent in high rate.
* @NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION: allow probe request
* tx deferral (dot11FILSProbeDelay shall be set to 15ms)
* and suppression (if it has received a broadcast Probe Response frame,
* Beacon frame or FILS Discovery frame from an AP that the STA considers
* a suitable candidate for (re-)association - suitable in terms of
* SSID and/or RSSI.
* @NL80211_SCAN_FLAG_LOW_SPAN: Span corresponds to the total time taken to
* accomplish the scan. Thus, this flag intends the driver to perform the
* scan request with lesser span/duration. It is specific to the driver
* implementations on how this is accomplished. Scan accuracy may get
* impacted with this flag.
* @NL80211_SCAN_FLAG_LOW_POWER: This flag intends the scan attempts to consume
* optimal possible power. Drivers can resort to their specific means to
* optimize the power. Scan accuracy may get impacted with this flag.
* @NL80211_SCAN_FLAG_HIGH_ACCURACY: Accuracy here intends to the extent of scan
* results obtained. Thus HIGH_ACCURACY scan flag aims to get maximum
* possible scan results. This flag hints the driver to use the best
* possible scan configuration to improve the accuracy in scanning.
* Latency and power use may get impacted with this flag.
* @NL80211_SCAN_FLAG_RANDOM_SN: randomize the sequence number in probe
* request frames from this scan to avoid correlation/tracking being
* possible.
* @NL80211_SCAN_FLAG_MIN_PREQ_CONTENT: minimize probe request content to
* only have supported rates and no additional capabilities (unless
* added by userspace explicitly.)
* @NL80211_SCAN_FLAG_FREQ_KHZ: report scan results with
* %NL80211_ATTR_SCAN_FREQ_KHZ. This also means
* %NL80211_ATTR_SCAN_FREQUENCIES will not be included.
* @NL80211_SCAN_FLAG_COLOCATED_6GHZ: scan for collocated APs reported by
* 2.4/5 GHz APs. When the flag is set, the scan logic will use the
* information from the RNR element found in beacons/probe responses
* received on the 2.4/5 GHz channels to actively scan only the 6GHz
* channels on which APs are expected to be found. Note that when not set,
* the scan logic would scan all 6GHz channels, but since transmission of
* probe requests on non-PSC channels is limited, it is highly likely that
* these channels would passively be scanned. Also note that when the flag
* is set, in addition to the colocated APs, PSC channels would also be
* scanned if the user space has asked for it.
*/
enum nl80211_scan_flags {
NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0,
NL80211_SCAN_FLAG_FLUSH = 1<<1,
NL80211_SCAN_FLAG_AP = 1<<2,
NL80211_SCAN_FLAG_RANDOM_ADDR = 1<<3,
NL80211_SCAN_FLAG_FILS_MAX_CHANNEL_TIME = 1<<4,
NL80211_SCAN_FLAG_ACCEPT_BCAST_PROBE_RESP = 1<<5,
NL80211_SCAN_FLAG_OCE_PROBE_REQ_HIGH_TX_RATE = 1<<6,
NL80211_SCAN_FLAG_OCE_PROBE_REQ_DEFERRAL_SUPPRESSION = 1<<7,
NL80211_SCAN_FLAG_LOW_SPAN = 1<<8,
NL80211_SCAN_FLAG_LOW_POWER = 1<<9,
NL80211_SCAN_FLAG_HIGH_ACCURACY = 1<<10,
NL80211_SCAN_FLAG_RANDOM_SN = 1<<11,
NL80211_SCAN_FLAG_MIN_PREQ_CONTENT = 1<<12,
NL80211_SCAN_FLAG_FREQ_KHZ = 1<<13,
NL80211_SCAN_FLAG_COLOCATED_6GHZ = 1<<14,
};
/**
* enum nl80211_acl_policy - access control policy
*
* Access control policy is applied on a MAC list set by
* %NL80211_CMD_START_AP and %NL80211_CMD_SET_MAC_ACL, to
* be used with %NL80211_ATTR_ACL_POLICY.
*
* @NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED: Deny stations which are
* listed in ACL, i.e. allow all the stations which are not listed
* in ACL to authenticate.
* @NL80211_ACL_POLICY_DENY_UNLESS_LISTED: Allow the stations which are listed
* in ACL, i.e. deny all the stations which are not listed in ACL.
*/
enum nl80211_acl_policy {
NL80211_ACL_POLICY_ACCEPT_UNLESS_LISTED,
NL80211_ACL_POLICY_DENY_UNLESS_LISTED,
};
/**
* enum nl80211_smps_mode - SMPS mode
*
* Requested SMPS mode (for AP mode)
*
* @NL80211_SMPS_OFF: SMPS off (use all antennas).
* @NL80211_SMPS_STATIC: static SMPS (use a single antenna)
* @NL80211_SMPS_DYNAMIC: dynamic smps (start with a single antenna and
* turn on other antennas after CTS/RTS).
* @__NL80211_SMPS_AFTER_LAST: internal
* @NL80211_SMPS_MAX: highest used enumeration
*/
enum nl80211_smps_mode {
NL80211_SMPS_OFF,
NL80211_SMPS_STATIC,
NL80211_SMPS_DYNAMIC,
__NL80211_SMPS_AFTER_LAST,
NL80211_SMPS_MAX = __NL80211_SMPS_AFTER_LAST - 1
};
/**
* enum nl80211_radar_event - type of radar event for DFS operation
*
* Type of event to be used with NL80211_ATTR_RADAR_EVENT to inform userspace
* about detected radars or success of the channel available check (CAC)
*
* @NL80211_RADAR_DETECTED: A radar pattern has been detected. The channel is
* now unusable.
* @NL80211_RADAR_CAC_FINISHED: Channel Availability Check has been finished,
* the channel is now available.
* @NL80211_RADAR_CAC_ABORTED: Channel Availability Check has been aborted, no
* change to the channel status.
* @NL80211_RADAR_NOP_FINISHED: The Non-Occupancy Period for this channel is
* over, channel becomes usable.
* @NL80211_RADAR_PRE_CAC_EXPIRED: Channel Availability Check done on this
* non-operating channel is expired and no longer valid. New CAC must
* be done on this channel before starting the operation. This is not
* applicable for ETSI dfs domain where pre-CAC is valid for ever.
* @NL80211_RADAR_CAC_STARTED: Channel Availability Check has been started,
* should be generated by HW if NL80211_EXT_FEATURE_DFS_OFFLOAD is enabled.
*/
enum nl80211_radar_event {
NL80211_RADAR_DETECTED,
NL80211_RADAR_CAC_FINISHED,
NL80211_RADAR_CAC_ABORTED,
NL80211_RADAR_NOP_FINISHED,
NL80211_RADAR_PRE_CAC_EXPIRED,
NL80211_RADAR_CAC_STARTED,
};
/**
* enum nl80211_dfs_state - DFS states for channels
*
* Channel states used by the DFS code.
*
* @NL80211_DFS_USABLE: The channel can be used, but channel availability
* check (CAC) must be performed before using it for AP or IBSS.
* @NL80211_DFS_UNAVAILABLE: A radar has been detected on this channel, it
* is therefore marked as not available.
* @NL80211_DFS_AVAILABLE: The channel has been CAC checked and is available.
*/
enum nl80211_dfs_state {
NL80211_DFS_USABLE,
NL80211_DFS_UNAVAILABLE,
NL80211_DFS_AVAILABLE,
};
/**
* enum nl80211_protocol_features - nl80211 protocol features
* @NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP: nl80211 supports splitting
* wiphy dumps (if requested by the application with the attribute
* %NL80211_ATTR_SPLIT_WIPHY_DUMP. Also supported is filtering the
* wiphy dump by %NL80211_ATTR_WIPHY, %NL80211_ATTR_IFINDEX or
* %NL80211_ATTR_WDEV.
*/
enum nl80211_protocol_features {
NL80211_PROTOCOL_FEATURE_SPLIT_WIPHY_DUMP = 1 << 0,
};
/**
* enum nl80211_crit_proto_id - nl80211 critical protocol identifiers
*
* @NL80211_CRIT_PROTO_UNSPEC: protocol unspecified.
* @NL80211_CRIT_PROTO_DHCP: BOOTP or DHCPv6 protocol.
* @NL80211_CRIT_PROTO_EAPOL: EAPOL protocol.
* @NL80211_CRIT_PROTO_APIPA: APIPA protocol.
* @NUM_NL80211_CRIT_PROTO: must be kept last.
*/
enum nl80211_crit_proto_id {
NL80211_CRIT_PROTO_UNSPEC,
NL80211_CRIT_PROTO_DHCP,
NL80211_CRIT_PROTO_EAPOL,
NL80211_CRIT_PROTO_APIPA,
/* add other protocols before this one */
NUM_NL80211_CRIT_PROTO
};
/* maximum duration for critical protocol measures */
#define NL80211_CRIT_PROTO_MAX_DURATION 5000 /* msec */
/**
* enum nl80211_rxmgmt_flags - flags for received management frame.
*
* Used by cfg80211_rx_mgmt()
*
* @NL80211_RXMGMT_FLAG_ANSWERED: frame was answered by device/driver.
* @NL80211_RXMGMT_FLAG_EXTERNAL_AUTH: Host driver intends to offload
* the authentication. Exclusively defined for host drivers that
* advertises the SME functionality but would like the userspace
* to handle certain authentication algorithms (e.g. SAE).
*/
enum nl80211_rxmgmt_flags {
NL80211_RXMGMT_FLAG_ANSWERED = 1 << 0,
NL80211_RXMGMT_FLAG_EXTERNAL_AUTH = 1 << 1,
};
/*
* If this flag is unset, the lower 24 bits are an OUI, if set
* a Linux nl80211 vendor ID is used (no such IDs are allocated
* yet, so that's not valid so far)
*/
#define NL80211_VENDOR_ID_IS_LINUX 0x80000000
/**
* struct nl80211_vendor_cmd_info - vendor command data
* @vendor_id: If the %NL80211_VENDOR_ID_IS_LINUX flag is clear, then the
* value is a 24-bit OUI; if it is set then a separately allocated ID
* may be used, but no such IDs are allocated yet. New IDs should be
* added to this file when needed.
* @subcmd: sub-command ID for the command
*/
struct nl80211_vendor_cmd_info {
__u32 vendor_id;
__u32 subcmd;
};
/**
* enum nl80211_tdls_peer_capability - TDLS peer flags.
*
* Used by tdls_mgmt() to determine which conditional elements need
* to be added to TDLS Setup frames.
*
* @NL80211_TDLS_PEER_HT: TDLS peer is HT capable.
* @NL80211_TDLS_PEER_VHT: TDLS peer is VHT capable.
* @NL80211_TDLS_PEER_WMM: TDLS peer is WMM capable.
* @NL80211_TDLS_PEER_HE: TDLS peer is HE capable.
*/
enum nl80211_tdls_peer_capability {
NL80211_TDLS_PEER_HT = 1<<0,
NL80211_TDLS_PEER_VHT = 1<<1,
NL80211_TDLS_PEER_WMM = 1<<2,
NL80211_TDLS_PEER_HE = 1<<3,
};
/**
* enum nl80211_sched_scan_plan - scanning plan for scheduled scan
* @__NL80211_SCHED_SCAN_PLAN_INVALID: attribute number 0 is reserved
* @NL80211_SCHED_SCAN_PLAN_INTERVAL: interval between scan iterations. In
* seconds (u32).
* @NL80211_SCHED_SCAN_PLAN_ITERATIONS: number of scan iterations in this
* scan plan (u32). The last scan plan must not specify this attribute
* because it will run infinitely. A value of zero is invalid as it will
* make the scan plan meaningless.
* @NL80211_SCHED_SCAN_PLAN_MAX: highest scheduled scan plan attribute number
* currently defined
* @__NL80211_SCHED_SCAN_PLAN_AFTER_LAST: internal use
*/
enum nl80211_sched_scan_plan {
__NL80211_SCHED_SCAN_PLAN_INVALID,
NL80211_SCHED_SCAN_PLAN_INTERVAL,
NL80211_SCHED_SCAN_PLAN_ITERATIONS,
/* keep last */
__NL80211_SCHED_SCAN_PLAN_AFTER_LAST,
NL80211_SCHED_SCAN_PLAN_MAX =
__NL80211_SCHED_SCAN_PLAN_AFTER_LAST - 1
};
/**
* struct nl80211_bss_select_rssi_adjust - RSSI adjustment parameters.
*
* @band: band of BSS that must match for RSSI value adjustment. The value
* of this field is according to &enum nl80211_band.
* @delta: value used to adjust the RSSI value of matching BSS in dB.
*/
struct nl80211_bss_select_rssi_adjust {
__u8 band;
__s8 delta;
} __attribute__((packed));
/**
* enum nl80211_bss_select_attr - attributes for bss selection.
*
* @__NL80211_BSS_SELECT_ATTR_INVALID: reserved.
* @NL80211_BSS_SELECT_ATTR_RSSI: Flag indicating only RSSI-based BSS selection
* is requested.
* @NL80211_BSS_SELECT_ATTR_BAND_PREF: attribute indicating BSS
* selection should be done such that the specified band is preferred.
* When there are multiple BSS-es in the preferred band, the driver
* shall use RSSI-based BSS selection as a second step. The value of
* this attribute is according to &enum nl80211_band (u32).
* @NL80211_BSS_SELECT_ATTR_RSSI_ADJUST: When present the RSSI level for
* BSS-es in the specified band is to be adjusted before doing
* RSSI-based BSS selection. The attribute value is a packed structure
* value as specified by &struct nl80211_bss_select_rssi_adjust.
* @NL80211_BSS_SELECT_ATTR_MAX: highest bss select attribute number.
* @__NL80211_BSS_SELECT_ATTR_AFTER_LAST: internal use.
*
* One and only one of these attributes are found within %NL80211_ATTR_BSS_SELECT
* for %NL80211_CMD_CONNECT. It specifies the required BSS selection behaviour
* which the driver shall use.
*/
enum nl80211_bss_select_attr {
__NL80211_BSS_SELECT_ATTR_INVALID,
NL80211_BSS_SELECT_ATTR_RSSI,
NL80211_BSS_SELECT_ATTR_BAND_PREF,
NL80211_BSS_SELECT_ATTR_RSSI_ADJUST,
/* keep last */
__NL80211_BSS_SELECT_ATTR_AFTER_LAST,
NL80211_BSS_SELECT_ATTR_MAX = __NL80211_BSS_SELECT_ATTR_AFTER_LAST - 1
};
/**
* enum nl80211_nan_function_type - NAN function type
*
* Defines the function type of a NAN function
*
* @NL80211_NAN_FUNC_PUBLISH: function is publish
* @NL80211_NAN_FUNC_SUBSCRIBE: function is subscribe
* @NL80211_NAN_FUNC_FOLLOW_UP: function is follow-up
* @__NL80211_NAN_FUNC_TYPE_AFTER_LAST: internal use
* @NL80211_NAN_FUNC_MAX_TYPE: internal use
*/
enum nl80211_nan_function_type {
NL80211_NAN_FUNC_PUBLISH,
NL80211_NAN_FUNC_SUBSCRIBE,
NL80211_NAN_FUNC_FOLLOW_UP,
/* keep last */
__NL80211_NAN_FUNC_TYPE_AFTER_LAST,
NL80211_NAN_FUNC_MAX_TYPE = __NL80211_NAN_FUNC_TYPE_AFTER_LAST - 1,
};
/**
* enum nl80211_nan_publish_type - NAN publish tx type
*
* Defines how to send publish Service Discovery Frames
*
* @NL80211_NAN_SOLICITED_PUBLISH: publish function is solicited
* @NL80211_NAN_UNSOLICITED_PUBLISH: publish function is unsolicited
*/
enum nl80211_nan_publish_type {
NL80211_NAN_SOLICITED_PUBLISH = 1 << 0,
NL80211_NAN_UNSOLICITED_PUBLISH = 1 << 1,
};
/**
* enum nl80211_nan_func_term_reason - NAN functions termination reason
*
* Defines termination reasons of a NAN function
*
* @NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST: requested by user
* @NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED: timeout
* @NL80211_NAN_FUNC_TERM_REASON_ERROR: errored
*/
enum nl80211_nan_func_term_reason {
NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST,
NL80211_NAN_FUNC_TERM_REASON_TTL_EXPIRED,
NL80211_NAN_FUNC_TERM_REASON_ERROR,
};
#define NL80211_NAN_FUNC_SERVICE_ID_LEN 6
#define NL80211_NAN_FUNC_SERVICE_SPEC_INFO_MAX_LEN 0xff
#define NL80211_NAN_FUNC_SRF_MAX_LEN 0xff
/**
* enum nl80211_nan_func_attributes - NAN function attributes
* @__NL80211_NAN_FUNC_INVALID: invalid
* @NL80211_NAN_FUNC_TYPE: &enum nl80211_nan_function_type (u8).
* @NL80211_NAN_FUNC_SERVICE_ID: 6 bytes of the service ID hash as
* specified in NAN spec. This is a binary attribute.
* @NL80211_NAN_FUNC_PUBLISH_TYPE: relevant if the function's type is
* publish. Defines the transmission type for the publish Service Discovery
* Frame, see &enum nl80211_nan_publish_type. Its type is u8.
* @NL80211_NAN_FUNC_PUBLISH_BCAST: relevant if the function is a solicited
* publish. Should the solicited publish Service Discovery Frame be sent to
* the NAN Broadcast address. This is a flag.
* @NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE: relevant if the function's type is
* subscribe. Is the subscribe active. This is a flag.
* @NL80211_NAN_FUNC_FOLLOW_UP_ID: relevant if the function's type is follow up.
* The instance ID for the follow up Service Discovery Frame. This is u8.
* @NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID: relevant if the function's type
* is follow up. This is a u8.
* The requester instance ID for the follow up Service Discovery Frame.
* @NL80211_NAN_FUNC_FOLLOW_UP_DEST: the MAC address of the recipient of the
* follow up Service Discovery Frame. This is a binary attribute.
* @NL80211_NAN_FUNC_CLOSE_RANGE: is this function limited for devices in a
* close range. The range itself (RSSI) is defined by the device.
* This is a flag.
* @NL80211_NAN_FUNC_TTL: strictly positive number of DWs this function should
* stay active. If not present infinite TTL is assumed. This is a u32.
* @NL80211_NAN_FUNC_SERVICE_INFO: array of bytes describing the service
* specific info. This is a binary attribute.
* @NL80211_NAN_FUNC_SRF: Service Receive Filter. This is a nested attribute.
* See &enum nl80211_nan_srf_attributes.
* @NL80211_NAN_FUNC_RX_MATCH_FILTER: Receive Matching filter. This is a nested
* attribute. It is a list of binary values.
* @NL80211_NAN_FUNC_TX_MATCH_FILTER: Transmit Matching filter. This is a
* nested attribute. It is a list of binary values.
* @NL80211_NAN_FUNC_INSTANCE_ID: The instance ID of the function.
* Its type is u8 and it cannot be 0.
* @NL80211_NAN_FUNC_TERM_REASON: NAN function termination reason.
* See &enum nl80211_nan_func_term_reason.
*
* @NUM_NL80211_NAN_FUNC_ATTR: internal
* @NL80211_NAN_FUNC_ATTR_MAX: highest NAN function attribute
*/
enum nl80211_nan_func_attributes {
__NL80211_NAN_FUNC_INVALID,
NL80211_NAN_FUNC_TYPE,
NL80211_NAN_FUNC_SERVICE_ID,
NL80211_NAN_FUNC_PUBLISH_TYPE,
NL80211_NAN_FUNC_PUBLISH_BCAST,
NL80211_NAN_FUNC_SUBSCRIBE_ACTIVE,
NL80211_NAN_FUNC_FOLLOW_UP_ID,
NL80211_NAN_FUNC_FOLLOW_UP_REQ_ID,
NL80211_NAN_FUNC_FOLLOW_UP_DEST,
NL80211_NAN_FUNC_CLOSE_RANGE,
NL80211_NAN_FUNC_TTL,
NL80211_NAN_FUNC_SERVICE_INFO,
NL80211_NAN_FUNC_SRF,
NL80211_NAN_FUNC_RX_MATCH_FILTER,
NL80211_NAN_FUNC_TX_MATCH_FILTER,
NL80211_NAN_FUNC_INSTANCE_ID,
NL80211_NAN_FUNC_TERM_REASON,
/* keep last */
NUM_NL80211_NAN_FUNC_ATTR,
NL80211_NAN_FUNC_ATTR_MAX = NUM_NL80211_NAN_FUNC_ATTR - 1
};
/**
* enum nl80211_nan_srf_attributes - NAN Service Response filter attributes
* @__NL80211_NAN_SRF_INVALID: invalid
* @NL80211_NAN_SRF_INCLUDE: present if the include bit of the SRF set.
* This is a flag.
* @NL80211_NAN_SRF_BF: Bloom Filter. Present if and only if
* %NL80211_NAN_SRF_MAC_ADDRS isn't present. This attribute is binary.
* @NL80211_NAN_SRF_BF_IDX: index of the Bloom Filter. Mandatory if
* %NL80211_NAN_SRF_BF is present. This is a u8.
* @NL80211_NAN_SRF_MAC_ADDRS: list of MAC addresses for the SRF. Present if
* and only if %NL80211_NAN_SRF_BF isn't present. This is a nested
* attribute. Each nested attribute is a MAC address.
* @NUM_NL80211_NAN_SRF_ATTR: internal
* @NL80211_NAN_SRF_ATTR_MAX: highest NAN SRF attribute
*/
enum nl80211_nan_srf_attributes {
__NL80211_NAN_SRF_INVALID,
NL80211_NAN_SRF_INCLUDE,
NL80211_NAN_SRF_BF,
NL80211_NAN_SRF_BF_IDX,
NL80211_NAN_SRF_MAC_ADDRS,
/* keep last */
NUM_NL80211_NAN_SRF_ATTR,
NL80211_NAN_SRF_ATTR_MAX = NUM_NL80211_NAN_SRF_ATTR - 1,
};
/**
* enum nl80211_nan_match_attributes - NAN match attributes
* @__NL80211_NAN_MATCH_INVALID: invalid
* @NL80211_NAN_MATCH_FUNC_LOCAL: the local function that had the
* match. This is a nested attribute.
* See &enum nl80211_nan_func_attributes.
* @NL80211_NAN_MATCH_FUNC_PEER: the peer function
* that caused the match. This is a nested attribute.
* See &enum nl80211_nan_func_attributes.
*
* @NUM_NL80211_NAN_MATCH_ATTR: internal
* @NL80211_NAN_MATCH_ATTR_MAX: highest NAN match attribute
*/
enum nl80211_nan_match_attributes {
__NL80211_NAN_MATCH_INVALID,
NL80211_NAN_MATCH_FUNC_LOCAL,
NL80211_NAN_MATCH_FUNC_PEER,
/* keep last */
NUM_NL80211_NAN_MATCH_ATTR,
NL80211_NAN_MATCH_ATTR_MAX = NUM_NL80211_NAN_MATCH_ATTR - 1
};
/**
* enum nl80211_nan_band_conf_attributes - NAN band configuration attributes
* @__NL80211_NAN_BAND_CONF_INVALID: Invalid.
* @NL80211_NAN_BAND_CONF_BAND: Band for which the configuration is
* being set. The value is according to &enum nl80211_band (u8).
* @NL80211_NAN_BAND_CONF_FREQ: Discovery frequency. This attribute shall not
* be present on 2.4 GHZ band. On 5 GHz band its presence is optional.
* The allowed values are 5220 (channel 44) or 5745 (channel 149).
* If not present, channel 149 is used if allowed, otherwise channel 44
* will be selected. The value is in MHz (u16).
* @NL80211_NAN_BAND_CONF_RSSI_CLOSE: RSSI close threshold used for NAN state
* transition algorithm as described in chapters 3.3.6 and 3.3.7 "NAN
* Device Role and State Transition" of Wi-Fi Aware (TM) Specification
* v4.0. If not specified, default device value is used. The value should
* be greater than -60 dBm (s8).
* @NL80211_NAN_BAND_CONF_RSSI_MIDDLE: RSSI middle threshold used for NAN state
* transition algorithm as described in chapters 3.3.6 and 3.3.7 "NAN
* Device Role and State Transition" of Wi-Fi Aware (TM) Specification
* v4.0. If not present, default device value is used. The value should be
* greater than -75 dBm and less than %NL80211_NAN_BAND_CONF_RSSI_CLOSE
* (s8).
* @NL80211_NAN_BAND_CONF_WAKE_DW: Committed DW information (values 0-5).
* Value 0 means that the device will not wake up during the
* discovery window. Values 1-5 mean that the device will wake up
* during each 2^(n - 1) discovery window, where n is the value of
* this attribute. Setting this attribute to 0 is not allowed on
* 2.4 GHz band (u8). This is an optional parameter (default is 1).
* @NL80211_NAN_BAND_CONF_DISABLE_SCAN: Optional flag attribute to disable
* scanning (for cluster merge) on the band. If set, the device will not
* scan on this band anymore. Disabling scanning on 2.4 GHz band is not
* allowed.
* @NUM_NL80211_NAN_BAND_CONF_ATTR: Internal.
* @NL80211_NAN_BAND_CONF_ATTR_MAX: Highest NAN band configuration attribute.
*
* These attributes are used to configure NAN band-specific parameters. Note,
* that both RSSI attributes should be configured (or both left unset).
*/
enum nl80211_nan_band_conf_attributes {
__NL80211_NAN_BAND_CONF_INVALID,
NL80211_NAN_BAND_CONF_BAND,
NL80211_NAN_BAND_CONF_FREQ,
NL80211_NAN_BAND_CONF_RSSI_CLOSE,
NL80211_NAN_BAND_CONF_RSSI_MIDDLE,
NL80211_NAN_BAND_CONF_WAKE_DW,
NL80211_NAN_BAND_CONF_DISABLE_SCAN,
/* keep last */
NUM_NL80211_NAN_BAND_CONF_ATTR,
NL80211_NAN_BAND_CONF_ATTR_MAX = NUM_NL80211_NAN_BAND_CONF_ATTR - 1,
};
/**
* enum nl80211_nan_conf_attributes - NAN configuration attributes
* @__NL80211_NAN_CONF_INVALID: Invalid attribute, used for validation.
* @NL80211_NAN_CONF_CLUSTER_ID: ID for the NAN cluster. This is a MAC
* address that can take values from 50-6F-9A-01-00-00 to
* 50-6F-9A-01-FF-FF. This attribute is optional. If not present,
* a random Cluster ID will be chosen.
* @NL80211_NAN_CONF_EXTRA_ATTRS: Additional NAN attributes to be
* published in the beacons. This is an optional byte array.
* @NL80211_NAN_CONF_VENDOR_ELEMS: Vendor-specific elements that will
* be published in the beacons. This is an optional byte array.
* @NL80211_NAN_CONF_BAND_CONFIGS: This is a nested array attribute,
* containing multiple entries for each supported band. Each band
* configuration consists of &enum nl80211_nan_band_conf_attributes.
* @NL80211_NAN_CONF_SCAN_PERIOD: Scan period in seconds. If not configured,
* device default is used. Zero value will disable scanning.
* This is u16 (optional).
* @NL80211_NAN_CONF_SCAN_DWELL_TIME: Scan dwell time in TUs per channel.
* Only non-zero values are valid. If not configured the device default
* value is used. This is u16 (optional)
* @NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL: Discovery beacon interval
* in TUs. Valid range is 50-200 TUs. If not configured the device default
* value is used. This is u8 (optional)
* @NL80211_NAN_CONF_NOTIFY_DW: If set, the driver will notify userspace about
* the upcoming discovery window with
* %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION.
* This is a flag attribute.
* @NUM_NL80211_NAN_CONF_ATTR: Internal.
* @NL80211_NAN_CONF_ATTR_MAX: Highest NAN configuration attribute.
*
* These attributes are used to configure NAN-specific parameters.
*/
enum nl80211_nan_conf_attributes {
__NL80211_NAN_CONF_INVALID,
NL80211_NAN_CONF_CLUSTER_ID,
NL80211_NAN_CONF_EXTRA_ATTRS,
NL80211_NAN_CONF_VENDOR_ELEMS,
NL80211_NAN_CONF_BAND_CONFIGS,
NL80211_NAN_CONF_SCAN_PERIOD,
NL80211_NAN_CONF_SCAN_DWELL_TIME,
NL80211_NAN_CONF_DISCOVERY_BEACON_INTERVAL,
NL80211_NAN_CONF_NOTIFY_DW,
/* keep last */
NUM_NL80211_NAN_CONF_ATTR,
NL80211_NAN_CONF_ATTR_MAX = NUM_NL80211_NAN_CONF_ATTR - 1,
};
/**
* enum nl80211_external_auth_action - Action to perform with external
* authentication request. Used by NL80211_ATTR_EXTERNAL_AUTH_ACTION.
* @NL80211_EXTERNAL_AUTH_START: Start the authentication.
* @NL80211_EXTERNAL_AUTH_ABORT: Abort the ongoing authentication.
*/
enum nl80211_external_auth_action {
NL80211_EXTERNAL_AUTH_START,
NL80211_EXTERNAL_AUTH_ABORT,
};
/**
* enum nl80211_ftm_responder_attributes - fine timing measurement
* responder attributes
* @__NL80211_FTM_RESP_ATTR_INVALID: Invalid
* @NL80211_FTM_RESP_ATTR_ENABLED: FTM responder is enabled
* @NL80211_FTM_RESP_ATTR_LCI: The content of Measurement Report Element
* (9.4.2.22 in 802.11-2016) with type 8 - LCI (9.4.2.22.10),
* i.e. starting with the measurement token
* @NL80211_FTM_RESP_ATTR_CIVICLOC: The content of Measurement Report Element
* (9.4.2.22 in 802.11-2016) with type 11 - Civic (Section 9.4.2.22.13),
* i.e. starting with the measurement token
* @__NL80211_FTM_RESP_ATTR_LAST: Internal
* @NL80211_FTM_RESP_ATTR_MAX: highest FTM responder attribute.
*/
enum nl80211_ftm_responder_attributes {
__NL80211_FTM_RESP_ATTR_INVALID,
NL80211_FTM_RESP_ATTR_ENABLED,
NL80211_FTM_RESP_ATTR_LCI,
NL80211_FTM_RESP_ATTR_CIVICLOC,
/* keep last */
__NL80211_FTM_RESP_ATTR_LAST,
NL80211_FTM_RESP_ATTR_MAX = __NL80211_FTM_RESP_ATTR_LAST - 1,
};
/*
* enum nl80211_ftm_responder_stats - FTM responder statistics
*
* These attribute types are used with %NL80211_ATTR_FTM_RESPONDER_STATS
* when getting FTM responder statistics.
*
* @__NL80211_FTM_STATS_INVALID: attribute number 0 is reserved
* @NL80211_FTM_STATS_SUCCESS_NUM: number of FTM sessions in which all frames
* were ssfully answered (u32)
* @NL80211_FTM_STATS_PARTIAL_NUM: number of FTM sessions in which part of the
* frames were successfully answered (u32)
* @NL80211_FTM_STATS_FAILED_NUM: number of failed FTM sessions (u32)
* @NL80211_FTM_STATS_ASAP_NUM: number of ASAP sessions (u32)
* @NL80211_FTM_STATS_NON_ASAP_NUM: number of non-ASAP sessions (u32)
* @NL80211_FTM_STATS_TOTAL_DURATION_MSEC: total sessions durations - gives an
* indication of how much time the responder was busy (u64, msec)
* @NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM: number of unknown FTM triggers -
* triggers from initiators that didn't finish successfully the negotiation
* phase with the responder (u32)
* @NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM: number of FTM reschedule requests
* - initiator asks for a new scheduling although it already has scheduled
* FTM slot (u32)
* @NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM: number of FTM triggers out of
* scheduled window (u32)
* @NL80211_FTM_STATS_PAD: used for padding, ignore
* @__NL80211_TXQ_ATTR_AFTER_LAST: Internal
* @NL80211_FTM_STATS_MAX: highest possible FTM responder stats attribute
*/
enum nl80211_ftm_responder_stats {
__NL80211_FTM_STATS_INVALID,
NL80211_FTM_STATS_SUCCESS_NUM,
NL80211_FTM_STATS_PARTIAL_NUM,
NL80211_FTM_STATS_FAILED_NUM,
NL80211_FTM_STATS_ASAP_NUM,
NL80211_FTM_STATS_NON_ASAP_NUM,
NL80211_FTM_STATS_TOTAL_DURATION_MSEC,
NL80211_FTM_STATS_UNKNOWN_TRIGGERS_NUM,
NL80211_FTM_STATS_RESCHEDULE_REQUESTS_NUM,
NL80211_FTM_STATS_OUT_OF_WINDOW_TRIGGERS_NUM,
NL80211_FTM_STATS_PAD,
/* keep last */
__NL80211_FTM_STATS_AFTER_LAST,
NL80211_FTM_STATS_MAX = __NL80211_FTM_STATS_AFTER_LAST - 1
};
/**
* enum nl80211_preamble - frame preamble types
* @NL80211_PREAMBLE_LEGACY: legacy (HR/DSSS, OFDM, ERP PHY) preamble
* @NL80211_PREAMBLE_HT: HT preamble
* @NL80211_PREAMBLE_VHT: VHT preamble
* @NL80211_PREAMBLE_DMG: DMG preamble
* @NL80211_PREAMBLE_HE: HE preamble
*/
enum nl80211_preamble {
NL80211_PREAMBLE_LEGACY,
NL80211_PREAMBLE_HT,
NL80211_PREAMBLE_VHT,
NL80211_PREAMBLE_DMG,
NL80211_PREAMBLE_HE,
};
/**
* enum nl80211_peer_measurement_type - peer measurement types
* @NL80211_PMSR_TYPE_INVALID: invalid/unused, needed as we use
* these numbers also for attributes
*
* @NL80211_PMSR_TYPE_FTM: flight time measurement
*
* @NUM_NL80211_PMSR_TYPES: internal
* @NL80211_PMSR_TYPE_MAX: highest type number
*/
enum nl80211_peer_measurement_type {
NL80211_PMSR_TYPE_INVALID,
NL80211_PMSR_TYPE_FTM,
NUM_NL80211_PMSR_TYPES,
NL80211_PMSR_TYPE_MAX = NUM_NL80211_PMSR_TYPES - 1
};
/**
* enum nl80211_peer_measurement_status - peer measurement status
* @NL80211_PMSR_STATUS_SUCCESS: measurement completed successfully
* @NL80211_PMSR_STATUS_REFUSED: measurement was locally refused
* @NL80211_PMSR_STATUS_TIMEOUT: measurement timed out
* @NL80211_PMSR_STATUS_FAILURE: measurement failed, a type-dependent
* reason may be available in the response data
*/
enum nl80211_peer_measurement_status {
NL80211_PMSR_STATUS_SUCCESS,
NL80211_PMSR_STATUS_REFUSED,
NL80211_PMSR_STATUS_TIMEOUT,
NL80211_PMSR_STATUS_FAILURE,
};
/**
* enum nl80211_peer_measurement_req - peer measurement request attributes
* @__NL80211_PMSR_REQ_ATTR_INVALID: invalid
*
* @NL80211_PMSR_REQ_ATTR_DATA: This is a nested attribute with measurement
* type-specific request data inside. The attributes used are from the
* enums named nl80211_peer_measurement__req.
* @NL80211_PMSR_REQ_ATTR_GET_AP_TSF: include AP TSF timestamp, if supported
* (flag attribute)
*
* @NUM_NL80211_PMSR_REQ_ATTRS: internal
* @NL80211_PMSR_REQ_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_req {
__NL80211_PMSR_REQ_ATTR_INVALID,
NL80211_PMSR_REQ_ATTR_DATA,
NL80211_PMSR_REQ_ATTR_GET_AP_TSF,
/* keep last */
NUM_NL80211_PMSR_REQ_ATTRS,
NL80211_PMSR_REQ_ATTR_MAX = NUM_NL80211_PMSR_REQ_ATTRS - 1
};
/**
* enum nl80211_peer_measurement_resp - peer measurement response attributes
* @__NL80211_PMSR_RESP_ATTR_INVALID: invalid
*
* @NL80211_PMSR_RESP_ATTR_DATA: This is a nested attribute with measurement
* type-specific results inside. The attributes used are from the enums
* named nl80211_peer_measurement__resp.
* @NL80211_PMSR_RESP_ATTR_STATUS: u32 value with the measurement status
* (using values from &enum nl80211_peer_measurement_status.)
* @NL80211_PMSR_RESP_ATTR_HOST_TIME: host time (%CLOCK_BOOTTIME) when the
* result was measured; this value is not expected to be accurate to
* more than 20ms. (u64, nanoseconds)
* @NL80211_PMSR_RESP_ATTR_AP_TSF: TSF of the AP that the interface
* doing the measurement is connected to when the result was measured.
* This shall be accurately reported if supported and requested
* (u64, usec)
* @NL80211_PMSR_RESP_ATTR_FINAL: If results are sent to the host partially
* (*e.g. with FTM per-burst data) this flag will be cleared on all but
* the last result; if all results are combined it's set on the single
* result.
* @NL80211_PMSR_RESP_ATTR_PAD: padding for 64-bit attributes, ignore
*
* @NUM_NL80211_PMSR_RESP_ATTRS: internal
* @NL80211_PMSR_RESP_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_resp {
__NL80211_PMSR_RESP_ATTR_INVALID,
NL80211_PMSR_RESP_ATTR_DATA,
NL80211_PMSR_RESP_ATTR_STATUS,
NL80211_PMSR_RESP_ATTR_HOST_TIME,
NL80211_PMSR_RESP_ATTR_AP_TSF,
NL80211_PMSR_RESP_ATTR_FINAL,
NL80211_PMSR_RESP_ATTR_PAD,
/* keep last */
NUM_NL80211_PMSR_RESP_ATTRS,
NL80211_PMSR_RESP_ATTR_MAX = NUM_NL80211_PMSR_RESP_ATTRS - 1
};
/**
* enum nl80211_peer_measurement_peer_attrs - peer attributes for measurement
* @__NL80211_PMSR_PEER_ATTR_INVALID: invalid
*
* @NL80211_PMSR_PEER_ATTR_ADDR: peer's MAC address
* @NL80211_PMSR_PEER_ATTR_CHAN: channel definition, nested, using top-level
* attributes like %NL80211_ATTR_WIPHY_FREQ etc.
* @NL80211_PMSR_PEER_ATTR_REQ: This is a nested attribute indexed by
* measurement type, with attributes from the
* &enum nl80211_peer_measurement_req inside.
* @NL80211_PMSR_PEER_ATTR_RESP: This is a nested attribute indexed by
* measurement type, with attributes from the
* &enum nl80211_peer_measurement_resp inside.
*
* @NUM_NL80211_PMSR_PEER_ATTRS: internal
* @NL80211_PMSR_PEER_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_peer_attrs {
__NL80211_PMSR_PEER_ATTR_INVALID,
NL80211_PMSR_PEER_ATTR_ADDR,
NL80211_PMSR_PEER_ATTR_CHAN,
NL80211_PMSR_PEER_ATTR_REQ,
NL80211_PMSR_PEER_ATTR_RESP,
/* keep last */
NUM_NL80211_PMSR_PEER_ATTRS,
NL80211_PMSR_PEER_ATTR_MAX = NUM_NL80211_PMSR_PEER_ATTRS - 1,
};
/**
* enum nl80211_peer_measurement_attrs - peer measurement attributes
* @__NL80211_PMSR_ATTR_INVALID: invalid
*
* @NL80211_PMSR_ATTR_MAX_PEERS: u32 attribute used for capability
* advertisement only, indicates the maximum number of peers
* measurements can be done with in a single request
* @NL80211_PMSR_ATTR_REPORT_AP_TSF: flag attribute in capability
* indicating that the connected AP's TSF can be reported in
* measurement results
* @NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR: flag attribute in capability
* indicating that MAC address randomization is supported.
* @NL80211_PMSR_ATTR_TYPE_CAPA: capabilities reported by the device,
* this contains a nesting indexed by measurement type, and
* type-specific capabilities inside, which are from the enums
* named nl80211_peer_measurement__capa.
* @NL80211_PMSR_ATTR_PEERS: nested attribute, the nesting index is
* meaningless, just a list of peers to measure with, with the
* sub-attributes taken from
* &enum nl80211_peer_measurement_peer_attrs.
*
* @NUM_NL80211_PMSR_ATTR: internal
* @NL80211_PMSR_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_attrs {
__NL80211_PMSR_ATTR_INVALID,
NL80211_PMSR_ATTR_MAX_PEERS,
NL80211_PMSR_ATTR_REPORT_AP_TSF,
NL80211_PMSR_ATTR_RANDOMIZE_MAC_ADDR,
NL80211_PMSR_ATTR_TYPE_CAPA,
NL80211_PMSR_ATTR_PEERS,
/* keep last */
NUM_NL80211_PMSR_ATTR,
NL80211_PMSR_ATTR_MAX = NUM_NL80211_PMSR_ATTR - 1
};
/**
* enum nl80211_peer_measurement_ftm_capa - FTM capabilities
* @__NL80211_PMSR_FTM_CAPA_ATTR_INVALID: invalid
*
* @NL80211_PMSR_FTM_CAPA_ATTR_ASAP: flag attribute indicating ASAP mode
* is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP: flag attribute indicating non-ASAP
* mode is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI: flag attribute indicating if LCI
* data can be requested during the measurement
* @NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC: flag attribute indicating if civic
* location data can be requested during the measurement
* @NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES: u32 bitmap attribute of bits
* from &enum nl80211_preamble.
* @NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS: bitmap of values from
* &enum nl80211_chan_width indicating the supported channel
* bandwidths for FTM. Note that a higher channel bandwidth may be
* configured to allow for other measurements types with different
* bandwidth requirement in the same measurement.
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT: u32 attribute indicating
* the maximum bursts exponent that can be used (if not present anything
* is valid)
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST: u32 attribute indicating
* the maximum FTMs per burst (if not present anything is valid)
* @NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED: flag attribute indicating if
* trigger based ranging measurement is supported
* @NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED: flag attribute indicating
* if non-trigger-based ranging measurement is supported
*
* @NUM_NL80211_PMSR_FTM_CAPA_ATTR: internal
* @NL80211_PMSR_FTM_CAPA_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_ftm_capa {
__NL80211_PMSR_FTM_CAPA_ATTR_INVALID,
NL80211_PMSR_FTM_CAPA_ATTR_ASAP,
NL80211_PMSR_FTM_CAPA_ATTR_NON_ASAP,
NL80211_PMSR_FTM_CAPA_ATTR_REQ_LCI,
NL80211_PMSR_FTM_CAPA_ATTR_REQ_CIVICLOC,
NL80211_PMSR_FTM_CAPA_ATTR_PREAMBLES,
NL80211_PMSR_FTM_CAPA_ATTR_BANDWIDTHS,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_BURSTS_EXPONENT,
NL80211_PMSR_FTM_CAPA_ATTR_MAX_FTMS_PER_BURST,
NL80211_PMSR_FTM_CAPA_ATTR_TRIGGER_BASED,
NL80211_PMSR_FTM_CAPA_ATTR_NON_TRIGGER_BASED,
/* keep last */
NUM_NL80211_PMSR_FTM_CAPA_ATTR,
NL80211_PMSR_FTM_CAPA_ATTR_MAX = NUM_NL80211_PMSR_FTM_CAPA_ATTR - 1
};
/**
* enum nl80211_peer_measurement_ftm_req - FTM request attributes
* @__NL80211_PMSR_FTM_REQ_ATTR_INVALID: invalid
*
* @NL80211_PMSR_FTM_REQ_ATTR_ASAP: ASAP mode requested (flag)
* @NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE: preamble type (see
* &enum nl80211_preamble), optional for DMG (u32)
* @NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP: number of bursts exponent as in
* 802.11-2016 9.4.2.168 "Fine Timing Measurement Parameters element"
* (u8, 0-15, optional with default 15 i.e. "no preference")
* @NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD: interval between bursts in units
* of 100ms (u16, optional with default 0)
* @NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION: burst duration, as in 802.11-2016
* Table 9-257 "Burst Duration field encoding" (u8, 0-15, optional with
* default 15 i.e. "no preference")
* @NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST: number of successful FTM frames
* requested per burst
* (u8, 0-31, optional with default 0 i.e. "no preference")
* @NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES: number of FTMR frame retries
* (u8, default 3)
* @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI: request LCI data (flag)
* @NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC: request civic location data
* (flag)
* @NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED: request trigger based ranging
* measurement (flag).
* This attribute and %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED are
* mutually exclusive.
* if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
* ranging will be used.
* @NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED: request non-trigger-based
* ranging measurement (flag)
* This attribute and %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED are
* mutually exclusive.
* if neither %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED nor
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set, EDCA based
* ranging will be used.
* @NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK: negotiate for LMR feedback. Only
* valid if either %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED or
* %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED is set.
* @NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR: optional. The BSS color of the
* responder. Only valid if %NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED
* or %NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED is set.
*
* @NUM_NL80211_PMSR_FTM_REQ_ATTR: internal
* @NL80211_PMSR_FTM_REQ_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_ftm_req {
__NL80211_PMSR_FTM_REQ_ATTR_INVALID,
NL80211_PMSR_FTM_REQ_ATTR_ASAP,
NL80211_PMSR_FTM_REQ_ATTR_PREAMBLE,
NL80211_PMSR_FTM_REQ_ATTR_NUM_BURSTS_EXP,
NL80211_PMSR_FTM_REQ_ATTR_BURST_PERIOD,
NL80211_PMSR_FTM_REQ_ATTR_BURST_DURATION,
NL80211_PMSR_FTM_REQ_ATTR_FTMS_PER_BURST,
NL80211_PMSR_FTM_REQ_ATTR_NUM_FTMR_RETRIES,
NL80211_PMSR_FTM_REQ_ATTR_REQUEST_LCI,
NL80211_PMSR_FTM_REQ_ATTR_REQUEST_CIVICLOC,
NL80211_PMSR_FTM_REQ_ATTR_TRIGGER_BASED,
NL80211_PMSR_FTM_REQ_ATTR_NON_TRIGGER_BASED,
NL80211_PMSR_FTM_REQ_ATTR_LMR_FEEDBACK,
NL80211_PMSR_FTM_REQ_ATTR_BSS_COLOR,
/* keep last */
NUM_NL80211_PMSR_FTM_REQ_ATTR,
NL80211_PMSR_FTM_REQ_ATTR_MAX = NUM_NL80211_PMSR_FTM_REQ_ATTR - 1
};
/**
* enum nl80211_peer_measurement_ftm_failure_reasons - FTM failure reasons
* @NL80211_PMSR_FTM_FAILURE_UNSPECIFIED: unspecified failure, not used
* @NL80211_PMSR_FTM_FAILURE_NO_RESPONSE: no response from the FTM responder
* @NL80211_PMSR_FTM_FAILURE_REJECTED: FTM responder rejected measurement
* @NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL: we already know the peer is
* on a different channel, so can't measure (if we didn't know, we'd
* try and get no response)
* @NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE: peer can't actually do FTM
* @NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP: invalid T1/T4 timestamps
* received
* @NL80211_PMSR_FTM_FAILURE_PEER_BUSY: peer reports busy, you may retry
* later (see %NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME)
* @NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS: parameters were changed
* by the peer and are no longer supported
*/
enum nl80211_peer_measurement_ftm_failure_reasons {
NL80211_PMSR_FTM_FAILURE_UNSPECIFIED,
NL80211_PMSR_FTM_FAILURE_NO_RESPONSE,
NL80211_PMSR_FTM_FAILURE_REJECTED,
NL80211_PMSR_FTM_FAILURE_WRONG_CHANNEL,
NL80211_PMSR_FTM_FAILURE_PEER_NOT_CAPABLE,
NL80211_PMSR_FTM_FAILURE_INVALID_TIMESTAMP,
NL80211_PMSR_FTM_FAILURE_PEER_BUSY,
NL80211_PMSR_FTM_FAILURE_BAD_CHANGED_PARAMS,
};
/**
* enum nl80211_peer_measurement_ftm_resp - FTM response attributes
* @__NL80211_PMSR_FTM_RESP_ATTR_INVALID: invalid
*
* @NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON: FTM-specific failure reason
* (u32, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX: optional, if bursts are reported
* as separate results then it will be the burst index 0...(N-1) and
* the top level will indicate partial results (u32)
* @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS: number of FTM Request frames
* transmitted (u32, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES: number of FTM Request frames
* that were acknowledged (u32, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME: retry time received from the
* busy peer (u32, seconds)
* @NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP: actual number of bursts exponent
* used by the responder (similar to request, u8)
* @NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION: actual burst duration used by
* the responder (similar to request, u8)
* @NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST: actual FTMs per burst used
* by the responder (similar to request, u8)
* @NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG: average RSSI across all FTM action
* frames (optional, s32, 1/2 dBm)
* @NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD: RSSI spread across all FTM action
* frames (optional, s32, 1/2 dBm)
* @NL80211_PMSR_FTM_RESP_ATTR_TX_RATE: bitrate we used for the response to the
* FTM action frame (optional, nested, using &enum nl80211_rate_info
* attributes)
* @NL80211_PMSR_FTM_RESP_ATTR_RX_RATE: bitrate the responder used for the FTM
* action frame (optional, nested, using &enum nl80211_rate_info attrs)
* @NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG: average RTT (s64, picoseconds, optional
* but one of RTT/DIST must be present)
* @NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE: RTT variance (u64, ps^2, note that
* standard deviation is the square root of variance, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD: RTT spread (u64, picoseconds,
* optional)
* @NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG: average distance (s64, mm, optional
* but one of RTT/DIST must be present)
* @NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE: distance variance (u64, mm^2, note
* that standard deviation is the square root of variance, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD: distance spread (u64, mm, optional)
* @NL80211_PMSR_FTM_RESP_ATTR_LCI: LCI data from peer (binary, optional);
* this is the contents of the Measurement Report Element (802.11-2016
* 9.4.2.22.1) starting with the Measurement Token, with Measurement
* Type 8.
* @NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC: civic location data from peer
* (binary, optional);
* this is the contents of the Measurement Report Element (802.11-2016
* 9.4.2.22.1) starting with the Measurement Token, with Measurement
* Type 11.
* @NL80211_PMSR_FTM_RESP_ATTR_PAD: ignore, for u64/s64 padding only
*
* @NUM_NL80211_PMSR_FTM_RESP_ATTR: internal
* @NL80211_PMSR_FTM_RESP_ATTR_MAX: highest attribute number
*/
enum nl80211_peer_measurement_ftm_resp {
__NL80211_PMSR_FTM_RESP_ATTR_INVALID,
NL80211_PMSR_FTM_RESP_ATTR_FAIL_REASON,
NL80211_PMSR_FTM_RESP_ATTR_BURST_INDEX,
NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_ATTEMPTS,
NL80211_PMSR_FTM_RESP_ATTR_NUM_FTMR_SUCCESSES,
NL80211_PMSR_FTM_RESP_ATTR_BUSY_RETRY_TIME,
NL80211_PMSR_FTM_RESP_ATTR_NUM_BURSTS_EXP,
NL80211_PMSR_FTM_RESP_ATTR_BURST_DURATION,
NL80211_PMSR_FTM_RESP_ATTR_FTMS_PER_BURST,
NL80211_PMSR_FTM_RESP_ATTR_RSSI_AVG,
NL80211_PMSR_FTM_RESP_ATTR_RSSI_SPREAD,
NL80211_PMSR_FTM_RESP_ATTR_TX_RATE,
NL80211_PMSR_FTM_RESP_ATTR_RX_RATE,
NL80211_PMSR_FTM_RESP_ATTR_RTT_AVG,
NL80211_PMSR_FTM_RESP_ATTR_RTT_VARIANCE,
NL80211_PMSR_FTM_RESP_ATTR_RTT_SPREAD,
NL80211_PMSR_FTM_RESP_ATTR_DIST_AVG,
NL80211_PMSR_FTM_RESP_ATTR_DIST_VARIANCE,
NL80211_PMSR_FTM_RESP_ATTR_DIST_SPREAD,
NL80211_PMSR_FTM_RESP_ATTR_LCI,
NL80211_PMSR_FTM_RESP_ATTR_CIVICLOC,
NL80211_PMSR_FTM_RESP_ATTR_PAD,
/* keep last */
NUM_NL80211_PMSR_FTM_RESP_ATTR,
NL80211_PMSR_FTM_RESP_ATTR_MAX = NUM_NL80211_PMSR_FTM_RESP_ATTR - 1
};
/**
* enum nl80211_obss_pd_attributes - OBSS packet detection attributes
* @__NL80211_HE_OBSS_PD_ATTR_INVALID: Invalid
*
* @NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET: the OBSS PD minimum tx power offset.
* @NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET: the OBSS PD maximum tx power offset.
* @NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET: the non-SRG OBSS PD maximum
* tx power offset.
* @NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP: bitmap that indicates the BSS color
* values used by members of the SRG.
* @NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP: bitmap that indicates the partial
* BSSID values used by members of the SRG.
* @NL80211_HE_OBSS_PD_ATTR_SR_CTRL: The SR Control field of SRP element.
*
* @__NL80211_HE_OBSS_PD_ATTR_LAST: Internal
* @NL80211_HE_OBSS_PD_ATTR_MAX: highest OBSS PD attribute.
*/
enum nl80211_obss_pd_attributes {
__NL80211_HE_OBSS_PD_ATTR_INVALID,
NL80211_HE_OBSS_PD_ATTR_MIN_OFFSET,
NL80211_HE_OBSS_PD_ATTR_MAX_OFFSET,
NL80211_HE_OBSS_PD_ATTR_NON_SRG_MAX_OFFSET,
NL80211_HE_OBSS_PD_ATTR_BSS_COLOR_BITMAP,
NL80211_HE_OBSS_PD_ATTR_PARTIAL_BSSID_BITMAP,
NL80211_HE_OBSS_PD_ATTR_SR_CTRL,
/* keep last */
__NL80211_HE_OBSS_PD_ATTR_LAST,
NL80211_HE_OBSS_PD_ATTR_MAX = __NL80211_HE_OBSS_PD_ATTR_LAST - 1,
};
/**
* enum nl80211_bss_color_attributes - BSS Color attributes
* @__NL80211_HE_BSS_COLOR_ATTR_INVALID: Invalid
*
* @NL80211_HE_BSS_COLOR_ATTR_COLOR: the current BSS Color.
* @NL80211_HE_BSS_COLOR_ATTR_DISABLED: is BSS coloring disabled.
* @NL80211_HE_BSS_COLOR_ATTR_PARTIAL: the AID equation to be used..
*
* @__NL80211_HE_BSS_COLOR_ATTR_LAST: Internal
* @NL80211_HE_BSS_COLOR_ATTR_MAX: highest BSS Color attribute.
*/
enum nl80211_bss_color_attributes {
__NL80211_HE_BSS_COLOR_ATTR_INVALID,
NL80211_HE_BSS_COLOR_ATTR_COLOR,
NL80211_HE_BSS_COLOR_ATTR_DISABLED,
NL80211_HE_BSS_COLOR_ATTR_PARTIAL,
/* keep last */
__NL80211_HE_BSS_COLOR_ATTR_LAST,
NL80211_HE_BSS_COLOR_ATTR_MAX = __NL80211_HE_BSS_COLOR_ATTR_LAST - 1,
};
/**
* enum nl80211_iftype_akm_attributes - interface type AKM attributes
* @__NL80211_IFTYPE_AKM_ATTR_INVALID: Invalid
*
* @NL80211_IFTYPE_AKM_ATTR_IFTYPES: nested attribute containing a flag
* attribute for each interface type that supports AKM suites specified in
* %NL80211_IFTYPE_AKM_ATTR_SUITES
* @NL80211_IFTYPE_AKM_ATTR_SUITES: an array of u32. Used to indicate supported
* AKM suites for the specified interface types.
*
* @__NL80211_IFTYPE_AKM_ATTR_LAST: Internal
* @NL80211_IFTYPE_AKM_ATTR_MAX: highest interface type AKM attribute.
*/
enum nl80211_iftype_akm_attributes {
__NL80211_IFTYPE_AKM_ATTR_INVALID,
NL80211_IFTYPE_AKM_ATTR_IFTYPES,
NL80211_IFTYPE_AKM_ATTR_SUITES,
/* keep last */
__NL80211_IFTYPE_AKM_ATTR_LAST,
NL80211_IFTYPE_AKM_ATTR_MAX = __NL80211_IFTYPE_AKM_ATTR_LAST - 1,
};
/**
* enum nl80211_fils_discovery_attributes - FILS discovery configuration
* from IEEE Std 802.11ai-2016, Annex C.3 MIB detail.
*
* @__NL80211_FILS_DISCOVERY_ATTR_INVALID: Invalid
*
* @NL80211_FILS_DISCOVERY_ATTR_INT_MIN: Minimum packet interval (u32, TU).
* Allowed range: 0..10000 (TU = Time Unit)
* @NL80211_FILS_DISCOVERY_ATTR_INT_MAX: Maximum packet interval (u32, TU).
* Allowed range: 0..10000 (TU = Time Unit). If set to 0, the feature is disabled.
* @NL80211_FILS_DISCOVERY_ATTR_TMPL: Template data for FILS discovery action
* frame including the headers.
*
* @__NL80211_FILS_DISCOVERY_ATTR_LAST: Internal
* @NL80211_FILS_DISCOVERY_ATTR_MAX: highest attribute
*/
enum nl80211_fils_discovery_attributes {
__NL80211_FILS_DISCOVERY_ATTR_INVALID,
NL80211_FILS_DISCOVERY_ATTR_INT_MIN,
NL80211_FILS_DISCOVERY_ATTR_INT_MAX,
NL80211_FILS_DISCOVERY_ATTR_TMPL,
/* keep last */
__NL80211_FILS_DISCOVERY_ATTR_LAST,
NL80211_FILS_DISCOVERY_ATTR_MAX = __NL80211_FILS_DISCOVERY_ATTR_LAST - 1
};
/*
* FILS discovery template minimum length with action frame headers and
* mandatory fields.
*/
#define NL80211_FILS_DISCOVERY_TMPL_MIN_LEN 42
/**
* enum nl80211_unsol_bcast_probe_resp_attributes - Unsolicited broadcast probe
* response configuration. Applicable only in 6GHz.
*
* @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID: Invalid
*
* @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT: Maximum packet interval (u32, TU).
* Allowed range: 0..20 (TU = Time Unit). IEEE P802.11ax/D6.0
* 26.17.2.3.2 (AP behavior for fast passive scanning). If set to 0, the feature is
* disabled.
* @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL: Unsolicited broadcast probe response
* frame template (binary).
*
* @__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST: Internal
* @NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX: highest attribute
*/
enum nl80211_unsol_bcast_probe_resp_attributes {
__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INVALID,
NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_INT,
NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_TMPL,
/* keep last */
__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST,
NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX =
__NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_LAST - 1
};
/**
* enum nl80211_sae_pwe_mechanism - The mechanism(s) allowed for SAE PWE
* derivation. Applicable only when WPA3-Personal SAE authentication is
* used.
*
* @NL80211_SAE_PWE_UNSPECIFIED: not specified, used internally to indicate that
* attribute is not present from userspace.
* @NL80211_SAE_PWE_HUNT_AND_PECK: hunting-and-pecking loop only
* @NL80211_SAE_PWE_HASH_TO_ELEMENT: hash-to-element only
* @NL80211_SAE_PWE_BOTH: both hunting-and-pecking loop and hash-to-element
* can be used.
*/
enum nl80211_sae_pwe_mechanism {
NL80211_SAE_PWE_UNSPECIFIED,
NL80211_SAE_PWE_HUNT_AND_PECK,
NL80211_SAE_PWE_HASH_TO_ELEMENT,
NL80211_SAE_PWE_BOTH,
};
/**
* enum nl80211_sar_type - type of SAR specs
*
* @NL80211_SAR_TYPE_POWER: power limitation specified in 0.25dBm unit
*
* @NUM_NL80211_SAR_TYPE: internal
*/
enum nl80211_sar_type {
NL80211_SAR_TYPE_POWER,
/* add new type here */
/* Keep last */
NUM_NL80211_SAR_TYPE,
};
/**
* enum nl80211_sar_attrs - Attributes for SAR spec
*
* @__NL80211_SAR_ATTR_INVALID: Invalid
*
* @NL80211_SAR_ATTR_TYPE: the SAR type as defined in &enum nl80211_sar_type.
*
* @NL80211_SAR_ATTR_SPECS: Nested array of SAR power
* limit specifications. Each specification contains a set
* of %nl80211_sar_specs_attrs.
*
* For SET operation, it contains array of %NL80211_SAR_ATTR_SPECS_POWER
* and %NL80211_SAR_ATTR_SPECS_RANGE_INDEX.
*
* For sar_capa dump, it contains array of
* %NL80211_SAR_ATTR_SPECS_START_FREQ
* and %NL80211_SAR_ATTR_SPECS_END_FREQ.
*
* @__NL80211_SAR_ATTR_LAST: Internal
* @NL80211_SAR_ATTR_MAX: highest sar attribute
*
* These attributes are used with %NL80211_CMD_SET_SAR_SPEC
*/
enum nl80211_sar_attrs {
__NL80211_SAR_ATTR_INVALID,
NL80211_SAR_ATTR_TYPE,
NL80211_SAR_ATTR_SPECS,
__NL80211_SAR_ATTR_LAST,
NL80211_SAR_ATTR_MAX = __NL80211_SAR_ATTR_LAST - 1,
};
/**
* enum nl80211_sar_specs_attrs - Attributes for SAR power limit specs
*
* @__NL80211_SAR_ATTR_SPECS_INVALID: Invalid
*
* @NL80211_SAR_ATTR_SPECS_POWER: Required (s32)value to specify the actual
* power limit value in units of 0.25 dBm if type is
* NL80211_SAR_TYPE_POWER. (i.e., a value of 44 represents 11 dBm).
* 0 means userspace doesn't have SAR limitation on this associated range.
*
* @NL80211_SAR_ATTR_SPECS_RANGE_INDEX: Required (u32) value to specify the
* index of exported freq range table and the associated power limitation
* is applied to this range.
*
* Userspace isn't required to set all the ranges advertised by WLAN driver,
* and userspace can skip some certain ranges. These skipped ranges don't
* have SAR limitations, and they are same as setting the
* %NL80211_SAR_ATTR_SPECS_POWER to any unreasonable high value because any
* value higher than regulatory allowed value just means SAR power
* limitation is removed, but it's required to set at least one range.
* It's not allowed to set duplicated range in one SET operation.
*
* Every SET operation overwrites previous SET operation.
*
* @NL80211_SAR_ATTR_SPECS_START_FREQ: Required (u32) value to specify the start
* frequency of this range edge when registering SAR capability to wiphy.
* It's not a channel center frequency. The unit is kHz.
*
* @NL80211_SAR_ATTR_SPECS_END_FREQ: Required (u32) value to specify the end
* frequency of this range edge when registering SAR capability to wiphy.
* It's not a channel center frequency. The unit is kHz.
*
* @__NL80211_SAR_ATTR_SPECS_LAST: Internal
* @NL80211_SAR_ATTR_SPECS_MAX: highest sar specs attribute
*/
enum nl80211_sar_specs_attrs {
__NL80211_SAR_ATTR_SPECS_INVALID,
NL80211_SAR_ATTR_SPECS_POWER,
NL80211_SAR_ATTR_SPECS_RANGE_INDEX,
NL80211_SAR_ATTR_SPECS_START_FREQ,
NL80211_SAR_ATTR_SPECS_END_FREQ,
__NL80211_SAR_ATTR_SPECS_LAST,
NL80211_SAR_ATTR_SPECS_MAX = __NL80211_SAR_ATTR_SPECS_LAST - 1,
};
/**
* enum nl80211_mbssid_config_attributes - multiple BSSID (MBSSID) and enhanced
* multi-BSSID advertisements (EMA) in AP mode.
* Kernel uses some of these attributes to advertise driver's support for
* MBSSID and EMA.
* Remaining attributes should be used by the userspace to configure the
* features.
*
* @__NL80211_MBSSID_CONFIG_ATTR_INVALID: Invalid
*
* @NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES: Used by the kernel to advertise
* the maximum number of MBSSID interfaces supported by the driver.
* Driver should indicate MBSSID support by setting
* wiphy->mbssid_max_interfaces to a value more than or equal to 2.
*
* @NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY: Used by the kernel
* to advertise the maximum profile periodicity supported by the driver
* if EMA is enabled. Driver should indicate EMA support to the userspace
* by setting wiphy->ema_max_profile_periodicity to
* a non-zero value.
*
* @NL80211_MBSSID_CONFIG_ATTR_INDEX: Mandatory parameter to pass the index of
* this BSS (u8) in the multiple BSSID set.
* Value must be set to 0 for the transmitting interface and non-zero for
* all non-transmitting interfaces. The userspace will be responsible
* for using unique indices for the interfaces.
* Range: 0 to wiphy->mbssid_max_interfaces-1.
*
* @NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX: Mandatory parameter for
* a non-transmitted profile which provides the interface index (u32) of
* the transmitted profile. The value must match one of the interface
* indices advertised by the kernel. Optional if the interface being set up
* is the transmitting one, however, if provided then the value must match
* the interface index of the same.
*
* @NL80211_MBSSID_CONFIG_ATTR_EMA: Flag used to enable EMA AP feature.
* Setting this flag is permitted only if the driver advertises EMA support
* by setting wiphy->ema_max_profile_periodicity to non-zero.
*
* @NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID: Link ID of the transmitted profile.
* This parameter is mandatory when NL80211_ATTR_MBSSID_CONFIG attributes
* are sent for a non-transmitted profile and if the transmitted profile
* is part of an MLD. For all other cases this parameter is unnecessary.
*
* @__NL80211_MBSSID_CONFIG_ATTR_LAST: Internal
* @NL80211_MBSSID_CONFIG_ATTR_MAX: highest attribute
*/
enum nl80211_mbssid_config_attributes {
__NL80211_MBSSID_CONFIG_ATTR_INVALID,
NL80211_MBSSID_CONFIG_ATTR_MAX_INTERFACES,
NL80211_MBSSID_CONFIG_ATTR_MAX_EMA_PROFILE_PERIODICITY,
NL80211_MBSSID_CONFIG_ATTR_INDEX,
NL80211_MBSSID_CONFIG_ATTR_TX_IFINDEX,
NL80211_MBSSID_CONFIG_ATTR_EMA,
NL80211_MBSSID_CONFIG_ATTR_TX_LINK_ID,
/* keep last */
__NL80211_MBSSID_CONFIG_ATTR_LAST,
NL80211_MBSSID_CONFIG_ATTR_MAX = __NL80211_MBSSID_CONFIG_ATTR_LAST - 1,
};
/**
* enum nl80211_ap_settings_flags - AP settings flags
*
* @NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT: AP supports external
* authentication.
* @NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT: Userspace supports SA Query
* procedures offload to driver. If driver advertises
* %NL80211_AP_SME_SA_QUERY_OFFLOAD in AP SME features, userspace shall
* ignore SA Query procedures and validations when this flag is set by
* userspace.
*/
enum nl80211_ap_settings_flags {
NL80211_AP_SETTINGS_EXTERNAL_AUTH_SUPPORT = 1 << 0,
NL80211_AP_SETTINGS_SA_QUERY_OFFLOAD_SUPPORT = 1 << 1,
};
/**
* enum nl80211_wiphy_radio_attrs - wiphy radio attributes
*
* @__NL80211_WIPHY_RADIO_ATTR_INVALID: Invalid
*
* @NL80211_WIPHY_RADIO_ATTR_INDEX: Index of this radio (u32)
* @NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE: Frequency range supported by this
* radio. Attribute may be present multiple times.
* @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface
* combination for this radio. Attribute may be present multiple times
* and contains attributes defined in &enum nl80211_if_combination_attrs.
* @NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK: bitmask (u32) of antennas
* connected to this radio.
* @NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD: RTS threshold (u32) of this radio.
*
* @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
* @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
*/
enum nl80211_wiphy_radio_attrs {
__NL80211_WIPHY_RADIO_ATTR_INVALID,
NL80211_WIPHY_RADIO_ATTR_INDEX,
NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK,
NL80211_WIPHY_RADIO_ATTR_RTS_THRESHOLD,
/* keep last */
__NL80211_WIPHY_RADIO_ATTR_LAST,
NL80211_WIPHY_RADIO_ATTR_MAX = __NL80211_WIPHY_RADIO_ATTR_LAST - 1,
};
/**
* enum nl80211_wiphy_radio_freq_range - wiphy radio frequency range
*
* @__NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID: Invalid
*
* @NL80211_WIPHY_RADIO_FREQ_ATTR_START: Frequency range start (u32).
* The unit is kHz.
* @NL80211_WIPHY_RADIO_FREQ_ATTR_END: Frequency range end (u32).
* The unit is kHz.
*
* @__NL80211_WIPHY_RADIO_FREQ_ATTR_LAST: Internal
* @NL80211_WIPHY_RADIO_FREQ_ATTR_MAX: Highest attribute
*/
enum nl80211_wiphy_radio_freq_range {
__NL80211_WIPHY_RADIO_FREQ_ATTR_INVALID,
NL80211_WIPHY_RADIO_FREQ_ATTR_START,
NL80211_WIPHY_RADIO_FREQ_ATTR_END,
__NL80211_WIPHY_RADIO_FREQ_ATTR_LAST,
NL80211_WIPHY_RADIO_FREQ_ATTR_MAX = __NL80211_WIPHY_RADIO_FREQ_ATTR_LAST - 1,
};
/**
* enum nl80211_s1g_short_beacon_attrs - S1G short beacon data
*
* @__NL80211_S1G_SHORT_BEACON_ATTR_INVALID: Invalid
*
* @NL80211_S1G_SHORT_BEACON_ATTR_HEAD: Short beacon head (binary).
* @NL80211_S1G_SHORT_BEACON_ATTR_TAIL: Short beacon tail (binary).
*
* @__NL80211_S1G_SHORT_BEACON_ATTR_LAST: Internal
* @NL80211_S1G_SHORT_BEACON_ATTR_MAX: Highest attribute
*/
enum nl80211_s1g_short_beacon_attrs {
__NL80211_S1G_SHORT_BEACON_ATTR_INVALID,
NL80211_S1G_SHORT_BEACON_ATTR_HEAD,
NL80211_S1G_SHORT_BEACON_ATTR_TAIL,
/* keep last */
__NL80211_S1G_SHORT_BEACON_ATTR_LAST,
NL80211_S1G_SHORT_BEACON_ATTR_MAX =
__NL80211_S1G_SHORT_BEACON_ATTR_LAST - 1
};
/**
* enum nl80211_nan_capabilities - NAN (Neighbor Aware Networking)
* capabilities.
*
* @__NL80211_NAN_CAPABILITIES_INVALID: Invalid.
* @NL80211_NAN_CAPA_CONFIGURABLE_SYNC: Flag attribute indicating that
* the device supports configurable synchronization. If set, the device
* should be able to handle %NL80211_ATTR_NAN_CONFIG
* attribute in the %NL80211_CMD_START_NAN (and change) command.
* @NL80211_NAN_CAPA_USERSPACE_DE: Flag attribute indicating that
* NAN Discovery Engine (DE) is not offloaded and the driver assumes
* user space DE implementation. When set, %NL80211_CMD_ADD_NAN_FUNCTION,
* %NL80211_CMD_DEL_NAN_FUNCTION and %NL80211_CMD_NAN_MATCH commands
* should not be used. In addition, the device/driver should support
* sending discovery window (DW) notifications using
* %NL80211_CMD_NAN_NEXT_DW_NOTIFICATION and handling transmission and
* reception of NAN SDF frames on NAN device interface during DW windows.
* (%NL80211_CMD_FRAME is used to transmit SDFs)
* @NL80211_NAN_CAPA_OP_MODE: u8 attribute indicating the supported operation
* modes as defined in Wi-Fi Aware (TM) specification Table 81 (Operation
* Mode field format).
* @NL80211_NAN_CAPA_NUM_ANTENNAS: u8 attribute indicating the number of
* TX and RX antennas supported by the device. Lower nibble indicates
* the number of TX antennas and upper nibble indicates the number of RX
* antennas. Value 0 indicates the information is not available.
* See table 79 of Wi-Fi Aware (TM) specification (Number of
* Antennas field).
* @NL80211_NAN_CAPA_MAX_CHANNEL_SWITCH_TIME: u16 attribute indicating the
* maximum time in microseconds that the device requires to switch
* channels.
* @NL80211_NAN_CAPA_CAPABILITIES: u8 attribute containing the
* capabilities of the device as defined in Wi-Fi Aware (TM)
* specification Table 79 (Capabilities field).
* @__NL80211_NAN_CAPABILITIES_LAST: Internal
* @NL80211_NAN_CAPABILITIES_MAX: Highest NAN capability attribute.
*/
enum nl80211_nan_capabilities {
__NL80211_NAN_CAPABILITIES_INVALID,
NL80211_NAN_CAPA_CONFIGURABLE_SYNC,
NL80211_NAN_CAPA_USERSPACE_DE,
NL80211_NAN_CAPA_OP_MODE,
NL80211_NAN_CAPA_NUM_ANTENNAS,
NL80211_NAN_CAPA_MAX_CHANNEL_SWITCH_TIME,
NL80211_NAN_CAPA_CAPABILITIES,
/* keep last */
__NL80211_NAN_CAPABILITIES_LAST,
NL80211_NAN_CAPABILITIES_MAX = __NL80211_NAN_CAPABILITIES_LAST - 1,
};
#endif /* __LINUX_NL80211_H */
uoaerg-wavemon-fb158b0/rfkill.c 0000664 0000000 0000000 00000003635 15142173343 0016520 0 ustar 00root root 0000000 0000000 /*
* Routines to check and describe the rfkill state of a wireless interface.
*
* Based on https://www.kernel.org/doc/Documentation/ABI/stable/sysfs-class-rfkill
*/
#include "iw_if.h"
#include
/** Return human-friendly description of @state. */
const char *rfkill_state_name(const rfkill_state_t state) {
static const char *states[] = {
[RFKILL_STATE_UNDEFINED] = "unknown",
[RFKILL_STATE_UNBLOCKED] = "unblocked",
[RFKILL_STATE_SOFT_BLOCKED] = "software RF-kill",
[RFKILL_STATE_HARD_BLOCKED] = "hardware RF-kill",
[RFKILL_STATE_FULL_BLOCKED] = "hardware/software RF-kill",
};
return states[state];
}
/** Return true if @state indicates that RF-kill is active. */
bool is_rfkill_blocked_state(const rfkill_state_t state) {
return state != RFKILL_STATE_UNBLOCKED && state != RFKILL_STATE_UNDEFINED;
}
/** Determine the rfkill state of wireless interface identified by @wdev_index. */
rfkill_state_t get_rfkill_state(const uint32_t wdev_index) {
rfkill_state_t state = RFKILL_STATE_UNDEFINED;
char wdev_state_path[256];
uint32_t val;
snprintf(wdev_state_path, sizeof(wdev_state_path) - 1,
"/sys/class/rfkill/rfkill%u/hard", wdev_index);
if (read_number_file(wdev_state_path, &val) != 1)
return RFKILL_STATE_UNDEFINED;
state = val ? RFKILL_STATE_HARD_BLOCKED : RFKILL_STATE_UNBLOCKED;
snprintf(wdev_state_path, sizeof(wdev_state_path) - 1,
"/sys/class/rfkill/rfkill%u/soft", wdev_index);
if (read_number_file(wdev_state_path, &val) != 1)
return RFKILL_STATE_UNDEFINED;
if (!val)
return state;
if (state == RFKILL_STATE_HARD_BLOCKED)
return RFKILL_STATE_FULL_BLOCKED;
return RFKILL_STATE_SOFT_BLOCKED;
}
/** Return true if the configured wireless interface is be blocked by rfkill. */
bool default_interface_is_rfkill_blocked(void) {
struct interface_info *data = NULL;
iw_nl80211_get_interface_data(&data);
return data && is_rfkill_blocked_state(get_rfkill_state(data->wdev));
}
uoaerg-wavemon-fb158b0/scan_scr.c 0000664 0000000 0000000 00000020611 15142173343 0017021 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "iw_scan.h"
/* GLOBALS */
static struct scan_result sr = {
.head = NULL,
.channel_stats = NULL,
.msg[0] = '\0',
};
static pthread_t scan_thread;
static WINDOW *w_aplst;
/**
* Sanitize and format single scan entry as a string.
* @cur: entry to format
* @buf: buffer to put results into
* @buflen: length of @buf
*/
static void fmt_scan_entry(struct scan_entry *cur, char buf[], size_t buflen)
{
size_t len = 0;
if (cur->bss_signal) {
float sig_qual, sig_qual_max;
if (cur->bss_signal_qual) {
/* BSS_SIGNAL_UNSPEC is scaled 0..100 */
sig_qual = cur->bss_signal_qual;
sig_qual_max = 100;
} else {
if (cur->bss_signal < -110)
sig_qual = 0;
else if (cur->bss_signal > -40)
sig_qual = 70;
else
sig_qual = cur->bss_signal + 110;
sig_qual_max = 70;
}
len += snprintf(buf + len, buflen - len, "%3.0f%%, %d dBm",
(1E2 * sig_qual)/ sig_qual_max, cur->bss_signal);
} else if (cur->bss_signal_qual) {
len += snprintf(buf + len, buflen - len, "%2d/%d",
cur->bss_signal_qual, 100);
} else {
len += snprintf(buf + len, buflen - len, "? dBm");
}
if (cur->chan >= 0)
len += snprintf(buf + len, buflen - len, ", %s %3d, %d MHz",
cur->freq < 5e6 ? "ch" : "CH",
cur->chan, cur->freq);
else
len += snprintf(buf + len, buflen - len, ", %g GHz",
cur->freq / 1e3);
if (cur->bss_capa & WLAN_CAPABILITY_ESS) {
if (cur->bss_sta_count || cur->bss_chan_usage > 2) {
if (cur->bss_sta_count)
len += snprintf(buf + len, buflen - len, " %u sta", cur->bss_sta_count);
if (cur->bss_chan_usage > 2) /* 1% is 2.55 */
len += snprintf(buf + len, buflen - len, "%s %.0f%% chan",
cur->bss_sta_count? "," : "", (1e2 * cur->bss_chan_usage)/2.55e2);
} else {
len += snprintf(buf + len, buflen - len, " ESS");
}
if (cur->bss_capa & WLAN_CAPABILITY_RADIO_MEASURE)
len += snprintf(buf + len, buflen - len, ", Radio Measure");
if (cur->bss_capa & WLAN_CAPABILITY_SPECTRUM_MGMT)
len += snprintf(buf + len, buflen - len, ", Spectrum Mgmt");
} else if (cur->bss_capa & WLAN_CAPABILITY_IBSS) {
len += snprintf(buf + len, buflen - len, " IBSS");
}
if (cur->mesh_enabled) {
len += snprintf(buf + len, buflen - len, ", Mesh");
}
}
static void display_aplist(WINDOW *w_aplst)
{
char s[256];
const char *sort_type[] = {
[SO_CHAN] = "Chan",
[SO_SIGNAL] = "Sig",
[SO_MAC] = "Mac",
[SO_ESSID] = "Essid",
[SO_OPEN] = "Open",
[SO_CHAN_SIG] = "Ch/Sg",
[SO_OPEN_SIG] = "Op/Sg"
};
int i, col, line = 1;
struct scan_entry *cur;
/* Scanning can take several seconds - do not refresh while locked. */
if (pthread_mutex_trylock(&sr.mutex))
return;
if (sr.head || *sr.msg)
for (i = 1; i <= MAXYLEN; i++)
mvwclrtoborder(w_aplst, i, 1);
if (!sr.head)
waddstr_center(w_aplst, WAV_HEIGHT/2 - 1, sr.msg);
/* Truncate overly long access point lists to match screen height. */
for (cur = sr.head; cur && line < MAXYLEN; cur = cur->next) {
if (!conf.scan_hidden_essids && !*cur->essid)
continue;
if (!WLAN_CAPABILITY_IS_STA_BSS(cur->bss_capa) && (cur->bss_capa & WLAN_CAPABILITY_ESS)) {
col = cur->has_key ? CP_RED : CP_GREEN;
} else {
col = CP_YELLOW;
}
wmove(w_aplst, line, 1);
if (!*cur->essid) {
sprintf(s, "%-*s ", sr.max_essid_len, "");
wattron(w_aplst, COLOR_PAIR(col));
waddstr(w_aplst, s);
} else if (str_is_ascii(cur->essid)) {
sprintf(s, "%-*s ", sr.max_essid_len, cur->essid);
waddstr_b(w_aplst, s);
wattron(w_aplst, COLOR_PAIR(col));
} else {
sprintf(s, "%-*s ", sr.max_essid_len, "");
wattron(w_aplst, COLOR_PAIR(col));
waddstr(w_aplst, s);
}
waddstr(w_aplst, ether_addr(&cur->ap_addr));
wattroff(w_aplst, COLOR_PAIR(col));
fmt_scan_entry(cur, s, sizeof(s));
waddstr(w_aplst, " ");
waddstr(w_aplst, s);
line++;
}
if (sr.num.entries < MAX_CH_STATS)
goto done;
wmove(w_aplst, MAXYLEN, 1);
if (conf.scan_filter_band == SCAN_FILTER_BAND_2G) {
wadd_attr_str(w_aplst, A_REVERSE, "total 2.4G:");
} else if (conf.scan_filter_band == SCAN_FILTER_BAND_5G) {
wadd_attr_str(w_aplst, A_REVERSE, "total 5G:");
} else {
wadd_attr_str(w_aplst, A_REVERSE, "total:");
}
sprintf(s, " %d ", sr.num.entries);
waddstr(w_aplst, s);
sprintf(s, "%s %ssc", sort_type[conf.scan_sort_order], conf.scan_sort_asc ? "a" : "de");
wadd_attr_str(w_aplst, A_REVERSE, s);
if (line == MAXYLEN && sr.num.entries > line - 1) {
/* Truncated display truncated. Need to subtract 1 for the status line at the bottom. */
sprintf(s, ", %d not shown", sr.num.entries - (line - 1));
waddstr(w_aplst, s);
}
if (sr.num.open) {
sprintf(s, ", %d open", sr.num.open);
waddstr(w_aplst, s);
}
if (sr.num.hidden) {
sprintf(s, ", %d hidden", sr.num.hidden);
waddstr(w_aplst, s);
}
if (sr.num.two_gig && sr.num.five_gig) {
waddch(w_aplst, ' ');
wadd_attr_str(w_aplst, A_REVERSE, "5/2GHz:");
sprintf(s, " %d/%d", sr.num.five_gig, sr.num.two_gig);
waddstr(w_aplst, s);
}
if (sr.channel_stats) {
waddch(w_aplst, ' ');
if (conf.scan_sort_order == SO_CHAN && !conf.scan_sort_asc)
sprintf(s, "bottom-%d:", (int)sr.num.ch_stats);
else
sprintf(s, "top-%d:", (int)sr.num.ch_stats);
wadd_attr_str(w_aplst, A_REVERSE, s);
for (size_t i = 0; i < sr.num.ch_stats; i++) {
waddstr(w_aplst, i ? ", " : " ");
sprintf(s, "ch#%d", sr.channel_stats[i].val);
wadd_attr_str(w_aplst, A_BOLD, s);
sprintf(s, " (%d)", sr.channel_stats[i].count);
waddstr(w_aplst, s);
}
}
done:
pthread_mutex_unlock(&sr.mutex);
wrefresh(w_aplst);
}
void scr_aplst_init(void)
{
static bool initialized = false;
w_aplst = newwin_title(0, WAV_HEIGHT, "Scan window", false);
/* Gathering scan data can take seconds. Inform user. */
mvwaddstr(w_aplst, 2, 1, "Waiting for scan data ...");
wrefresh(w_aplst);
if (!initialized) {
pthread_mutexattr_t attr;
pthread_mutexattr_init(&attr);
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK);
pthread_mutex_init(&sr.mutex, &attr);
initialized = true;
}
pthread_create(&scan_thread, NULL, do_scan, &sr);
}
int scr_aplst_loop(WINDOW *w_menu)
{
int key;
display_aplist(w_aplst);
key = wgetch(w_menu);
switch (key) {
/*
* Filtering
*/
case 'b': /* Both 2.4 and 5 Ghz */
conf.scan_filter_band = SCAN_FILTER_BAND_BOTH;
return -1;
case '2': /* 2.4 GHz band only */
conf.scan_filter_band = SCAN_FILTER_BAND_2G;
return -1;
case '5': /* 5 GHz band only */
conf.scan_filter_band = SCAN_FILTER_BAND_5G;
return -1;
case 'h': /* Toggle inclusion of hidden ESSIDs */
conf.scan_hidden_essids = !conf.scan_hidden_essids;
return -1;
/*
* Sort Order
*/
case 'a': /* ascending */
conf.scan_sort_asc = true;
return -1;
case 'c': /* channel */
conf.scan_sort_order = SO_CHAN;
return -1;
case 'C': /* channel and signal */
conf.scan_sort_order = SO_CHAN_SIG;
return -1;
case 'd': /* descending */
conf.scan_sort_asc = false;
return -1;
case 'e': /* ESSID */
conf.scan_sort_order = SO_ESSID;
return -1;
case 'm': /* MAC address */
conf.scan_sort_order = SO_MAC;
return -1;
case 'o': /* open (descending is default) */
conf.scan_sort_order = SO_OPEN;
conf.scan_sort_asc = false;
return -1;
case 'O': /* open and signal (descending) */
conf.scan_sort_order = SO_OPEN_SIG;
conf.scan_sort_asc = false;
return -1;
case 's': /* signal */
conf.scan_sort_order = SO_SIGNAL;
return -1;
}
return key;
}
void scr_aplst_fini(void)
{
/* Unlock mutex in case it was taken when scr_aplst_loop got interrupted by a SIGWINCH.
* We are ignoring the error (EPERM) here if the main thread did not acquire the mutex. */
pthread_mutex_unlock(&sr.mutex);
pthread_cancel(scan_thread);
pthread_join(scan_thread, NULL);
delwin(w_aplst);
}
uoaerg-wavemon-fb158b0/ui.c 0000664 0000000 0000000 00000010255 15142173343 0015646 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
/**
* newwin_title - Create a new bordered window at (y, 0)
* @y: vertical row position to start at
* @h: height of the new window in lines
* @title: name of the window
* @nobottom: whether to keep the bottom of the box open
*/
WINDOW *newwin_title(int y, int h, const char *title, bool nobottom)
{
WINDOW *win = newwin(h, WAV_WIDTH, y, 0);
#ifdef HAVE_LIBNCURSESW
const cchar_t * top_left = y > 0 ? WACS_LTEE : WACS_ULCORNER;
const cchar_t * top_right = y > 0 ? WACS_RTEE : WACS_URCORNER;
if (nobottom) {
mvwadd_wch(win, 0, 0, top_left);
mvwhline_set(win, 0, 1, WACS_HLINE, MAXXLEN);
mvwvline_set(win, 1, 0, WACS_VLINE, h);
mvwadd_wch(win, 0, WAV_WIDTH - 1, top_right);
mvwvline_set(win, 1, WAV_WIDTH - 1, WACS_VLINE, h);
} else {
wborder_set(win, WACS_VLINE, WACS_VLINE, WACS_HLINE, WACS_HLINE,
top_left, top_right, WACS_LLCORNER, WACS_LRCORNER);
}
#else
chtype top_left = y > 0 ? ACS_LTEE : ACS_ULCORNER;
chtype top_right = y > 0 ? ACS_RTEE : ACS_URCORNER;
if (nobottom) {
mvwaddch(win, 0, 0, top_left);
mvwhline(win, 0, 1, ACS_HLINE, MAXXLEN);
mvwvline(win, 1, 0, ACS_VLINE, h);
mvwaddch(win, 0, WAV_WIDTH - 1, top_right);
mvwvline(win, 1, WAV_WIDTH - 1, ACS_VLINE, h);
} else {
wborder(win, ACS_VLINE, ACS_VLINE, ACS_HLINE, ACS_HLINE,
top_left, top_right, ACS_LLCORNER, ACS_LRCORNER);
}
#endif
wattrset(win, COLOR_PAIR(CP_CYAN));
mvwaddstr(win, 0, 2, title);
wattroff(win, COLOR_PAIR(CP_CYAN));
return win;
}
/* clear inside window content up to the right border */
void mvwclrtoborder(WINDOW *win, int y, int x)
{
if (x >= 1 && x <= MAXXLEN)
mvwhline(win, y, x, ' ', 1 + MAXXLEN - x);
}
void wclrtoborder(WINDOW *win)
{
int x, y;
getyx(win, y, x);
mvwclrtoborder(win, y, x);
}
void waddstr_center(WINDOW *win, int y, const char *s)
{
mvwaddstr(win, y, (WAV_WIDTH - strlen(s)) / 2, s);
}
void wadd_attr_str(WINDOW *win, const int attrs, const char *s)
{
wattron(win, attrs);
waddstr(win, s);
wattroff(win, attrs);
}
/* Enforce that @str is at most @len characters (excluding the terminal '\0') */
const char *curtail(const char *str, const char *sep, size_t len)
{
static char out_buf[128];
const char fallback_sep[] = "~";
size_t l = 0, front, mid, back;
if (len >= sizeof(out_buf))
len = sizeof(out_buf) - 1;
if (sep == NULL || *sep == '\0')
sep = fallback_sep;
mid = strlen(sep);
if (mid > len) {
sep = fallback_sep;
mid = strlen(sep);
}
if (str != NULL)
l = strlen(str);
if (l <= len)
return str;
front = (len - mid)/2.0 + 0.5;
back = len - front - mid;
strncpy(out_buf, str, front);
strncpy(out_buf + front, sep, mid);
strncpy(out_buf + front + mid, str + l - back, back + 1);
return out_buf;
}
static double interpolate(const double val, const double min, const double max)
{
return val < min ? 0 :
val > max ? 1 : (val - min) / (max - min);
}
void waddbar(WINDOW *win, int y, float v, float min, float max,
int8_t *cscale, bool rev)
{
chtype ch = '=' | A_BOLD | cp_from_scale(v, cscale, rev);
int len = MAXXLEN * interpolate(v, min, max);
mvwhline(win, y, 1, ch, len);
mvwclrtoborder(win, y, len + 1);
}
void waddthreshold(WINDOW *win, int y, float v, float tv,
float minv, float maxv, int8_t *cscale, chtype tch)
{
if (tv > minv && tv < maxv) {
if (v > tv)
tch |= COLOR_PAIR(CP_STANDARD);
else
tch |= cp_from_scale(v, cscale, true);
mvwaddch(win, y, 1 + MAXXLEN * interpolate(tv, minv, maxv), tch);
}
}
uoaerg-wavemon-fb158b0/utils.c 0000664 0000000 0000000 00000016461 15142173343 0016376 0 ustar 00root root 0000000 0000000 /*
* General-purpose utilities used by multiple files.
*/
#include "wavemon.h"
#include "nl80211.h"
#include
#include
#include
#include
#include
#include
#include
#include
#include
/* Maximum length of a MAC address: 2 * 6 hex digits, 6 - 1 colons, plus '\0' */
#define MAC_ADDR_MAX 18
/** Read up to @buflen-1 contents of file @path into @buf. Returns -1 on error. */
ssize_t read_file(const char *path, char *buf, size_t buflen) {
int fd = open(path, O_RDONLY), i, n;
if (fd < 0)
return -1;
buf[buflen-1] = '\0';
n = read(fd, buf, buflen-1);
if (close(fd) < 0)
return -1;
// Strip trailing whitespace.
for (i = n-1; i >= 0 && isspace(buf[i]); i--)
buf[i] = '\0';
return n;
}
/** Read contents of @path into @num. Return 1 if ok, 0 on format error, -1 on error */
int read_number_file(const char *path, uint32_t *num) {
char buf[64];
int rc = read_file(path, buf, sizeof(buf));
if (rc < 0)
return rc;
return sscanf(buf, "%u", num);
}
/* Return true if all ethernet octets are zero. */
bool ether_addr_is_zero(const struct ether_addr *ea)
{
static const struct ether_addr zero = {{0}};
return memcmp(ea, &zero, sizeof(zero)) == 0;
}
/* Print a mac-address, include leading zeroes (unlike ether_ntoa(3)) */
char *ether_addr(const struct ether_addr *ea)
{
static char mac[MAC_ADDR_MAX];
char *d = mac, *a = ether_ntoa(ea);
next_chunk:
if (a[0] == '\0' || a[1] == '\0' || a[1] == ':')
*d++ = '0';
while ((*d++ = conf.cisco_mac ? (*a == ':' ? '.' : *a) : toupper(*a)))
if (*a++ == ':')
goto next_chunk;
return mac;
}
/* Print mac-address translation from /etc/ethers if available */
char *ether_lookup(const struct ether_addr *ea)
{
static char hostname[BUFSIZ];
if (ether_ntohost(hostname, ea) == 0)
return hostname;
return ether_addr(ea);
}
/* Format an Ethernet mac address */
char *mac_addr(const struct sockaddr *sa)
{
if (sa->sa_family != ARPHRD_ETHER)
return "00:00:00:00:00:00";
return ether_lookup((const struct ether_addr *)sa->sa_data);
}
/* Print into allocated string (reimplementation of asprintf(3), since not standard). */
char *a_sprintf(const char *fmt, ...)
{
char *p = NULL;
int size;
va_list ap;
va_start(ap, fmt);
size = vsnprintf(NULL, 0, fmt, ap);
if (size < 0)
err_quit("unable to determine '%s' string size", fmt);
va_end(ap);
p = malloc(++size); /* Add one for '\0'. */
if (p == NULL)
err_sys("unable to allocate string space");
va_start(ap, fmt);
size = vsnprintf(p, size, fmt, ap);
if (size < 0)
err_quit("unable to format '%s' properly", fmt);
va_end(ap);
return p;
}
/* count bits set in @mask the Brian Kernighan way */
uint8_t bit_count(uint32_t mask)
{
uint8_t bits_set;
for (bits_set = 0; mask; bits_set++)
mask &= mask - 1;
return bits_set;
}
/* netmask = contiguous 1's followed by contiguous 0's */
uint8_t prefix_len(const struct sockaddr *netmask)
{
uint8_t bs = 0;
if (netmask->sa_family == AF_INET)
return bit_count(((const struct sockaddr_in *)netmask)->sin_addr.s_addr);
for (int i = 0; i < 16; i++)
bs += bit_count(((const struct sockaddr_in6 *)netmask)->sin6_addr.s6_addr[i]);
return bs;
}
/* Pretty-print @sec into a string of up to 6 characters. */
const char *pretty_time(const unsigned sec)
{
static char buf[12];
unsigned d = sec / 86400,
h = sec % 86400 / 3600,
m = sec % 3600 / 60;
if (d > 9) {
sprintf(buf, "%u days", d);
} else if (d) {
if (h) {
sprintf(buf, "%ud %uh", d, h);
} else if (m) {
sprintf(buf, "%ud %dm", d, m);
} else {
sprintf(buf, "%u day%s", d, d == 1 ? "" : "s");
}
} else if (h) {
sprintf(buf, "%u:%02uh", h, m);
} else if (m) {
sprintf(buf, "%u:%02um", m, sec % 60);
} else {
sprintf(buf, "%u sec", sec);
}
return buf;
}
/* Like pretty_time, but allow milliseconds */
const char *pretty_time_ms(const unsigned msec)
{
static char buf[12];
if (msec < 1000) {
sprintf(buf, "%u ms", msec);
return buf;
}
return pretty_time(msec/1000);
}
/* Convert (preferred, valid) address lifetime to string. */
const char *lft2str(const uint32_t lifetime)
{
if (lifetime == (uint32_t)-1)
return "forever";
return pretty_time(lifetime);
}
/* Convert log dBm values to linear mW */
double dbm2mw(const double in)
{
return pow(10.0, in / 10.0);
}
char *dbm2units(const double in)
{
static char with_units[0x100];
double val = dbm2mw(in);
if (val < 0.00000001) {
sprintf(with_units, "%.2f pW", val * 1e9);
} else if (val < 0.00001) {
sprintf(with_units, "%.2f nW", val * 1e6);
} else if (val < 0.01) {
sprintf(with_units, "%.2f uW", val * 1e3);
} else {
sprintf(with_units, "%.2f mW", val);
}
return with_units;
}
/* Convert linear mW values to log dBm */
double mw2dbm(const double in)
{
return 10.0 * log10(in);
}
/* Stolen from iw:util.c */
int ieee80211_frequency_to_channel(int freq)
{
if (freq < 1000)
return 0;
/* see 802.11-2007 17.3.8.3.2 and Annex J */
if (freq == 2484)
return 14;
/* see 802.11ax D6.1 27.3.23.2 and Annex E */
else if (freq == 5935)
return 2;
else if (freq < 2484)
return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5;
else if (freq < 5950)
return (freq - 5000) / 5;
else if (freq <= 45000) /* DMG band lower limit */
/* see 802.11ax D6.1 27.3.23.2 */
return (freq - 5950) / 5;
else if (freq >= 58320 && freq <= 70200)
return (freq - 56160) / 2160;
else
return 0;
}
const char *channel_width_name(enum nl80211_chan_width width)
{
switch (width) {
case NL80211_CHAN_WIDTH_1:
return "1 MHz";
case NL80211_CHAN_WIDTH_2:
return "2 MHz";
case NL80211_CHAN_WIDTH_4:
return "4 MHz";
case NL80211_CHAN_WIDTH_8:
return "8 MHz";
case NL80211_CHAN_WIDTH_16:
return "16 MHz";
case NL80211_CHAN_WIDTH_5:
return "5 MHz";
case NL80211_CHAN_WIDTH_10:
return "10 MHz";
case NL80211_CHAN_WIDTH_20:
return "20 MHz";
case NL80211_CHAN_WIDTH_20_NOHT:
return "20 MHz (no HT)";
case NL80211_CHAN_WIDTH_40:
return "40 MHz";
case NL80211_CHAN_WIDTH_80:
return "80 MHz";
case NL80211_CHAN_WIDTH_80P80:
return "80+80 MHz";
case NL80211_CHAN_WIDTH_160:
return "160 MHz";
case NL80211_CHAN_WIDTH_320:
return "320 MHz";
}
return "unknown";
}
/* stolen from iw:interface.c */
const char *channel_type_name(enum nl80211_channel_type channel_type)
{
switch (channel_type) {
case NL80211_CHAN_NO_HT:
return "NO HT";
case NL80211_CHAN_HT20:
return "HT20";
case NL80211_CHAN_HT40MINUS:
return "HT40-";
case NL80211_CHAN_HT40PLUS:
return "HT40+";
}
return "unknown";
}
/* stolen from iw:util.c */
const char *iftype_name(enum nl80211_iftype iftype)
{
static char modebuf[100];
static const char *ifmodes[NL80211_IFTYPE_MAX + 1] = {
"Unspecified",
"IBSS",
"Managed",
"AP",
"AP/VLAN",
"WDS",
"Monitor",
"Mesh Point",
"P2P-Client",
"P2P-GO",
"P2P-Device",
"Outside of a BSS",
"NAN",
};
if (iftype <= NL80211_IFTYPE_MAX && ifmodes[iftype])
return ifmodes[iftype];
sprintf(modebuf, "Unknown mode (%d)", iftype);
return modebuf;
}
/* stolen from iw:reg.c */
const char *dfs_domain_name(enum nl80211_dfs_regions region)
{
switch (region) {
case NL80211_DFS_UNSET:
return "DFS-UNSET";
case NL80211_DFS_FCC:
return "DFS-FCC";
case NL80211_DFS_ETSI:
return "DFS-ETSI";
case NL80211_DFS_JP:
return "DFS-JP";
default:
return "DFS-invalid";
}
}
uoaerg-wavemon-fb158b0/wavemon.1 0000664 0000000 0000000 00000014631 15142173343 0016625 0 ustar 00root root 0000000 0000000 .TH wavemon 1 "September 2021" Linux "User Manuals"
.SH NAME
wavemon \- a wireless network monitor
.SH SYNOPSIS
.B wavemon [-h] [-i
.I ifname
.B ] [-g] [-v]
.SH DESCRIPTION
\fIwavemon\fR is a ncurses-based monitoring application for wireless network
devices. It plots levels in real-time as well as showing wireless and network
related device information.
The \fIwavemon\fR interface splits into different "screens".
Each screen presents information in a specific manner. For example, the
"info" screen shows current levels as bargraphs, whereas the "level" screen
represents the same levels as a moving histogram.
On startup, you'll see (depending on configuration) one of the different monitor
screens. At the bottom, you'll find a \fImenu-bar\fR listing the screens and
their activating keys. Each screen is activated by either the corresponding
function key (F1..10), its numeric shortcut (1..0), or the underlined shortcut
letter of the screen name. The following \fIscreens\fR can be selected:
.TP
.B Info (F1 or 'i')
This is the most comprehensive screen. It displays a condensed overview of
wireless-specific parameters and network statistics, as well as bar graphs.
The layout is arranged into several sub-sections.
The
.B Interface
section at the top shows information about the monitoring interface,
including interface name, type, ESSID, and available encryption formats.
Below, in the
.B Levels
section, you can see up to four bargraphs showing (1) relative signal quality
and (2) signal level in dBm. If the wireless driver also supports noise level
information, additionally (3) noise level in dBm and (4) Signal-Noise-Ratio
(SNR) in dB are shown. The colour of the signal level bargraph changes
from red to yellow and green at fixed levels. If thresholds have been set,
two arrows on the signal level graph will show the positions of the current
thresholds.
The
.B Statistics
section displays packet and byte counters and a few other packet-related
statistics.
The subsequent
.B Info
subsection lists the current operational mode and configuration of the
wireless interface. What parameters are actually shown depends on the
capabilities and selected mode of your network device.
Lastly, the
.B Network
section shows network-level parameters. The MAC-address is resolved from
\fBethers\fR(5). The IPv4 address is shown in CIDR notation (RFC\ 4632
\fIaddress\fR\fB/\fR\fIprefix_len\fR format). Since often those two values
also determine the broadcast address (last 32 \- \fIprefix_len\fR bits set
to 1), that address is shown only if it does not derive from the interface
address and prefix length. Likewise, the interface MTU is shown only if it
differs from the default Ethernet MTU of 1500 bytes.
.TP
.B Level histogram (F2 or 'l')
This is a full-screen histogram plot showing the evolution of the signal
level over time.
The screen is partitioned into a grid, with dBm levels shown in green at
the right hand side.
.TP
.B Scan window (F3 or 's')
A periodically updated network scan, showing access points and other
wireless clients. It is sorted depending on \fIsort_order\fR and \fIsort_ascending\fR, see \fBwavemonrc\fR(5).
Each entry starts with the ESSID, followed by the colour-coded MAC
address and the signal/channel information. A green/red MAC address indicates
an (un-)encrypted access point, the colour changes to yellow for non-access
points (in this case the mode is shown at the end of the line). The
uncoloured information following the MAC address lists relative and
absolute signal strengths, channel, frequency, and station-specific information.
The station-specific information includes the station type (ESS for Access Point,
IBSS for Ad-Hoc network), station count and channel utilisation.
A status line at the bottom informs about the current sort order and a few
statistics, such as most (least) crowded channels (least crowded channels
are listed when sorting by descending channel).
The \fIsort_order\fR can also directly be changed via these keyboard shortcuts:
\fIa\fRscending, \fId\fRescending; by \fIe\fRssid, \fIs\fRignal, \fIc\fRhannel (\fIC\fR also with signal),
\fIm\fRac address, or by \fIo\fRpen access (\fIO\fR also with signal).
Please note that sorting order changes at the time new data comes in,
not when the setting is activated.
You can \fIfilter\fR the bands via these keyboard shortcuts: \fI2\fR (2.4GHz only),
\fI5\fR (5GHz only), and \fIb\fR (both bands). Hidden ESSIDs can be excluded from
display via the \fIh\fR shortcut.
.TP
.B Preferences (F7 or 'p')
This screen allows you to change all program options such as interface and
level scale parameters, and to save the new settings to the configuration
file. Select a parameter with and , then change the value with
and . Please refer to \fBwavemonrc\fR(5) for an in-depth
description of applicable settings.
.TP
.B Help (F8 or 'h')
This page might show an online-help.
.TP
.B About (F9 or 'a')
Release information and contact URLs.
.TP
\fBQuit (F10 or 'q')
Exit \fIwavemon\fR.
.LP
.SH "OPTIONS"
.IP "\fB\-i \fIinterface\fR\fR"
override autodetection and use the specified \fIinterface\fR.
.IP "\fB\-g\fR"
check screen \fIgeometry\fR: a minimum size is required for proper display; this flag
adds a check to ensure it is sufficiently large. Enable this if window does not display
properly.
.IP "\fB\-h\fR"
print help and exit.
.IP "\fB\-v\fR"
print version information and exit.
.SH Troubleshooting
.IP \(bu
\fIwavemon\fR will exit with \fB'no supported wireless interfaces found'\fR if no usable wireless interfaces
were detected. Check if your wireless interface is otherwise usable, using e.g. \fBiw\fR(8).
If your interface is not listed, causes can be a missing (or not loaded) kernel module; or missing firmware,
which some cards need to operate.
.IP \(bu
Some operations, such as displaying encryption information or performing scans, require
\fBCAP_NET_ADMIN\fR privileges (see \fBcapabilities\fR(7)). For non-root users, these can be
enabled by installing \fIwavemon\fR setuid-root.
.IP \(bu
Running \fIwavemon\fR inside \fBscreen\fR(1) may cause garbled output on certain locales.
This can be fixed calling screen like this:
.EX
$ LC_ALL=C screen
.EE
.SH FILES
.IP $XDG_CONFIG_HOME/wavemon/wavemonrc
The local per-user configuration file.
.SH "AUTHOR"
Written by Jan Morgenstern .
.SH "REPORTING BUGS"
Open an issue on \fIhttps://github.com/uoaerg/wavemon/issues\fR.
.SH "SEE ALSO"
.BR wavemonrc (5),
.BR ethers (5),
.BR capabilities (7),
.BR iw (8),
.BR locale (1)
uoaerg-wavemon-fb158b0/wavemon.c 0000664 0000000 0000000 00000015047 15142173343 0016711 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include "wavemon.h"
#include
#include
/* GLOBALS */
/**
* screen switching table
* @key_name: name under which the screen appears in the menu bar
* @shortcut: 1-character shortcut key for @key_name
* @init: screen initialisation function pointer
* @loop: screen update function pointer (connected to menu)
* @fini: screen cleanup function pointer
*/
static const struct {
const char *const key_name;
const char shortcut;
void (*init)(void);
int (*loop)(WINDOW *);
void (*fini)(void);
} screens[] = {
[SCR_INFO] = {
.key_name = "info",
.shortcut = 'i',
.init = scr_info_init,
.loop = scr_info_loop,
.fini = scr_info_fini
},
[SCR_LHIST] = {
.key_name = "lhist",
.shortcut = 'l',
.init = scr_lhist_init,
.loop = scr_lhist_loop,
.fini = scr_lhist_fini
},
[SCR_SCAN] = {
.key_name = "scan",
.shortcut = 's',
.init = scr_aplst_init,
.loop = scr_aplst_loop,
.fini = scr_aplst_fini
},
[SCR_EMPTY_F4] = {
.key_name = "",
},
[SCR_EMPTY_F5] = {
.key_name = "",
},
[SCR_EMPTY_F6] = {
.key_name = "",
},
[SCR_PREFS] = {
.key_name = "prefs",
.shortcut = 'p',
.init = scr_conf_init,
.loop = scr_conf_loop,
.fini = scr_conf_fini
},
[SCR_HELP] = {
.key_name = "help",
.shortcut = 'h',
.init = scr_help_init,
.loop = scr_help_loop,
.fini = scr_help_fini
},
[SCR_ABOUT] = {
.key_name = "about",
.shortcut = 'a',
.init = scr_about_init,
.loop = scr_about_loop,
.fini = scr_about_fini
},
[SCR_QUIT] = {
.key_name = "quit",
.shortcut = 'q',
}
};
/*
* SIGWINCH handling with buffer synchronisation variable
*/
static sigjmp_buf env_winch;
static volatile sig_atomic_t env_winch_ready;
static void sig_winch(int __attribute__((unused))signo)
{
if (env_winch_ready) {
env_winch_ready = false;
siglongjmp(env_winch, 1);
}
}
static WINDOW *init_menubar(const enum wavemon_screen active)
{
WINDOW *menu = newwin(1, WAV_WIDTH, WAV_HEIGHT, 0);
char fkey[8];
nodelay(menu, TRUE);
keypad(menu, TRUE);
wmove(menu, 0, 0);
for (enum wavemon_screen cur = SCR_INFO; cur <= SCR_QUIT; cur++) {
const char *p = screens[cur].key_name;
const int attrs = cur != active ? COLOR_PAIR(CP_CYAN)
: COLOR_PAIR(CP_CYAN_ON_BLUE) | A_BOLD;
if (*p) {
snprintf(fkey, sizeof(fkey), "F%d", cur + 1);
wattrset(menu, A_REVERSE | A_BOLD);
waddstr(menu, fkey);
wattrset(menu, attrs);
for (int i = 0; i < MAX_MENU_KEY; i++) {
if (*p == screens[cur].shortcut) {
wattron(menu, A_UNDERLINE);
waddch(menu, *p++);
wattroff(menu, A_UNDERLINE);
} else if (*p) {
waddch(menu, *p++);
} else {
wattroff(menu, attrs);
waddch(menu, ' ');
}
}
}
}
wrefresh(menu);
return menu;
}
static void check_geometry(void)
{
if (conf.check_geometry &&
(LINES < MIN_SCREEN_LINES || COLS < MIN_SCREEN_COLS))
err_quit("need at least a screen of %ux%u, have only %ux%u",
MIN_SCREEN_LINES, MIN_SCREEN_COLS, LINES, COLS);
}
int main(int argc, char *argv[])
{
int bg_color = COLOR_BLACK;
volatile enum wavemon_screen cur, next;
sigset_t blockmask, oldmask;
getconf(argc, argv);
if (!isatty(STDIN_FILENO))
errx(1, "input is not from a terminal");
setlocale(LC_ALL, "");
/* initialize the ncurses interface */
initscr();
noecho();
nonl();
cbreak();
curs_set(0);
clear();
check_geometry();
start_color();
if (conf.transparent_bg) {
bg_color = -1;
use_default_colors();
}
init_pair(CP_RED, COLOR_RED, bg_color);
init_pair(CP_YELLOW, COLOR_YELLOW, bg_color);
init_pair(CP_GREEN, COLOR_GREEN, bg_color);
init_pair(CP_CYAN, COLOR_CYAN, bg_color);
init_pair(CP_BLUE, COLOR_BLUE, bg_color);
init_pair(CP_RED_ON_BLUE, COLOR_RED, COLOR_BLUE);
init_pair(CP_GREEN_ON_BLUE, COLOR_GREEN, COLOR_BLUE);
init_pair(CP_CYAN_ON_BLUE, COLOR_CYAN, COLOR_BLUE);
init_pair(CP_BLUE_ON_BLUE, COLOR_BLUE, COLOR_BLUE);
/* Override signal handlers installed during ncurses initialisation. */
xsignal(SIGCHLD, SIG_IGN);
xsignal(SIGWINCH, sig_winch); /* triggers only when env_winch_ready */
sigemptyset(&blockmask);
sigaddset(&blockmask, SIGWINCH);
for (cur = conf.startup_scr; cur != SCR_QUIT; cur = next) {
WINDOW *w_menu;
volatile int escape = 0;
if (sigprocmask(SIG_BLOCK, &blockmask, &oldmask) < 0)
err_sys("cannot block SIGWINCH");
next = cur;
w_menu = init_menubar(cur);
(*screens[cur].init)();
if (sigprocmask(SIG_SETMASK, &oldmask, NULL) < 0)
err_sys("cannot unblock SIGWINCH");
if (sigsetjmp(env_winch, true) == 0) {
env_winch_ready = true;
do {
int key = (*screens[cur].loop)(w_menu);
if (key <= 0)
usleep(5000);
/*
* Translate vt100 PF1..4 escape sequences sent
* by some X terminals (e.g. aterm) into F1..F4.
*/
switch (key) {
case 033:
escape = 1;
break;
case 'O':
escape = 2;
break;
default:
if ('P' <= key && key <= 'S' && escape == 2)
key = KEY_F(key - 'P' + 1);
escape = 0;
}
/* Main menu */
for (enum wavemon_screen s = SCR_INFO; s <= SCR_QUIT; s++) {
if (*screens[s].key_name && (
(unsigned)key == (s == SCR_QUIT ? '0' : '1' + s) ||
(unsigned)key == KEY_F(s + 1) ||
key == screens[s].shortcut)) {
next = s;
break;
}
}
} while (next == cur);
}
delwin(w_menu);
(*screens[cur].fini)();
/*
* next = cur is set in the protected critical section before
* sigsetjmp. Due to the loop condition, it can not occur when
* no SIGWINCH occurred, hence it indicates a resizing event.
*/
if (next == cur) {
struct winsize size;
if (ioctl(STDIN_FILENO, TIOCGWINSZ, &size) < 0)
err_sys("can not determine terminal size");
resizeterm(size.ws_row, size.ws_col);
check_geometry();
}
clear();
refresh();
}
curs_set(1);
endwin();
return EXIT_SUCCESS;
}
uoaerg-wavemon-fb158b0/wavemon.h 0000664 0000000 0000000 00000024773 15142173343 0016724 0 ustar 00root root 0000000 0000000 /*
* wavemon - a wireless network monitoring application
*
* Copyright (c) 2001-2002 Jan Morgenstern
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#if defined(HAVE_LIBNCURSESW) && defined(HAVE_NCURSESW_CURSES_H)
#include
#else
#include
#endif
#include "llist.h"
/**
* Minimum screen dimensions.
* The number of lines depends on the size requirements of scr_info(). The
* number of columns comes from the menubar length (10 items of length 6
* plus the 'Fxx'). This value was also chosen since 24x80 is a very common
* screen size, in particular allowing the use on the console.
*/
enum info_screen_geometry {
WH_IFACE = 2, /* 'Interface' area at the top */
WH_LEVEL = 9, /* Level meters */
WH_STATS = 3, /* WiFi statistics area */
WH_INFO = 8, /* WiFi information area */
WH_NET = 7, /* Network interface information area */
WH_MENU = 1 /* Menu bar at the bottom */
};
#define WH_INFO_SCR_BASE (WH_IFACE + WH_LEVEL + WH_STATS + WH_MENU)
#define MIN_SCREEN_LINES (WH_INFO_SCR_BASE + WH_INFO + WH_NET)
#define MIN_SCREEN_COLS 80
/*
* Screen layout constants.
*
* All windows extend over the whole screen width; the vertical number of
* rows is reduced by one due to the menubar at the bottom of the screen.
*/
#define WAV_WIDTH (COLS)
#define WAV_HEIGHT (LINES-1)
/*
* Maximum length of a menubar key entry
*/
#define MAX_MENU_KEY (MIN_SCREEN_COLS/10)
/*
* Maximum lengths/coordinates inside the bordered screen.
*
* The printable window area is constrained by the frame lines connecting
* the corner points (0, 0), (0, COLS-1), (LINES-1, 0), (LINES-1, COLS-1).
*/
#define MAXXLEN (WAV_WIDTH - 2)
#define MAXYLEN (WAV_HEIGHT - 2)
/* Number of seconds to display a warning message outside ncurses mode */
#define WARN_DISPLAY_DELAY 1
/* Maximum length of a formatted SSID. */
#define MAX_ESSID_LEN 32
/*
* Symbolic names for scan sort order comparison.
*/
enum scan_sort_order {
SO_CHAN,
SO_SIGNAL,
SO_MAC,
SO_ESSID,
SO_OPEN,
SO_CHAN_SIG,
SO_OPEN_SIG
};
/** Band filtering (2.4 GHz / 5 GHz / Both) */
enum scan_filter_band {
SCAN_FILTER_BAND_BOTH,
SCAN_FILTER_BAND_2G,
SCAN_FILTER_BAND_5G
};
/*
* Global in-memory representation of current wavemon configuration state
*/
extern struct wavemon_conf {
int if_idx; /* Index into interface list */
int stat_iv,
info_iv;
int sig_min, sig_max,
noise_min, noise_max;
int lthreshold,
hthreshold;
int slotsize,
meter_decay;
/* Boolean values */
int check_geometry, /* Ensure window is large enough */
cisco_mac, /* Cisco-style MAC addresses */
transparent_bg, /* Use terminal background instead of black */
override_bounds, /* Override autodetection */
scan_sort_asc, /* Direction of @scan_sort_order */
scan_hidden_essids; /* Whether to include hidden SSIDs */
/* Enumerated values */
int scan_sort_order, /* channel|signal|open|chan/sig ... */
scan_filter_band, /* 2.4ghz|5ghz|both */
lthreshold_action, /* disabled|beep|flash|beep+flash */
hthreshold_action, /* disabled|beep|flash|beep+flash */
startup_scr; /* info|histogram|aplist */
} conf;
/*
* Initialisation & Configuration
*/
extern void getconf(int argc, char *argv[]);
/* Configuration items to manipulate the current configuration */
struct conf_item {
char *name, /* name for preferences screen */
*cfname; /* name for wavemonrc(5) */
enum { /* type of parameter */
t_int, /* @v.i is interpreted as raw value */
t_list, /* @v.i is an index into @list */
t_sep, /* dummy, separator entry */
t_func /* void (*fp) (void) */
} type;
union { /* type-dependent container for value */
int *i; /* t_int and t_list index into @list */
void (*fp)(); /* t_func */
} v;
char **list; /* t_list: NULL-terminated array of strings */
int *dep; /* dependency */
bool hidden; /* only allow to set via wavemonrc(5) */
int min, /* value boundaries */
max,
inc; /* increment for value changes */
char *unit; /* name of units to display */
};
/*
* Screen functions
*/
enum wavemon_screen {
SCR_INFO, /* F1 */
SCR_LHIST, /* F2 */
SCR_SCAN, /* F3 */
SCR_EMPTY_F4, /* placeholder */
SCR_EMPTY_F5, /* placeholder */
SCR_EMPTY_F6, /* placeholder */
SCR_PREFS, /* F7 */
SCR_HELP, /* F8 */
SCR_ABOUT, /* F9 */
SCR_QUIT /* F10 */
};
extern void scr_info_init(void);
extern int scr_info_loop(WINDOW *w_menu);
extern void scr_info_fini(void);
extern void scr_lhist_init(void);
extern int scr_lhist_loop(WINDOW *w_menu);
extern void scr_lhist_fini(void);
extern void scr_aplst_init(void);
extern int scr_aplst_loop(WINDOW *w_menu);
extern void scr_aplst_fini(void);
extern void scr_conf_init(void);
extern int scr_conf_loop(WINDOW *w_menu);
extern void scr_conf_fini(void);
extern void scr_help_init(void);
extern int scr_help_loop(WINDOW *w_menu);
extern void scr_help_fini(void);
extern void scr_about_init(void);
extern int scr_about_loop(WINDOW *w_menu);
extern void scr_about_fini(void);
/*
* Ncurses definitions and functions
*/
extern WINDOW *newwin_title(int y, int h, const char *title, bool nobottom);
extern WINDOW *wmenubar(const enum wavemon_screen active);
extern void wclrtoborder(WINDOW *win);
extern void mvwclrtoborder(WINDOW *win, int y, int x);
extern void wadd_attr_str(WINDOW *win, const int attrs, const char *s);
static inline void waddstr_b(WINDOW * win, const char *s)
{
wadd_attr_str(win, A_BOLD, s);
}
extern void waddstr_center(WINDOW * win, int y, const char *s);
extern const char *curtail(const char *str, const char *sep, size_t len);
extern void waddbar(WINDOW *win, int y, float v, float min, float max,
int8_t *cscale, bool rev);
extern void waddthreshold(WINDOW *win, int y, float v, float tv,
float minv, float maxv, int8_t *cscale, chtype tch);
enum colour_pair {
/* CP_STANDARD must be 0 for transparency to work */
CP_STANDARD,
CP_RED,
CP_YELLOW,
CP_GREEN,
CP_CYAN,
CP_BLUE,
CP_RED_ON_BLUE,
CP_GREEN_ON_BLUE,
CP_CYAN_ON_BLUE,
CP_BLUE_ON_BLUE,
};
static inline int cp_from_scale(float value, int8_t const *cscale, bool reverse)
{
enum colour_pair cp;
if (value < (float)cscale[0])
cp = reverse ? CP_RED : CP_GREEN;
else if (value < (float)cscale[1])
cp = CP_YELLOW;
else
cp = reverse ? CP_GREEN : CP_RED;
return COLOR_PAIR(cp);
}
/*
* Wireless interfaces
*/
extern void conf_get_interface_list(void);
extern const char *conf_ifname(void);
/*
* Error handling
*/
extern bool has_net_admin_capability(void);
extern void err_msg(const char *format, ...);
extern void err_quit(const char *format, ...);
extern void err_sys(const char *format, ...);
/*
* Helper functions
*/
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
static inline void (*xsignal(int signo, void (*handler)(int)))(int)
{
struct sigaction old_sa, sa = { .sa_handler = handler, .sa_flags = 0 };
if (sigemptyset(&sa.sa_mask) < 0 || sigaction(signo, &sa, &old_sa) < 0)
err_sys("xsignal(%d) failed", signo);
return old_sa.sa_handler;
}
/** Return the length of the NULL-terminated array @argv. */
static inline size_t argv_count(char **argv)
{
size_t cnt = 0;
assert(argv != NULL);
while (*argv++)
cnt++;
return cnt;
}
/** Find any entry in @argv whose prefix is @what. */
static inline int argv_find(char **argv, const char *what)
{
const size_t len = strlen(what);
for (size_t i = 0; argv[i]; i++)
if (strncasecmp(argv[i], what, len) == 0)
return i;
return -1;
}
static inline void str_tolower(char *s)
{
for (; s && *s; s++)
*s = tolower(*s);
}
/* Check if @str is printable (compare iw_essid_escape()) */
static inline bool str_is_ascii(char *s)
{
if (!s || !*s)
return false;
for (; *s; s++)
if (!isascii(*s) || iscntrl(*s))
return false;
return true;
}
/* number of digits needed to display integer part of @val */
static inline int num_int_digits(const double val)
{
return 1 + (val > 1.0 ? log10(val) : val < -1.0 ? log10(-val) : 0);
}
static inline int max(const int a, const int b)
{
return a > b ? a : b;
}
static inline bool in_range(int val, int min, int max)
{
return min <= val && val <= max;
}
static inline int clamp(int val, int min, int max)
{
return val < min ? min : (val > max ? max : val);
}
/* SI units -- see units(7) */
static inline char *byte_units(const double bytes)
{
static char result[0x100];
if (bytes >= 1 << 30)
sprintf(result, "%0.2lf GiB", bytes / (1 << 30));
else if (bytes >= 1 << 20)
sprintf(result, "%0.2lf MiB", bytes / (1 << 20));
else if (bytes >= 1 << 10)
sprintf(result, "%0.2lf KiB", bytes / (1 << 10));
else
sprintf(result, "%.0lf B", bytes);
return result;
}
/* Integer units - similar to %g for float. */
static inline char *int_counts(uint32_t count)
{
static char result[0x10];
if (count < 1e3)
sprintf(result, "%u", count);
else if (count < 1e9)
sprintf(result, "%.0fk", count/1e3);
else
sprintf(result, "%.1G", (double)count);
return result;
}
/**
* Compute exponentially weighted moving average
* @mavg: old value of the moving average
* @sample: new sample to update @mavg
* @weight: decay factor for new samples, 0 < weight <= 1
*/
static inline double ewma(double mavg, double sample, double weight)
{
return mavg == 0 ? sample : weight * mavg + (1.0 - weight) * sample;
}
/* map 0.0 <= ratio <= 1.0 into min..max */
static inline double map_val(double ratio, double min, double max)
{
return min + ratio * (max - min);
}
/* map minv <= val <= maxv into the range min..max (no clamping) */
static inline double map_range(double val, double minv, double maxv,
double min, double max)
{
return map_val((val - minv) / (maxv - minv), min, max);
}
/* map val into the reverse range max..min */
static inline int reverse_range(int val, int min, int max)
{
assert(min <= val && val <= max);
return max - (val - min);
}
uoaerg-wavemon-fb158b0/wavemonrc.5 0000664 0000000 0000000 00000006776 15142173343 0017171 0 ustar 00root root 0000000 0000000 .TH wavemonrc 5 "September 2021" Linux "User Manuals"
.SH NAME
$XDG_CONFIG_HOME/wavemon/wavemonrc \- wavemon configuration file
.SH DESCRIPTION
\fIwavemonrc\fR is the per-user configuration file for \fBwavemon\fR(1).
This page describes its individual configuration options. Each corresponds
to a configuration item of the \fIPreferences\fR screen (F7 key), whose
on-screen name is shown in parentheses.
.P
.B interface =
.RS
.RE
(Interface)
.RS
Selects the wireless interface to use.
.P
.RE
.B cisco_mac = (on|off)
.RS
.RE
(Cisco-style MAC addresses)
.RS
If enabled, display MAC addresses using lower-case hex digits separated by dots
rather than colons.
.P
.RE
.B scan_filter_band = (2.4ghz|5ghz|both)
.RS
.RE
(Scan band selection)
.RS
Filter bands in the scan window: \fI2.4ghz\fR (2.4GHz only), \fI5ghz\fR (5GHz only), or \fIboth\fR (show both bands).
.P
.RE
.B scan_hidden_essids = (on|off)
.RS
.RE
(Scan hidden ESSIDs)
.RS
Whether the scan window should include hidden ESSIDs.
.P
.RE
.B sort_order = (channel|essid|mac|signal|open|chan/sig|open/sig)
.RS
.RE
(Scan sort type)
.RS
Determines the ordering used in the scan window: \fIchannel\fR sorts by channel number, \fIessid\fR by
access point name, \fImac\fR by MAC address, \fIsignal\fR by signal strength, and \fIopen\fR by openness.
The combined variants \fIchan/sig\fR and \fIopen/sig\fR sort first by channel/openness and then by signal strength.
It also affects the status line at the bottom: normally the most crowded channels are listed,
sorting by \fIchannel\fR in descending order switches to least crowded ones instead.
.P
.RE
.B sort_ascending = (on|off)
.RS
.RE
(Scan sort direction)
.RS
Sets the direction of the \fIsort_order\fR: ascending (on) or descending (off).
.P
.P
.RE
.B stat_updates =
.RS
.RE
(Statistics updates)
.RS
Time interval for polling new statistics (including scan refresh). Range: 10..4000ms.
.P
.RE
.B lhist_slot_size =
.RS
.RE
(Histogram update cycles)
.RS
Number of samples used per each histogram slot. For example, if the stat_updates
interval is 500ms and the histogram slot size is 4, the histogram is moved
one slot further every 2 seconds. Range: 1..64.
.P
.RE
.B meter_smoothness =
.RS
.RE
(Level meter smoothness)
.RS
Determines the responsiveness of level meters, tracking the moving average
rather than following each new sample. The given value specifies the percentage
of the history (the 'inertia') of preceding samples. A value of 0 disables
this option. Range: 0..99%.
.P
.RE
.B info_updates =
.RS
.RE
(Dynamic info updates)
.RS
Sets refresh rate for dynamic device parameters (e.g. bitrate) and the
refresh interval for the Scan window (F3). Range: 1..60s.
.P
.RE
.B override_auto_scale = (on|off)
.RS
.RE
(Override scale autodetect)
.RS
Override the auto-scaling of the bar graphs and histogram, allowing you to set your own scales.
.P
.RE
.B min_signal_level, max_signal_level =
.RS
.RE
(Minimum signal level, Maximum signal level)
.RS
Set the left and right boundaries of the signal level scales. Ranges: \-100..\-39 (minimum) and \-40..\-10dBm (maximum).
.P
.RE
.B transparent_bg = (on|off)
.RS
.RE
(Use a transparent background)
.RS
Use a transparent background instead of black. This is enabled by default and can only be turned off via the startup file.
.P
.RE
.B startup_screen = (info|histogram|scan window)
.RS
.RE
(Startup screen)
.RS
Which of the screens appears at program startup.
.SH "AUTHOR"
Written by Jan Morgenstern .
.SH "REPORTING BUGS"
Open an issue on \fIhttps://github.com/uoaerg/wavemon/issues\fR.