From dac9fede8c1064797eee70cca6946d05b7a929f9 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sun, 10 Aug 2003 19:56:53 +0000 Subject: Great cleanup Ready for first release git-svn-id: file:///home/lennart/svn/public/aeswepd/trunk@4 022f378f-78c4-0310-b860-d162c87e6274 --- LICENSE | 340 +++++++++++++++++++++++++++++++++++++++++++++++ Makefile.am | 22 +-- bootstrap.sh | 12 +- conf/Makefile.am | 42 ++++++ conf/scripts/Makefile.am | 37 ++++++ conf/scripts/default | 44 ------ conf/scripts/default.in | 62 +++++++++ conf/waproamd.conf | 37 ++++++ conf/waproamd.init.in | 64 +++++++++ configure.ac | 62 ++++++++- doc/Makefile.am | 20 +++ doc/README | 1 + src/Makefile.am | 51 ++++++- src/aes.c | 20 +++ src/aes.h | 20 +++ src/aeswepd.c | 32 +++-- src/aeswepd.h | 27 ++++ src/assocwatch.c | 20 +++ src/assocwatch.h | 20 +++ src/exec.c | 20 +++ src/exec.h | 20 +++ src/ifmonitor.c | 20 +++ src/ifmonitor.h | 20 +++ src/interface.c | 21 +++ src/interface.h | 22 ++- src/iwapi.c | 20 +++ src/iwapi.h | 20 +++ src/iwkey.c | 20 +++ src/iwkey.h | 20 +++ src/nlapi.c | 20 +++ src/nlapi.h | 20 +++ src/util.c | 20 +++ src/util.h | 21 ++- src/waproamd.c | 33 +++-- src/waproamd.h | 36 +++++ src/wireless.h | 27 ++++ 36 files changed, 1221 insertions(+), 92 deletions(-) create mode 100644 LICENSE create mode 100644 conf/Makefile.am create mode 100644 conf/scripts/Makefile.am delete mode 100755 conf/scripts/default create mode 100755 conf/scripts/default.in create mode 100644 conf/waproamd.conf create mode 100755 conf/waproamd.init.in create mode 100644 doc/Makefile.am create mode 100644 doc/README create mode 100644 src/waproamd.h create mode 100644 src/wireless.h diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d60c31a --- /dev/null +++ b/LICENSE @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) 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 +this service 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 make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. 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. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +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 +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the 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 a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE 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. + + 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 +convey 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 2 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, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision 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, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This 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 Library General +Public License instead of this License. diff --git a/Makefile.am b/Makefile.am index 17aafcf..a9be40e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,23 +1,23 @@ -# $Id: Makefile.am 22 2003-06-15 16:36:33Z lennart $ +# $Id$ -# This file is part of wepkeyd. +# This file is part of waproamd. # -# wepkeyd is free software; you can redistribute it and/or modify it +# waproamd 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 2 of the License, or # (at your option) any later version. # -# wepkeyd is distributed in the hope that it will be useful, but +# waproamd 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 wepkeyd; if not, write to the Free Software Foundation, +# along with waproamd; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. EXTRA_DIST=bootstrap.sh README LICENSE -SUBDIRS=src #man conf doc patches +SUBDIRS=src conf doc #man MAINTAINERCLEANFILES = README noinst_DATA = README @@ -25,11 +25,11 @@ noinst_DATA = README README: rm -f README # $(MAKE) -C doc README - ln -s doc/README README + cd $(srcdir) && ln -s doc/README README homepage: test -d $$HOME/homepage/lennart - mkdir -p $$HOME/homepage/lennart/projects/wepkeyd - cp *.tar.gz $$HOME/homepage/lennart/projects/wepkeyd - cp doc/README.html doc/style.css doc/NEWS $$HOME/homepage/lennart/projects/wepkeyd - cp $$HOME/homepage/lennart/projects/wepkeyd/README.html $$HOME/homepage/lennart/projects/wepkeyd/index.html + mkdir -p $$HOME/homepage/lennart/projects/waproamd + cp *.tar.gz $$HOME/homepage/lennart/projects/waproamd + cp doc/README.html doc/style.css doc/NEWS $$HOME/homepage/lennart/projects/waproamd + cp $$HOME/homepage/lennart/projects/waproamd/README.html $$HOME/homepage/lennart/projects/waproamd/index.html diff --git a/bootstrap.sh b/bootstrap.sh index 1a9ef00..c998385 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,20 +1,20 @@ #!/bin/sh -# $Id: bootstrap.sh 20 2003-07-10 16:21:55Z lennart $ +# $Id$ -# This file is part of wepkeyd. +# This file is part of waproamd. # -# wepkeyd is free software; you can redistribute it and/or modify it +# waproamd 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 2 of the License, or # (at your option) any later version. # -# wepkeyd is distributed in the hope that it will be useful, but +# waproamd 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 wepkeyd; if not, write to the Free Software Foundation, +# along with waproamd; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. if [ "x$1" = "xam" ] ; then @@ -34,6 +34,6 @@ else automake -a -c autoconf -Wall - ./configure --sysconfdir=/etc "$@" + ./configure --enabled-maintainer-mode --sysconfdir=/etc "$@" fi diff --git a/conf/Makefile.am b/conf/Makefile.am new file mode 100644 index 0000000..e5b252f --- /dev/null +++ b/conf/Makefile.am @@ -0,0 +1,42 @@ +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or +# (at your option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +SUBDIRS = scripts + +if BUILD_WAPROAMD + +noinst_DATA = waproamd.init waproamd.conf + +EXTRA_DIST = waproamd.init.in waproamd.conf + +CLEANFILES = waproamd.init + +waproamd.init: waproamd.init.in Makefile + sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@sbindir\@,$(sbindir),g' $< > $@ + chmod 755 $@ + +install-data-local: waproamd.init + $(INSTALL) -D -m755 waproamd.init ${DESTDIR}/${sysconfdir}/init.d/waproamd + $(INSTALL) -D -m644 $(srcdir)/waproamd.conf ${DESTDIR}/${sysconfdir}/waproamd/waproamd.conf + mkdir -p ${DESTDIR}/${sysconfdir}/waproamd/keys + +uninstall-local: + rmdir ${DESTDIR}/${sysconfdir}/waproamd/keys + rm -f ${DESTDIR}/${sysconfdir}/init.d/waproamd ${DESTDIR}/${sysconfdir}/waproamd/waproamd.conf + +endif diff --git a/conf/scripts/Makefile.am b/conf/scripts/Makefile.am new file mode 100644 index 0000000..97a94d3 --- /dev/null +++ b/conf/scripts/Makefile.am @@ -0,0 +1,37 @@ +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or +# (at your option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +if BUILD_WAPROAMD + +noinst_DATA = default + +EXTRA_DIST = default.in + +CLEANFILES = default + +default: default.in Makefile + sed -e 's,@sysconfdir\@,$(sysconfdir),g' -e 's,@sbindir\@,$(sbindir),g' $< > $@ + chmod 755 $@ + +install-data-local: default + $(INSTALL) -D -m755 default ${DESTDIR}/${sysconfdir}/waproamd/scripts/default + +uninstall-local: + rm -f ${DESTDIR}/${sysconfdir}/waproamd/scripts/default + +endif diff --git a/conf/scripts/default b/conf/scripts/default deleted file mode 100755 index a871c39..0000000 --- a/conf/scripts/default +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh - -KEYDIR=. - -if [ -z "$AP" -o -z "$IFACE" ] ; then - echo "Corrupt environment" > /dev/stderr - exit 1 -fi - -if test -r "$KEYDIR/$AP.aes" ; then - METHOD=aes -else if test -r "$KEYDIR/$AP.wep" ; then - METHOD=wep -else - METHOD=open -fi ; fi - -echo "Settings policy '$METHOD' for AP $AP" - -case "$1.$METHOD" in - start.aes) - iwconfig $IFACE key on - aeswepd -i $IFACE -w -F "$KEYDIR/$AP.aes" - ;; - - stop.aes) - aeswepd -i $IFACE -k - iwconfig $IFACE key off - ;; - - start.wep) - iwconfig $IFACE key "`cat $KEYDIR/$AP.wep`" [1] key restricted key [1] key on - ;; - - *.open|stop.wep) - iwconfig $IFACE key off - ;; - *) - echo "Unknown command\n" > /dev/stderr - exit 1 - ;; -esac - -exit 0 diff --git a/conf/scripts/default.in b/conf/scripts/default.in new file mode 100755 index 0000000..02bdca4 --- /dev/null +++ b/conf/scripts/default.in @@ -0,0 +1,62 @@ +#!/bin/sh + +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or +# (at your option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +KEYDIR="@sysconfdir@/waproamd/keys" + +if [ -z "$AP" -o -z "$IFACE" ] ; then + echo "Corrupt environment" > /dev/stderr + exit 1 +fi + +if test -r "$KEYDIR/$AP.aes" ; then + METHOD=aes +else if test -r "$KEYDIR/$AP.wep" ; then + METHOD=wep +else + METHOD=open +fi ; fi + +echo "Settings policy '$METHOD' for AP $AP" + +case "$1.$METHOD" in + start.aes) + iwconfig $IFACE key on + aeswepd -i $IFACE -w -F "$KEYDIR/$AP.aes" + ;; + + stop.aes) + aeswepd -i $IFACE -k + iwconfig $IFACE key off + ;; + + start.wep) + iwconfig $IFACE key "`cat $KEYDIR/$AP.wep`" [1] key restricted key [1] key on + ;; + + *.open|stop.wep) + iwconfig $IFACE key off + ;; + *) + echo "Unknown command\n" > /dev/stderr + exit 1 + ;; +esac + +exit 0 diff --git a/conf/waproamd.conf b/conf/waproamd.conf new file mode 100644 index 0000000..35d1ee1 --- /dev/null +++ b/conf/waproamd.conf @@ -0,0 +1,37 @@ +# -*-sh-*- +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or (at your +# option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +# waproamd configuration file + +# Please note that this is a bourne shell fragment sourced by the +# init script of waproamd. + +# Specify the interfaces to control here, separated by spaces. +# Waproamd processes will be started for each of these interfaces +# when the waproamd init script is called with the "start" argument. +INTERFACES="wlan0" + +# Additional parameters for waproamd. +# (Run "waproamd -h" for further information.) +ARGS="-wM" + +# Additional parameters for waproamd for the specified interface. Note +# that $ARGS is ignored, when a variable like this is set for an +# interface +#ARGS_wlan0="-wM" diff --git a/conf/waproamd.init.in b/conf/waproamd.init.in new file mode 100755 index 0000000..891cd24 --- /dev/null +++ b/conf/waproamd.init.in @@ -0,0 +1,64 @@ +#!/bin/sh +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or (at your +# option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +CFG=@sysconfdir@/waproamd/waproamd.conf + +WAPROAMD=@sbindir@/waproamd +test -x $WAPROAMD || exit 0 + +if [ `id -u` != "0" ] && [ "$1" = "start" -o "$1" = "stop" ] ; then + echo "You must be root to start, stop or restart waproamd." + exit 1 +fi + +[ -f $CFG ] && . $CFG + +case "$1" in + start) + echo -n "Starting Wireless Access Point Roaming Daemon:" + for IF in $INTERFACES ; do + $WAPROAMD -i $IF $ARGS + echo -n " $IF" + done + echo "." + ;; + stop) + echo -n "Stopping Wireless Access Point Roaming Daemon:" + for IF in $INTERFACES ; do + $WAPROAMD -k -i $IF + echo -n " $IF" + done + echo "." + ;; + status) + for IF in $INTERFACES ; do + $WAPROAMD -c -i $IF + done + ;; + force-reload|restart) + $0 stop + sleep 3 + $0 start + ;; + *) + echo "Usage: $0 {start|stop|restart|force-reload|status}" + exit 1 +esac + +exit 0 diff --git a/configure.ac b/configure.ac index 76c0677..60f7381 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ # -*- Autoconf -*- # Process this file with autoconf to produce a configure script. -# $Id: Makefile.am 22 2003-06-15 16:36:33Z lennart $ +# $Id$ # This file is part of waproamd. # @@ -27,17 +27,39 @@ AM_INIT_AUTOMAKE([foreign -Wall]) AM_MAINTAINER_MODE # Checks for programs. -AC_PROG_CXX AC_PROG_CC +AC_PROG_LN_S +AC_PROG_MAKE_SET # If using GCC specifiy some additional parameters if test "x$GCC" = "xyes" ; then CFLAGS="$CFLAGS -pipe -Wall" fi +if test -d /usr/local/stow ; then + AC_MSG_NOTICE([*** Found /usr/local/stow: installing to /usr/local/stow/waproamd-$VERSION *** ]) + AC_PREFIX_DEFAULT([/usr/local/stow/waproamd-$VERSION]) +fi + # Checks for libraries. +AC_HEADER_STDC +AC_HEADER_SYS_WAIT +AC_CHECK_HEADERS([fcntl.h limits.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h unistd.h]) + AC_CHECK_LIB([daemon], [daemon_fork],, [AC_MSG_ERROR([*** Sorry, you have to install libdaemon ***])]) -AC_CHECK_LIB([mcrypt], [mcrypt_module_open],, [AC_MSG_ERROR([*** Sorry, you have to install libmcrypt ***])]) +AC_CHECK_LIB([mcrypt], [mcrypt_module_open], [MCRYPT=1 AC_DEFINE(HAVE_MCRYPT, 1, [libmcrypt available])], [MCRYPT=0]) + +AC_C_CONST +AC_TYPE_MODE_T +AC_TYPE_PID_T +AC_HEADER_TIME + +AC_FUNC_FORK +AC_PROG_GCC_TRADITIONAL +AC_FUNC_MALLOC +AC_FUNC_MEMCMP +AC_FUNC_SELECT_ARGTYPES +AC_CHECK_FUNCS([dup2 ftruncate memset select setenv socket strchr strcspn strdup strerror strrchr]) # LYNX documentation generation AC_ARG_ENABLE(lynx, @@ -78,5 +100,37 @@ fi AM_CONDITIONAL([USE_XMLTOMAN], [test "x$xmltoman" = xyes]) -AC_CONFIG_FILES([src/Makefile Makefile]) # man/Makefile conf/Makefile doc/Makefile doc/README.html patches/Makefile waproamd.spec]) +# Build aeswepd? +AC_ARG_ENABLE(aeswepd, + AC_HELP_STRING([--disable-aeswepd], [Disable building of aeswepd]), +[case "${enableval}" in + yes) aeswepd=yes ;; + no) aeswepd=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --disable-aeswepd]) ;; +esac], [aeswepd=yes]) + +# Build waproamd? +AC_ARG_ENABLE(waproamd, + AC_HELP_STRING([--disable-waproamd], [Disable building of waproamd]), +[case "${enableval}" in + yes) waproamd=yes ;; + no) waproamd=no ;; + *) AC_MSG_ERROR([bad value ${enableval} for --disable-waproamd]) ;; +esac], [waproamd=yes]) + +if test x$aeswepd = xno && test x$waproamd = xno ; then + AC_MSG_ERROR([*** If you build neither aeswepd nor waproamd, nothing gets built ***]) +fi + +if test x$aeswepd = xyes && test x$MCRYPT != x1 ; then + AC_MSG_ERROR([*** Sorry, you have to install libmcrypt or use --disable-aeswepd ***]) +fi + +AM_CONDITIONAL([BUILD_AESWEPD], [test "x$aeswepd" = xyes]) +AM_CONDITIONAL([BUILD_WAPROAMD], [test "x$waproamd" = xyes]) + +AC_CONFIG_FILES([src/Makefile Makefile conf/Makefile conf/scripts/Makefile doc/Makefile]) # man/Makefile doc/Makefile doc/README.html]) AC_OUTPUT + +AC_MSG_NOTICE([*** aeswepd is built: $aeswepd ***]) +AC_MSG_NOTICE([*** waproamd is built: $waproamd ***]) diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..d36fe90 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,20 @@ +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or +# (at your option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + +EXTRA_DIST=README + diff --git a/doc/README b/doc/README new file mode 100644 index 0000000..e9cfad8 --- /dev/null +++ b/doc/README @@ -0,0 +1 @@ +Sorry, no README yet. diff --git a/src/Makefile.am b/src/Makefile.am index a55c459..1080a15 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,6 +1,51 @@ +# $Id$ + +# This file is part of waproamd. +# +# waproamd 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 2 of the License, or +# (at your option) any later version. +# +# waproamd 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 waproamd; if not, write to the Free Software Foundation, +# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + AM_CFLAGS = -DSYSCONFDIR="\"$(sysconfdir)\"" -sbin_PROGRAMS = waproamd aeswepd +sbin_PROGRAMS = + +if BUILD_WAPROAMD +sbin_PROGRAMS += waproamd + +waproamd_SOURCES = waproamd.c waproamd.h \ + interface.c interface.h \ + iwapi.c iwapi.h \ + util.c util.h \ + exec.c exec.h \ + nlapi.c nlapi.h \ + assocwatch.c assocwatch.h \ + ifmonitor.c ifmonitor.h \ + wireless.h wireless.15.h +endif + +if BUILD_AESWEPD +sbin_PROGRAMS += aeswepd + +aeswepd_SOURCES = aeswepd.c aeswepd.h \ + aes.c aes.h \ + interface.c interface.h \ + iwkey.c iwkey.h \ + util.c util.h \ + wireless.h wireless.15.h + +aeswepd_LDADD = -lmcrypt -aeswepd_SOURCES = aeswepd.c aeswepd.h aes.c aes.h interface.c interface.h iwkey.c iwkey.h util.c util.h -waproamd_SOURCES = waproamd.c interface.c interface.h iwapi.c iwapi.h util.c util.h exec.c exec.h nlapi.c nlapi.h assocwatch.c assocwatch.h ifmonitor.c ifmonitor.h +install-exec-hook: + cd $(DESTDIR)/$(sbindir) && ln -sf aeswepd aeswepls +endif diff --git a/src/aes.c b/src/aes.c index 5165992..944da03 100644 --- a/src/aes.c +++ b/src/aes.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/aes.h b/src/aes.h index cb00254..8d0f25a 100644 --- a/src/aes.h +++ b/src/aes.h @@ -1,6 +1,26 @@ #ifndef fooaeshfoo #define fooaeshfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include int aes_crypt(uint8_t *key, uint8_t *data, uint8_t *result); diff --git a/src/aeswepd.c b/src/aeswepd.c index 9b4c07f..684b224 100644 --- a/src/aeswepd.c +++ b/src/aeswepd.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #define _GNU_SOURCE #include @@ -24,14 +44,6 @@ #include "interface.h" #include "util.h" -#ifdef HAVE_CONFIG_H -#include -#endif - -#ifndef VARLIBAESWEPD -#define VARLIBAESWEPD "/var/lib/aeswepd" -#endif - uint8_t aes_key[AES_KEY_LEN]; int rekey_time = 15*60; int n_max_keys = 3; @@ -55,7 +67,7 @@ const char *get_status_file_name(void) { } -int do_list_keys() { +int do_list_keys(void) { FILE *f; char ln[256]; @@ -338,7 +350,7 @@ void parse_args(int argc, char *argv[]) { b = argv[0]; - if (strcmp(b, "aeswepl") == 0) + if (strcmp(b, "aeswepls") == 0) _list_keys = 1; memset(aes_key, sizeof(aes_key), 0); diff --git a/src/aeswepd.h b/src/aeswepd.h index c3be819..0313ed6 100644 --- a/src/aeswepd.h +++ b/src/aeswepd.h @@ -1,6 +1,26 @@ #ifndef fooaeswepdhfoo #define fooaeswepdhfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #define WEP_KEY_LEN 13 @@ -10,5 +30,12 @@ extern int n_max_keys; extern int key_map[MAX_WEP_KEYS]; +#ifdef HAVE_CONFIG_H +#include +#endif + +#ifndef VARLIBAESWEPD +#define VARLIBAESWEPD "/var/lib/aeswepd" +#endif #endif diff --git a/src/assocwatch.c b/src/assocwatch.c index c3bf5f2..a2191bd 100644 --- a/src/assocwatch.c +++ b/src/assocwatch.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/assocwatch.h b/src/assocwatch.h index 7a06f87..77fd732 100644 --- a/src/assocwatch.h +++ b/src/assocwatch.h @@ -1,6 +1,26 @@ #ifndef fooassocwatchfoo #define fooassocwatchfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include "util.h" int assocwatch_init(int (*cb) (int idx, struct hw_addr *a)); diff --git a/src/exec.c b/src/exec.c index 2e8b33b..f2a37ef 100644 --- a/src/exec.c +++ b/src/exec.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/exec.h b/src/exec.h index 419096c..081e214 100644 --- a/src/exec.h +++ b/src/exec.h @@ -1,6 +1,26 @@ #ifndef fooexehfoo #define fooexehfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + int log_exec(const char *dir, const char *prog, const char *arg); #endif diff --git a/src/ifmonitor.c b/src/ifmonitor.c index b1124a5..c1e05ec 100644 --- a/src/ifmonitor.c +++ b/src/ifmonitor.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/ifmonitor.h b/src/ifmonitor.h index cdbb5dd..f860dc2 100644 --- a/src/ifmonitor.h +++ b/src/ifmonitor.h @@ -1,6 +1,26 @@ #ifndef fooifmonitorhfoo #define fooifmonitorhfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + int ifmonitor_init(int (*cb) (int b, int index, unsigned short type, const char *name)); #endif diff --git a/src/interface.c b/src/interface.c index 5fa7dfb..72030c3 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include @@ -8,6 +28,7 @@ #include "interface.h" #include "util.h" +#include "wireless.h" struct interface *interface_open(char *name) { struct interface* i = NULL; diff --git a/src/interface.h b/src/interface.h index b6f3b9d..c05c5b3 100644 --- a/src/interface.h +++ b/src/interface.h @@ -1,8 +1,28 @@ #ifndef foointerfacehfoo #define foointerfacehfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include -#include "wireless.h" +#include #include "util.h" struct interface { diff --git a/src/iwapi.c b/src/iwapi.c index 5662548..e9b4177 100644 --- a/src/iwapi.c +++ b/src/iwapi.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/iwapi.h b/src/iwapi.h index bf65829..9a15387 100644 --- a/src/iwapi.h +++ b/src/iwapi.h @@ -1,6 +1,26 @@ #ifndef fooiwapihfoo #define fooiwapihfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include "interface.h" #include "wireless.h" #include "util.h" diff --git a/src/iwkey.c b/src/iwkey.c index 3875594..b4b44c5 100644 --- a/src/iwkey.c +++ b/src/iwkey.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/iwkey.h b/src/iwkey.h index 8e412d4..3b39f7e 100644 --- a/src/iwkey.h +++ b/src/iwkey.h @@ -1,6 +1,26 @@ #ifndef fooiwkeyhfoo #define fooiwkeyhfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include "interface.h" #include "aeswepd.h" diff --git a/src/nlapi.c b/src/nlapi.c index 1f6e690..d88a1ed 100644 --- a/src/nlapi.c +++ b/src/nlapi.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/nlapi.h b/src/nlapi.h index 11ee81d..e7e369f 100644 --- a/src/nlapi.h +++ b/src/nlapi.h @@ -1,6 +1,26 @@ #ifndef foonlapihfoo #define foonlapihfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/util.c b/src/util.c index 4728752..9b6061f 100644 --- a/src/util.c +++ b/src/util.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include #include diff --git a/src/util.h b/src/util.h index 8241ddf..fc7805b 100644 --- a/src/util.h +++ b/src/util.h @@ -1,6 +1,26 @@ #ifndef fooutilhfoo #define fooutilhfoo +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #include #include @@ -16,7 +36,6 @@ struct hw_addr { uint8_t addr[ETH_ALEN]; }; - extern struct hw_addr null_ap; void print_hex(FILE *f, uint8_t *w, int l); diff --git a/src/waproamd.c b/src/waproamd.c index c2af3af..430c839 100644 --- a/src/waproamd.c +++ b/src/waproamd.c @@ -1,3 +1,23 @@ +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + #define _GNU_SOURCE #include @@ -20,18 +40,7 @@ #include "nlapi.h" #include "ifmonitor.h" #include "assocwatch.h" - -#ifndef SYSCONFDIR -#define SYSCONFDIR "/etc/waproamd" -#endif - -#ifndef SCRIPTDIR -#define SCRIPTDIR SYSCONFDIR"/scripts" -#endif - -#ifdef HAVE_CONFIG_H -#include -#endif +#include "waproamd.h" char *interface_name = NULL; int interface_index = -1; diff --git a/src/waproamd.h b/src/waproamd.h new file mode 100644 index 0000000..a6faefb --- /dev/null +++ b/src/waproamd.h @@ -0,0 +1,36 @@ +#ifndef foowaproamdhfoo +#define foowaproamdhfoo + +/* $Id$ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#ifndef SYSCONFDIR +#define SYSCONFDIR "/etc" +#endif + +#ifndef SCRIPTDIR +#define SCRIPTDIR SYSCONFDIR"/waproamd/scripts" +#endif + +#ifdef HAVE_CONFIG_H +#include +#endif + +#endif diff --git a/src/wireless.h b/src/wireless.h new file mode 100644 index 0000000..db302a8 --- /dev/null +++ b/src/wireless.h @@ -0,0 +1,27 @@ +#ifndef foowirelesshfoo +#define foowirelesshfoo + +/* $Id: waproamd.c 1.12 Sat, 01 Feb 2003 03:00:07 +0100 lennart $ */ + +/* + * This file is part of waproamd. + * + * waproamd 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 2 of the License, or + * (at your option) any later version. + * + * waproamd 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 waproamd; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + */ + +#include +#include "wireless.15.h" + +#endif -- cgit