diff --git a/COPYING b/COPYING index 606347e..883d3b1 100644 --- a/COPYING +++ b/COPYING @@ -5,7 +5,7 @@ The files in the scripts/python/ directory are released under GNU General Public License (GPL) version 3, or (at your option) any later version. See - "LICENSE.GPL3" in the root of this distribution. + "LICENSE-GPL3" in the root of this distribution. The Perl client module (scripts/perl/Nut.pm) is released under the same license as Perl itself. That is to say either GPL version 1 or (at your option) diff --git a/ChangeLog b/ChangeLog index a21849b..12e3085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,391 @@ +2011-06-01 Arnaud Quette + + * [r3023] docs/download.txt: Add the missing SHA-256 sum on the + Download page / section + * [r3022] NEWS, UPGRADING, configure.in, docs/download.txt, + docs/website/news.txt: Final update for 2.6.1 release + * [r3021] docs/configure.txt: Update '--with-all' option + documentation + * [r3020] configure.in: HAL deprecation (continued): HAL support is + not enabled anymore when using '--with-all' configure option + * [r3019] drivers/mge-hid.c: Add support for 'battery.runtime.low' + * [r3018] data/cmdvartab: Add the missing entry for + 'ups.efficiency' + * [r3017] data/driver.list.in: Add Vivaldi EA200 LED to the list of + richcomm_usb supported models (reported by Sergey Talchuk) + * [r3016] drivers/mge-hid.c: Add 'ups.efficiency' data, supported + by Eaton 5 PX + +2011-05-31 Arnaud Quette + + * [r3015] docs/nut-names.txt: Documentation the new + 'ups.efficiency' NUT variable + * [r3014] data/driver.list.in: Add Eaton 5 PX to the list of + usbhid-ups, mge-shut and newmge-shut supported models + * [r3013] scripts/upower/95-upower-hid.rules: Update UPower script + with Phoenixtec fix + * [r3012] tools/nut-usbinfo.pl: Do not overwrite manufacturer names + with empty values + * [r3011] drivers/liebert-hid.c: Fix USB VendorID 0x06da, which is + Phoenixtec, not Liebert + * [r3010] docs/download.txt: Update Subversion access information, + following Alioth update + * [r3009] docs/download.txt, docs/website/news.txt: Add the Windows + Beta package information + +2011-05-27 Arjen de Korte + + * [r3008] scripts/upower/95-upower-hid.rules: Update upower script + with Powerware entry + * [r3006] drivers/blazer.c: Don't log status read failures until + MAXTRIES subsequent failures. Occasional communication errors are + common for these devices and are not a concern. + +2011-05-26 Arnaud Quette + + * [r3005] drivers/bcmxcp.c, drivers/bcmxcp_ser.c: Improve bcmxcp + support for older PowerWare 9315 (patch from Chris Adams) + +2011-05-25 Arnaud Quette + + * [r3002] server/netinstcmd.c: Fix the missing 'extra value' + handling for instant commands + +2011-05-24 msoltyspl-guest + + * [r2997] drivers/apcsmart.c: apcmsart.c: fix + upsdrv_shutdown_advanced() - with 'continue' statement, sdcmd_*s + ignoring 'n' weren't called. + +2011-05-20 Arjen de Korte + + * [r2994] drivers/blazer_usb.c: Don't use the USB_DEVICE() + declaration macro with non compliant identifiers, such as + blazer_usb' krauler subdriver (missing from previous commit) + +2011-05-20 Arnaud Quette + + * [r2993] drivers/blazer_usb.c, drivers/usb-common.h: Don't use the + USB_DEVICE() declaration macro with non compliant identifiers, + such as blazer_usb' krauler subdriver + +2011-05-19 Arnaud Quette + + * [r2991] server/netlist.c: State explicitely when device + description is not available, to avoid user confusion (reported + by Noel David Torres Taño, Debian bug #595773 + * [r2990] docs/man/powercom.txt, drivers/powercom.c: Improve + formating and wording of the powercom documentation, manual page + and driver messages (patch from Keven L. Ates) + +2011-05-13 Arnaud Quette + + * [r2984] drivers/powercom.c, drivers/powercom.h: Improve PowerCom + BNT 1500A and BNT-other support, and bump driver version to 0.13 + (patch from Keven L. Ates) + +2011-04-30 Arnaud Quette + + * [r2979] data/driver.list.in: Complete Informer Compact supported + VA ratings (reported by Dushan Tcholich) + +2011-04-27 Arnaud Quette + + * [r2978] docs/website/Makefile.am: Enable website quirks to + address Internet Explorer 6, which were missing since 2.6.0 + publication + * [r2977] docs/website/web-layout.conf: Complete meta keywords, and + enable meta name and keywords on all pages + * [r2976] data/driver.list.in: Add Numeric 3000 SW to the list of + blazer_ser supported models (reported by Petr Kubánek) + +2011-04-26 Arjen de Korte + + * [r2975] data/driver.list.in, drivers/blazer_usb.c: Add support + for GE EP series + + [http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-April/006788.html] + +2011-04-18 Arnaud Quette + + * [r2973] drivers/libhid.c: Smarter solution for r2972 (pointed by + Arjen de Korte) + * [r2972] drivers/libhid.c: Trim extraneous end-of-line, in buggy + HID string tables, which results in upsc breaking the + communication pipe (Ubuntu bug #753661) + +2011-04-15 Arnaud Quette + + * [r2971] docs/stable-hcl.txt: Detail existing guidelines for + reporting new device entry + * [r2970] docs/features.txt: Refreshed graphic illustrations + credits + * [r2969] docs/images/advanced.png, docs/images/bigbox.png, + docs/images/bizarre.png, docs/images/simple.png: Refreshed + graphic illustrations (provided by Eaton) + +2011-04-01 Arjen de Korte + + * [r2964] data/driver.list.in: Add Inform Sinus SS 210 to list of + supported devices + + [http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-March/006767.html] + * [r2963] drivers/cps-hid.c: Clamp reported battery charge to 100% + (seems to report AbsoluteStateOfCharge instead of + RemainingCapacity) + + [http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-March/006770.html] + +2011-03-31 fbohe-guest + + * [r2962] data/driver.list.in, drivers/mge-hid.c: Add Eaton + Powerware 9140 to the list of usbhid-ups supported models + +2011-03-29 Arjen de Korte + + * [r2961] drivers/blazer.c, drivers/blazer_usb.c: Make the + terminating '\r' in the Q1 reply optional + +2011-03-29 Arnaud Quette + + * [r2960] lib/libupsclient-config.in, lib/libupsclient.pc.in: Fix + remaining references to LIBSSL_LDFLAGS, instead of LIBSSL_LIBS, + which cause unresolved symbol on libupsclient users (reported by + Fabrice Coutadeur on Ubuntu) + +2011-03-23 fbohe-guest + + * [r2957] INSTALL: Reverting previous commit (should not be in the + trunk) + * [r2956] INSTALL: Add information about installing Windows + +2011-03-18 Arjen de Korte + + * [r2952] include/Makefile.am: The include/nut_stdint.h file is no + longer a generated one (part two) + * [r2951] include/Makefile.am: The include/nut_stdint.h file is no + longer a generated one + * [r2950] configure.in, include, include/nut_stdint.h, + m4/ax_create_stdint_h.m4: Clean up fixed width integer types. + + All C99 capable systems have , which shall include + . + * [r2947] drivers/solis.c: Fix typo in previous commit + * [r2945] drivers/solis.c: Fix compilation warning (no functional + change) + * [r2944] data/driver.list.in: Update driver list for SVEN Power + Pro+ series (recent models ship with a different USB to serial + implementation) + * [r2942] clients/upssched.c, configure.in, drivers/dstate.c, + server/upsd.c: The third argument to accept is an int on HPUX if + _XOPEN_SOURCE_EXTENDED is not defined (reverting previous commit) + * [r2941] configure.in: Quick check to see if defining '-munix=95' + on HPUX fixes a problem with the accept() call + +2011-03-15 Chetan Agarwal + + * [r2936] drivers/rhino.c: Fix compilation error (no functional + change) + * [r2935] drivers/rhino.c: Fix missing comment closure from + previous commit (no functional change) + * [r2934] drivers/bcmxcp_usb.c, drivers/microdowell.c, + drivers/rhino.c, drivers/solis.c: Fix remaining C++ style + comments, to conform to the NUT coding rules (no functional + change) + on behalf of Prachi Gandhi (prachisgandhi@eaton.com) + +2011-03-14 Arjen de Korte + + * [r2933] configure.in: Quick check to see if defining _REENTRANT + on HPUX fixes a compilation warning + +2011-03-14 Arnaud Quette + + * [r2932] data/driver.list.in: Add IPAR Mini Energy ME 800 to the + list of blazer_usb supported models + +2011-03-06 Arjen de Korte + + * [r2930] drivers/apcsmart.c: Fix another compilation warning. Some + compilers (rightfully) claim that the value of 'n' may be used + without initialization. Until this is resolved, skip over this if + the value isn't set. + * [r2929] drivers/apcsmart.c: Fix compilation warning + * [r2928] drivers/apcsmart.h: Add additional Matrix models + [http://lists.alioth.debian.org/pipermail/nut-upsdev/2011-March/005319.html] + * [r2927] drivers/apcsmart.c: Flush the input buffer before sending + a command [on behalf of Michal Soltys ] + * [r2926] drivers/apcsmart.c, drivers/apcsmart.h: protocol_verify() + only cares about explicitly specified commands + and variables [on behalf of Michal Soltys ] + * [r2925] drivers/apcsmart.c: Additional driver variables that can + be set to influence shutdown behavior [on behalf of Michal Soltys + ] + * [r2924] drivers/apcsmart.c: Update version and author info [on + behalf of Michal Soltys ] + * [r2923] drivers/apcsmart.c: Deal with more different shutdown + methods [on behalf of Michal Soltys ] + * [r2922] drivers/apcsmart.c: As 'b' can return different things + than firmware version on some old + models, prefer 'V' over 'b' [on behalf of Michal Soltys + ] + * [r2921] drivers/apcsmart.c: remove superfluous status_commit() + [on behalf of Michal Soltys ] + * [r2920] drivers/apcsmart.c, drivers/apcsmart.h: adjust ignored + chars and handle over/~over [on behalf of Michal Soltys + ] + * [r2919] drivers/apcsmart.c: cosmetics [on behalf of Michal Soltys + ] + * [r2918] drivers/apcsmart.c, drivers/apcsmart.h: remove APC_IGNORE + [on behalf of Michal Soltys ] + * [r2917] drivers/apcsmart.h: add compat hardware, add commands [on + behalf of Michal Soltys ] + * [r2916] drivers/apcsmart.h: comsetics - adjust tabs [on behalf of + Michal Soltys ] + +2011-03-02 Charles Lepple + + * [r2915] docs/FAQ.txt: Update Mac power-on FAQ + +2011-03-01 Arnaud Quette + + * [r2913] drivers/liebert-esp2.c: Improved Liebert ESP II support, + including UPS shutdown (poweroff), 1 and 3-phase input and output + variables, and most input / output / bypass / nominal variables, + along with a fix for the USB to serial cable (patch from Farkas + Levente and Spiros Ioannou) + * [r2912] data/driver.list.in: Add Eaton Powerware 9140, using the + serial interface, to the list of bcmxcp supported models + +2011-02-25 Charles Lepple + + * [r2910] docs/download.txt: Moved SHA-256 value into download + page, and reformatted a bit. + +2011-02-24 Arnaud Quette + + * [r2909] data/driver.list.in: Add several upscode2 supported + devices that were reported on the list: + http://lists.alioth.debian.org/pipermail/nut-upsdev/2011-February/005281.html + http://lists.alioth.debian.org/pipermail/nut-upsuser/2005-July/000031.html + +2011-02-21 Arnaud Quette + + * [r2906] data/driver.list.in, drivers/mge-hid.c: Add Eaton Ellipse + ECO (with Eco control support) to the list of usbhid-ups + supported models + * [r2905] drivers/eaton-mib.c: Add support for the first ambient + sensor (up to 8 sensors can be supported) on Eaton ePDU managed + * [r2904] clients/upsrw.c: Add the missing 'help' handler ('-h') to + the supported options + +2011-02-20 Arjen de Korte + + * [r2903] docs/man/ups.conf.txt, drivers/dstate.c: Variables that + have an override. in ups.conf are now really immutable. + They can't be changed anymore (not even if they would have been + R/W otherwise). Rationale is, that if a user wants to override a + value, we should honor that request. + + Added documentation accordingly (and corrected previous commit). + * [r2902] docs/man/ups.conf.txt, drivers/dstate.c, drivers/main.c: + Add 'ignorelb' flag to list of UPS fields in ups.conf to override + the LB condition reported by the UPS. + + This allows all drivers that report battery.charge + (battery.runtime) to shutdown early by setting this flag and + battery.charge.low (battery.runtime.low) in ups.conf. + * [r2901] data/driver.list.in: Removing subdriver setting (cypress + is auto detected for this VID:PID combination, so there is no + need to specify this in usb.conf) + +2011-02-19 Charles Lepple + + * [r2900] data/driver.list.in: Add Mustek Yukai PowerMust 1000 USB + + Reported by Noel David Torres Taño: + http://lists.alioth.debian.org/pipermail/nut-upsuser/2010-August/006163.html + + Other models may be supported as well. + * http://www.mustek.com.tw/Yukai/html/prod_ups/PowerMust1000.html + * http://www.mustek.com.tw/Yukai/html/UPS.html + +2011-02-17 Arnaud Quette + + * [r2899] docs/download.txt: Preliminary support for source release + hash, using unsigned SHA256 sum + +2011-02-15 Arjen de Korte + + * [r2898] common/parseconf.c: In PCONF_CTX_t, argsize is an array + of type size_t values, so instead of using sizeof(int *) we + really should use sizeof(size_t) for the size of individual + elements + +2011-02-15 Charles Lepple + + * [r2897] data/driver.list.in: Re-add some devices to + driver.list.in from r2516 + + These entries seem to have been dropped, potentially due to the + rename from + driver.list to driver.list.in, and the format change. + +2011-02-11 Arjen de Korte + + * [r2893] drivers/libhid.c: Restore the nut-2.4.1 behavior for + reading reports from devices + +2011-02-09 Arjen de Korte + + * [r2891] drivers/dummy-ups.c: Prefer 'snprintf' and 'snprintfcat' + over 'strncat' (the latter can overflow the destination buffer) + +2011-02-09 fbohe-guest + + * [r2888] drivers/dummy-ups.c: Fix a memory leak in dummy-ups + driver + +2011-02-08 Arjen de Korte + + * [r2887] drivers/apc-hid.c: Add yet another way to shutdown the + APC CS-500 + + [http://lists.alioth.debian.org/pipermail/nut-upsuser/2011-January/006550.html] + +2011-02-02 Arnaud Quette + + * [r2884] drivers/mge-hid.c: Fix a wrong value mapping resolution, + and bump driver's HID data version to 1.20 + * [r2883] docs/website/web-layout.conf: Unconditional inclusion of + Google Analytics code + * [r2882] docs/man/dummy-ups.txt, docs/man/metasys.txt, + drivers/apcsmart.c, drivers/dummy-ups.c, drivers/genericups.c, + drivers/metasys.c, drivers/snmp-ups.c: Fix some spelling errors + (base patch from Laurent Bigonville, from Debian) + +2011-01-31 Charles Lepple + + * [r2877] docs/documentation.txt, docs/download.txt: Update URL for + Trac. + +2011-01-28 Arnaud Quette + + * [r2874] configure.in: Add missing variables setting, to allow + AC_SUBST() propagation + +2011-01-22 Arjen de Korte + + * [r2850] drivers/apc-hid.c: Add mappings to APC HID subdriver + +2011-01-17 Charles Lepple + + * [r2836] scripts/Makefile.am: Include perl/Nut.pm in tarball. + * [r2835] COPYING, Makefile.am: Include LICENSE-GPL{2,3} in + tarball. + + Made the text in COPYING agree with the filenames. + 2011-01-14 Arnaud Quette * [r2832] docs/download.txt, docs/website/news.txt: Missing website diff --git a/LICENSE-GPL2 b/LICENSE-GPL2 new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/LICENSE-GPL2 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser 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., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 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 Lesser General +Public License instead of this License. diff --git a/LICENSE-GPL3 b/LICENSE-GPL3 new file mode 100644 index 0000000..4432540 --- /dev/null +++ b/LICENSE-GPL3 @@ -0,0 +1,676 @@ + + 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 +. + diff --git a/Makefile.am b/Makefile.am index 82c212c..60db46f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,8 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = include common clients conf data docs drivers lib \ tools scripts server -EXTRA_DIST = MAINTAINERS UPGRADING +# COPYING is included automatically. +EXTRA_DIST = LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING # ---------------------------------------------------------------------- # flags to pass to ./configure when calling "make distcheck" and "make diff --git a/Makefile.in b/Makefile.in index f7b5c89..2f6c7aa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -43,7 +43,6 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ depcomp install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -290,7 +289,9 @@ ACLOCAL_AMFLAGS = -I m4 SUBDIRS = include common clients conf data docs drivers lib \ tools scripts server -EXTRA_DIST = MAINTAINERS UPGRADING + +# COPYING is included automatically. +EXTRA_DIST = LICENSE-GPL2 LICENSE-GPL3 MAINTAINERS UPGRADING # ---------------------------------------------------------------------- # flags to pass to ./configure when calling "make distcheck" and "make diff --git a/NEWS b/NEWS index ab1bb39..e381249 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,51 @@ If you're upgrading from an earlier version, see the UPGRADING file. For a complete list of changes, please refer to the ChangeLog file. +--------------------------------------------------------------------------- +Release notes for NUT 2.6.1 - what's new since 2.6.0: + + - the various recent USB regressions have been definitely fixed. + + - NUT now propose a variable to expose UPS efficiency (ups.efficiency). + Eaton 5 PX already uses it. + + - the Perl module from Gabor Kiss (rewritten from Kit Peters') is now + distributed with NUT source code. + + - support for new devices: Eaton Ellipse ECO, Powerware 9140, Eaton 5 PX, and + ambient sensor on Eaton ePDU managed ; GE EP series ; Inform Sinus SS 210 ; + IPAR Mini Energy ME 800 ; Mustek Yukai PowerMust 1000 USB ; Numeric 3000 SW ; + SVEN Power Pro+ series (recent models) ; Vivaldi EA200 LED. + + - liebert-esp2: Improved Liebert ESP II support, including UPS shutdown + (poweroff), 1 and 3-phase input and output variables, and most + input / output / bypass / nominal variables. There is also a fix for the + USB to serial cable (Farkas Levente and Spiros Ioannou). + + - powercom has improved PowerCom BNT 1500A and BNT-other support, along with + driver documentation and code conformance to the NUT rules (Keven L. Ates). + + - apcsmart has more improved UPS poweroff support and options (Michal Soltys). + + - blazer has also seen some improvements. + + - usbhid-ups has completed a bit supported variables for APC and Eaton / MGE. + + - on the quality assurance side, Eaton has worked on fixing a few non + conformances, like C++ style comments and warnings, using a newly developed + verification tool (Prachi Gandhi). + + - fix remaining references to LIBSSL_LDFLAGS, instead of LIBSSL_LIBS, + which cause unresolved symbol on libupsclient users (Fabrice Coutadeur). + + - the website has now a better support for Internet Explorer 6. + + - graphic illustrations, used for the Features page on the website Features + and chapter of the user manual, have been refreshed (courtesy of Eaton). + + - more bugfixes, cleanup and improvements, on both source code and + documentation. + --------------------------------------------------------------------------- Release notes for NUT 2.6.0 - what's new since 2.4.3: diff --git a/UPGRADING b/UPGRADING index 9336069..12680d9 100644 --- a/UPGRADING +++ b/UPGRADING @@ -7,6 +7,11 @@ This file lists changes that affect users who installed older versions of this software. When upgrading from an older version, be sure to check this file to see if you need to make changes to your system. +Changes from 2.6.0 to 2.6.1 +--------------------------- + +- nothing that affects upgraded systems. + Changes from 2.4.3 to 2.6.0 --------------------------- diff --git a/aclocal.m4 b/aclocal.m4 index 9da2cb1..99662b0 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -13,14 +13,14 @@ m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl -m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.65],, -[m4_warning([this file was generated for autoconf 2.65. +m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],, +[m4_warning([this file was generated for autoconf 2.67. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) -# longlong.m4 serial 13 -dnl Copyright (C) 1999-2007 Free Software Foundation, Inc. +# longlong.m4 serial 14 +dnl Copyright (C) 1999-2007, 2009-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -41,33 +41,33 @@ AC_DEFUN([AC_TYPE_LONG_LONG_INT], [AC_LINK_IFELSE( [_AC_TYPE_LONG_LONG_SNIPPET], [dnl This catches a bug in Tandem NonStop Kernel (OSS) cc -O circa 2004. - dnl If cross compiling, assume the bug isn't important, since - dnl nobody cross compiles for this platform as far as we know. - AC_RUN_IFELSE( - [AC_LANG_PROGRAM( - [[@%:@include - @%:@ifndef LLONG_MAX - @%:@ define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - @%:@ define LLONG_MAX (HALF - 1 + HALF) - @%:@endif]], - [[long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0;]])], - [ac_cv_type_long_long_int=yes], - [ac_cv_type_long_long_int=no], - [ac_cv_type_long_long_int=yes])], + dnl If cross compiling, assume the bug isn't important, since + dnl nobody cross compiles for this platform as far as we know. + AC_RUN_IFELSE( + [AC_LANG_PROGRAM( + [[@%:@include + @%:@ifndef LLONG_MAX + @%:@ define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + @%:@ define LLONG_MAX (HALF - 1 + HALF) + @%:@endif]], + [[long long int n = 1; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0;]])], + [ac_cv_type_long_long_int=yes], + [ac_cv_type_long_long_int=no], + [ac_cv_type_long_long_int=yes])], [ac_cv_type_long_long_int=no])]) if test $ac_cv_type_long_long_int = yes; then - AC_DEFINE([HAVE_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_LONG_LONG_INT], [1], [Define to 1 if the system has the type `long long int'.]) fi ]) @@ -90,7 +90,7 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], [ac_cv_type_unsigned_long_long_int=yes], [ac_cv_type_unsigned_long_long_int=no])]) if test $ac_cv_type_unsigned_long_long_int = yes; then - AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], 1, + AC_DEFINE([HAVE_UNSIGNED_LONG_LONG_INT], [1], [Define to 1 if the system has the type `unsigned long long int'.]) fi ]) @@ -103,30 +103,27 @@ AC_DEFUN([AC_TYPE_UNSIGNED_LONG_LONG_INT], AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET], [ AC_LANG_PROGRAM( - [[/* Test preprocessor. */ - #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - error in preprocessor; - #endif - #if ! (18446744073709551615ULL <= -1ull) - error in preprocessor; - #endif + [[/* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63;]], [[/* Test availability of runtime routines for shift and division. */ long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull));]]) + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull));]]) ]) # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. @@ -1135,7 +1132,6 @@ AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([m4/ax_compare_version.m4]) -m4_include([m4/ax_create_stdint_h.m4]) m4_include([m4/libtool.m4]) m4_include([m4/ltoptions.m4]) m4_include([m4/ltsugar.m4]) diff --git a/clients/Makefile.in b/clients/Makefile.in index d2ca2fc..71f8770 100644 --- a/clients/Makefile.in +++ b/clients/Makefile.in @@ -54,7 +54,6 @@ DIST_COMMON = $(am__include_HEADERS_DIST) $(dist_bin_SCRIPTS) \ $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/clients/upsrw.c b/clients/upsrw.c index 21649ff..aacbfe8 100644 --- a/clients/upsrw.c +++ b/clients/upsrw.c @@ -405,7 +405,7 @@ int main(int argc, char **argv) const char *prog = xbasename(argv[0]); char *password = NULL, *username = NULL, *setvar = NULL; - while ((i = getopt(argc, argv, "+s:p:u:V")) != -1) { + while ((i = getopt(argc, argv, "+hs:p:u:V")) != -1) { switch (i) { case 's': @@ -420,6 +420,7 @@ int main(int argc, char **argv) case 'V': printf("Network UPS Tools %s %s\n", prog, UPS_VERSION); exit(EXIT_SUCCESS); + case 'h': default: usage(prog); exit(EXIT_SUCCESS); diff --git a/clients/upssched.c b/clients/upssched.c index e707248..6fcb5c3 100644 --- a/clients/upssched.c +++ b/clients/upssched.c @@ -356,7 +356,11 @@ static void conn_add(int sockfd) int acc, ret; conn_t *tmp, *last; struct sockaddr_un saddr; +#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED) + int salen; +#else socklen_t salen; +#endif salen = sizeof(saddr); acc = accept(sockfd, (struct sockaddr *) &saddr, &salen); @@ -495,9 +499,6 @@ static void start_daemon(int lockfd) struct timeval tv; fd_set rfds; conn_t *tmp, *tmpnext; - socklen_t fromlen; - - fromlen = sizeof(struct sockaddr); us_serialize(SERIALIZE_INIT); diff --git a/common/Makefile.in b/common/Makefile.in index 8006e9e..c0e19e2 100644 --- a/common/Makefile.in +++ b/common/Makefile.in @@ -42,7 +42,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in atexit.c \ setenv.c snprintf.c strerror.c ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/common/parseconf.c b/common/parseconf.c index 1680db7..bc6d6a1 100644 --- a/common/parseconf.c +++ b/common/parseconf.c @@ -129,7 +129,7 @@ static void add_arg_word(PCONF_CTX_t *ctx) pconf_fatal(ctx, "realloc arglist failed"); ctx->argsize = realloc(ctx->argsize, - sizeof(int *) * ctx->numargs); + sizeof(size_t) * ctx->numargs); if (!ctx->argsize) pconf_fatal(ctx, "realloc argsize failed"); diff --git a/conf/Makefile.in b/conf/Makefile.in index 8dd6128..18708a5 100644 --- a/conf/Makefile.in +++ b/conf/Makefile.in @@ -42,7 +42,6 @@ DIST_COMMON = $(am__dist_sysconf_DATA_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/upssched.conf.sample.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/config.guess b/config.guess index e3a2116..c2246a4 100755 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-10' +timestamp='2009-12-30' # 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 @@ -27,16 +27,16 @@ timestamp='2009-06-10' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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." @@ -333,6 +334,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in 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" @@ -807,12 +811,12 @@ EOF i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) + *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd | genuineintel) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -854,6 +858,20 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix 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="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -876,6 +894,17 @@ EOF frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -901,39 +930,18 @@ EOF #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - 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="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -942,8 +950,11 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux @@ -966,58 +977,6 @@ EOF xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; 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 @@ -1247,6 +1206,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + 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 + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} diff --git a/config.sub b/config.sub index eb0389a..c2d1257 100755 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2009-06-11' +timestamp='2010-01-22' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2009-06-11' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # 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: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # 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. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 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." @@ -149,7 +153,7 @@ case $os in -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) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; @@ -284,6 +288,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -291,13 +296,14 @@ case $basic_machine in | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -340,7 +346,7 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -368,15 +374,17 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ + | 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-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ @@ -726,6 +734,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1076,6 +1087,11 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu + ;; tile*) basic_machine=tile-unknown os=-linux-gnu @@ -1247,6 +1263,9 @@ 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|'` ;; @@ -1268,8 +1287,8 @@ case $os in # -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* | -solaris* | -sym* \ - | -kopensolaris* \ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ @@ -1290,7 +1309,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1423,6 +1442,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) diff --git a/configure b/configure index 260bf0e..071b034 100755 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65 for nut 2.6.0. +# Generated by GNU Autoconf 2.67 for nut 2.6.1. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -316,7 +316,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -356,19 +356,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + 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 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -679,7 +679,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# 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` @@ -698,8 +698,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='nut' PACKAGE_TARNAME='nut' -PACKAGE_VERSION='2.6.0' -PACKAGE_STRING='nut 2.6.0' +PACKAGE_VERSION='2.6.1' +PACKAGE_STRING='nut 2.6.1' PACKAGE_BUGREPORT='' PACKAGE_URL='' @@ -1060,8 +1060,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -1106,7 +1107,7 @@ do 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" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1132,7 +1133,7 @@ do 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" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1336,7 +1337,7 @@ do 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" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1352,7 +1353,7 @@ do 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" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1382,8 +1383,8 @@ do | --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." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1391,7 +1392,7 @@ Try \`$0 --help' for more information." # 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'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1409,13 +1410,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + 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" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1438,7 +1439,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + 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' @@ -1452,8 +1453,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1468,9 +1469,9 @@ 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" + 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" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1509,11 +1510,11 @@ else 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" + 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" + 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 @@ -1539,7 +1540,7 @@ 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 nut 2.6.0 to adapt to many kinds of systems. +\`configure' configures nut 2.6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1553,7 +1554,7 @@ Configuration: --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 + -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 @@ -1610,7 +1611,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of nut 2.6.0:";; + short | recursive ) echo "Configuration of nut 2.6.1:";; esac cat <<\_ACEOF @@ -1632,8 +1633,7 @@ Optional Features: Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-all enable serial, usb, snmp, hal, cgi, dev, neon, - powerman + --with-all enable serial, usb, snmp, neon, powerman, cgi, dev --with-dev build and install the development files (no) --with-serial build and install serial drivers (yes) --with-usb build and install USB drivers (auto) @@ -1774,10 +1774,10 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -nut configure 2.6.0 -generated by GNU Autoconf 2.65 +nut configure 2.6.1 +generated by GNU Autoconf 2.67 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1847,7 +1847,7 @@ $as_echo "$ac_try_echo"; } >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { + test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : @@ -1871,10 +1871,10 @@ fi ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + if eval "test \"\${$3+set}\"" = set; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 @@ -1910,7 +1910,7 @@ if ac_fn_c_try_cpp "$LINENO"; then : else ac_header_preproc=no fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } @@ -1937,7 +1937,7 @@ $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" @@ -2001,7 +2001,7 @@ ac_fn_c_check_header_compile () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2077,7 +2077,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2136,15 +2136,18 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_func -# ac_fn_c_check_decl LINENO SYMBOL VAR -# ------------------------------------ -# Tests whether SYMBOL is declared, setting cache variable VAR accordingly. +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. ac_fn_c_check_decl () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $2 is declared" >&5 -$as_echo_n "checking whether $2 is declared... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2153,8 +2156,12 @@ $4 int main () { -#ifndef $2 - (void) $2; +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif #endif ; @@ -2184,7 +2191,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${$3+set}\"" = set; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2228,190 +2235,12 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type - -# ac_fn_c_compute_int LINENO EXPR VAR INCLUDES -# -------------------------------------------- -# Tries to find the compile-time value of EXPR in a program that includes -# INCLUDES, setting VAR accordingly. Returns whether the value could be -# computed -ac_fn_c_compute_int () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=0 ac_mid=0 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid; break -else - as_fn_arith $ac_mid + 1 && ac_lo=$as_val - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=-1 ac_mid=-1 - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_lo=$ac_mid; break -else - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - ac_lo= ac_hi= -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - as_fn_arith '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo && ac_mid=$as_val - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_hi=$ac_mid -else - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in #(( -?*) eval "$3=\$ac_lo"; ac_retval=0 ;; -'') ac_retval=1 ;; -esac - else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -static long int longval () { return $2; } -static unsigned long int ulongval () { return $2; } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (($2) < 0) - { - long int i = longval (); - if (i != ($2)) - return 1; - fprintf (f, "%ld", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ($2)) - return 1; - fprintf (f, "%lu", i); - } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - echo >>conftest.val; read $3 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 nut $as_me 2.6.0, which was -generated by GNU Autoconf 2.65. Invocation command line was +It was created by nut $as_me 2.6.1, which was +generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2521,11 +2350,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2559,11 +2386,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2576,11 +2401,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2594,11 +2417,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2653,7 +2474,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2668,7 +2494,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$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 @@ -2744,7 +2574,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2762,16 +2592,22 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu echo "Network UPS Tools version ${PACKAGE_VERSION}" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -2785,7 +2621,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # 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 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } @@ -2796,16 +2632,16 @@ else 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 + 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 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5 ;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -2830,7 +2666,7 @@ else 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 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -2838,7 +2674,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5 ;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -2863,7 +2699,7 @@ else ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi @@ -2871,7 +2707,7 @@ fi $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5 ;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -3140,11 +2976,11 @@ am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) - as_fn_error "unsafe absolute working directory name" "$LINENO" 5;; + as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5 ;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) - as_fn_error "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;; + as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5 ;; esac # Do `set' in a subshell so we don't clobber the current shell's @@ -3166,7 +3002,7 @@ if ( # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". - as_fn_error "ls -t appears to fail. Make sure there is not a broken + as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi @@ -3176,7 +3012,7 @@ then # Ok. : else - as_fn_error "newly created file is older than distributed files! + as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3414,7 +3250,7 @@ done $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF @@ -3422,7 +3258,7 @@ SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +# GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; @@ -3456,7 +3292,7 @@ if test "`cd $srcdir && pwd`" != "`pwd`"; then am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then - as_fn_error "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 + as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi @@ -3472,7 +3308,7 @@ fi # Define the identity of the package. PACKAGE='nut' - VERSION='2.6.0' + VERSION='2.6.1' cat >>confdefs.h <<_ACEOF @@ -3880,8 +3716,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3995,9 +3831,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5 ; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -4039,8 +3874,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } +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 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -4097,9 +3932,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5 ; } fi fi fi @@ -4150,8 +3985,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } +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 @@ -4541,7 +4376,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4557,11 +4392,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -4600,7 +4435,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -4616,18 +4451,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -4688,7 +4523,7 @@ esac 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 + 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 @@ -4754,7 +4589,7 @@ esac 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 + 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 @@ -4886,8 +4721,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -5317,8 +5151,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$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; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5 ; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -5693,7 +5527,7 @@ $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` -if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval "test \"\${ac_cv_prog_cc_${ac_cc}_c_o+set}\"" = set; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5852,7 +5686,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5868,11 +5702,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -5911,7 +5745,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -5927,18 +5761,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5 ; } fi ac_ext=c @@ -6002,7 +5836,7 @@ esac 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 + 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 @@ -6367,8 +6201,8 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ;; #( *) - as_fn_error "unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; + as_fn_error $? "unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" "$LINENO" 5 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 @@ -6491,8 +6325,7 @@ for ac_func in flock lockf fcvt fcvtl do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6504,8 +6337,7 @@ for ac_func in cfsetispeed tcsendbreak do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6517,8 +6349,7 @@ for ac_func in seteuid setsid getpassphrase do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6530,8 +6361,7 @@ for ac_func in on_exit strptime setlogmask do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6556,8 +6386,7 @@ for ac_func in vsnprintf snprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6620,22 +6449,19 @@ else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - /* Test preprocessor. */ - #if ! (-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - error in preprocessor; - #endif - #if ! (18446744073709551615ULL <= -1ull) - error in preprocessor; - #endif + /* For now, do not test the preprocessor; as of 2007 there are too many + implementations with broken preprocessors. Perhaps this can + be revisited in 2012. In the meantime, code should not expect + #if to work with literals wider than 32 bits. */ /* Test literals. */ long long int ll = 9223372036854775807ll; long long int nll = -9223372036854775807LL; unsigned long long int ull = 18446744073709551615ULL; /* Test constant expressions. */ typedef int a[((-9223372036854775807LL < 0 && 0 < 9223372036854775807ll) - ? 1 : -1)]; + ? 1 : -1)]; typedef int b[(18446744073709551615ULL <= (unsigned long long int) -1 - ? 1 : -1)]; + ? 1 : -1)]; int i = 63; int main () @@ -6644,40 +6470,40 @@ main () long long int llmax = 9223372036854775807ll; unsigned long long int ullmax = 18446744073709551615ull; return ((ll << 63) | (ll >> 63) | (ll < i) | (ll > i) - | (llmax / ll) | (llmax % ll) - | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) - | (ullmax / ull) | (ullmax % ull)); + | (llmax / ll) | (llmax % ll) + | (ull << 63) | (ull >> 63) | (ull << i) | (ull >> i) + | (ullmax / ull) | (ullmax % ull)); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - if test "$cross_compiling" = yes; then : + if test "$cross_compiling" = yes; then : ac_cv_type_long_long_int=yes else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - #ifndef LLONG_MAX - # define HALF \ - (1LL << (sizeof (long long int) * CHAR_BIT - 2)) - # define LLONG_MAX (HALF - 1 + HALF) - #endif + #ifndef LLONG_MAX + # define HALF \ + (1LL << (sizeof (long long int) * CHAR_BIT - 2)) + # define LLONG_MAX (HALF - 1 + HALF) + #endif int main () { long long int n = 1; - int i; - for (i = 0; ; i++) - { - long long int m = n << i; - if (m >> i != n) - return 1; - if (LLONG_MAX / 2 < m) - break; - } - return 0; + int i; + for (i = 0; ; i++) + { + long long int m = n << i; + if (m >> i != n) + return 1; + if (LLONG_MAX / 2 < m) + break; + } + return 0; ; return 0; } @@ -6710,25 +6536,44 @@ fi done -for ac_func in setenv strerror atexit -do : - as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF +ac_fn_c_check_func "$LINENO" "setenv" "ac_cv_func_setenv" +if test "x$ac_cv_func_setenv" = x""yes; then : + $as_echo "#define HAVE_SETENV 1" >>confdefs.h else case " $LIBOBJS " in - *" $ac_func.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + *" setenv.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS setenv.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "strerror" "ac_cv_func_strerror" +if test "x$ac_cv_func_strerror" = x""yes; then : + $as_echo "#define HAVE_STRERROR 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" strerror.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS strerror.$ac_objext" + ;; +esac + +fi + +ac_fn_c_check_func "$LINENO" "atexit" "ac_cv_func_atexit" +if test "x$ac_cv_func_atexit" = x""yes; then : + $as_echo "#define HAVE_ATEXIT 1" >>confdefs.h + +else + case " $LIBOBJS " in + *" atexit.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS atexit.$ac_objext" ;; esac fi -done @@ -6737,6 +6582,12 @@ then CFLAGS="${CFLAGS} -Wall -Wsign-compare" fi +case ${target_os} in + hpux11* ) + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; +esac + ac_fn_c_check_decl "$LINENO" "optind" "ac_cv_have_decl_optind" "$ac_includes_default " if test "x$ac_cv_have_decl_optind" = x""yes; then : @@ -7005,8 +6856,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7016,473 +6866,6 @@ fi done -# ------ AX CREATE STDINT H ------------------------------------- -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint types" >&5 -$as_echo_n "checking for stdint types... " >&6; } -ac_stdint_h=`echo include/nut_stdint.h` -# try to shortcircuit - if the default include path of the compiler -# can find a "stdint.h" header then we assume that all compilers can. -if test "${ac_cv_header_stdint_t+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - -old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" -old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" -old_CFLAGS="$CFLAGS" ; CFLAGS="" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -int_least32_t v = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_stdint_result="(assuming C99 compatible system)" - ac_cv_header_stdint_t="stdint.h"; -else - ac_cv_header_stdint_t="" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then -CFLAGS="-std=c99" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -int_least32_t v = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&5 -$as_echo "$as_me: WARNING: your GCC compiler has a defunct stdint.h for its default-mode" >&2;} -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -CXXFLAGS="$old_CXXFLAGS" -CPPFLAGS="$old_CPPFLAGS" -CFLAGS="$old_CFLAGS" -fi - - -v="... $ac_cv_header_stdint_h" -if test "$ac_stdint_h" = "stdint.h" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./stdint.h?)" >&5 -$as_echo "(are you sure you want them in ./stdint.h?)" >&6; } -elif test "$ac_stdint_h" = "inttypes.h" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (are you sure you want them in ./inttypes.h?)" >&5 -$as_echo "(are you sure you want them in ./inttypes.h?)" >&6; } -elif test "_$ac_cv_header_stdint_t" = "_" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (putting them into $ac_stdint_h)$v" >&5 -$as_echo "(putting them into $ac_stdint_h)$v" >&6; } -else - ac_cv_header_stdint="$ac_cv_header_stdint_t" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint (shortcircuit)" >&5 -$as_echo "$ac_cv_header_stdint (shortcircuit)" >&6; } -fi - -if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. - - -inttype_headers=`echo | sed -e 's/,/ /g'` - -ac_cv_stdint_result="(no helpful system typedefs seen)" - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 -$as_echo_n "checking for stdint uintptr_t... " >&6; } -if test "${ac_cv_header_stdint_x+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 -$as_echo "(..)" >&6; } - for i in stdint.h inttypes.h sys/inttypes.h $inttype_headers - do - unset ac_cv_type_uintptr_t - unset ac_cv_type_uint64_t - ac_fn_c_check_type "$LINENO" "uintptr_t" "ac_cv_type_uintptr_t" "#include <$i> -" -if test "x$ac_cv_type_uintptr_t" = x""yes; then : - ac_cv_header_stdint_x=$i -else - continue -fi - - ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> -" -if test "x$ac_cv_type_uint64_t" = x""yes; then : - and64="/uint64_t" -else - and64="" -fi - - ac_cv_stdint_result="(seen uintptr_t$and64 in $i)" - break - done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uintptr_t" >&5 -$as_echo_n "checking for stdint uintptr_t... " >&6; } - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_x" >&5 -$as_echo "$ac_cv_header_stdint_x" >&6; } - - -if test "_$ac_cv_header_stdint_x" = "_" ; then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 -$as_echo_n "checking for stdint uint32_t... " >&6; } -if test "${ac_cv_header_stdint_o+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 -$as_echo "(..)" >&6; } - for i in inttypes.h sys/inttypes.h stdint.h $inttype_headers - do - unset ac_cv_type_uint32_t - unset ac_cv_type_uint64_t - ac_fn_c_check_type "$LINENO" "uint32_t" "ac_cv_type_uint32_t" "#include <$i> -" -if test "x$ac_cv_type_uint32_t" = x""yes; then : - ac_cv_header_stdint_o=$i -else - continue -fi - - ac_fn_c_check_type "$LINENO" "uint64_t" "ac_cv_type_uint64_t" "#include<$i> -" -if test "x$ac_cv_type_uint64_t" = x""yes; then : - and64="/uint64_t" -else - and64="" -fi - - ac_cv_stdint_result="(seen uint32_t$and64 in $i)" - break - break; - done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint uint32_t" >&5 -$as_echo_n "checking for stdint uint32_t... " >&6; } - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_o" >&5 -$as_echo "$ac_cv_header_stdint_o" >&6; } - -fi - -if test "_$ac_cv_header_stdint_x" = "_" ; then -if test "_$ac_cv_header_stdint_o" = "_" ; then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 -$as_echo_n "checking for stdint u_int32_t... " >&6; } -if test "${ac_cv_header_stdint_u+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - - ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 -$as_echo "(..)" >&6; } - for i in sys/types.h inttypes.h sys/inttypes.h $inttype_headers ; do - unset ac_cv_type_u_int32_t - unset ac_cv_type_u_int64_t - ac_fn_c_check_type "$LINENO" "u_int32_t" "ac_cv_type_u_int32_t" "#include <$i> -" -if test "x$ac_cv_type_u_int32_t" = x""yes; then : - ac_cv_header_stdint_u=$i -else - continue -fi - - ac_fn_c_check_type "$LINENO" "u_int64_t" "ac_cv_type_u_int64_t" "#include<$i> -" -if test "x$ac_cv_type_u_int64_t" = x""yes; then : - and64="/u_int64_t" -else - and64="" -fi - - ac_cv_stdint_result="(seen u_int32_t$and64 in $i)" - break - break; - done - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint u_int32_t" >&5 -$as_echo_n "checking for stdint u_int32_t... " >&6; } - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdint_u" >&5 -$as_echo "$ac_cv_header_stdint_u" >&6; } - -fi fi - -if test "_$ac_cv_header_stdint_x" = "_" ; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdint datatype model" >&5 -$as_echo_n "checking for stdint datatype model... " >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: result: (..)" >&5 -$as_echo "(..)" >&6; } - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of char" >&5 -$as_echo_n "checking size of char... " >&6; } -if test "${ac_cv_sizeof_char+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (char))" "ac_cv_sizeof_char" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_char" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (char) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_char=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_char" >&5 -$as_echo "$ac_cv_sizeof_char" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_CHAR $ac_cv_sizeof_char -_ACEOF - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short" >&5 -$as_echo_n "checking size of short... " >&6; } -if test "${ac_cv_sizeof_short+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short))" "ac_cv_sizeof_short" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_short" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (short) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_short=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_short" >&5 -$as_echo "$ac_cv_sizeof_short" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_SHORT $ac_cv_sizeof_short -_ACEOF - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 -$as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_int" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_int=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 -$as_echo "$ac_cv_sizeof_int" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_INT $ac_cv_sizeof_int -_ACEOF - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_long=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - - # The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of void*" >&5 -$as_echo_n "checking size of void*... " >&6; } -if test "${ac_cv_sizeof_voidp+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (void*))" "ac_cv_sizeof_voidp" "$ac_includes_default"; then : - -else - if test "$ac_cv_type_voidp" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (void*) -See \`config.log' for more details." "$LINENO" 5; }; } - else - ac_cv_sizeof_voidp=0 - fi -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_voidp" >&5 -$as_echo "$ac_cv_sizeof_voidp" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOIDP $ac_cv_sizeof_voidp -_ACEOF - - - ac_cv_char_data_model="" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking data model" >&5 -$as_echo_n "checking data model... " >&6; } - case "$ac_cv_char_data_model/$ac_cv_long_data_model" in - 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; - 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; - 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; - 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; - 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; - 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; - 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; - 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; - 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; - 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; - 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; - 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; - 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; - 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; - 222/*|333/*|444/*|666/*|888/*) : - ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; - *) ac_cv_data_model="none" ; n="very unusual model" ;; - esac - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_data_model ($ac_cv_long_data_model, $n)" >&5 -$as_echo "$ac_cv_data_model ($ac_cv_long_data_model, $n)" >&6; } - -fi - -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_x" -elif test "_$ac_cv_header_stdint_o" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_o" -elif test "_$ac_cv_header_stdint_u" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_u" -else - ac_cv_header_stdint="stddef.h" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for extra inttypes in chosen header" >&5 -$as_echo_n "checking for extra inttypes in chosen header... " >&6; } -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ($ac_cv_header_stdint)" >&5 -$as_echo "($ac_cv_header_stdint)" >&6; } -unset ac_cv_type_int_least32_t -unset ac_cv_type_int_fast32_t -ac_fn_c_check_type "$LINENO" "int_least32_t" "ac_cv_type_int_least32_t" "#include <$ac_cv_header_stdint> -" -if test "x$ac_cv_type_int_least32_t" = x""yes; then : - -fi - -ac_fn_c_check_type "$LINENO" "int_fast32_t" "ac_cv_type_int_fast32_t" "#include<$ac_cv_header_stdint> -" -if test "x$ac_cv_type_int_fast32_t" = x""yes; then : - -fi - -ac_fn_c_check_type "$LINENO" "intmax_t" "ac_cv_type_intmax_t" "#include <$ac_cv_header_stdint> -" -if test "x$ac_cv_type_intmax_t" = x""yes; then : - -fi - - -fi # shortcircut to system "stdint.h" -# ------------------ PREPARE VARIABLES ------------------------------ -if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` -else -ac_cv_stdint_message="using $CC" -fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&5 -$as_echo "make use of $ac_cv_header_stdint in $ac_stdint_h $ac_cv_stdint_result" >&6; } - -# ----------------- DONE inttypes.h checks START header ------------- -ac_config_commands="$ac_config_commands $ac_stdint_h" - - ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" "#include #include @@ -7532,7 +6915,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done if test "x$nut_cv_socklen_t_equiv" = x; then - as_fn_error "Cannot find a type to use in place of socklen_t" "$LINENO" 5 + as_fn_error $? "Cannot find a type to use in place of socklen_t" "$LINENO" 5 fi fi @@ -7559,7 +6942,6 @@ if test "${with_all+set}" = set; then : if test -z "${with_serial}"; then with_serial="${withval}"; fi if test -z "${with_usb}"; then with_usb="${withval}"; fi if test -z "${with_snmp}"; then with_snmp="${withval}"; fi - if test -z "${with_hal}"; then with_hal="${withval}"; fi if test -z "${with_neon}"; then with_neon="${withval}"; fi if test -z "${with_powerman}"; then with_powerman="${withval}"; fi if test -z "${with_cgi}"; then with_cgi="${withval}"; fi @@ -7647,7 +7029,7 @@ if test "${with_snmp_includes+set}" = set; then : withval=$with_snmp_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-snmp-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-snmp-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -7669,7 +7051,7 @@ if test "${with_snmp_libs+set}" = set; then : withval=$with_snmp_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-snmp-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-snmp-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -7758,7 +7140,7 @@ if test "${with_usb_includes+set}" = set; then : withval=$with_usb_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-usb-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-usb-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -7778,7 +7160,7 @@ if test "${with_usb_libs+set}" = set; then : withval=$with_usb_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-usb-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-usb-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -7878,7 +7260,7 @@ if test "${with_hal_includes+set}" = set; then : withval=$with_hal_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -7905,7 +7287,7 @@ if test "${with_hal_libs+set}" = set; then : withval=$with_hal_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -7944,8 +7326,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8004,7 +7385,7 @@ if test "${with_hal_user+set}" = set; then : withval=$with_hal_user; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-user - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-user - see docs/configure.txt" "$LINENO" 5 ;; *) HAL_USER="${withval}" @@ -8036,7 +7417,7 @@ if test "${with_hal_device_match_key+set}" = set; then : withval=$with_hal_device_match_key; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-device-match-key - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-device-match-key - see docs/configure.txt" "$LINENO" 5 ;; *) HAL_DEVICE_MATCH_KEY="${withval}" @@ -8064,7 +7445,7 @@ if test "${with_hal_callouts_path+set}" = set; then : withval=$with_hal_callouts_path; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-callouts-path - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-callouts-path - see docs/configure.txt" "$LINENO" 5 ;; *) HAL_CALLOUTS_PATH="${withval}" @@ -8091,7 +7472,7 @@ if test "${with_hal_fdi_path+set}" = set; then : withval=$with_hal_fdi_path; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-hal-fdi-path - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-hal-fdi-path - see docs/configure.txt" "$LINENO" 5 ;; *) HAL_FDI_PATH="${withval}" @@ -8145,7 +7526,7 @@ if test "${with_snmp_includes+set}" = set; then : withval=$with_snmp_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-snmp-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-snmp-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -8167,7 +7548,7 @@ if test "${with_snmp_libs+set}" = set; then : withval=$with_snmp_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-snmp-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-snmp-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -8253,7 +7634,7 @@ if test "${with_neon_includes+set}" = set; then : withval=$with_neon_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-neon-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-neon-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -8275,7 +7656,7 @@ if test "${with_neon_libs+set}" = set; then : withval=$with_neon_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-neon-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-neon-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -8323,8 +7704,7 @@ done do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -8365,7 +7745,7 @@ if test "${with_powerman_includes+set}" = set; then : withval=$with_powerman_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-powerman-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-powerman-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -8387,7 +7767,7 @@ if test "${with_powerman_libs+set}" = set; then : withval=$with_powerman_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-powerman-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-powerman-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -8539,7 +7919,7 @@ $as_echo "${nut_with_serial}" >&6; } if test "${nut_with_usb}" = "yes" -a "${nut_have_libusb}" != "yes"; then - as_fn_error "\"USB drivers requested, but libusb not found.\"" "$LINENO" 5 + as_fn_error $? "\"USB drivers requested, but libusb not found.\"" "$LINENO" 5 fi if test "${nut_with_usb}" != "no"; then @@ -8571,7 +7951,7 @@ $as_echo "${nut_with_usb}" >&6; } if test "${nut_with_snmp}" = "yes" -a "${nut_have_libnetsnmp}" != "yes"; then - as_fn_error "\"Net-SNMP libraries not found, required for SNMP drivers\"" "$LINENO" 5 + as_fn_error $? "\"Net-SNMP libraries not found, required for SNMP drivers\"" "$LINENO" 5 fi if test "${nut_with_snmp}" != "no"; then @@ -8603,7 +7983,7 @@ $as_echo "${nut_with_snmp}" >&6; } if test "${nut_with_neon}" = "yes" -a "${nut_have_neon}" != "yes"; then - as_fn_error "\"neon libraries not found, required for neon based XML/HTTP driver\"" "$LINENO" 5 + as_fn_error $? "\"neon libraries not found, required for neon based XML/HTTP driver\"" "$LINENO" 5 fi if test "${nut_with_neon}" != "no"; then @@ -8636,7 +8016,7 @@ $as_echo "${nut_with_neon}" >&6; } if test "${nut_with_powerman}" = "yes" -a "${nut_have_libpowerman}" != "yes"; then - as_fn_error "\"Powerman client libraries not found, required for Powerman PDU client driver\"" "$LINENO" 5 + as_fn_error $? "\"Powerman client libraries not found, required for Powerman PDU client driver\"" "$LINENO" 5 fi if test "${nut_with_powerman}" != "no"; then @@ -8708,7 +8088,7 @@ if test "${with_ssl_includes+set}" = set; then : withval=$with_ssl_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-ssl-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-ssl-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -8728,7 +8108,7 @@ if test "${with_ssl_libs+set}" = set; then : withval=$with_ssl_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-ssl-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-ssl-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LIBS="${withval}" @@ -8784,7 +8164,7 @@ fi fi if test "${nut_with_ssl}" = "yes" -a "${nut_have_libssl}" != "yes"; then - as_fn_error "\"OpenSSL not found, required for SSL support\"" "$LINENO" 5 + as_fn_error $? "\"OpenSSL not found, required for SSL support\"" "$LINENO" 5 fi if test "${nut_with_ssl}" != "no"; then @@ -8979,7 +8359,7 @@ fi fi if test "${nut_with_wrap}" = "yes" -a "${nut_have_libwrap}" != "yes"; then - as_fn_error "\"libwrap not found\"" "$LINENO" 5 + as_fn_error $? "\"libwrap not found\"" "$LINENO" 5 fi if test "${nut_with_wrap}" != "no"; then @@ -9067,7 +8447,7 @@ if test "${with_gd_includes+set}" = set; then : withval=$with_gd_includes; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-gd-includes - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-gd-includes - see docs/configure.txt" "$LINENO" 5 ;; *) CFLAGS="${withval}" @@ -9087,7 +8467,7 @@ if test "${with_gd_libs+set}" = set; then : withval=$with_gd_libs; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-gd-libs - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-gd-libs - see docs/configure.txt" "$LINENO" 5 ;; *) LDFLAGS="${withval}" @@ -9105,8 +8485,7 @@ do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -9192,7 +8571,7 @@ fi fi if test "${nut_with_cgi}" = "yes" -a "${nut_have_libgd}" != "yes"; then - as_fn_error "libgd not found, required for CGI build" "$LINENO" 5 + as_fn_error $? "libgd not found, required for CGI build" "$LINENO" 5 fi if test "${nut_with_cgi}" != "no"; then @@ -9224,11 +8603,11 @@ $as_echo "${nut_with_cgi}" >&6; } if test "${nut_with_hal}" = "yes" -a "${nut_have_libhal}" != "yes"; then - as_fn_error "\"libhal not found, required for HAL support\"" "$LINENO" 5 + as_fn_error $? "\"libhal not found, required for HAL support\"" "$LINENO" 5 fi if test "${nut_with_hal}" = "yes" -a "${nut_have_libusb}" != "yes"; then - as_fn_error "\"libusb not found, required for HAL support\"" "$LINENO" 5 + as_fn_error $? "\"libusb not found, required for HAL support\"" "$LINENO" 5 fi if test "${nut_with_hal}" != "no"; then @@ -9610,7 +8989,7 @@ no) if test -z "${DOC_NOBUILD_LIST}"; then nut_with_doc="yes" else - as_fn_error "\"Asciidoc is required for documentation support and missing\"" "$LINENO" 5 + as_fn_error $? "\"Asciidoc is required for documentation support and missing\"" "$LINENO" 5 fi ;; esac @@ -9825,7 +9204,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then - as_fn_error "no acceptable sed could be found in \$PATH" "$LINENO" 5 + as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5 fi else ac_cv_path_SED=$SED @@ -9904,7 +9283,7 @@ esac done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then - as_fn_error "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_FGREP=$FGREP @@ -10020,7 +9399,7 @@ else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi -test -z "$LD" && as_fn_error "no acceptable ld found in \$PATH" "$LINENO" 5 +test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then : @@ -10222,13 +9601,13 @@ if test "${lt_cv_nm_interface+set}" = set; then : else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:10225: $ac_compile\"" >&5) + (eval echo "\"\$as_me:9604: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:10228: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:9607: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:10231: output\"" >&5) + (eval echo "\"\$as_me:9610: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" @@ -11433,7 +10812,7 @@ ia64-*-hpux*) ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 11436 "configure"' > conftest.$ac_ext + echo '#line 10815 "configure"' > conftest.$ac_ext if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? @@ -12695,11 +12074,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:12698: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12077: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:12702: \$? = $ac_status" >&5 + echo "$as_me:12081: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13034,11 +12413,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13037: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12416: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:13041: \$? = $ac_status" >&5 + echo "$as_me:12420: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. @@ -13139,11 +12518,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13142: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12521: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13146: \$? = $ac_status" >&5 + echo "$as_me:12525: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -13194,11 +12573,11 @@ else -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13197: $lt_compile\"" >&5) + (eval echo "\"\$as_me:12576: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:13201: \$? = $ac_status" >&5 + echo "$as_me:12580: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized @@ -15578,7 +14957,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15581 "configure" +#line 14960 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15674,7 +15053,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 15677 "configure" +#line 15056 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -15967,7 +15346,7 @@ if test "${with_statepath+set}" = set; then : withval=$with_statepath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-statepath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-statepath - see docs/configure.txt" "$LINENO" 5 ;; *) STATEPATH="${withval}" @@ -15993,7 +15372,7 @@ if test "${with_altpidpath+set}" = set; then : withval=$with_altpidpath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-altpidpath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-altpidpath - see docs/configure.txt" "$LINENO" 5 ;; *) ALTPIDPATH="${withval}" @@ -16022,7 +15401,7 @@ if test "${with_drvpath+set}" = set; then : withval=$with_drvpath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-drvpath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-drvpath - see docs/configure.txt" "$LINENO" 5 ;; *) driverexecdir="${withval}" @@ -16050,7 +15429,7 @@ if test "${with_cgipath+set}" = set; then : withval=$with_cgipath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-cgipath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-cgipath - see docs/configure.txt" "$LINENO" 5 ;; *) cgiexecdir="${withval}" @@ -16078,7 +15457,7 @@ if test "${with_htmlpath+set}" = set; then : withval=$with_htmlpath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-htmlpath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-htmlpath - see docs/configure.txt" "$LINENO" 5 ;; *) htmldir="${withval}" @@ -16106,7 +15485,7 @@ if test "${with_pidpath+set}" = set; then : withval=$with_pidpath; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-pidpath - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-pidpath - see docs/configure.txt" "$LINENO" 5 ;; *) PIDPATH="${withval}" @@ -16131,7 +15510,7 @@ if test "${with_port+set}" = set; then : withval=$with_port; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-port - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-port - see docs/configure.txt" "$LINENO" 5 ;; *) PORT="${withval}" @@ -16160,7 +15539,7 @@ if test "${with_user+set}" = set; then : withval=$with_user; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-user - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-user - see docs/configure.txt" "$LINENO" 5 ;; *) RUN_AS_USER="${withval}" @@ -16190,7 +15569,7 @@ if test "${with_group+set}" = set; then : withval=$with_group; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-group - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-group - see docs/configure.txt" "$LINENO" 5 ;; *) RUN_AS_GROUP="${withval}" @@ -16213,9 +15592,9 @@ _ACEOF $as_echo "${RUN_AS_GROUP}" >&6; } if test "${nut_user_given}" = "yes" -a "${nut_group_given}" = "no"; then - as_fn_error "\"If you specify --with-user, you also must specify --with-group\"" "$LINENO" 5 + as_fn_error $? "\"If you specify --with-user, you also must specify --with-group\"" "$LINENO" 5 elif test "${nut_user_given}" = "no" -a "${nut_group_given}" = "yes"; then - as_fn_error "\"If you specify --with-group, you also must specify --with-user\"" "$LINENO" 5 + as_fn_error $? "\"If you specify --with-group, you also must specify --with-user\"" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking facility for syslog" >&5 @@ -16226,7 +15605,7 @@ if test "${with_logfacility+set}" = set; then : withval=$with_logfacility; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-logfacility - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-logfacility - see docs/configure.txt" "$LINENO" 5 ;; *) LOGFACILITY="${withval}" @@ -16255,7 +15634,7 @@ if test "${with_drivers+set}" = set; then : withval=$with_drivers; case "${withval}" in yes|no) - as_fn_error "invalid option --with(out)-drivers - see docs/configure.txt" "$LINENO" 5 + as_fn_error $? "invalid option --with(out)-drivers - see docs/configure.txt" "$LINENO" 5 ;; *) DRIVER_BUILD_LIST=`echo ${withval} | sed "s/,/ /g"` @@ -16380,7 +15759,7 @@ if test "${with_hotplug_dir+set}" = set; then : if test -z "${hotplugdir}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error "\"hotplug directory requested but not found\"" "$LINENO" 5 + as_fn_error $? "\"hotplug directory requested but not found\"" "$LINENO" 5 fi ;; auto) @@ -16422,7 +15801,7 @@ if test "${with_udev_dir+set}" = set; then : if test -z "${udevdir}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error "\"udev directory requested but not found\"" "$LINENO" 5 + as_fn_error $? "\"udev directory requested but not found\"" "$LINENO" 5 fi ;; auto) @@ -16567,6 +15946,7 @@ _ACEOF conftemp="${datadir}" eval conftemp=\"${conftemp}\" eval conftemp=\"${conftemp}\" +DATADIR=${conftemp} cat >>confdefs.h <<_ACEOF #define DATADIR "${conftemp}" @@ -16576,6 +15956,7 @@ _ACEOF conftemp="${bindir}" eval conftemp=\"${conftemp}\" eval conftemp=\"${conftemp}\" +BINDIR=${conftemp} cat >>confdefs.h <<_ACEOF #define BINDIR "${conftemp}" @@ -16708,6 +16089,7 @@ DEFS=-DHAVE_CONFIG_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$//' @@ -16731,84 +16113,84 @@ else fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then - as_fn_error "conditional \"AMDEP\" was never defined. + as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error "conditional \"MAINTAINER_MODE\" was never defined. + as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then - as_fn_error "conditional \"am__fastdepCC\" was never defined. + as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SERIAL_TRUE}" && test -z "${WITH_SERIAL_FALSE}"; then - as_fn_error "conditional \"WITH_SERIAL\" was never defined. + as_fn_error $? "conditional \"WITH_SERIAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_USB_TRUE}" && test -z "${WITH_USB_FALSE}"; then - as_fn_error "conditional \"WITH_USB\" was never defined. + as_fn_error $? "conditional \"WITH_USB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SNMP_TRUE}" && test -z "${WITH_SNMP_FALSE}"; then - as_fn_error "conditional \"WITH_SNMP\" was never defined. + as_fn_error $? "conditional \"WITH_SNMP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_NEONXML_TRUE}" && test -z "${WITH_NEONXML_FALSE}"; then - as_fn_error "conditional \"WITH_NEONXML\" was never defined. + as_fn_error $? "conditional \"WITH_NEONXML\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_LIBPOWERMAN_TRUE}" && test -z "${WITH_LIBPOWERMAN_FALSE}"; then - as_fn_error "conditional \"WITH_LIBPOWERMAN\" was never defined. + as_fn_error $? "conditional \"WITH_LIBPOWERMAN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_SSL_TRUE}" && test -z "${WITH_SSL_FALSE}"; then - as_fn_error "conditional \"WITH_SSL\" was never defined. + as_fn_error $? "conditional \"WITH_SSL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_WRAP_TRUE}" && test -z "${WITH_WRAP_FALSE}"; then - as_fn_error "conditional \"WITH_WRAP\" was never defined. + as_fn_error $? "conditional \"WITH_WRAP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_CGI_TRUE}" && test -z "${WITH_CGI_FALSE}"; then - as_fn_error "conditional \"WITH_CGI\" was never defined. + as_fn_error $? "conditional \"WITH_CGI\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_HAL_TRUE}" && test -z "${WITH_HAL_FALSE}"; then - as_fn_error "conditional \"WITH_HAL\" was never defined. + as_fn_error $? "conditional \"WITH_HAL\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_ASCIIDOC_TRUE}" && test -z "${HAVE_ASCIIDOC_FALSE}"; then - as_fn_error "conditional \"HAVE_ASCIIDOC\" was never defined. + as_fn_error $? "conditional \"HAVE_ASCIIDOC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_DEV_TRUE}" && test -z "${WITH_DEV_FALSE}"; then - as_fn_error "conditional \"WITH_DEV\" was never defined. + as_fn_error $? "conditional \"WITH_DEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${SOME_DRIVERS_TRUE}" && test -z "${SOME_DRIVERS_FALSE}"; then - as_fn_error "conditional \"SOME_DRIVERS\" was never defined. + as_fn_error $? "conditional \"SOME_DRIVERS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_PKG_CONFIG_TRUE}" && test -z "${WITH_PKG_CONFIG_FALSE}"; then - as_fn_error "conditional \"WITH_PKG_CONFIG\" was never defined. + as_fn_error $? "conditional \"WITH_PKG_CONFIG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_HOTPLUG_TRUE}" && test -z "${WITH_HOTPLUG_FALSE}"; then - as_fn_error "conditional \"WITH_HOTPLUG\" was never defined. + as_fn_error $? "conditional \"WITH_HOTPLUG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${WITH_UDEV_TRUE}" && test -z "${WITH_UDEV_FALSE}"; then - as_fn_error "conditional \"WITH_UDEV\" was never defined. + as_fn_error $? "conditional \"WITH_UDEV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${MANUALUPDATE_TRUE}" && test -z "${MANUALUPDATE_FALSE}"; then - as_fn_error "conditional \"MANUALUPDATE\" was never defined. + as_fn_error $? "conditional \"MANUALUPDATE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi @@ -16958,19 +16340,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# 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. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + 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 + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -17166,7 +16548,7 @@ $as_echo X"$as_dir" | 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" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -17219,8 +16601,8 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by nut $as_me 2.6.0, which was -generated by GNU Autoconf 2.65. Invocation command line was +This file was extended by nut $as_me 2.6.1, which was +generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -17285,11 +16667,11 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -nut config.status 2.6.0 -configured by $0, generated by GNU Autoconf 2.65, +nut config.status 2.6.1 +configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -17307,11 +16689,16 @@ 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 @@ -17333,6 +16720,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -17345,7 +16733,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -17354,7 +16742,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -17399,24 +16787,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -# variables for create stdint.h replacement -PACKAGE="$PACKAGE" -VERSION="$VERSION" -ac_stdint_h="$ac_stdint_h" -_ac_stdint_h=`$as_echo "_$PACKAGE-$ac_stdint_h" | $as_tr_cpp` -ac_cv_stdint_message="$ac_cv_stdint_message" -ac_cv_header_stdint_t="$ac_cv_header_stdint_t" -ac_cv_header_stdint_x="$ac_cv_header_stdint_x" -ac_cv_header_stdint_o="$ac_cv_header_stdint_o" -ac_cv_header_stdint_u="$ac_cv_header_stdint_u" -ac_cv_type_uint64_t="$ac_cv_type_uint64_t" -ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" -ac_cv_char_data_model="$ac_cv_char_data_model" -ac_cv_long_data_model="$ac_cv_long_data_model" -ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" -ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" -ac_cv_type_intmax_t="$ac_cv_type_intmax_t" - # The HP-UX ksh and POSIX shell print the target directory to stdout @@ -17683,7 +17053,6 @@ do case $ac_config_target in "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "$ac_stdint_h") CONFIG_COMMANDS="$CONFIG_COMMANDS $ac_stdint_h" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "clients/Makefile") CONFIG_FILES="$CONFIG_FILES clients/Makefile" ;; "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; @@ -17722,7 +17091,7 @@ do "tools/Makefile") CONFIG_FILES="$CONFIG_FILES tools/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5 ;; esac done @@ -17760,7 +17129,7 @@ $debug || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -17777,7 +17146,7 @@ if test "x$ac_cr" = x; then 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' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi @@ -17791,18 +17160,18 @@ _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 '$'` + 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 + 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 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -17891,20 +17260,28 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# 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[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + 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 @@ -17932,7 +17309,7 @@ for ac_last_try in false false :; do if test -z "$ac_t"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -18017,7 +17394,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -18030,7 +17407,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5 ;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -18058,7 +17435,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5 ;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -18085,7 +17462,7 @@ $as_echo "$as_me: creating $ac_file" >&6;} case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -18222,22 +17599,22 @@ s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$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 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -18248,19 +17625,19 @@ which seems to be undefined. Please make sure it is defined." >&2;} $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" @@ -18399,470 +17776,6 @@ $as_echo X"$file" | done done } - ;; - "$ac_stdint_h":C) -{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_stdint_h : $_ac_stdint_h" >&5 -$as_echo "$as_me: creating $ac_stdint_h : $_ac_stdint_h" >&6;} -ac_stdint=$tmp/_stdint.h - -echo "#ifndef" $_ac_stdint_h >$ac_stdint -echo "#define" $_ac_stdint_h "1" >>$ac_stdint -echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint -echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint -echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint -if test "_$ac_cv_header_stdint_t" != "_" ; then -echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint -echo "#include " >>$ac_stdint -echo "#endif" >>$ac_stdint -echo "#endif" >>$ac_stdint -else - -cat >>$ac_stdint < -#else -#include - -/* .................... configured part ............................ */ - -STDINT_EOF - -echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_header="$ac_cv_header_stdint_x" - echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint -fi - -echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_o" != "_" ; then - ac_header="$ac_cv_header_stdint_o" - echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint -fi - -echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint -if test "_$ac_cv_header_stdint_u" != "_" ; then - ac_header="$ac_cv_header_stdint_u" - echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint -fi - -echo "" >>$ac_stdint - -if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then - echo "#include <$ac_header>" >>$ac_stdint - echo "" >>$ac_stdint -fi fi - -echo "/* which 64bit typedef has been found */" >>$ac_stdint -if test "$ac_cv_type_uint64_t" = "yes" ; then -echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint -fi -if test "$ac_cv_type_u_int64_t" = "yes" ; then -echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* which type model has been detected */" >>$ac_stdint -if test "_$ac_cv_char_data_model" != "_" ; then -echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint -echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint -else -echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint -echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* whether int_least types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_least32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint -fi -echo "/* whether int_fast types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_fast32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint -fi -echo "/* whether intmax_t type was detected */" >>$ac_stdint -if test "$ac_cv_type_intmax_t" = "yes"; then -echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - - cat >>$ac_stdint <= 199901L -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#elif !defined __STRICT_ANSI__ -#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ -#define _HAVE_UINT64_T -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ -/* note: all ELF-systems seem to have loff-support which needs 64-bit */ -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#elif defined __alpha || (defined __mips && defined _ABIN32) -#if !defined _NO_LONGLONG -typedef long int64_t; -typedef unsigned long uint64_t; -#endif - /* compiler/cpu type to define int64_t */ -#endif -#endif -#endif - -#if defined _STDINT_HAVE_U_INT_TYPES -/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int32_t uint32_t; - -/* glibc compatibility */ -#ifndef __int8_t_defined -#define __int8_t_defined -#endif -#endif - -#ifdef _STDINT_NEED_INT_MODEL_T -/* we must guess all the basic types. Apart from byte-adressable system, */ -/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ -/* (btw, those nibble-addressable systems are way off, or so we assume) */ - - -#if defined _STDINT_BYTE_MODEL -#if _STDINT_LONG_MODEL+0 == 242 -/* 2:4:2 = IP16 = a normal 16-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 -/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ -/* 4:4:4 = ILP32 = a normal 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 -/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ -/* 4:8:8 = LP64 = a normal 64-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* this system has a "long" of 64bit */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -typedef unsigned long uint64_t; -typedef long int64_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 448 -/* LLP64 a 64-bit system derived from a 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* assuming the system has a "long long" */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef unsigned long long uint64_t; -typedef long long int64_t; -#endif -#else -#define _STDINT_NO_INT32_T -#endif -#else -#define _STDINT_NO_INT8_T -#define _STDINT_NO_INT32_T -#endif -#endif - -/* - * quote from SunOS-5.8 sys/inttypes.h: - * Use at your own risk. As of February 1996, the committee is squarely - * behind the fixed sized types; the "least" and "fast" types are still being - * discussed. The probability that the "fast" types may be removed before - * the standard is finalized is high enough that they are not currently - * implemented. - */ - -#if defined _STDINT_NEED_INT_LEAST_T -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_least64_t; -#endif - -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_least64_t; -#endif - /* least types */ -#endif - -#if defined _STDINT_NEED_INT_FAST_T -typedef int8_t int_fast8_t; -typedef int int_fast16_t; -typedef int32_t int_fast32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_fast64_t; -#endif - -typedef uint8_t uint_fast8_t; -typedef unsigned uint_fast16_t; -typedef uint32_t uint_fast32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_fast64_t; -#endif - /* fast types */ -#endif - -#ifdef _STDINT_NEED_INTMAX_T -#ifdef _HAVE_UINT64_T -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; -#else -typedef long intmax_t; -typedef unsigned long uintmax_t; -#endif -#endif - -#ifdef _STDINT_NEED_INTPTR_T -#ifndef __intptr_t_defined -#define __intptr_t_defined -/* we encourage using "long" to store pointer values, never use "int" ! */ -#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 -typedef unsigned int uintptr_t; -typedef int intptr_t; -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 -typedef unsigned long uintptr_t; -typedef long intptr_t; -#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T -typedef uint64_t uintptr_t; -typedef int64_t intptr_t; -#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ -typedef unsigned long uintptr_t; -typedef long intptr_t; -#endif -#endif -#endif - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#ifndef UINT32_C - -/* Signed. */ -# define INT8_C(c) c -# define INT16_C(c) c -# define INT32_C(c) c -# ifdef _HAVE_LONGLONG_UINT64_T -# define INT64_C(c) c ## L -# else -# define INT64_C(c) c ## LL -# endif - -/* Unsigned. */ -# define UINT8_C(c) c ## U -# define UINT16_C(c) c ## U -# define UINT32_C(c) c ## U -# ifdef _HAVE_LONGLONG_UINT64_T -# define UINT64_C(c) c ## UL -# else -# define UINT64_C(c) c ## ULL -# endif - -/* Maximal type. */ -# ifdef _HAVE_LONGLONG_UINT64_T -# define INTMAX_C(c) c ## L -# define UINTMAX_C(c) c ## UL -# else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL -# endif - - /* literalnumbers */ -#endif -#endif - -/* These limits are merily those of a two complement byte-oriented system */ - -/* Minimum of signed integral types. */ -# define INT8_MIN (-128) -# define INT16_MIN (-32767-1) -# define INT32_MIN (-2147483647-1) -# define INT64_MIN (-__INT64_C(9223372036854775807)-1) -/* Maximum of signed integral types. */ -# define INT8_MAX (127) -# define INT16_MAX (32767) -# define INT32_MAX (2147483647) -# define INT64_MAX (__INT64_C(9223372036854775807)) - -/* Maximum of unsigned integral types. */ -# define UINT8_MAX (255) -# define UINT16_MAX (65535) -# define UINT32_MAX (4294967295U) -# define UINT64_MAX (__UINT64_C(18446744073709551615)) - -/* Minimum of signed integral types having a minimum size. */ -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# define INT_LEAST64_MIN INT64_MIN -/* Maximum of signed integral types having a minimum size. */ -# define INT_LEAST8_MAX INT8_MAX -# define INT_LEAST16_MAX INT16_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST64_MAX INT64_MAX - -/* Maximum of unsigned integral types having a minimum size. */ -# define UINT_LEAST8_MAX UINT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define UINT_LEAST64_MAX UINT64_MAX - - /* shortcircuit*/ -#endif - /* once */ -#endif -#endif -STDINT_EOF -fi - if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_stdint_h is unchanged" >&5 -$as_echo "$as_me: $ac_stdint_h is unchanged" >&6;} - else - ac_dir=`$as_dirname -- "$ac_stdint_h" || -$as_expr X"$ac_stdint_h" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_stdint_h" : 'X\(//\)[^/]' \| \ - X"$ac_stdint_h" : 'X\(//\)$' \| \ - X"$ac_stdint_h" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_stdint_h" | - 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 - rm -f $ac_stdint_h - mv $ac_stdint $ac_stdint_h - fi ;; "libtool":C) @@ -19509,7 +18422,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -19530,7 +18443,7 @@ if test "$no_create" != yes; then 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 $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/configure.in b/configure.in index 7af73e4..bdbb136 100644 --- a/configure.in +++ b/configure.in @@ -3,7 +3,7 @@ dnl | Network UPS Tools: configure.in | dnl +------------------------------------------------------------------+ dnl NUT version number is defined here and *only* here (no more include/version) -AC_INIT(nut, 2.6.0) +AC_INIT(nut, 2.6.1) AC_CONFIG_SRCDIR(server/upsd.c) AC_CONFIG_MACRO_DIR([m4]) echo "Network UPS Tools version ${PACKAGE_VERSION}" @@ -108,6 +108,14 @@ then CFLAGS="${CFLAGS} -Wall -Wsign-compare" fi +case ${target_os} in + hpux11* ) + dnl It seems like the thread safe string functions won't be included + dnl on 64 bit HP-UX unless we define _REENTRANT + CFLAGS="${CFLAGS} -D_REENTRANT" + ;; +esac + dnl optind handling: dnl need to check if unistd.h is enough, else try getopt.h, else need decls AC_CHECK_DECLS(optind, [], [ @@ -148,7 +156,6 @@ AC_CHECK_HEADERS(sys/modem.h stdarg.h varargs.h sys/termios.h sys/time.h, [], [] dnl ---------------------------------------------------------------------- dnl Check for types and define possible replacements -AX_CREATE_STDINT_H(include/nut_stdint.h) NUT_TYPE_SOCKLEN_T dnl ---------------------------------------------------------------------- @@ -156,7 +163,7 @@ dnl check for --with-all (or --without-all, or --with-all=auto) flag AC_MSG_CHECKING(for --with-all) AC_ARG_WITH(all, - AS_HELP_STRING([--with-all], [enable serial, usb, snmp, hal, cgi, dev, neon, powerman]), + AS_HELP_STRING([--with-all], [enable serial, usb, snmp, neon, powerman, cgi, dev]), [ if test -n "${withval}"; then dnl Note: we allow "no" as a positive value, because @@ -164,7 +171,6 @@ AC_ARG_WITH(all, if test -z "${with_serial}"; then with_serial="${withval}"; fi if test -z "${with_usb}"; then with_usb="${withval}"; fi if test -z "${with_snmp}"; then with_snmp="${withval}"; fi - if test -z "${with_hal}"; then with_hal="${withval}"; fi if test -z "${with_neon}"; then with_neon="${withval}"; fi if test -z "${with_powerman}"; then with_powerman="${withval}"; fi if test -z "${with_cgi}"; then with_cgi="${withval}"; fi @@ -848,12 +854,14 @@ dnl same for datadir conftemp="${datadir}" eval conftemp=\"${conftemp}\" eval conftemp=\"${conftemp}\" +DATADIR=${conftemp} AC_DEFINE_UNQUOTED(DATADIR, "${conftemp}", [Default path for data files]) dnl same for bindir conftemp="${bindir}" eval conftemp=\"${conftemp}\" eval conftemp=\"${conftemp}\" +BINDIR=${conftemp} AC_DEFINE_UNQUOTED(BINDIR, "${conftemp}", [Default path for user executables]) AC_SUBST(OS_NAME) diff --git a/data/Makefile.in b/data/Makefile.in index fb8e69a..b70eda8 100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@ -42,7 +42,6 @@ DIST_COMMON = $(dist_data_DATA) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/driver.list.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/data/cmdvartab b/data/cmdvartab index f594412..1765213 100644 --- a/data/cmdvartab +++ b/data/cmdvartab @@ -3,12 +3,13 @@ # This file is optional. You may delete it to save resources, but # clients will receive "Unavailable" for any description requests. # -# *** NOTE *** : When updating this file, also update docs/new-names.txt +# *** NOTE *** : When updating this file, also update docs/nut-names.txt VARDESC ups.alarm "UPS alarms" VARDESC ups.status "UPS status" VARDESC ups.time "Internal UPS clock time" VARDESC ups.date "Internal UPS clock date" +VARDESC ups.efficiency "Efficiency of the UPS" VARDESC ups.model "UPS model" VARDESC ups.mfr "UPS manufacturer" VARDESC ups.mfr.date "UPS manufacturing date" diff --git a/data/driver.list.in b/data/driver.list.in index f5501c7..d1b2d5e 100644 --- a/data/driver.list.in +++ b/data/driver.list.in @@ -184,6 +184,7 @@ "Delta" "ups" "1" "GES602N" "" "belkin" "Deltec" "ups" "1" "PowerRite Pro II" "" "genericups upstype=15" +"Deltec" "ups" "4" "PRM 450/700/1000/1500" "" "upscode2" "Digital Loggers" "pdu" "1" "LPC, EPCR2, DIN" "8 outlets" "powerman-pdu (experimental)" @@ -196,6 +197,7 @@ "Dynex" "ups" "2" "DX-800U" "USB" "usbhid-ups" "Eaton" "ups" "5" "Protection Station 500/650/800 VA" "USB" "usbhid-ups" +"Eaton" "ups" "5" "Ellipse ECO 650/800/1200/1600 VA" "USB" "usbhid-ups" "Eaton" "ups" "5" "Ellipse ASR USBS 600/750/1000/1500 VA" "USB cable" "usbhid-ups" "Eaton" "ups" "5" "Ellipse MAX USBS 600/850/1100/1500 VA" "USB cable" "usbhid-ups" "Eaton" "ups" "5" "Evolution 650/850/1150/1550/2000 VA" "USB port" "usbhid-ups" @@ -204,6 +206,7 @@ "Eaton" "ups" "5" "EX 2200/3000/3000 XL VA" "USB port" "usbhid-ups" "Eaton" "ups" "5" "EX 1000 RT2U / 1500 RT2U" "USB port" "usbhid-ups" "Eaton" "ups" "5" "MX 5/8/10/15/20 kVA" "USB port" "usbhid-ups" +"Eaton" "ups" "5" "5 PX" "USB port" "usbhid-ups" "Eaton" "ups" "5" "Nova AVR 625/1250" "USB" "usbhid-ups" "Eaton" "ups" "5" "Ellipse ASR USBS 600/750/1000/1500 VA" "Serial cable" "mge-shut or newmge-shut" "Eaton" "ups" "5" "Ellipse MAX USBS 600/850/1100/1500 VA" "Serial cable" "mge-shut or newmge-shut" @@ -213,12 +216,14 @@ "Eaton" "ups" "5" "EX 2200/3000/3000 XL VA" "Serial port" "mge-shut or newmge-shut" "Eaton" "ups" "5" "EX 1000 RT2U / 1500 RT2U" "Serial port" "mge-shut or newmge-shut" "Eaton" "ups" "5" "MX 5/8/10/15/20 kVA" "Serial port" "mge-shut or newmge-shut" +"Eaton" "ups" "5" "5 PX" "Serial port" "mge-shut or newmge-shut" "Eaton" "ups" "5" "EX RT 1:1 7/11 kVA" "" "mge-shut or newmge-shut" "Eaton" "ups" "5" "EX RT 3:1 5/7/11 kVA" "" "mge-shut or newmge-shut" "Eaton" "ups" "5" "EX RT (XML/HTTP)" "NMC Transverse card (ref 66074)" "netxml-ups (experimental)" "Eaton" "ups" "5" "EX RT (SNMP)" "NMC Transverse card (ref 66074)" "snmp-ups (experimental)" "Eaton" "ups" "5" "E Series NV UPS 400-2000 VA" "" "blazer_usb" "Eaton" "ups" "5" "E Series DX UPS 1-20 kVA" "" "mge-utalk" +"Eaton" "ups" "4" "NetUPS SE 450/700/1000/1500" "" "upscode2" "Eaton" "ups" "5" "BladeUPS (SNMP)" "ConnectUPS Web/SNMP Card" "snmp-ups (experimental)" "Eaton" "ups" "5" "various models (XML/HTTP mode)" "NMC Minislot (Ref 66102)" "netxml-ups (experimental)" "Eaton" "ups" "5" "various models (SNMP mode)" "NMC Minislot (Ref 66102)" "snmp-ups (experimental)" @@ -227,6 +232,7 @@ "Eaton" "pdu" "5" "ePDU Managed" "" "snmp-ups (experimental)" "Eaton" "pdu" "5" "ePDU Monitored" "" "snmp-ups or netxml-ups" "Eaton" "ups" "5" "Powerware 9130" "" "bcmxcp or usbhid-ups" +"Eaton" "ups" "5" "Powerware 9140" "" "bcmxcp or usbhid-ups" "Eaton" "ups" "5" "Powerware 5130" "" "usbhid-ups" "Eaton" "ups" "5" "9395" "Serial port" "bcmxcp" "Eaton" "ups" "5" "Best Ferrups" "older ConnectUPS" "snmp-ups" @@ -247,6 +253,7 @@ "Ever-Power" "ups" "1" "625/1000" "" "safenet" "Exide" "ups" "1" "NetUPS SE" "" "genericups upstype=15" +"Exide" "ups" "4" "NetUPS SE 450/700/1000/1500" "" "upscode2" "Fenton Technologies" "ups" "1" "PowerPal" "P-series" "safenet" "Fenton Technologies" "ups" "5" "PowerPal" "L-series" "blazer_ser" @@ -274,6 +281,8 @@ "Gamatronic" "ups" "5" "MS" "" "gamatronic" "Gamatronic" "ups" "5" "µPS3/1" "" "gamatronic" +"GE" "ups" "2" "EP series" "" "blazer_usb" + "Geek Squad" "ups" "2" "GS1285U" "USB" "usbhid-ups" "Gemini" "ups" "1" "UPS625/UPS1000" "" "safenet" @@ -303,7 +312,8 @@ "Inform" "ups" "1" "GUARD" "Line Interactive AP model" "powercom" "Inform" "ups" "2" "Guard S 1500AP" "" "blazer_ser" -"Inform" "ups" "2" "Informer Compact 1000VA" "" "blazer_ser" +"Inform" "ups" "2" "Informer Compact 1000-2000-3000 VA" "" "blazer_ser" +"Inform" "ups" "2" "Sinus SS 210" "" "blazer_ser" "Infosec" "ups" "2" "iPEL 350" "" "blazer_ser" "Infosec" "ups" "2" "iPEL 500" "" "blazer_ser" @@ -313,6 +323,8 @@ "Infosec" "ups" "2" "XP 500" "USB" "blazer_usb" "Infosec" "ups" "2" "XP 1000" "" "blazer_ser" +"IPAR" "ups" "2" "Mini Energy ME 800" "" "blazer_usb" + "IPMI" "pdu" "1" "" "" "powerman-pdu (experimental)" "Ippon" "ups" "2" "Back Power Pro 400/500/600/700/800" "" "blazer_ser" @@ -554,6 +566,7 @@ "Mustek" "ups" "2" "Powermust" "2000VA USB" "blazer_ser" "Mustek" "ups" "2" "Powermust Office 650" "USB" "blazer_usb" "Mustek" "ups" "2" "PowerMust 424 / 636 / 848" "USB" "blazer_usb" +"Mustek" "ups" "2" "Yukai PowerMust" "1000 USB (PID: 5161)" "blazer_usb" "Mustek" "ups" "2" "Various" "" "blazer_ser" "Neus" "ups" "2" "400va / 600va" "" "blazer_ser" @@ -562,6 +575,8 @@ "Nitram" "ups" "1" "Elite 2002" "" "genericups upstype=16" "Nitram" "ups" "1" "Elite 2005" "" "powerpanel" +"NUMERIC" "ups" "2" "3000 SW" "" "blazer_ser" + "Oneac" "ups" "1" "ON400" "advanced interface" "oneac" "Oneac" "ups" "1" "ON600" "advanced interface" "oneac" "Oneac" "ups" "1" "ON900" "advanced interface" "oneac" @@ -662,7 +677,7 @@ "Repotec" "ups" "1" "RPT-800A" "" "genericups upstype=13" "Repotec" "ups" "1" "RPT-162A" "" "genericups upstype=13" -"Rocketfish" "ups" "2" "RF-1000VA / RF-1025VA" "" "usbhid-ups" +"Rocketfish" "ups" "2" "RF-1000VA / RF-1025VA" "" "usbhid-ups" "SmartLabs" "pdu" "1" "2412S Power Line Modem" "for X10/Insteon" "powerman-pdu (experimental)" @@ -692,8 +707,9 @@ "SuperPower" "ups" "2" "HP360, Hope-550" "" "blazer_ser" -"SVEN" "ups" "2" "Power Pro+ series" "USB" "blazer_usb" -"SVEN" "ups" "2" "Power Smart RM 2000" "USB" "blazer_usb" +"SVEN" "ups" "2" "Power Pro+ series" "USB" "blazer_usb (USB ID 05b8:0000)" +"SVEN" "ups" "1" "Power Pro+ series" "USB" "richcomm_usb (USB ID 0925:1234)" +"SVEN" "ups" "2" "Power Smart RM 2000" "USB" "blazer_usb (USB ID 05b8:0000)" "Sweex" "ups" "1" "500/1000" "smart - shipped with SafeNet" "safenet" "Sweex" "ups" "1" "500/1000" "" "genericups upstype=7" @@ -722,6 +738,8 @@ "Tripp-Lite" "ups" "2" "AVR750U" "USB" "usbhid-ups" "Tripp-Lite" "ups" "2" "ECO550UPS" "USB" "usbhid-ups" "Tripp-Lite" "ups" "2" "SmartOnline SU1500RTXL2ua" "USB" "usbhid-ups" +"Tripp-Lite" "ups" "2" "Smart1000LCD" "USB" "usbhid-ups" +"Tripp-Lite" "ups" "2" "Smart1500LCD" "USB" "usbhid-ups" "Tripp-Lite" "ups" "2" "smart2200RMXL2U" "USB, newer models" "usbhid-ups" "Trust" "ups" "2" "UPS 1000 Management PW-4105" "" "blazer_ser" @@ -755,6 +773,8 @@ "Viewsonic" "ups" "1" "PowerES" "420E" "optiups" +"Vivaldi" "ups" "1" "EA200 LED" "USB" "richcomm_usb" + "WinPower" "ups" "2" "CPM-800" "" "blazer_ser" "WTI" "pdu" "1" "RPS-10" "10 outlets" "powerman-pdu (experimental)" diff --git a/data/html/Makefile.in b/data/html/Makefile.in index 7685a37..3e63f89 100644 --- a/data/html/Makefile.in +++ b/data/html/Makefile.in @@ -40,7 +40,6 @@ DIST_COMMON = README $(am__dist_html_DATA_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/header.html.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/docs/FAQ.txt b/docs/FAQ.txt index fb913e4..2e6126a 100644 --- a/docs/FAQ.txt +++ b/docs/FAQ.txt @@ -299,15 +299,12 @@ things depending on what's supported: it into powering up whenever line power is present - Teach a monkey to watch the machine and press the power button when the outage is over. - This might work, but it creates high produce bills. If you can't use one of the first two options, give the board to an enemy. Let them worry about it. -== My PowerMac G4 won't power back up by itself (into Linux) after the UPS shuts down. What can I do about this? - -*Answer 1* +== My Mac won't power back up by itself into Linux after the UPS shuts down. What can I do about this? This is about the same situation as the ATX question above, only worse. Earlier Macs apparently supported a hack where you could @@ -324,15 +321,20 @@ From Usenet post <6boftzxz51.fsf@ecc-office.sp.cs.cmu.edu>: autoboot.adb contains these three bytes (in hex): 01 13 01 -Unfortunately, the hardware has evolved and there is no good -equivalent for this hack on today's systems. +Later PowerPC Macs with a PMU and the appropriate kernel driver can achieve the +same effect with the following command: -If you find out how to do this, please send me some mail, since -this affects one of my systems and my stop-gap solution is getting -cranky. + echo server_mode=1 > /proc/pmu/options -Note: this question has been in the FAQ for over a year and -there's still no answer. Let me guess: everyone who runs a server +The following pages have some slightly more kludgy answers which involve the +use of `setpci`, and are highly model-specific: + + - http://mythic-beasts.com/support/macminicolo_howto.html + - http://superuser.com/questions/212434/reboot-after-power-failure-for-mac-running-ubuntu + - http://ubuntuforums.org/showthread.php?t=1209576 + +Note: this question has been in the FAQ for several years now, and +there's still no clean answer. Let me guess: everyone who runs a server on Mac hardware has a team of trained monkeys, and feeds them by growing bananas in the tropical environment formed by waste heat from the equipment. @@ -341,14 +343,14 @@ The rest of us are still waiting for the answer. Booting into the Mac OS to frob the "file server" panel is not an acceptable solution. -*Answer 2* +== My Mac won't power back up by itself into Mac OS X after the UPS shuts down. What can I do about this? -If you're on OS X, this is relatively simple to fix. Go to system -preferences, click on energy saver, click on the options tab, check -"Restart automatically after a power failure". +This is relatively simple to fix. If you have console or VNC access, log in as +an administrator, go to System Preferences, click on energy saver, click on the +options tab, check "Restart automatically after a power failure". -If you're on some other OS, hope they've figured out how to duplicate -the above in a non-simian manner. +Alternatively, you can connect via SSH and run "sudo pmset autorestart 1" to +achieve the same effect. == I want to keep the drivers and upsd in their own security domains. How can this be accomplished? diff --git a/docs/Makefile.in b/docs/Makefile.in index d39db23..1030704 100644 --- a/docs/Makefile.in +++ b/docs/Makefile.in @@ -38,7 +38,6 @@ subdir = docs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/docs/configure.txt b/docs/configure.txt index 31ffed3..180ad7d 100644 --- a/docs/configure.txt +++ b/docs/configure.txt @@ -75,8 +75,8 @@ Build and install the upsclient library and header files. --with-all (no default) -Build and install all of the above (the serial, USB, and SNMP -drivers, the CGI programs and HTML files, and the upsclient +Build and install all of the above (the serial, USB, SNMP, XML/HTTP and +PowerMan drivers, the CGI programs and HTML files, and the upsclient library). --with-ssl (default: auto-detect) diff --git a/docs/documentation.txt b/docs/documentation.txt index 2d21868..8e84b4d 100644 --- a/docs/documentation.txt +++ b/docs/documentation.txt @@ -53,7 +53,7 @@ These are writeups by users of the software. - link:http://www.dimat.unina2.it/LCS/MonitoraggioUpsNutUbuntu10-eng.htm[Deploying NUT on an Ubuntu 10.04 cluster] '(Stefano Angelone)' - link:http://blog.shadypixel.com/monitoring-a-ups-with-nut-on-debian-or-ubuntu-linux[Monitoring a UPS with nut on Debian or Ubuntu Linux] '(Avery Fay)' - link:http://linux.developpez.com/cours/upsusb/[Installation et gestion d'un UPS USB en réseau sous linux] '(Olivier Van Hoof, french)' -- link:http://boxster.ghz.cc/projects/nut/wiki/NutOnMacOSX[Network UPS Tools (NUT) on Mac OS X (10.4.10)] '(Andy Poush)' +- link:http://trac.networkupstools.org/projects/nut/wiki/NutOnMacOSX[Network UPS Tools (NUT) on Mac OS X (10.4.10)] '(Andy Poush)' - link:http://www.llondel.org/ups.shtml[Interfacing a Contact-Closure UPS to Mac OS X and Linux] '(David Hough)' - link:http://fedoranews.org/contributors/kazutoshi_morioka/nut/[How to use UPS with nut on RedHat / Fedora Core] '(Kazutoshi Morioka)' - link:http://people.freebsd.org/~thierry/nut_FreeBSD_HowTo.txt[FreeBSD installation procedure] '(Thierry Thomas, from FreeBSD)' diff --git a/docs/download.txt b/docs/download.txt index c551902..d4a25c2 100644 --- a/docs/download.txt +++ b/docs/download.txt @@ -23,10 +23,11 @@ to do so. Stable tree: 2.6 ~~~~~~~~~~~~~~~~ -link:http://www.networkupstools.org/source/2.6/nut-2.6.0.tar.gz[nut-2.6.0.tar.gz] -link:http://www.networkupstools.org/source/2.6/nut-2.6.0.tar.gz.sig[signature] -link:http://www.networkupstools.org/source/2.6/new-2.6.0.txt[release notes] -link:http://www.networkupstools.org/source/2.6/ChangeLog[ChangeLog] +- link:http://www.networkupstools.org/source/2.6/nut-2.6.1.tar.gz[nut-2.6.1.tar.gz] +- link:http://www.networkupstools.org/source/2.6/nut-2.6.1.tar.gz.sig[PGP/GPG signature] +- SHA-256 sum: 4ba1d297a98190db0ae86eb31136c780f35e6d3f47ae845316b44eaa9245a86e +- link:http://www.networkupstools.org/source/2.6/new-2.6.1.txt[Release notes] +- link:http://www.networkupstools.org/source/2.6/ChangeLog[ChangeLog] You can also browse the link:http://www.networkupstools.org/source/2.6/[stable source directory]. @@ -48,7 +49,7 @@ link:http://alioth.debian.org/[Debian Alioth server]. To retrieve the current development tree, use the following command: - $ svn co svn://svn.debian.org/nut/trunk + $ svn co svn://anonscm.debian.org/nut/trunk To generate the build scripts, you must call, from the 'trunk' directory: @@ -69,9 +70,8 @@ use <>. Browse code ^^^^^^^^^^^ -You can also browse the code with link:http://svn.debian.org/wsvn/nut/trunk/?rev=0&sc=0[WebSvn]. - -Or through the link:http://boxster.ghz.cc/projects/nut[Trac mirror], +You can also browse the code with link:http://alioth.debian.org/scm/?group_id=30602[WebSvn], +or through the link:http://trac.networkupstools.org/projects/nut[Trac mirror], kindly hosted and maintained by Charles Lepple. [[Snapshots]] @@ -113,5 +113,6 @@ link:http://www.openbsd.org/cgi-bin/cvsweb/ports/sysutils/nut/[OpenBSD]. link:http://pdb.finkproject.org/pdb/package.php/nut[Fink], link:http://trac.macports.org/browser/trunk/dports/sysutils/nut/Portfile[MacPorts] -- Windows (client side only): -link:http://csociety.ecn.purdue.edu/~delpha/winnut/[WinNUT] +- Windows (complete port, Beta): +link:http://www.networkupstools.org/source/2.6/NUT-Installer-2.6.0-1.msi[Windows MSI installer 2.6.0-1] + diff --git a/docs/features.txt b/docs/features.txt index 5e49483..d114ea1 100644 --- a/docs/features.txt +++ b/docs/features.txt @@ -235,5 +235,4 @@ The other systems are Slaves of UPS 2. Image credits ------------- -Thanks to Luc Descotils and Arnaud Quette at Eaton for providing shiny -cleaned-up graphics. +Thanks to Eaton for providing shiny modern graphics. diff --git a/docs/images/advanced.png b/docs/images/advanced.png index 1aaf75d..8f1df80 100644 Binary files a/docs/images/advanced.png and b/docs/images/advanced.png differ diff --git a/docs/images/bigbox.png b/docs/images/bigbox.png index e552b4a..37c792a 100644 Binary files a/docs/images/bigbox.png and b/docs/images/bigbox.png differ diff --git a/docs/images/bizarre.png b/docs/images/bizarre.png index 4e97eaa..0c56884 100644 Binary files a/docs/images/bizarre.png and b/docs/images/bizarre.png differ diff --git a/docs/images/simple.png b/docs/images/simple.png index d30355f..ab1acad 100644 Binary files a/docs/images/simple.png and b/docs/images/simple.png differ diff --git a/docs/man/Makefile.in b/docs/man/Makefile.in index 78a79f9..81b7335 100644 --- a/docs/man/Makefile.in +++ b/docs/man/Makefile.in @@ -63,7 +63,6 @@ subdir = docs/man DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/docs/man/apcsmart.8 b/docs/man/apcsmart.8 index 4c0075b..31efce5 100644 --- a/docs/man/apcsmart.8 +++ b/docs/man/apcsmart.8 @@ -2,12 +2,12 @@ .\" Title: apcsmart .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "APCSMART" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "APCSMART" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bcmxcp.8 b/docs/man/bcmxcp.8 index 2a7af9d..503db8a 100644 --- a/docs/man/bcmxcp.8 +++ b/docs/man/bcmxcp.8 @@ -2,12 +2,12 @@ .\" Title: bcmxcp .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BCMXCP" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BCMXCP" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bcmxcp_usb.8 b/docs/man/bcmxcp_usb.8 index 591c43e..628435f 100644 --- a/docs/man/bcmxcp_usb.8 +++ b/docs/man/bcmxcp_usb.8 @@ -2,12 +2,12 @@ .\" Title: bcmxcp_usb .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BCMXCP_USB" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BCMXCP_USB" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/belkin.8 b/docs/man/belkin.8 index 4aa1378..07b0e2c 100644 --- a/docs/man/belkin.8 +++ b/docs/man/belkin.8 @@ -2,12 +2,12 @@ .\" Title: belkin .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BELKIN" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BELKIN" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/belkinunv.8 b/docs/man/belkinunv.8 index eca4c8c..2e1ed16 100644 --- a/docs/man/belkinunv.8 +++ b/docs/man/belkinunv.8 @@ -2,12 +2,12 @@ .\" Title: belkinunv .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BELKINUNV" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BELKINUNV" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bestfcom.8 b/docs/man/bestfcom.8 index dfeafd1..e57a232 100644 --- a/docs/man/bestfcom.8 +++ b/docs/man/bestfcom.8 @@ -2,12 +2,12 @@ .\" Title: bestfcom .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BESTFCOM" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BESTFCOM" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bestfortress.8 b/docs/man/bestfortress.8 index 031c8fe..d169d47 100644 --- a/docs/man/bestfortress.8 +++ b/docs/man/bestfortress.8 @@ -2,12 +2,12 @@ .\" Title: bestfortress .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BESTFORTRESS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BESTFORTRESS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bestuferrups.8 b/docs/man/bestuferrups.8 index e45ab0a..59f7bee 100644 --- a/docs/man/bestuferrups.8 +++ b/docs/man/bestuferrups.8 @@ -2,12 +2,12 @@ .\" Title: bestuferrups .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BESTUFERRUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BESTUFERRUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/bestups.8 b/docs/man/bestups.8 index aed0cee..4849183 100644 --- a/docs/man/bestups.8 +++ b/docs/man/bestups.8 @@ -2,12 +2,12 @@ .\" Title: bestups .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BESTUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BESTUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/blazer.8 b/docs/man/blazer.8 index 781eea8..daa7244 100644 --- a/docs/man/blazer.8 +++ b/docs/man/blazer.8 @@ -2,12 +2,12 @@ .\" Title: blazer .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "BLAZER" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "BLAZER" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/clone.8 b/docs/man/clone.8 index 94b04be..75ebf97 100644 --- a/docs/man/clone.8 +++ b/docs/man/clone.8 @@ -2,12 +2,12 @@ .\" Title: clone .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "CLONE" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "CLONE" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/dummy-ups.8 b/docs/man/dummy-ups.8 index f50bf03..ba9b312 100644 --- a/docs/man/dummy-ups.8 +++ b/docs/man/dummy-ups.8 @@ -2,12 +2,12 @@ .\" Title: dummy-ups .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "DUMMY\-UPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "DUMMY\-UPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -63,7 +63,7 @@ For instance: .RE .\} .sp -This file is generally named "something\&.dev"\&. It contains a list of all valid data and associated values, and has the same format as an \fBupsc\fR(8) dump (: )\&. So you can easilly create definition files from an existing UPS using "upsc > file\&.dev"\&. It can also be empty, in which case only a basic set of data is available: device\&.\fB, driver\&.\fR, ups\&.mfr, ups\&.model, ups\&.status +This file is generally named "something\&.dev"\&. It contains a list of all valid data and associated values, and has the same format as an \fBupsc\fR(8) dump (: )\&. So you can easily create definition files from an existing UPS using "upsc > file\&.dev"\&. It can also be empty, in which case only a basic set of data is available: device\&.\fB, driver\&.\fR, ups\&.mfr, ups\&.model, ups\&.status .sp Samples definition files are available in the "data" directory of the nut source tree, and generally in the sysconfig directory of your system distribution\&. .sp diff --git a/docs/man/dummy-ups.txt b/docs/man/dummy-ups.txt index ef55db5..496e8db 100644 --- a/docs/man/dummy-ups.txt +++ b/docs/man/dummy-ups.txt @@ -55,7 +55,7 @@ For instance: This file is generally named "something.dev". It contains a list of all valid data and associated values, and has the same format as an linkman:upsc[8] -dump (: ). So you can easilly create definition +dump (: ). So you can easily create definition files from an existing UPS using "upsc > file.dev". It can also be empty, in which case only a basic set of data is available: device.*, driver.*, ups.mfr, ups.model, ups.status diff --git a/docs/man/etapro.8 b/docs/man/etapro.8 index 236dd99..7f91bbc 100644 --- a/docs/man/etapro.8 +++ b/docs/man/etapro.8 @@ -2,12 +2,12 @@ .\" Title: etapro .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "ETAPRO" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "ETAPRO" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/everups.8 b/docs/man/everups.8 index 94ce786..9d7538b 100644 --- a/docs/man/everups.8 +++ b/docs/man/everups.8 @@ -2,12 +2,12 @@ .\" Title: everups .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "EVERUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "EVERUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/gamatronic.8 b/docs/man/gamatronic.8 index 2c64b44..9503f1e 100644 --- a/docs/man/gamatronic.8 +++ b/docs/man/gamatronic.8 @@ -2,12 +2,12 @@ .\" Title: gamatronic .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "GAMATRONIC" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "GAMATRONIC" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/genericups.8 b/docs/man/genericups.8 index 64a8b74..a0403e5 100644 --- a/docs/man/genericups.8 +++ b/docs/man/genericups.8 @@ -2,12 +2,12 @@ .\" Title: genericups .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "GENERICUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "GENERICUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/hosts.conf.5 b/docs/man/hosts.conf.5 index caf89a3..4b7245d 100644 --- a/docs/man/hosts.conf.5 +++ b/docs/man/hosts.conf.5 @@ -2,12 +2,12 @@ .\" Title: hosts.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "HOSTS\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "HOSTS\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/isbmex.8 b/docs/man/isbmex.8 index f649265..b74b2de 100644 --- a/docs/man/isbmex.8 +++ b/docs/man/isbmex.8 @@ -2,12 +2,12 @@ .\" Title: isbmex .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "ISBMEX" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "ISBMEX" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/ivtscd.8 b/docs/man/ivtscd.8 index f1365f2..9d25e5a 100644 --- a/docs/man/ivtscd.8 +++ b/docs/man/ivtscd.8 @@ -2,12 +2,12 @@ .\" Title: ivtscd .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "IVTSCD" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "IVTSCD" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/libupsclient-config.1 b/docs/man/libupsclient-config.1 index 99d9dcd..74f1382 100644 --- a/docs/man/libupsclient-config.1 +++ b/docs/man/libupsclient-config.1 @@ -2,12 +2,12 @@ .\" Title: libupsclient-config .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "LIBUPSCLIENT\-CONFIG" "1" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "LIBUPSCLIENT\-CONFIG" "1" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/liebert-esp2.8 b/docs/man/liebert-esp2.8 index d574af1..779ee90 100644 --- a/docs/man/liebert-esp2.8 +++ b/docs/man/liebert-esp2.8 @@ -2,12 +2,12 @@ .\" Title: liebert-esp2 .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "LIEBERT\-ESP2" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "LIEBERT\-ESP2" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/liebert.8 b/docs/man/liebert.8 index b1524fa..ab2530a 100644 --- a/docs/man/liebert.8 +++ b/docs/man/liebert.8 @@ -2,12 +2,12 @@ .\" Title: liebert .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "LIEBERT" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "LIEBERT" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/masterguard.8 b/docs/man/masterguard.8 index 11dc582..7ea77e7 100644 --- a/docs/man/masterguard.8 +++ b/docs/man/masterguard.8 @@ -2,12 +2,12 @@ .\" Title: masterguard .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "MASTERGUARD" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "MASTERGUARD" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/metasys.8 b/docs/man/metasys.8 index 7d0f54c..6edef80 100644 --- a/docs/man/metasys.8 +++ b/docs/man/metasys.8 @@ -2,12 +2,12 @@ .\" Title: metasys .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "METASYS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "METASYS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -124,7 +124,7 @@ This driver supports no extra arguments from \fBups.conf\fR(5)\&. .sp This driver has been tested on Meta System HF Millennium 820 and ally HF 1000 only\&. .sp -Any informations about the use of the driver with the other listed UPS are really welcome\&. +Any information about the use of the driver with the other listed UPS are really welcome\&. .SH "AUTHOR" .sp Fabio Di Niro diff --git a/docs/man/metasys.txt b/docs/man/metasys.txt index 2e29557..4a6fc2e 100644 --- a/docs/man/metasys.txt +++ b/docs/man/metasys.txt @@ -44,7 +44,7 @@ BUGS This driver has been tested on Meta System HF Millennium 820 and ally HF 1000 only. -Any informations about the use of the driver with the other listed +Any information about the use of the driver with the other listed UPS are really welcome. AUTHOR diff --git a/docs/man/mge-shut.8 b/docs/man/mge-shut.8 index d174e06..bd602a1 100644 --- a/docs/man/mge-shut.8 +++ b/docs/man/mge-shut.8 @@ -2,12 +2,12 @@ .\" Title: mge-shut .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "MGE\-SHUT" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "MGE\-SHUT" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/mge-utalk.8 b/docs/man/mge-utalk.8 index 82d1812..32462ef 100644 --- a/docs/man/mge-utalk.8 +++ b/docs/man/mge-utalk.8 @@ -2,12 +2,12 @@ .\" Title: mge-utalk .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "MGE\-UTALK" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "MGE\-UTALK" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/microdowell.8 b/docs/man/microdowell.8 index a166d56..8a97ec4 100644 --- a/docs/man/microdowell.8 +++ b/docs/man/microdowell.8 @@ -2,12 +2,12 @@ .\" Title: microdowell .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "MICRODOWELL" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "MICRODOWELL" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/netxml-ups.8 b/docs/man/netxml-ups.8 index 2ecc4e0..49eec6a 100644 --- a/docs/man/netxml-ups.8 +++ b/docs/man/netxml-ups.8 @@ -2,12 +2,12 @@ .\" Title: netxml-ups .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "NETXML\-UPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "NETXML\-UPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/nut.conf.5 b/docs/man/nut.conf.5 index 9665388..f48a192 100644 --- a/docs/man/nut.conf.5 +++ b/docs/man/nut.conf.5 @@ -2,12 +2,12 @@ .\" Title: nut.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "NUT\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "NUT\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/nutupsdrv.8 b/docs/man/nutupsdrv.8 index 043fed2..1ddc49e 100644 --- a/docs/man/nutupsdrv.8 +++ b/docs/man/nutupsdrv.8 @@ -2,12 +2,12 @@ .\" Title: nutupsdrv .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "NUTUPSDRV" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "NUTUPSDRV" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/oneac.8 b/docs/man/oneac.8 index 507e23c..1ff049f 100644 --- a/docs/man/oneac.8 +++ b/docs/man/oneac.8 @@ -2,12 +2,12 @@ .\" Title: oneac .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "ONEAC" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "ONEAC" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/optiups.8 b/docs/man/optiups.8 index ec18abc..eda8030 100644 --- a/docs/man/optiups.8 +++ b/docs/man/optiups.8 @@ -2,12 +2,12 @@ .\" Title: optiups .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "OPTIUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "OPTIUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/powercom.8 b/docs/man/powercom.8 index d3a4560..7f48c2f 100644 --- a/docs/man/powercom.8 +++ b/docs/man/powercom.8 @@ -2,12 +2,12 @@ .\" Title: powercom .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "POWERCOM" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "POWERCOM" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -41,7 +41,7 @@ This driver supports the following optional settings in the \fBups.conf\fR(5) fi .PP \fBlinevoltage\fR=\fIvalue\fR .RS 4 -An integer specifying the mains voltage\&. It can\(cqt be auto detected\&. Acceptable values are in the range of 110\(em120 or 220\(em240\&. The default is +An integer specifying the line voltage\&. It can\(cqt be auto detected\&. Acceptable values are in the range of 110\-120 or 220\-240\&. The default is \fI230\fR\&. .RE .PP @@ -66,23 +66,30 @@ Like modelname above, but for the serial number\&. The default is \fBtype\fR=\fIname\fR .RS 4 The exact type of the communication protocol within the powercom family, that will be used to communicate with the UPS\&. The type is named after the first modelname that was coded with that protocol\&. The acceptable names are -\fIKP625AP\fR, \fITrust\fR, \fIEgys\fR, +\fIKP625AP\fR, +\fIIMP\fR, \fIKIN\fR, -\fIBNT\fR, -\fIIMP\fR -and +\fIBNT\fR, and \fIBNT\-other\fR\&. The default is \fITrust\fR\&. .sp \fIBNT\-other\fR -is a special type for BNT 100\-120V models\&. For this type you can (I think must!) specify voltage, batteryPercentage, loadPercentage and validationSequence\&. +is a special type for other BNT models (such as the 1500A at 120V and can be used to override ALL models using ALL of the following values\&. +.RE +.PP +\fBshutdownArguments\fR={{\fIminutes\fR,\fIseconds\fR},\fIwhether_minutes_should_be_used\fR} +.RS 4 +The minutes and seconds that the UPS should wait between receiving the shutdown command and actually shutting off\&. The other argument should be set to the character +\fIn\fR +only when the minutes value should be skipped and not sent to the UPS\&. The default is type\-dependent and is given below\&. The braces and commas are mandatory\&. Note that there should be no whitespace characters\&. .RE .PP \fBnumOfBytesFromUPS\fR=\fIvalue\fR .RS 4 -The number of bytes in a UPS frame\&. The default is type\-dependent and is given below\&. +The number of bytes in a UPS frame: 16 is common, 11 for +\fITrust\fR\&. The default is type\-dependent and is given below\&. .RE .PP \fBmethodOfFlowControl\fR=\fIname\fR @@ -94,36 +101,29 @@ or \fIno_flow_control\fR\&. .RE .PP -\fBshutdownArguments\fR={{\fIminutes\fR,\fIseconds\fR},\fIwhether_minutes_should_be_used\fR} -.RS 4 -The minutes and seconds that the UPS should wait between receiving the shutdown command and actually shutting off\&. The other argument should be set to the character -\fIn\fR -only when the minutes value should be skipped and not sent to the UPS\&. The default is type\-dependent and is given below\&. The braces and commas are mandatory\&. Note that there should be no whitespace characters\&. -.RE -.PP -\fBvoltage\fR={\fIcoefficient1\fR,\fIcoefficient2\fR,\fIcoefficient3\fR,\fIcoefficient4\fR} -.RS 4 -(Only for types KP625AP, Trust, Egys, BNT\-other\&.) A quad that is used convert the raw data to a human\-readable voltage reading\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as well as the lack of whitespace characters\&. -.RE -.PP -\fBfrequency\fR={\fIcoefficient1\fR,\fIcoefficient2\fR} -.RS 4 -(Only for types KP625AP, Trust, Egys\&.) A pair to convert the raw data to a human\-readable frequency reading\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory as well, as the lack of whitespace characters\&. -.RE -.PP -\fBbatteryPercentage\fR={\fIcoefficient1\fR,\fIcoefficient2\fR,\fIcoefficient3\fR,\fIcoefficient4\fR,\fIcoefficient5\fR} -.RS 4 -(Only for KP625AP, Trust, Egys, BNT\-other\&.) A 5 tuple to convert the raw data to a human\-readable battery percentage reading\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as the lack of white space characters\&. -.RE -.PP -\fBloadPercentage\fR={\fIcoefficient1\fR,\fIcoefficient2\fR,\fIcoefficient3\fR,\fIcoefficient4\fR} -.RS 4 -(Only for types KP625AP, Trust, Egys, BNT\-other\&.) A quad to convert the raw data to human readable load percentage reading\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as the lack of white space characters\&. -.RE -.PP \fBvalidationSequence\fR={{\fIindex1\fR,\fIvalue1\fR},{\fIindex2\fR,\fIvalue2\fR},{\fIindex3\fR,\fIvalue3\fR}} .RS 4 -(Only for types KP625AP, Trust, Egys, BNT\-other\&.) 3 pairs to be used for validating the UPS by comparing bytes of the raw data with constant values\&. The default is type\-dependent and is given below\&. The braces and commas are mandatory, as the lack of white space characters\&. +(Only for types KP625AP, Trust, Egys\&.) 3 pairs to be used for validating the UPS by comparing bytes of the raw data with constant values\&. The index selects the byte from the UPS (see numOfBytesFromUPS) and the value is for matching to the byte\&. The default is type\-dependent and is given below\&. The braces and commas are mandatory, as the lack of white space characters\&. +.RE +.PP +\fBfrequency\fR={\fIA\fR,\fIB\fR} +.RS 4 +(Only for types KP625AP, Trust, Egys\&.) A pair to convert the raw frequency data to a human\-readable frequency reading using the function 1/(A*x+B)\&. If the raw value x IS the frequency, then set A=1/(x^2) and B=0\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory as well, as the lack of whitespace characters\&. +.RE +.PP +\fBloadPercentage\fR={\fIBatteryA\fR,\fIBatteryB\fR,\fILineA\fR,\fILineB\fR} +.RS 4 +(Only for types KP625AP, Trust, Egys\&.) A quad to convert the raw load data to human readable load percentage reading using the function A*x+B\&. If the raw value x IS the Load Percent, then set A=1 and B=0\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as the lack of white space characters\&. +.RE +.PP +\fBbatteryPercentage\fR={\fIBattery1\fR,\fIBattery2\fR,\fIBattery3\fR,\fILine4\fR,\fILine5\fR} +.RS 4 +(Only for KP625AP, Trust, Egys\&.) A 5 tuple to convert the raw battery and line data to a human\-readable battery and line percentage reading using the functions (Battery) A*x+B*y+C and (Line) D*x+E\&. If the raw value x IS the Battery Percent, then set A=1, B=0, C=0, D=1, E=0\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as the lack of white space characters\&. +.RE +.PP +\fBvoltage\fR={\fI240A\fR,\fI240B\fR,\fI120A\fR,\fI120B\fR} +.RS 4 +(Only for types KP625AP, Trust, Egys\&.) A quad that is used convert the raw voltage data to a human\-readable voltage reading using the function A*x+B\&. If the raw value x IS HALF the Voltage, then set A=2, B=0\&. The default is type\-dependent and is given below\&. Do note that the braces and commas are mandatory, as well as the lack of whitespace characters\&. .RE .SH "DEFAULT VALUES FOR THE EXTRA ARGUMENTS" .sp @@ -141,7 +141,7 @@ type = Trust .RE .\} .sp -The rest of the default values for the extra arguments are type\-dependent: +The rest of the default values for the extra arguments are type\-dependent\&. However, \fIBNT\-other\fR is a special type that can be used to override ALL values for ALL models\&. .SS "Trust" .sp .if n \{\ @@ -248,16 +248,17 @@ numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{8,0},{8,0},{8,0}} shutdownArguments = {{1,30},y} -loadPercentage = {1\&.4474,0\&.0,0\&.8594,0\&.0} -batteryPercentage = {5\&.0000,0\&.3268,\-825\&.00,0\&.46511,0} -voltage = {1\&.9216,\-0\&.0977,0\&.82857,0\&.0000} +frequency = {0\&.00027778,0\&.0000} +loadPercentage = {1\&.0000,0\&.0,1\&.0000,0\&.0} +batteryPercentage = {1\&.0000,0\&.0000,0\&.0000,1\&.0000,0\&.0000} +voltage = {2\&.0000,0\&.0000,2\&.0000,0\&.0000} .fi .if n \{\ .RE .\} .SH "AUTHOR" .sp -Peter Bieringer , Alexey Sidorov +Peter Bieringer , Alexey Sidorov , Keven L\&. Ates .SH "SEE ALSO" .SS "The core driver:" .sp diff --git a/docs/man/powercom.txt b/docs/man/powercom.txt index 020599d..f01bd9a 100644 --- a/docs/man/powercom.txt +++ b/docs/man/powercom.txt @@ -24,84 +24,85 @@ This driver supports the following optional settings in the linkman:ups.conf[5] file: *linevoltage*='value':: -An integer specifying the mains voltage. It can't be auto detected. -Acceptable values are in the range of 110--120 or 220--240. The default -is '230'. +An integer specifying the line voltage. It can't be auto detected. Acceptable +values are in the range of 110-120 or 220-240. The default is '230'. *manufacturer*='name':: -Specify the manufacturer name, which also can't be auto detected. This is -a user defined string, so any name is acceptable. The default is -'PowerCom'. +Specify the manufacturer name, which also can't be auto detected. This is a +user defined string, so any name is acceptable. The default is 'PowerCom'. *modelname*='name':: -Specify the model name, which also can't be auto detected. This is a -user defined string, so any name is acceptable. The default is -'Unknown'. +Specify the model name, which also can't be auto detected. This is a user +defined string, so any name is acceptable. The default is 'Unknown'. *serialnumber*='value':: -Like modelname above, but for the serial number. The default is -'Unknown'. +Like modelname above, but for the serial number. The default is 'Unknown'. *type*='name':: -The exact type of the communication protocol within the powercom family, -that will be used to communicate with the UPS. The type is named after -the first modelname that was coded with that protocol. The acceptable -names are 'KP625AP', 'Trust', 'Egys', 'KIN', 'BNT', 'IMP' and 'BNT-other'. The -default is 'Trust'. +The exact type of the communication protocol within the powercom family, that +will be used to communicate with the UPS. The type is named after the first +modelname that was coded with that protocol. The acceptable names are +'Trust', 'Egys', 'KP625AP', 'IMP', 'KIN', 'BNT', and 'BNT-other'. +The default is 'Trust'. + -'BNT-other' is a special type for BNT 100-120V models. -For this type you can (I think must!) specify voltage, batteryPercentage, -loadPercentage and validationSequence. - -*numOfBytesFromUPS*='value':: -The number of bytes in a UPS frame. The default is type-dependent and -is given below. - -*methodOfFlowControl*='name':: -The method of serial communication flow control that is engaged by the -UPS. The default is type-dependent and is given below. Acceptable names -are 'dtr0rts1', 'dtr1' or 'no_flow_control'. +'BNT-other' is a special type for other BNT models (such as the 1500A at 120V +and can be used to override ALL models using ALL of the following values. *shutdownArguments*={{'minutes','seconds'},'whether_minutes_should_be_used'}:: The minutes and seconds that the UPS should wait between receiving the -shutdown command and actually shutting off. The other argument should -be set to the character 'n' only when the minutes value should be -skipped and not sent to the UPS. The default is type-dependent and is -given below. The braces and commas are mandatory. Note that there should -be no whitespace characters. +shutdown command and actually shutting off. The other argument should be set +to the character 'n' only when the minutes value should be skipped and not +sent to the UPS. The default is type-dependent and is given below. The braces +and commas are mandatory. Note that there should be no whitespace characters. -*voltage*={'coefficient1','coefficient2','coefficient3','coefficient4'}:: -(Only for types KP625AP, Trust, Egys, BNT-other.) -A quad that is used convert the raw data to a human-readable voltage -reading. The default is type-dependent and is given below. Do note that -the braces and commas are mandatory, as well as the lack of whitespace -characters. +*numOfBytesFromUPS*='value':: +The number of bytes in a UPS frame: 16 is common, 11 for 'Trust'. The default +is type-dependent and is given below. -*frequency*={'coefficient1','coefficient2'}:: -(Only for types KP625AP, Trust, Egys.) -A pair to convert the raw data to a human-readable frequency reading. The -default is type-dependent and is given below. Do note that the braces -and commas are mandatory as well, as the lack of whitespace characters. - -*batteryPercentage*={'coefficient1','coefficient2','coefficient3','coefficient4','coefficient5'}:: -(Only for KP625AP, Trust, Egys, BNT-other.) -A 5 tuple to convert the raw data to a human-readable battery percentage -reading. The default is type-dependent and is given below. Do note that -the braces and commas are mandatory, as the lack of white space -characters. - -*loadPercentage*={'coefficient1','coefficient2','coefficient3','coefficient4'}:: -(Only for types KP625AP, Trust, Egys, BNT-other.) -A quad to convert the raw data to human readable load percentage -reading. The default is type-dependent and is given below. Do note that -the braces and commas are mandatory, as the lack of white space -characters. +*methodOfFlowControl*='name':: +The method of serial communication flow control that is engaged by the UPS. +The default is type-dependent and is given below. Acceptable names are +'dtr0rts1', 'dtr1' or 'no_flow_control'. *validationSequence*={{'index1','value1'},{'index2','value2'},{'index3','value3'}}:: -(Only for types KP625AP, Trust, Egys, BNT-other.) -3 pairs to be used for validating the UPS by comparing bytes of the raw -data with constant values. The default is type-dependent and is given -below. The braces and commas are mandatory, as the lack of white space +(Only for types KP625AP, Trust, Egys.) +3 pairs to be used for validating the UPS by comparing bytes of the raw data +with constant values. The index selects the byte from the UPS (see +numOfBytesFromUPS) and the value is for matching to the byte. The default is +type-dependent and is given below. The braces and commas are mandatory, as +the lack of white space characters. + +*frequency*={'A','B'}:: +(Only for types KP625AP, Trust, Egys.) +A pair to convert the raw frequency data to a human-readable frequency +reading using the function 1/(A*x+B). If the raw value x IS the frequency, +then set A=1/(x^2) and B=0. The default is type-dependent and is given below. +Do note that the braces and commas are mandatory as well, as the lack of +whitespace characters. + +*loadPercentage*={'BatteryA','BatteryB','LineA','LineB'}:: +(Only for types KP625AP, Trust, Egys.) +A quad to convert the raw load data to human readable load percentage reading +using the function A*x+B. If the raw value x IS the Load Percent, then set +A=1 and B=0. The default is type-dependent and is given below. Do note that +the braces and commas are mandatory, as the lack of white space +characters. + +*batteryPercentage*={'Battery1','Battery2','Battery3','Line4','Line5'}:: +(Only for KP625AP, Trust, Egys.) +A 5 tuple to convert the raw battery and line data to a human-readable +battery and line percentage reading using the functions (Battery) +A*x+B*y+C and (Line) D*x+E. If the raw value x IS the Battery Percent, then +set A=1, B=0, C=0, D=1, E=0. The default is type-dependent and is given below. +Do note that the braces and commas are mandatory, as the lack of white space +characters. + +*voltage*={'240A','240B','120A','120B'}:: +(Only for types KP625AP, Trust, Egys.) +A quad that is used convert the raw voltage data to a human-readable voltage +reading using the function A*x+B. If the raw value x IS HALF the Voltage, +then set A=2, B=0. The default is type-dependent and is given below. Do note +that the braces and commas are mandatory, as well as the lack of whitespace characters. DEFAULT VALUES FOR THE EXTRA ARGUMENTS @@ -112,7 +113,9 @@ DEFAULT VALUES FOR THE EXTRA ARGUMENTS serialnumber = Unknown type = Trust -The rest of the default values for the extra arguments are type-dependent: +The rest of the default values for the extra arguments are type-dependent. +However, 'BNT-other' is a special type that can be used to override ALL +values for ALL models. Trust ~~~~~ @@ -136,10 +139,8 @@ KP625AP batteryPercentage = {5.0000,0.3268,-825.00,4.5639,-835.82} voltage = {1.9216,-0.0977,0.9545,0.0000} - Egys ~~~~ - numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{5,0x80},{7,0},{8,0}} @@ -149,49 +150,43 @@ Egys batteryPercentage = {5.0000,0.3268,-825.00,2.2105,-355.37} voltage = {1.9216,-0.0977,0.9545,0.0000} - IMP ~~~ - numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{5,0xFF},{7,0},{8,0}} shutdownArguments = {{1,30},y} - KIN ~~~ - numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{11,0x4b},{8,0},{8,0}} shutdownArguments = {{1,30},y} - BNT ~~~ - numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{11,0x42},{8,0},{8,0}} shutdownArguments = {{1,30},y} - BNT-other ~~~~~~~~~ - numOfBytesFromUPS = 16 methodOfFlowControl = no_flow_control validationSequence = {{8,0},{8,0},{8,0}} shutdownArguments = {{1,30},y} - loadPercentage = {1.4474,0.0,0.8594,0.0} - batteryPercentage = {5.0000,0.3268,-825.00,0.46511,0} - voltage = {1.9216,-0.0977,0.82857,0.0000} + frequency = {0.00027778,0.0000} + loadPercentage = {1.0000,0.0,1.0000,0.0} + batteryPercentage = {1.0000,0.0000,0.0000,1.0000,0.0000} + voltage = {2.0000,0.0000,2.0000,0.0000} AUTHOR ------ Peter Bieringer , -Alexey Sidorov +Alexey Sidorov , +Keven L. Ates SEE ALSO -------- diff --git a/docs/man/powerman-pdu.8 b/docs/man/powerman-pdu.8 index f8afcdd..06cb22b 100644 --- a/docs/man/powerman-pdu.8 +++ b/docs/man/powerman-pdu.8 @@ -2,12 +2,12 @@ .\" Title: powerman-pdu .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "POWERMAN\-PDU" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "POWERMAN\-PDU" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/powerpanel.8 b/docs/man/powerpanel.8 index ddfe8b3..0352956 100644 --- a/docs/man/powerpanel.8 +++ b/docs/man/powerpanel.8 @@ -2,12 +2,12 @@ .\" Title: powerpanel .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "POWERPANEL" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "POWERPANEL" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/rhino.8 b/docs/man/rhino.8 index 3030456..f14f3d4 100644 --- a/docs/man/rhino.8 +++ b/docs/man/rhino.8 @@ -2,12 +2,12 @@ .\" Title: rhino .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "RHINO" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "RHINO" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/richcomm_usb.8 b/docs/man/richcomm_usb.8 index 22c29a3..084731c 100644 --- a/docs/man/richcomm_usb.8 +++ b/docs/man/richcomm_usb.8 @@ -2,12 +2,12 @@ .\" Title: richcomm_usb .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "RICHCOMM_USB" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "RICHCOMM_USB" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/safenet.8 b/docs/man/safenet.8 index a3ca1c8..8568660 100644 --- a/docs/man/safenet.8 +++ b/docs/man/safenet.8 @@ -2,12 +2,12 @@ .\" Title: safenet .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "SAFENET" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "SAFENET" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/snmp-ups.8 b/docs/man/snmp-ups.8 index 5345521..440087d 100644 --- a/docs/man/snmp-ups.8 +++ b/docs/man/snmp-ups.8 @@ -2,12 +2,12 @@ .\" Title: snmp-ups .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "SNMP\-UPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "SNMP\-UPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/solis.8 b/docs/man/solis.8 index 6478e12..93c54b9 100644 --- a/docs/man/solis.8 +++ b/docs/man/solis.8 @@ -2,12 +2,12 @@ .\" Title: solis .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "SOLIS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "SOLIS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/tripplite.8 b/docs/man/tripplite.8 index 2904180..a0c59d9 100644 --- a/docs/man/tripplite.8 +++ b/docs/man/tripplite.8 @@ -2,12 +2,12 @@ .\" Title: tripplite .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "TRIPPLITE" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "TRIPPLITE" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/tripplite_usb.8 b/docs/man/tripplite_usb.8 index df2c950..783b67c 100644 --- a/docs/man/tripplite_usb.8 +++ b/docs/man/tripplite_usb.8 @@ -2,12 +2,12 @@ .\" Title: tripplite_usb .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "TRIPPLITE_USB" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "TRIPPLITE_USB" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/tripplitesu.8 b/docs/man/tripplitesu.8 index 9857093..bf65a94 100644 --- a/docs/man/tripplitesu.8 +++ b/docs/man/tripplitesu.8 @@ -2,12 +2,12 @@ .\" Title: tripplitesu .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "TRIPPLITESU" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "TRIPPLITESU" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/ups.conf.5 b/docs/man/ups.conf.5 index e120145..0a35a09 100644 --- a/docs/man/ups.conf.5 +++ b/docs/man/ups.conf.5 @@ -2,12 +2,12 @@ .\" Title: ups.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPS\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPS\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- @@ -132,12 +132,79 @@ You should only use this if your system won\(cqt work without it\&. This may be needed on Mac OS X systems\&. .RE .PP +\fBignorelb\fR +.RS 4 +Optional\&. When you specify this, the driver ignores a low battery condition flag that is reported by the UPS (some devices will switch off almost immediately after setting this flag, or will report this as soons as the mains fails)\&. Instead it will use either of the following conditions to determine when the battery is low: +.sp +.if n \{\ +.RS 4 +.\} +.nf +battery\&.charge < battery\&.charge\&.low +battery\&.runtime < battery\&.runtime\&.low +.fi +.if n \{\ +.RE +.\} +.sp +The idea is to set the battery\&.charge\&.low and/or battery\&.runtime\&.low levels in +\fBups\&.conf\fR +to a value that gives enough time to cleanly shutdown your system: +.sp +.if n \{\ +.RS 4 +.\} +.nf +override\&.battery\&.charge\&.low = 30 +override\&.battery\&.runtime\&.low = 180 +.fi +.if n \{\ +.RE +.\} +.sp +In order for this to work, your UPS should be able to (reliably) report charge and/or runtime remaining on battery\&. Use with caution! +.RE +.PP \fBmaxstartdelay\fR .RS 4 Optional\&. This can be set as a global variable above your first UPS definition and it can also be set in a UPS section\&. This value controls how long upsdrvctl will wait for the driver to finish starting\&. This keeps your system from getting stuck due to a broken driver or UPS\&. .sp The default is 45 seconds\&. .RE +.PP +\fBdefault\&.\fR +.RS 4 +Optional\&. Set a default value for which is used in case the UPS doesn\(cqt provide a value, but will be overwritten if a value is available from the UPS: +.sp +.if n \{\ +.RS 4 +.\} +.nf +default\&.input\&.voltage\&.nominal = 230 +.fi +.if n \{\ +.RE +.\} +.sp +The above will report the nominal input voltage to be 230, unless the UPS tells us differently\&. +.RE +.PP +\fBoverride\&.\fR +.RS 4 +Optional\&. Set a value for that overrides any value that may be read from the UPS\&. Used for overriding values from the UPS that are clearly wrong (some devices report wrong values for battery voltage for instance): +.sp +.if n \{\ +.RS 4 +.\} +.nf +override\&.battery\&.voltage\&.nominal = 12 +.fi +.if n \{\ +.RE +.\} +.sp +Use with caution! This will only change the appearance of the variable to the outside world, internally in the UPS the original value is used\&. +.RE .sp All other fields are passed through to the hardware\-specific part of the driver\&. See those manuals for the list of what is allowed\&. .SH "INTEGRATION" diff --git a/docs/man/ups.conf.txt b/docs/man/ups.conf.txt index 432b1f4..8a72a83 100644 --- a/docs/man/ups.conf.txt +++ b/docs/man/ups.conf.txt @@ -109,6 +109,27 @@ You should only use this if your system won't work without it. + This may be needed on Mac OS X systems. +*ignorelb*:: + +Optional. When you specify this, the driver ignores a low battery condition +flag that is reported by the UPS (some devices will switch off almost +immediately after setting this flag, or will report this as soons as the +mains fails). Instead it will use either of the following conditions to +determine when the battery is low: + + battery.charge < battery.charge.low + battery.runtime < battery.runtime.low ++ +The idea is to set the battery.charge.low and/or battery.runtime.low levels +in *ups.conf* to a value that gives enough time to cleanly shutdown your +system: + + override.battery.charge.low = 30 + override.battery.runtime.low = 180 ++ +In order for this to work, your UPS should be able to (reliably) report +charge and/or runtime remaining on battery. Use with caution! + *maxstartdelay*:: Optional. This can be set as a global variable above your first UPS @@ -118,6 +139,28 @@ system from getting stuck due to a broken driver or UPS. + The default is 45 seconds. +*default.*:: + +Optional. Set a default value for which is used in case the UPS +doesn't provide a value, but will be overwritten if a value is available +from the UPS: + + default.input.voltage.nominal = 230 ++ +The above will report the nominal input voltage to be 230, unless the UPS +tells us differently. + +*override.*:: + +Optional. Set a value for that overrides any value that may be read +from the UPS. Used for overriding values from the UPS that are clearly wrong +(some devices report wrong values for battery voltage for instance): + + override.battery.voltage.nominal = 12 ++ +Use with caution! This will only change the appearance of the variable to +the outside world, internally in the UPS the original value is used. + All other fields are passed through to the hardware-specific part of the driver. See those manuals for the list of what is allowed. diff --git a/docs/man/upsc.8 b/docs/man/upsc.8 index 59828f0..e6dc870 100644 --- a/docs/man/upsc.8 +++ b/docs/man/upsc.8 @@ -2,12 +2,12 @@ .\" Title: upsc .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSC" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSC" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_connect.3 b/docs/man/upscli_connect.3 index 7ad7b85..0ab6637 100644 --- a/docs/man/upscli_connect.3 +++ b/docs/man/upscli_connect.3 @@ -2,12 +2,12 @@ .\" Title: upscli_connect .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_CONNECT" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_CONNECT" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_disconnect.3 b/docs/man/upscli_disconnect.3 index e745421..f8a5a4a 100644 --- a/docs/man/upscli_disconnect.3 +++ b/docs/man/upscli_disconnect.3 @@ -2,12 +2,12 @@ .\" Title: upscli_disconnect .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_DISCONNECT" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_DISCONNECT" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_fd.3 b/docs/man/upscli_fd.3 index c243aa1..96d807b 100644 --- a/docs/man/upscli_fd.3 +++ b/docs/man/upscli_fd.3 @@ -2,12 +2,12 @@ .\" Title: upscli_fd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_FD" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_FD" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_get.3 b/docs/man/upscli_get.3 index ec72a15..3f6a545 100644 --- a/docs/man/upscli_get.3 +++ b/docs/man/upscli_get.3 @@ -2,12 +2,12 @@ .\" Title: upscli_get .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_GET" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_GET" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_list_next.3 b/docs/man/upscli_list_next.3 index acbb024..783d393 100644 --- a/docs/man/upscli_list_next.3 +++ b/docs/man/upscli_list_next.3 @@ -2,12 +2,12 @@ .\" Title: upscli_list_next .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_LIST_NEXT" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_LIST_NEXT" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_list_start.3 b/docs/man/upscli_list_start.3 index aec5052..941e868 100644 --- a/docs/man/upscli_list_start.3 +++ b/docs/man/upscli_list_start.3 @@ -2,12 +2,12 @@ .\" Title: upscli_list_start .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_LIST_START" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_LIST_START" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_readline.3 b/docs/man/upscli_readline.3 index 226cd90..8f2a741 100644 --- a/docs/man/upscli_readline.3 +++ b/docs/man/upscli_readline.3 @@ -2,12 +2,12 @@ .\" Title: upscli_readline .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_READLINE" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_READLINE" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_sendline.3 b/docs/man/upscli_sendline.3 index 5f3004f..13efe30 100644 --- a/docs/man/upscli_sendline.3 +++ b/docs/man/upscli_sendline.3 @@ -2,12 +2,12 @@ .\" Title: upscli_sendline .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_SENDLINE" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_SENDLINE" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_splitaddr.3 b/docs/man/upscli_splitaddr.3 index 79145c6..cd38178 100644 --- a/docs/man/upscli_splitaddr.3 +++ b/docs/man/upscli_splitaddr.3 @@ -2,12 +2,12 @@ .\" Title: upscli_splitaddr .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_SPLITADDR" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_SPLITADDR" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_splitname.3 b/docs/man/upscli_splitname.3 index ca0c3d0..5180536 100644 --- a/docs/man/upscli_splitname.3 +++ b/docs/man/upscli_splitname.3 @@ -2,12 +2,12 @@ .\" Title: upscli_splitname .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_SPLITNAME" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_SPLITNAME" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_ssl.3 b/docs/man/upscli_ssl.3 index 70bdd99..2256b60 100644 --- a/docs/man/upscli_ssl.3 +++ b/docs/man/upscli_ssl.3 @@ -2,12 +2,12 @@ .\" Title: upscli_ssl .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_SSL" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_SSL" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_strerror.3 b/docs/man/upscli_strerror.3 index 64ff539..ffc4d1f 100644 --- a/docs/man/upscli_strerror.3 +++ b/docs/man/upscli_strerror.3 @@ -2,12 +2,12 @@ .\" Title: upscli_strerror .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_STRERROR" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_STRERROR" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscli_upserror.3 b/docs/man/upscli_upserror.3 index 36711c0..cd96ba4 100644 --- a/docs/man/upscli_upserror.3 +++ b/docs/man/upscli_upserror.3 @@ -2,12 +2,12 @@ .\" Title: upscli_upserror .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLI_UPSERROR" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLI_UPSERROR" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsclient.3 b/docs/man/upsclient.3 index 1496883..ece6715 100644 --- a/docs/man/upsclient.3 +++ b/docs/man/upsclient.3 @@ -2,12 +2,12 @@ .\" Title: upsclient .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCLIENT" "3" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCLIENT" "3" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscmd.8 b/docs/man/upscmd.8 index 944264a..b26db9f 100644 --- a/docs/man/upscmd.8 +++ b/docs/man/upscmd.8 @@ -2,12 +2,12 @@ .\" Title: upscmd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCMD" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCMD" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upscode2.8 b/docs/man/upscode2.8 index 194362b..b2edf82 100644 --- a/docs/man/upscode2.8 +++ b/docs/man/upscode2.8 @@ -2,12 +2,12 @@ .\" Title: upscode2 .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSCODE2" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSCODE2" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsd.8 b/docs/man/upsd.8 index 1d29102..6be6ba0 100644 --- a/docs/man/upsd.8 +++ b/docs/man/upsd.8 @@ -2,12 +2,12 @@ .\" Title: upsd .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSD" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSD" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsd.conf.5 b/docs/man/upsd.conf.5 index 2f9b2a8..9bd303f 100644 --- a/docs/man/upsd.conf.5 +++ b/docs/man/upsd.conf.5 @@ -2,12 +2,12 @@ .\" Title: upsd.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSD\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSD\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsd.users.5 b/docs/man/upsd.users.5 index f6246ab..11e41ee 100644 --- a/docs/man/upsd.users.5 +++ b/docs/man/upsd.users.5 @@ -2,12 +2,12 @@ .\" Title: upsd.users .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSD\&.USERS" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSD\&.USERS" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsdrvctl.8 b/docs/man/upsdrvctl.8 index 2b9b068..8223a68 100644 --- a/docs/man/upsdrvctl.8 +++ b/docs/man/upsdrvctl.8 @@ -2,12 +2,12 @@ .\" Title: upsdrvctl .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSDRVCTL" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSDRVCTL" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsimage.cgi.8 b/docs/man/upsimage.cgi.8 index d1f5eba..1b42870 100644 --- a/docs/man/upsimage.cgi.8 +++ b/docs/man/upsimage.cgi.8 @@ -2,12 +2,12 @@ .\" Title: upsimage.cgi .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSIMAGE\&.CGI" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSIMAGE\&.CGI" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upslog.8 b/docs/man/upslog.8 index e3ff7f3..869f16a 100644 --- a/docs/man/upslog.8 +++ b/docs/man/upslog.8 @@ -2,12 +2,12 @@ .\" Title: upslog .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSLOG" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSLOG" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsmon.8 b/docs/man/upsmon.8 index 6f9c028..d508ccb 100644 --- a/docs/man/upsmon.8 +++ b/docs/man/upsmon.8 @@ -2,12 +2,12 @@ .\" Title: upsmon .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSMON" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSMON" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsmon.conf.5 b/docs/man/upsmon.conf.5 index b00226c..3f70b14 100644 --- a/docs/man/upsmon.conf.5 +++ b/docs/man/upsmon.conf.5 @@ -2,12 +2,12 @@ .\" Title: upsmon.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSMON\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSMON\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsrw.8 b/docs/man/upsrw.8 index f052567..85a37bb 100644 --- a/docs/man/upsrw.8 +++ b/docs/man/upsrw.8 @@ -2,12 +2,12 @@ .\" Title: upsrw .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSRW" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSRW" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upssched.8 b/docs/man/upssched.8 index 2704421..069855c 100644 --- a/docs/man/upssched.8 +++ b/docs/man/upssched.8 @@ -2,12 +2,12 @@ .\" Title: upssched .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSCHED" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSCHED" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upssched.conf.5 b/docs/man/upssched.conf.5 index 2bace08..7953be4 100644 --- a/docs/man/upssched.conf.5 +++ b/docs/man/upssched.conf.5 @@ -2,12 +2,12 @@ .\" Title: upssched.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSCHED\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSCHED\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsset.cgi.8 b/docs/man/upsset.cgi.8 index 7c09012..f2f7230 100644 --- a/docs/man/upsset.cgi.8 +++ b/docs/man/upsset.cgi.8 @@ -2,12 +2,12 @@ .\" Title: upsset.cgi .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSET\&.CGI" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSET\&.CGI" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsset.conf.5 b/docs/man/upsset.conf.5 index 5e89519..385f0e8 100644 --- a/docs/man/upsset.conf.5 +++ b/docs/man/upsset.conf.5 @@ -2,12 +2,12 @@ .\" Title: upsset.conf .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSET\&.CONF" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSET\&.CONF" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsstats.cgi.8 b/docs/man/upsstats.cgi.8 index 2aa8c97..e51e116 100644 --- a/docs/man/upsstats.cgi.8 +++ b/docs/man/upsstats.cgi.8 @@ -2,12 +2,12 @@ .\" Title: upsstats.cgi .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSTATS\&.CGI" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSTATS\&.CGI" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/upsstats.html.5 b/docs/man/upsstats.html.5 index b20ae24..6159d5b 100644 --- a/docs/man/upsstats.html.5 +++ b/docs/man/upsstats.html.5 @@ -2,12 +2,12 @@ .\" Title: upsstats.html .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "UPSSTATS\&.HTML" "5" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "UPSSTATS\&.HTML" "5" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/usbhid-ups.8 b/docs/man/usbhid-ups.8 index 37c149d..551ba96 100644 --- a/docs/man/usbhid-ups.8 +++ b/docs/man/usbhid-ups.8 @@ -2,12 +2,12 @@ .\" Title: usbhid-ups .\" Author: [see the "AUTHORS" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "USBHID\-UPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "USBHID\-UPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/man/victronups.8 b/docs/man/victronups.8 index ae9fdae..d635204 100644 --- a/docs/man/victronups.8 +++ b/docs/man/victronups.8 @@ -2,12 +2,12 @@ .\" Title: victronups .\" Author: [see the "AUTHOR" section] .\" Generator: DocBook XSL Stylesheets v1.75.2 -.\" Date: 12/24/2010 +.\" Date: 05/31/2011 .\" Manual: NUT Manual .\" Source: Network UPS Tools .\" Language: English .\" -.TH "VICTRONUPS" "8" "12/24/2010" "Network UPS Tools" "NUT Manual" +.TH "VICTRONUPS" "8" "05/31/2011" "Network UPS Tools" "NUT Manual" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- diff --git a/docs/nut-names.txt b/docs/nut-names.txt index 80d173e..f99c13d 100644 --- a/docs/nut-names.txt +++ b/docs/nut-names.txt @@ -86,6 +86,9 @@ ups: General unit information panel (*** opaque) | E | ups.contacts | UPS external contact sensors (*** opaque) | F0 +| ups.efficiency | Efficiency of the UPS (ratio + of the output current on the + input current) (percent) | 95 | ups.power | Current value of apparent power (Volt-Amps) | 500 | ups.power.nominal | Nominal value of apparent @@ -363,6 +366,8 @@ outlet: Smart outlet management NOTE: *n* stands for the outlet index. For more information, refer to the NUT outlets management and PDU notes chapter of the user manual. +A special case is "outlet.0" which is equivalent to "outlet", and +represent the whole set of outlets of the device. [options="header"] |=============================================================================== diff --git a/docs/stable-hcl.txt b/docs/stable-hcl.txt index 49c799a..b522d89 100644 --- a/docs/stable-hcl.txt +++ b/docs/stable-hcl.txt @@ -3,8 +3,15 @@ Hardware compatibility list =========================== endif::website[] -NOTE: Before you buy, take a look at the link:acknowledgements.html[Acknowledgements] -for information about which drivers are developed with the support of the manufacturer. +[NOTE] +================================================================================ + +Before you buy, take a look at the link:acknowledgements.html[Acknowledgements] +for information about which drivers are developed with the support of the manufacturer. + +Be sure to also read the <>. + +================================================================================ ifdef::website[] ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -85,6 +92,7 @@ include::ups-html.txt[] endif::website[] +[[footnotes]] [NOTE] ================================================================================ @@ -111,12 +119,23 @@ between the set of developers and the set of owners of that hardware. The way to fix it is to turn a developer into an owner or an owner into a developer. -*Omissions or errors* +*Report new devices, omissions or errors* -There is a lot of UPS hardware for sale, and it's possible that we have missed -listing some that are supported. +There is a lot of power devices hardware for sale, and it's possible +that we have missed listing some that are supported, or made an error. + +So that this list can be as accurate as possible, please report any +omissions to the +link:http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser[NUT Users] +mailing list, with *[HCL]* in the subject and including the following +information: + +- Device manufacturer and name, +- upsc output (upsrw and upscmd outputs are also welcome), +- link:docs/user-manual.chunked/ar01s06.html#Shutdown_design[shutdown sequence] +testing results, +- a link to an online description is also appreciated. -Please report any omissions so that this list can be as accurate as possible. *Pointing the present HCL* diff --git a/docs/website/Makefile.am b/docs/website/Makefile.am index 5be8085..75a59d6 100644 --- a/docs/website/Makefile.am +++ b/docs/website/Makefile.am @@ -50,6 +50,7 @@ ASCIIDOC_PARAMS = --unsafe --backend=xhtml11 \ --attribute scriptsdir=$(srcdir)/scripts \ --attribute=badges \ --attribute=website \ + --attribute=quirks \ --attribute=revision=$(PACKAGE_VERSION) \ --attribute localdate=`TZ=UTC date +%Y-%m-%d` \ --attribute localtime=`TZ=UTC date +%H:%M:%S` \ diff --git a/docs/website/Makefile.in b/docs/website/Makefile.in index ad40ad9..d6ed1f3 100644 --- a/docs/website/Makefile.in +++ b/docs/website/Makefile.in @@ -38,7 +38,6 @@ subdir = docs/website DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -277,6 +276,7 @@ ASCIIDOC_PARAMS = --unsafe --backend=xhtml11 \ --attribute scriptsdir=$(srcdir)/scripts \ --attribute=badges \ --attribute=website \ + --attribute=quirks \ --attribute=revision=$(PACKAGE_VERSION) \ --attribute localdate=`TZ=UTC date +%Y-%m-%d` \ --attribute localtime=`TZ=UTC date +%H:%M:%S` \ diff --git a/docs/website/news.txt b/docs/website/news.txt index 95da757..46cbc6a 100644 --- a/docs/website/news.txt +++ b/docs/website/news.txt @@ -1,3 +1,5 @@ +- June 1, 2011: 2.6.1 released +- May 19, 2011: link:download.html#_binary_packages[Beta NUT 2.6.0-1 package for Windows released] - January 14, 2011: 2.6.0 released - December 24, 2010: 2.6.0-pre1 released - December 16, 2010: link:http://www.lestat.st/en/informatique/projets/nut-monitor[NUT-Monitor] 1.3 released diff --git a/docs/website/web-layout.conf b/docs/website/web-layout.conf index 0e4c16f..29a4406 100644 --- a/docs/website/web-layout.conf +++ b/docs/website/web-layout.conf @@ -35,10 +35,8 @@ Network UPS Tools - {doctitle} -ifdef::index-only[] - -endif::index-only[] + {doctype-manpage} ifdef::quirks[] @@ -166,20 +164,20 @@ endif::badges[] + + + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-9664272-1']); + _gaq.push(['_trackPageview']); - - + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + + endif::analytics[] diff --git a/drivers/Makefile.in b/drivers/Makefile.in index 841c3e6..80e5e13 100644 --- a/drivers/Makefile.in +++ b/drivers/Makefile.in @@ -68,7 +68,6 @@ DIST_COMMON = $(dist_noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/drivers/apc-hid.c b/drivers/apc-hid.c index c902462..f76621f 100644 --- a/drivers/apc-hid.c +++ b/drivers/apc-hid.c @@ -146,16 +146,38 @@ static usage_lkp_t apc_usage_lkp[] = { { "APCProbe1", 0xff860007 }, { "APCProbe2", 0xff860008 }, { "APCBattReplaceDate", 0xff860016 }, + /* usage seen in dumps but unknown: + * - ff860018 + * Path: UPS.Battery.ff860018, Type: Feature, ReportID: 0x48, Offset: 0, Size: 32, Value: 0 + */ { "APCBattCapBeforeStartup", 0xff860019 }, /* FIXME: exploit */ + /* usage seen in dumps but unknown: + * - ff86001a + * Path: UPS.Battery.ff86001a, Type: Input, ReportID: 0x1b, Offset: 0, Size: 8, Value: 3 + * Path: UPS.Battery.ff86001a, Type: Feature, ReportID: 0x1b, Offset: 0, Size: 8, Value: 3 + * - ff86001b + * Path: UPS.Battery.ff86001b, Type: Input, ReportID: 0x1c, Offset: 0, Size: 8, Value: 0 + * Path: UPS.Battery.ff86001b, Type: Feature, ReportID: 0x1c, Offset: 0, Size: 8, Value: 0 + * - ff860023 + * Path: UPS.ff860001.ff860023, Type: Feature, ReportID: 0x60, Offset: 0, Size: 16, Value: 0 + * - ff860024 + * Path: UPS.Battery.ff860024, Type: Feature, ReportID: 0x47, Offset: 0, Size: 8, Value: 245 + * Path: UPS.PowerConverter.ff860024, Type: Feature, ReportID: 0x51, Offset: 0, Size: 8, Value: 145 + * - ff860025 + * Path: UPS.ff860001.ff860025, Type: Feature, ReportID: 0x62, Offset: 0, Size: 32, Value: 0 + * - ff860026 + * Path: UPS.ff860001.ff860026, Type: Feature, ReportID: 0x61, Offset: 0, Size: 8, Value: 10 + * - ff860027 + * Path: UPS.ff860027, Type: Feature, ReportID: 0x3e, Offset: 0, Size: 32, Value: 0 + * - ff860028 + * Path: UPS.ff860028, Type: Feature, ReportID: 0x3f, Offset: 0, Size: 32, Value: 0 + * - ff860030 + * Path: UPS.Output.ff860030, Type: Feature, ReportID: 0x42, Offset: 0, Size: 16, Value: 5.8 + */ { "APC_UPS_FirmwareRevision", 0xff860042 }, { "APCLineFailCause", 0xff860052 }, { "APCStatusFlag", 0xff860060 }, { "APCSensitivity", 0xff860061 }, - /* usage seen in dumps but unknown: - * - ff860027, ff860028 - * Path: UPS.ff860027, Type: Feature, ReportID: 0x3e, Offset: 0, - * Size: 32, Value:0.000000 - */ { "APCPanelTest", 0xff860072 }, /* FIXME: exploit */ { "APCShutdownAfterDelay", 0xff860076 }, /* FIXME: exploit */ { "APC_USB_FirmwareRevision", 0xff860079 }, /* FIXME: exploit */ @@ -164,14 +186,24 @@ static usage_lkp_t apc_usage_lkp[] = { { "APCDelayBeforeStartup", 0xff86007e }, /* FIXME: exploit */ /* usage seen in dumps but unknown: * - ff860080 - * Path: UPS.PresentStatus.ff860080, Type: Input, ReportID: 0x33, - * Offset: 12, Size: 1, Value: 0.000000 - * - ff86001a - * Path: UPS.Battery.ff86001a, Type: Input, ReportID: 0x1b, - * Offset: 0, Size: 8, Value: 3.000000 - * - ff86001b - * Path: UPS.Battery.ff86001b, Type: Input, ReportID: 0x1c, - * Offset: 0, Size: 8, Value: 0.000000 + * Path: UPS.PresentStatus.ff860080, Type: Input, ReportID: 0x33, Offset: 12, Size: 1, Value: 0 + * Path: UPS.PresentStatus.ff860080, Type: Feature, ReportID: 0x33, Offset: 12, Size: 1, Value: 0 + * Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Input, ReportID: 0x07, Offset: 12, Size: 1, Value: 0 + * Path: UPS.PowerSummary.PresentStatus.ff860080, Type: Feature, ReportID: 0x07, Offset: 12, Size: 1, Value: 0 + * - ff860090, ff860091 + * Path: UPS.ff860090.ff860091, Type: Feature, ReportID: 0x8c, Offset: 0, Size: 8, Value: 1.000000 + * - ff860092 + * Path: UPS.ff860090.ff860092, Type: Feature, ReportID: 0x8d, Offset: 0, Size: 8, Value: 25.000000 + * - ff860093 + * Path: UPS.ff860090.ff860093, Type: Feature, ReportID: 0x8e, Offset: 0, Size: 8, Value: 83.000000 + * - ff860094 + * Path: UPS.ff860090.ff860094, Type: Feature, ReportID: 0x8f, Offset: 0, Size: 8, Value: 0.000000 + * - ff860095 + * Path: UPS.ff860090.ff860095, Type: Feature, ReportID: 0x90, Offset: 0, Size: 8, Value: 1.000000 + * - ff860096 + * Path: UPS.ff860090.ff860096, Type: Feature, ReportID: 0x91, Offset: 0, Size: 16, Value: 4.000000 + * - ff860097 + * Path: UPS.ff860090.ff860097, Type: Feature, ReportID: 0x92, Offset: 0, Size: 16, Value: 4.000000 */ /* Note (Arnaud): BUP stands for BackUPS Pro @@ -269,12 +301,12 @@ static hid_info_t apc_hid2nut[] = { { "ups.timer.start", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeStartup", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL}, { "ups.timer.shutdown", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeShutdown", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL}, { "ups.timer.reboot", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeReboot", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL}, - { "ups.test.result", 0, 0, "UPS.Battery.Test", NULL, "%s", 0, test_read_info }, { "ups.beeper.status", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "%s", 0, beeper_info }, { "ups.mfr.date", 0, 0, "UPS.ManufacturerDate", NULL, "%s", 0, date_conversion }, { "ups.mfr.date", 0, 0, "UPS.PowerSummary.ManufacturerDate", NULL, "%s", 0, date_conversion }, /* Back-UPS 500 */ - { "ups.realpower.nominal", 0, 0, "UPS.PowerConverter.ConfigActivePower", NULL, "%.0f", 0, NULL }, + { "ups.realpower.nominal", 0, 0, "UPS.PowerConverter.ConfigActivePower", NULL, "%.0f", 0, NULL }, + { "ups.realpower.nominal", 0, 0, "UPS.Output.ConfigActivePower", NULL, "%.0f", 0, NULL }, /* the below one need to be discussed as we might need to complete * the ups.test sub collection @@ -306,13 +338,18 @@ static hid_info_t apc_hid2nut[] = { /* Input page */ { "input.voltage", 0, 0, "UPS.Input.Voltage", NULL, "%.1f", 0, NULL }, { "input.voltage.nominal", 0, 0, "UPS.Input.ConfigVoltage", NULL, "%.0f", 0, NULL }, + { "input.transfer.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Output.LowVoltageTransfer", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, + { "input.transfer.high", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Output.HighVoltageTransfer", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, + /* used by APC BackUPS RS */ { "input.transfer.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Input.LowVoltageTransfer", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "input.transfer.high", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Input.HighVoltageTransfer", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "input.sensitivity", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.Input.APCSensitivity", NULL, "%s", HU_FLAG_SEMI_STATIC, apc_sensitivity_info }, - + /* Output page */ { "output.voltage", 0, 0, "UPS.Output.Voltage", NULL, "%.1f", 0, NULL }, { "output.voltage.nominal", 0, 0, "UPS.Output.ConfigVoltage", NULL, "%.1f", 0, NULL }, + { "output.current", 0, 0, "UPS.Output.Current", NULL, "%.2f", 0, NULL }, + { "output.frequency", 0, 0, "UPS.Output.Frequency", NULL, "%.1f", 0, NULL }, /* Environmental page */ { "ambient.temperature", 0, 0, "UPS.APCEnvironment.APCProbe1.Temperature", NULL, "%s", 0, kelvin_celsius_conversion }, @@ -352,7 +389,9 @@ static hid_info_t apc_hid2nut[] = { { "load.on.delay", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeStartup", NULL, DEFAULT_ONDELAY, HU_TYPE_CMD, NULL }, { "shutdown.stop", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeShutdown", NULL, "-1", HU_TYPE_CMD, NULL }, { "shutdown.reboot", 0, 0, "UPS.APCGeneralCollection.APCDelayBeforeReboot", NULL, "10", HU_TYPE_CMD, NULL }, - + /* used by APC BackUPS CS */ + { "shutdown.return", 0, 0, "UPS.Output.APCDelayBeforeReboot", NULL, "1", HU_TYPE_CMD, NULL }, + { "beeper.on", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "2", HU_TYPE_CMD, NULL }, { "beeper.off", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "3", HU_TYPE_CMD, NULL }, { "beeper.enable", 0, 0, "UPS.PowerSummary.AudibleAlarmControl", NULL, "2", HU_TYPE_CMD, NULL }, diff --git a/drivers/apcsmart.c b/drivers/apcsmart.c index aad21f8..f30f625 100644 --- a/drivers/apcsmart.c +++ b/drivers/apcsmart.c @@ -24,7 +24,7 @@ #include "apcsmart.h" #define DRIVER_NAME "APC Smart protocol driver" -#define DRIVER_VERSION "2.03" +#define DRIVER_VERSION "2.1" static upsdrv_info_t table_info = { "APC command table", @@ -38,8 +38,9 @@ static upsdrv_info_t table_info = { upsdrv_info_t upsdrv_info = { DRIVER_NAME, DRIVER_VERSION, - "Russell Kroll \n" \ - "Nigel Metheringham ", + "Russell Kroll \n" + "Nigel Metheringham \n" + "Michal Soltys ", DRV_STABLE, { &table_info, NULL } }; @@ -73,7 +74,7 @@ static apc_vartab_t *vartab_lookup_name(const char *var) /* FUTURE: change to use function pointers */ /* convert APC formatting to NUT formatting */ -static const char *convert_data(apc_vartab_t *cmd_entry, char *upsval) +static const char *convert_data(apc_vartab_t *cmd_entry, const char *upsval) { static char tmp[128]; int tval; @@ -178,6 +179,16 @@ static void alert_handler(char ch) ups_status |= APC_STAT_RB; break; + case '?': /* set OVER */ + upsdebugx(4, "alert_handler: OVER"); + ups_status |= APC_STAT_OVER; + break; + + case '=': /* clear OVER */ + upsdebugx(4, "alert_handler: not OVER"); + ups_status &= ~APC_STAT_OVER; + break; + default: upsdebugx(4, "alert_handler got 0x%02x (unhandled)", ch); break; @@ -252,8 +263,10 @@ static int query_ups(const char *var, int first) return 0; } - /* already known to not be supported? */ - if (vt->flags & APC_IGNORE) + /* + * not first run and already known to not be supported ? + */ + if (!first && !(vt->flags & APC_PRESENT)) return 0; /* empty the input buffer (while allowing the alert handler to run) */ @@ -278,11 +291,10 @@ static int query_ups(const char *var, int first) ser_comm_good(); - if ((ret < 1) || (!strcmp(temp, "NA"))) { /* not supported */ - vt->flags |= APC_IGNORE; + if ((ret < 1) || (!strcmp(temp, "NA"))) /* not supported */ return 0; - } + vt->flags |= APC_PRESENT; ptr = convert_data(vt, temp); dstate_setinfo(vt->name, "%s", ptr); @@ -293,7 +305,7 @@ static void do_capabilities(void) { const char *ptr, *entptr; char upsloc, temp[512], cmd, loc, etmp[16], *endtemp; - int nument, entlen, i, matrix, ret; + int nument, entlen, i, matrix, ret, valid; apc_vartab_t *vt; upsdebugx(1, "APC - About to get capabilities string"); @@ -324,7 +336,7 @@ static void do_capabilities(void) /* This should never happen since we only call this if the REQ_CAPABILITIES command is supported */ - upslogx(LOG_ERR, "ERROR: APC cannot do capabilites but said it could!"); + upslogx(LOG_ERR, "ERROR: APC cannot do capabilities but said it could!"); return; } @@ -333,8 +345,8 @@ static void do_capabilities(void) endtemp = &temp[0] + strlen(temp); if (temp[0] != '#') { - printf("Unrecognized capability start char %c\n", temp[0]); - printf("Please report this error [%s]\n", temp); + upsdebugx(1, "Unrecognized capability start char %c", temp[0]); + upsdebugx(1, "Please report this error [%s]", temp); upslogx(LOG_ERR, "ERROR: unknown capability start char %c!", temp[0]); @@ -377,9 +389,10 @@ static void do_capabilities(void) entptr = &ptr[4]; vt = vartab_lookup_char(cmd); + valid = vt && ((loc == upsloc) || (loc == '4')); /* mark this as writable */ - if (vt && ((loc == upsloc) || (loc == '4'))) { + if (valid) { upsdebugx(1, "Supported capability: %02x (%c) - %s", cmd, loc, vt->name); @@ -390,11 +403,10 @@ static void do_capabilities(void) } for (i = 0; i < nument; i++) { - snprintf(etmp, entlen + 1, "%s", entptr); - - if (vt && ((loc == upsloc) || (loc == '4'))) - dstate_addenum(vt->name, "%s", - convert_data(vt, etmp)); + if (valid) { + snprintf(etmp, entlen + 1, "%s", entptr); + dstate_addenum(vt->name, "%s", convert_data(vt, etmp)); + } entptr += entlen; } @@ -430,7 +442,6 @@ static int update_status(void) ups_status = strtol(buf, 0, 16) & 0xff; ups_status_set(); - status_commit(); dstate_dataok(); return 1; @@ -466,10 +477,6 @@ static void protocol_verify(unsigned char cmd) { int i, found; - /* we might not care about this one */ - if (strchr(CMD_IGN_CHARS, cmd)) - return; - /* see if it's a variable */ for (i = 0; apc_vartab[i].name != NULL; i++) { @@ -531,27 +538,28 @@ static int firmware_table_lookup(void) unsigned int i, j; char buf[SMALLBUF]; - upsdebugx(1, "Attempting firmware lookup"); + upsdebugx(1, "Attempting firmware lookup using command 'V'"); - ret = ser_send_char(upsfd, 'b'); + ret = ser_send_char(upsfd, 'V'); if (ret != 1) { - upslog_with_errno(LOG_ERR, "getbaseinfo: ser_send_char failed"); + upslog_with_errno(LOG_ERR, "firmware_table_lookup: ser_send_char failed"); return 0; } ret = ser_get_line(upsfd, buf, sizeof(buf), ENDCHAR, IGNCHARS, SER_WAIT_SEC, SER_WAIT_USEC); - /* see if this is an older version like an APC600 which doesn't - * response to 'a' or 'b' queries + /* + * Some UPSes support both 'V' and 'b'. As 'b' doesn't always return + * firmware version, we attempt that only if 'V' doesn't work. */ if ((ret < 1) || (!strcmp(buf, "NA"))) { - upsdebugx(1, "Attempting to contact older Smart-UPS version"); - ret = ser_send_char(upsfd, 'V'); + upsdebugx(1, "Attempting firmware lookup using command 'b'"); + ret = ser_send_char(upsfd, 'b'); if (ret != 1) { - upslog_with_errno(LOG_ERR, "getbaseinfo: ser_send_char failed"); + upslog_with_errno(LOG_ERR, "firmware_table_lookup: ser_send_char failed"); return 0; } @@ -562,10 +570,10 @@ static int firmware_table_lookup(void) upslog_with_errno(LOG_ERR, "firmware_table_lookup: ser_get_line failed"); return 0; } - - upsdebugx(2, "Firmware: [%s]", buf); } + upsdebugx(2, "Firmware: [%s]", buf); + /* this will be reworked if we get a lot of these things */ if (!strcmp(buf, "451.2.I")) { quirk_capability_overflow = 1; @@ -602,6 +610,10 @@ static void getbaseinfo(void) int ret = 0; char *alrts, *cmds, temp[512]; + /* + * try firmware lookup first; we could start with 'a', but older models + * sometimes return other things than a command set + */ if (firmware_table_lookup() == 1) return; @@ -622,7 +634,6 @@ static void getbaseinfo(void) SER_WAIT_SEC, SER_WAIT_USEC); if ((ret < 1) || (!strcmp(temp, "NA"))) { - /* We have an old dumb UPS - go to specific code for old stuff */ oldapcsetup(); return; @@ -774,101 +785,276 @@ static int smartmode(void) return 0; /* failure */ } +/* + * all shutdown commands should respond with 'OK' or '*' + */ +static int sdok(void) +{ + char temp[16]; + + ser_get_line(upsfd, temp, sizeof(temp), ENDCHAR, IGNCHARS, SER_WAIT_SEC, SER_WAIT_USEC); + upsdebugx(4, "sdok: got \"%s\"", temp); + + if (!strcmp(temp, "*") || !strcmp(temp, "OK")) { + upsdebugx(4, "Last issued shutdown command succeeded"); + return 1; + } + + upsdebugx(1, "Last issued shutdown command failed"); + return 0; +} + +/* soft hibernate: S - working only when OB, otherwise ignored */ +static int sdcmd_S(int dummy) +{ + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); + + upsdebugx(1, "Issuing soft hibernate"); + ser_send_char(upsfd, APC_CMD_SOFTDOWN); + + return sdok(); +} + +/* soft hibernate, hack version for CS 350 */ +static int sdcmd_CS(int tval) +{ + upsdebugx(1, "Using CS 350 'force OB' shutdown method"); + if (tval & APC_STAT_OL) { + upsdebugx(1, "On-line - forcing OB temporarily"); + ser_send_char(upsfd, 'U'); + usleep(UPSDELAY); + } + return sdcmd_S(tval); +} + +/* + * hard hibernate: @nnn / @nn + * note: works differently for older and new models, see help function for + * detailed info + */ +static int sdcmd_ATn(int cnt) +{ + int n = 0, mmax, ret; + const char *strval; + char timer[4]; + + mmax = cnt == 2 ? 99 : 999; + + if ((strval = getval("wugrace"))) { + errno = 0; + n = strtol(strval, NULL, 10); + if (errno || n < 0 || n > mmax) + n = 0; + } + + snprintf(timer, sizeof(timer), "%.*d", cnt, n); + + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); + upsdebugx(1, "Issuing hard hibernate with %d minutes additional wakeup delay", n*6); + + ser_send_char(upsfd, APC_CMD_GRACEDOWN); + usleep(CMDLONGDELAY); + ser_send_pace(upsfd, UPSDELAY, "%s", timer); + + ret = sdok(); + if (ret || cnt == 3) + return ret; + + /* + * "tricky" part - we tried @nn variation and it (unsurprisingly) + * failed; we have to abort the sequence with something bogus to have + * the clean state; newer upses will respond with 'NO', older will be + * silent (YMMV); + */ + ser_send_char(upsfd, APC_CMD_GRACEDOWN); + usleep(UPSDELAY); + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); + + return 0; +} + +/* shutdown: K - delayed poweroff */ +static int sdcmd_K(int dummy) +{ + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); + upsdebugx(1, "Issuing delayed poweroff"); + + ser_send_char(upsfd, APC_CMD_SHUTDOWN); + usleep(CMDLONGDELAY); + ser_send_char(upsfd, APC_CMD_SHUTDOWN); + + return sdok(); +} + +/* shutdown: Z - immediate poweroff */ +static int sdcmd_Z(int dummy) +{ + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); + upsdebugx(1, "Issuing immediate poweroff"); + + ser_send_char(upsfd, APC_CMD_OFF); + usleep(CMDLONGDELAY); + ser_send_char(upsfd, APC_CMD_OFF); + + return sdok(); +} + +static int (*sdlist[])(int) = { + sdcmd_S, + sdcmd_ATn, /* for @nnn version */ + sdcmd_K, + sdcmd_Z, + sdcmd_CS, + sdcmd_ATn, /* for @nn version */ +}; + +#define SDIDX_S 0 +#define SDIDX_AT3N 1 +#define SDIDX_K 2 +#define SDIDX_Z 3 +#define SDIDX_CS 4 +#define SDIDX_AT2N 5 + +#define SDCNT 6 + +static void upsdrv_shutdown_simple(int status) +{ + unsigned int sdtype = 0; + char *strval; + + if ((strval = getval("sdtype"))) { + errno = 0; + sdtype = strtol(strval, NULL, 10); + if (errno || sdtype < 0 || sdtype > 6) + sdtype = 0; + } + + switch (sdtype) { + + case 6: /* hard hibernate */ + sdcmd_ATn(3); + break; + case 5: /* "hack nn" hard hibernate */ + sdcmd_ATn(2); + break; + case 4: /* special hack for CS 350 and similar models */ + sdcmd_CS(status); + break; + + case 3: /* delayed poweroff */ + sdcmd_K(0); + break; + + case 2: /* instant poweroff */ + sdcmd_Z(0); + break; + case 1: + /* + * Send a combined set of shutdown commands which can work + * better if the UPS gets power during shutdown process + * Specifically it sends both the soft shutdown 'S' and the + * hard hibernate '@nnn' commands + */ + upsdebugx(1, "UPS - currently %s - sending soft/hard hibernate commands", + (status & APC_STAT_OL) ? "on-line" : "on battery"); + + /* S works only when OB */ + if ((status & APC_STAT_OB) && sdcmd_S(0)) + break; + sdcmd_ATn(3); + break; + + default: + /* + * Send @nnn or S, depending on OB / OL status + */ + if (status & APC_STAT_OL) /* on line */ + sdcmd_ATn(3); + else + sdcmd_S(0); + } +} + +static void upsdrv_shutdown_advanced(int status) +{ + const char *strval; + const char deforder[] = {48 + SDIDX_S, + 48 + SDIDX_AT3N, + 48 + SDIDX_K, + 48 + SDIDX_Z, + 0}; + size_t i; + int n; + + strval = getval("advorder"); + + /* sanitize advorder */ + + if (!strval || !strlen(strval) || strlen(strval) > SDCNT) + strval = deforder; + for (i = 0; i < strlen(strval); i++) { + if (strval[i] - 48 < 0 || strval[i] - 48 >= SDCNT) { + strval = deforder; + break; + } + } + + /* + * try each method in the list with a little bit of handling in certain + * cases + */ + + for (i = 0; i < strlen(strval); i++) { + switch (strval[i] - 48) { + case SDIDX_CS: + n = status; + break; + case SDIDX_AT3N: + n = 3; + break; + case SDIDX_AT2N: + default: + n = 2; + } + + if (sdlist[strval[i] - 48](n)) + break; /* finish if command succeeded */ + } +} + /* power down the attached load immediately */ void upsdrv_shutdown(void) { char temp[32]; - int ret, tval, sdtype = 0; + int ret, status; if (!smartmode()) - printf("Detection failed. Trying a shutdown command anyway.\n"); + upsdebugx(1, "SM detection failed. Trying a shutdown command anyway"); /* check the line status */ ret = ser_send_char(upsfd, APC_STATUS); if (ret == 1) { - ret = ser_get_line(upsfd, temp, sizeof(temp), ENDCHAR, + ret = ser_get_line(upsfd, temp, sizeof(temp), ENDCHAR, IGNCHARS, SER_WAIT_SEC, SER_WAIT_USEC); if (ret < 1) { - printf("Status read failed! Assuming on battery state\n"); - tval = APC_STAT_LB | APC_STAT_OB; + upsdebugx(1, "Status read failed ! Assuming on battery state"); + status = APC_STAT_LB | APC_STAT_OB; } else { - tval = strtol(temp, 0, 16); + status = strtol(temp, 0, 16); } } else { - printf("Status request failed; assuming on battery state\n"); - tval = APC_STAT_LB | APC_STAT_OB; + upsdebugx(1, "Status request failed; assuming on battery state"); + status = APC_STAT_LB | APC_STAT_OB; } - if (testvar("sdtype")) - sdtype = atoi(getval("sdtype")); - - switch (sdtype) { - - case 4: /* special hack for CS 350 and similar models */ - printf("Using CS 350 'force OB' shutdown method\n"); - - if (tval & APC_STAT_OL) { - printf("On line - forcing OB temporarily\n"); - ser_send_char(upsfd, 'U'); - } - - ser_send_char(upsfd, 'S'); - break; - - case 3: /* shutdown with grace period */ - printf("Sending delayed power off command to UPS\n"); - - ser_send_char(upsfd, APC_CMD_SHUTDOWN); - usleep(CMDLONGDELAY); - ser_send_char(upsfd, APC_CMD_SHUTDOWN); - - break; - - case 2: /* instant shutdown */ - printf("Sending power off command to UPS\n"); - - ser_send_char(upsfd, APC_CMD_OFF); - usleep(CMDLONGDELAY); - ser_send_char(upsfd, APC_CMD_OFF); - - break; - - case 1: - - /* Send a combined set of shutdown commands which can work better */ - /* if the UPS gets power during shutdown process */ - /* Specifically it sends both the soft shutdown 'S' */ - /* and the powerdown after grace period - '@000' commands */ - printf("UPS - currently %s - sending shutdown/powerdown\n", - (tval & APC_STAT_OL) ? "on-line" : "on battery"); - - ser_flush_in(upsfd, IGNCHARS, nut_debug_level); - ser_send_pace(upsfd, UPSDELAY, "S@000"); - break; - - default: - - /* @000 - shutdown after 'p' grace period */ - /* - returns after 000 minutes (i.e. right away) */ - - /* S - shutdown after 'p' grace period, only on battery */ - /* returns after 'e' charge % plus 'r' seconds */ - - ser_flush_in(upsfd, IGNCHARS, nut_debug_level); - - if (tval & APC_STAT_OL) { /* on line */ - printf("On line, sending shutdown+return command...\n"); - ser_send_pace(upsfd, UPSDELAY, "@000"); - } - else { - printf("On battery, sending normal shutdown command...\n"); - ser_send_char(upsfd, APC_CMD_SOFTDOWN); - } - } + if (testvar("advorder") && strcasecmp(getval("advorder"), "no")) + upsdrv_shutdown_advanced(status); + else + upsdrv_shutdown_simple(status); } /* 940-0095B support: set DTR, lower RTS */ @@ -921,6 +1107,7 @@ static int setvar_enum(apc_vartab_t *vt, const char *val) char orig[256], temp[256]; const char *ptr; + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); ret = ser_send_char(upsfd, vt->cmd); if (ret != 1) { @@ -1015,7 +1202,6 @@ static int setvar_string(apc_vartab_t *vt, const char *val) char temp[256]; ser_flush_in(upsfd, IGNCHARS, nut_debug_level); - ret = ser_send_char(upsfd, vt->cmd); if (ret != 1) { @@ -1118,6 +1304,7 @@ static int do_cmd(apc_cmdtab_t *ct) int ret; char buf[SMALLBUF]; + ser_flush_in(upsfd, IGNCHARS, nut_debug_level); ret = ser_send_char(upsfd, ct->cmd); if (ret != 1) { @@ -1222,7 +1409,9 @@ static void setuphandlers(void) void upsdrv_makevartable(void) { addvar(VAR_VALUE, "cable", "Specify alternate cable (940-0095B)"); - addvar(VAR_VALUE, "sdtype", "Specify shutdown type (1-3)"); + addvar(VAR_VALUE, "wugrace", "Hard hibernate's wakeup grace"); + addvar(VAR_VALUE, "sdtype", "Specify simple shutdown method (0-6)"); + addvar(VAR_VALUE, "advorder", "Enable advanced shutdown control"); } void upsdrv_initups(void) @@ -1234,9 +1423,8 @@ void upsdrv_initups(void) cable = getval("cable"); - if (cable) - if (!strcasecmp(cable, ALT_CABLE_1)) - init_serial_0095B(); + if (cable && !strcasecmp(cable, ALT_CABLE_1)) + init_serial_0095B(); /* make sure we wake up if the UPS sends alert chars to us */ extrafd = upsfd; @@ -1244,18 +1432,12 @@ void upsdrv_initups(void) void upsdrv_help(void) { - printf("\nShutdown types:\n"); - printf(" 0: soft shutdown or powerdown, depending on battery status\n"); - printf(" 1: soft shutdown followed by powerdown\n"); - printf(" 2: instant power off\n"); - printf(" 3: power off with grace period\n"); - printf(" 4: 'force OB' hack method for CS 350\n"); - printf("Modes 0-1 will make the UPS come back when power returns\n"); - printf("Modes 2-3 will make the UPS stay turned off when power returns\n"); } void upsdrv_initinfo(void) { + const char *pmod, *pser; + if (!smartmode()) { fatalx(EXIT_FAILURE, "Unable to detect an APC Smart protocol UPS on port %s\n" @@ -1268,8 +1450,12 @@ void upsdrv_initinfo(void) getbaseinfo(); - printf("Detected %s [%s] on %s\n", dstate_getinfo("ups.model"), - dstate_getinfo("ups.serial"), device_path); + if (!(pmod = dstate_getinfo("ups.model"))) + pmod = "\"unknown model\""; + if (!(pser = dstate_getinfo("ups.serial"))) + pser = "unknown serial"; + + upsdebugx(1, "Detected %s [%s] on %s", pmod, pser, device_path); setuphandlers(); } diff --git a/drivers/apcsmart.h b/drivers/apcsmart.h index 41ebbe1..f143cfa 100644 --- a/drivers/apcsmart.h +++ b/drivers/apcsmart.h @@ -23,20 +23,22 @@ #include "serial.h" #include "timehead.h" -#define APC_TABLE_VERSION "version 2.1" +#define APC_TABLE_VERSION "version 2.2" /* Basic UPS reply line structure */ #define ENDCHAR 10 /* APC ends responses with LF */ -/* these two are only used during startup */ -#define IGNCHARS "\015+$|!~%?=*#&" /* special characters to ignore */ +/* characters ignored by default */ +#define IGNCHARS "\015+$|!~%?=#&" /* special characters to ignore */ + +/* these one is used only during startup, due to ^Z sending certain characters such as # */ #define MINIGNCHARS "\015+$|!" /* minimum set of special characters to ignore */ /* normal polls: characters we don't want to parse (including a few alerts) */ -#define POLL_IGNORE "\015?=*&|" +#define POLL_IGNORE "\015&|" -/* alert characters we care about - OL, OB, LB, not LB, RB */ -#define POLL_ALERT "$!%+#" +/* alert characters we care about - OL, OB, LB, not LB, RB, OVER, not OVER */ +#define POLL_ALERT "$!%+#?=" #define UPSDELAY 50000 /* slow down multicharacter commands */ #define CMDLONGDELAY 1500000 /* some commands need a 1.5s gap for safety */ @@ -77,7 +79,6 @@ /* Driver command table flag values */ #define APC_POLL 0x0001 /* Poll this variable regularly */ -#define APC_IGNORE 0x0002 /* Never poll this */ #define APC_PRESENT 0x0004 /* Capability seen on this UPS */ #define APC_RW 0x0010 /* read-write variable */ @@ -109,15 +110,11 @@ typedef struct { apc_vartab_t apc_vartab[] = { + { "ups.firmware.old", 0, 'V' }, { "ups.firmware", 0, 'b' }, { "ups.firmware.aux", 0, 'v' }, { "ups.model", 0, 0x01 }, -/* FUTURE: depends on variable naming scheme */ -#if 0 - { "ups.model.code", 0, 'V' }, -#endif - { "ups.serial", 0, 'n' }, { "ups.mfr.date", 0, 'm' }, @@ -207,6 +204,7 @@ apc_vartab_t apc_vartab[] = { #define APC_CMD_CALTOGGLE 'D' #define APC_CMD_SHUTDOWN 'K' #define APC_CMD_SOFTDOWN 'S' +#define APC_CMD_GRACEDOWN '@' #define APC_CMD_SIMPWF 'U' #define APC_CMD_BTESTTOGGLE 'W' #define APC_CMD_OFF 'Z' @@ -232,6 +230,8 @@ apc_cmdtab_t apc_cmdtab[] = { "test.battery.start", 0, APC_CMD_BTESTTOGGLE }, { "test.battery.stop", 0, APC_CMD_BTESTTOGGLE }, + { "shutdown.return.grace", + APC_NASTY, APC_CMD_GRACEDOWN }, { "shutdown.return", APC_NASTY, APC_CMD_SOFTDOWN }, { "shutdown.stayoff", APC_NASTY|APC_REPEAT, APC_CMD_SHUTDOWN }, @@ -244,9 +244,6 @@ apc_cmdtab_t apc_cmdtab[] = { NULL, 0, 0 } }; -/* things to ignore in protocol_verify - useless variables, etc. */ -#define CMD_IGN_CHARS "\032-78@.,~\047\177QHRTYayz)1IJ" - /* compatibility with hardware that doesn't do APC_CMDSET ('a') */ struct { @@ -255,33 +252,40 @@ struct { int flags; } compat_tab[] = { /* APC Matrix */ + { "0XI", "789ABCDEFGKLMNOPQRSTUVWXYZcefgjklmnopqrsuwxz/<>\\^\014\026", 0 }, + { "0XM", "789ABCDEFGKLMNOPQRSTUVWXYZcefgjklmnopqrsuwxz/<>\\^\014\026", 0 }, { "0ZI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz/<>", 0 }, { "5UI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz/<>", 0 }, { "5ZM", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz/<>", 0 }, /* APC600 */ { "6QD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "6QI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "6QI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, { "6TD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, { "6TI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, /* SmartUPS 900 */ - { "7QD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "7QI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "7TD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "7TI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - /* SmartUPS 1250. */ + { "7QD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "7QI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "7TD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "7TI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + /* SmartUPS 900I */ + { "7II", "79ABCEFGKLMNOPQSUVWXYZcfg", 0 }, + /* SmartUPS 2000I */ + { "9II", "79ABCEFGKLMNOPQSUVWXYZcfg", 0 }, + { "9GI", "79ABCEFGKLMNOPQSUVWXYZcfg", 0 }, + /* SmartUPS 1250 */ { "8QD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, { "8QI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "8TD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, - { "8TI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "8TD", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, + { "8TI", "79ABCDEFGKLMNOPQRSUVWXYZcefgjklmnopqrsuxz", 0 }, /* CS 350 */ { "5.4.D", "\1ABPQRSUYbdfgjmnx9", 0 }, /* Smart-UPS 600 */ - { "D9", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, - { "D8", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, - { "D7", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, - { "D6", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, - { "D5", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, - { "D4", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D9", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D8", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D7", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D6", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D5", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, + { "D4", "789ABCEFGKLMNOPQRSUVWXYZ", 0 }, { NULL, NULL, 0 }, }; diff --git a/drivers/bcmxcp.c b/drivers/bcmxcp.c index 13b43bd..d2e0f5c 100644 --- a/drivers/bcmxcp.c +++ b/drivers/bcmxcp.c @@ -120,7 +120,7 @@ TODO List: #include "bcmxcp.h" #define DRIVER_NAME "BCMXCP UPS driver" -#define DRIVER_VERSION "0.23" +#define DRIVER_VERSION "0.24" /* driver description structure */ upsdrv_info_t upsdrv_info = { @@ -1176,17 +1176,20 @@ void upsdrv_initinfo(void) iIndex += 1; /* Size of command list block */ - cmd_list_len = get_word(answer+iIndex); + if (iIndex < res) + cmd_list_len = get_word(answer+iIndex); upsdebugx(2, "Length of command list: %d\n", cmd_list_len); iIndex += 2; /* Size of outlet monitoring block */ - outlet_block_len = get_word(answer+iIndex); + if (iIndex < res) + outlet_block_len = get_word(answer+iIndex); upsdebugx(2, "Length of outlet_block: %d\n", outlet_block_len); iIndex += 2; /* Size of the alarm block */ - alarm_block_len = get_word(answer+iIndex); + if (iIndex < res) + alarm_block_len = get_word(answer+iIndex); upsdebugx(2, "Length of alarm_block: %d\n", alarm_block_len); /* End of UPS ID block request */ @@ -1209,7 +1212,8 @@ void upsdrv_initinfo(void) init_limit(); /* Get information on UPS commands */ - init_command_map(); + if (cmd_list_len) + init_command_map(); /* FIXME: leave up to init_command_map() to add instant commands? */ dstate_addcmd("shutdown.return"); diff --git a/drivers/bcmxcp_ser.c b/drivers/bcmxcp_ser.c index b6f98f0..b03e0c1 100644 --- a/drivers/bcmxcp_ser.c +++ b/drivers/bcmxcp_ser.c @@ -6,7 +6,7 @@ #define PW_MAX_BAUD 5 #define SUBDRIVER_NAME "RS-232 communication subdriver" -#define SUBDRIVER_VERSION "0.17" +#define SUBDRIVER_VERSION "0.18" /* communication driver description structure */ upsdrv_info_t comm_upsdrv_info = { @@ -47,8 +47,10 @@ static void send_command(unsigned char *command, int command_length) while (retry++ < PW_MAX_TRY) { - if (retry == PW_MAX_TRY) + if (retry == PW_MAX_TRY) { ser_send_char(upsfd, 0x1d); /* last retry is preceded by a ESC.*/ + usleep(250000); + } sent = ser_send_buf(upsfd, sbuf, command_length); @@ -82,7 +84,7 @@ int get_answer(unsigned char *data, unsigned char command) res = ser_get_char(upsfd, my_buf, 1, 0); if (res != 1) { - upsdebugx(1,"Receive error (PW_COMMAND_START_BYTE): %d!!!\n", res); + upsdebugx(1,"Receive error (PW_COMMAND_START_BYTE): %d, cmd=%x!!!\n", res, command); return -1; } @@ -250,6 +252,7 @@ void upsdrv_comm_good() void pw_comm_setup(const char *port) { unsigned char command = PW_SET_REQ_ONLY_MODE; + unsigned char id_command = PW_ID_BLOCK_REQ; unsigned char answer[256]; int i = 0, baud, mybaud = 0, ret = -1; @@ -274,6 +277,10 @@ void pw_comm_setup(const char *port) send_write_command(AUT, 4); usleep(500000); ret = command_sequence(&command, 1, answer); + if (ret <= 0) { + usleep(500000); + ret = command_sequence(&id_command, 1, answer); + } if (ret > 0) { upslogx(LOG_INFO, "Connected to UPS on %s with baudrate %d", port, baud); @@ -293,6 +300,10 @@ void pw_comm_setup(const char *port) send_write_command(AUT, 4); usleep(500000); ret = command_sequence(&command, 1, answer); + if (ret <= 0) { + usleep(500000); + ret = command_sequence(&id_command, 1, answer); + } if (ret > 0) { upslogx(LOG_INFO, "Connected to UPS on %s with baudrate %d", port, pw_baud_rates[i].name); diff --git a/drivers/bcmxcp_usb.c b/drivers/bcmxcp_usb.c index ce44abb..95feea7 100644 --- a/drivers/bcmxcp_usb.c +++ b/drivers/bcmxcp_usb.c @@ -160,7 +160,7 @@ int get_answer(unsigned char *data, unsigned char command) { /* Clear any possible endpoint stalls */ usb_clear_halt(upsdev, 0x81); - //continue; // FIXME: seems a break would be better! + /* continue; */ /* FIXME: seems a break would be better! */ break; } diff --git a/drivers/blazer.c b/drivers/blazer.c index 4dbbcbd..5179be5 100644 --- a/drivers/blazer.c +++ b/drivers/blazer.c @@ -186,7 +186,7 @@ static int blazer_status(const char *cmd) * 01234567890123456789012345678901234567890123456 * 0 1 2 3 4 */ - if (blazer_command(cmd, buf, sizeof(buf)) < 47) { + if (blazer_command(cmd, buf, sizeof(buf)) < 46) { upsdebugx(2, "%s: short reply", __func__); return -1; } @@ -691,6 +691,9 @@ void upsdrv_updateinfo(void) if (blazer_status(command[proto].status)) { if (retry < MAXTRIES) { + upsdebugx(1, "Communications with UPS lost: status read failed!"); + retry++; + } else if (retry == MAXTRIES) { upslogx(LOG_WARNING, "Communications with UPS lost: status read failed!"); retry++; } else { @@ -723,7 +726,7 @@ void upsdrv_updateinfo(void) lastpoll = now; } - if (retry) { + if (retry > MAXTRIES) { upslogx(LOG_NOTICE, "Communications with UPS re-established"); } diff --git a/drivers/blazer_usb.c b/drivers/blazer_usb.c index 7a07107..317093e 100644 --- a/drivers/blazer_usb.c +++ b/drivers/blazer_usb.c @@ -255,16 +255,17 @@ static int krauler_command(const char *cmd, char *buf, size_t buflen) /* "UPS No Ack" has a special meaning */ if (!strcasecmp(buf, "UPS No Ack")) { + upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf); continue; } /* Replace the first byte of what we received with the correct one */ buf[0] = command[i].prefix; + upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf); return ret; } - upsdebugx(3, "read: %.*s", (int)strcspn(buf, "\r"), buf); return 0; } @@ -295,13 +296,21 @@ static void *krauler_subdriver(void) } +static void *phoenix_subdriver(void) +{ + subdriver_command = &phoenix_command; + return NULL; +} + + static usb_device_id_t blazer_usb_id[] = { { USB_DEVICE(0x05b8, 0x0000), &cypress_subdriver }, /* Agiler UPS */ - { USB_DEVICE(0x0001, 0x0000), &krauler_subdriver }, /* Krauler UP-M500VA */ - { USB_DEVICE(0xffff, 0x0000), &krauler_subdriver }, /* Ablerex 625L USB */ + { 0x0001, 0x0000, &krauler_subdriver }, /* Krauler UP-M500VA */ + { 0xffff, 0x0000, &krauler_subdriver }, /* Ablerex 625L USB */ { USB_DEVICE(0x0665, 0x5161), &cypress_subdriver }, /* Belkin F6C1200-UNV */ { USB_DEVICE(0x06da, 0x0003), &ippon_subdriver }, /* Mustek Powermust */ { USB_DEVICE(0x0f03, 0x0001), &cypress_subdriver }, /* Unitek Alpha 1200Sx */ + { USB_DEVICE(0x14f0, 0x00c9), &phoenix_subdriver }, /* GE EP series */ /* end of list */ {-1, -1, NULL} }; diff --git a/drivers/cps-hid.c b/drivers/cps-hid.c index e594a59..b098df3 100644 --- a/drivers/cps-hid.c +++ b/drivers/cps-hid.c @@ -74,6 +74,22 @@ static info_lkp_t cps_battvolt[] = { { 0, NULL, &cps_battvolt_fun } }; +/* returns statically allocated string - must not use it again before + done with result! */ +static const char *cps_battcharge_fun(double value) +{ + static char buf[8]; + + /* clamp battery charge to 100% */ + snprintf(buf, sizeof(buf), "%.0f", value < 100.0 ? value : 100.0); + + return buf; +} + +static info_lkp_t cps_battcharge[] = { + { 0, NULL, &cps_battcharge_fun } +}; + /* --------------------------------------------------------------- */ /* Vendor-specific usage table */ /* --------------------------------------------------------------- */ @@ -106,7 +122,7 @@ static hid_info_t cps_hid2nut[] = { { "battery.mfr.date", 0, 0, "UPS.PowerSummary.iOEMInformation", NULL, "%s", 0, stringid_conversion }, { "battery.charge.warning", 0, 0, "UPS.PowerSummary.WarningCapacityLimit", NULL, "%.0f", 0, NULL }, { "battery.charge.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.RemainingCapacityLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, - { "battery.charge", 0, 0, "UPS.PowerSummary.RemainingCapacity", NULL, "%.0f", 0, NULL }, + { "battery.charge", 0, 0, "UPS.PowerSummary.RemainingCapacity", NULL, "%s", 0, cps_battcharge }, { "battery.runtime", 0, 0, "UPS.PowerSummary.RunTimeToEmpty", NULL, "%.0f", 0, NULL }, { "battery.runtime.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.RemainingTimeLimit", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "battery.voltage.nominal", 0, 0, "UPS.PowerSummary.ConfigVoltage", NULL, "%.0f", 0, NULL }, diff --git a/drivers/dstate.c b/drivers/dstate.c index b95cec9..316c54f 100644 --- a/drivers/dstate.c +++ b/drivers/dstate.c @@ -32,7 +32,7 @@ #include "state.h" #include "parseconf.h" - static int sockfd = -1, stale = 1, alarm_active = 0; + static int sockfd = -1, stale = 1, alarm_active = 0, ignorelb = 0; static char *sockfn = NULL; static char status_buf[ST_MAX_VALUE_LEN], alarm_buf[ST_MAX_VALUE_LEN]; static st_tree_t *dtree_root = NULL; @@ -223,8 +223,11 @@ static void sock_connect(int sock) int fd, ret; conn_t *conn; struct sockaddr_un sa; +#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED) + int salen; +#else socklen_t salen; - +#endif salen = sizeof(sa); fd = accept(sock, (struct sockaddr *) &sa, &salen); @@ -639,7 +642,12 @@ void dstate_setflags(const char *var, int flags) sttmp = state_tree_find(dtree_root, var); if (!sttmp) { - upslogx(LOG_ERR, "dstate_setflags: base variable (%s) does not exist", var); + upslogx(LOG_ERR, "%s: base variable (%s) does not exist", __func__, var); + return; + } + + if (sttmp->flags & ST_FLAG_IMMUTABLE) { + upslogx(LOG_WARNING, "%s: base variable (%s) is immutable", __func__, var); return; } @@ -792,12 +800,21 @@ int dstate_is_stale(void) /* clean out the temp space for a new pass */ void status_init(void) { + if (dstate_getinfo("driver.flag.ignorelb")) { + ignorelb = 1; + } + memset(status_buf, 0, sizeof(status_buf)); } /* add a status element */ void status_set(const char *buf) { + if (ignorelb && !strcasecmp(buf, "LB")) { + upsdebugx(2, "%s: ignoring LB flag from device", __func__); + return; + } + /* separate with a space if multiple elements are present */ if (strlen(status_buf) > 0) { snprintfcat(status_buf, sizeof(status_buf), " %s", buf); @@ -809,6 +826,31 @@ void status_set(const char *buf) /* write the status_buf into the externally visible dstate storage */ void status_commit(void) { + while (ignorelb) { + const char *val, *low; + + val = dstate_getinfo("battery.charge"); + low = dstate_getinfo("battery.charge.low"); + + if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { + snprintfcat(status_buf, sizeof(status_buf), " LB"); + upsdebugx(2, "%s: appending LB flag [charge '%s' below '%s']", __func__, val, low); + break; + } + + val = dstate_getinfo("battery.runtime"); + low = dstate_getinfo("battery.runtime.low"); + + if (val && low && (strtol(val, NULL, 10) < strtol(low, NULL, 10))) { + snprintfcat(status_buf, sizeof(status_buf), " LB"); + upsdebugx(2, "%s: appending LB flag [runtime '%s' below '%s']", __func__, val, low); + break; + } + + /* LB condition not detected */ + break; + } + if (alarm_active) { dstate_setinfo("ups.status", "ALARM %s", status_buf); } else { diff --git a/drivers/dummy-ups.c b/drivers/dummy-ups.c index 468e660..72bef62 100644 --- a/drivers/dummy-ups.c +++ b/drivers/dummy-ups.c @@ -375,7 +375,7 @@ static int is_valid_data(const char* varname) * enforcing controls! We also need a way to automate * the update / sync process (with cmdvartab?!) */ - upsdebugx(1, "Unknown data. Commiting anyway..."); + upsdebugx(1, "Unknown data. Committing anyway..."); return 1; /* return 0;*/ } @@ -395,7 +395,7 @@ static int is_valid_value(const char* varname, const char *value) * enforcing controls! We also need a way to automate * the update / sync process (with cmdvartab?) */ - upsdebugx(1, "Unknown data. Commiting value anyway..."); + upsdebugx(1, "Unknown data. Committing value anyway..."); return 1; /* return 0;*/ } @@ -412,7 +412,7 @@ static void upsconf_err(const char *errmsg) static int parse_data_file(int upsfd) { char fn[SMALLBUF]; - char *ptr, *var_value = (char*) xmalloc(MAX_STRING_SIZE); + char *ptr, var_value[MAX_STRING_SIZE]; int value_args = 0, counter; time_t now; @@ -501,13 +501,13 @@ static int parse_data_file(int upsfd) } else { - memset(var_value, 0, MAX_STRING_SIZE); for (counter = 1, value_args = ctx->numargs ; counter < value_args ; counter++) { - if (counter != 1) /* don't append the first space separator */ - strncat(var_value, " ", 1); - strncat(var_value, ctx->arglist[counter], MAX_STRING_SIZE); + if (counter == 1) /* don't append the first space separator */ + snprintf(var_value, sizeof(var_value), "%s", ctx->arglist[counter]); + else + snprintfcat(var_value, sizeof(var_value), " %s", ctx->arglist[counter]); } if (setvar(ctx->arglist[0], var_value) == STAT_SET_UNKNOWN) @@ -529,7 +529,6 @@ static int parse_data_file(int upsfd) pconf_finish(ctx); free(ctx); ctx=NULL; - free(var_value); } return 1; } diff --git a/drivers/eaton-mib.c b/drivers/eaton-mib.c index 1bd2dd2..18fcf55 100644 --- a/drivers/eaton-mib.c +++ b/drivers/eaton-mib.c @@ -1,6 +1,6 @@ /* eaton-mib.c - data to monitor Eaton Aphel PDUs (Basic and Complex) * - * Copyright (C) 2008 + * Copyright (C) 2008 - 2010 * Arnaud Quette * * Sponsored by Eaton @@ -25,7 +25,7 @@ #include "eaton-mib.h" -#define EATON_APHEL_MIB_VERSION "0.4" +#define EATON_APHEL_MIB_VERSION "0.45" /* APHEL-GENESIS-II-MIB (monitored ePDU) * ************************************* @@ -87,8 +87,6 @@ static snmp_info_t eaton_aphel_genesisII_mib[] = { #define APHEL2_OID_MODEL_NAME AR_OID_MODEL_NAME -/* Common Aphel / Raritan declaration */ - #define AR_OID_MODEL_NAME AR_BASE_OID ".1.1.12.0" #define AR_OID_DEVICE_NAME AR_BASE_OID ".1.1.13.0" #define AR_OID_FIRMREV AR_BASE_OID ".1.1.1.0" @@ -180,12 +178,21 @@ static snmp_info_t eaton_aphel_revelation_mib[] = { /* FIXME: * - delay for startup/shutdown sequence - * - support for Ambient page - temperatureSensorCount" src="snmp:$sysoid.2.1.0 - ambient.temperature src="snmp:$sysoid.2.2.1.3.$indiceSensor => seems dumb! - ambient.humidity src="snmp:$sysoid.2.4.1.3.$indiceSensor + * - support for multiple Ambient sensors ( max. 8), starting at index '0' + * ambient.%i.temperature => .1.3.6.1.4.1.534.6.6.6.2.2.1.3.%i + * ambient.%i.humidity => .1.3.6.1.4.1.534.6.6.6.2.4.1.3.%i */ + /* Ambient page */ + /* We use critical levels, for both temperature and humidity, + * since warning levels are also available! */ + { "ambient.temperature", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.2.1.3.0", NULL, SU_FLAG_OK, NULL, NULL }, + { "ambient.temperature.low", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.6.0", NULL, SU_FLAG_OK, NULL, NULL }, + { "ambient.temperature.high", 0, 1.0, "1.3.6.1.4.1.534.6.6.6.2.2.1.7.0", NULL, SU_FLAG_OK, NULL, NULL }, + { "ambient.humidity", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.3.0", NULL, SU_FLAG_OK, NULL, NULL }, + { "ambient.humidity.low", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.6.0", NULL, SU_FLAG_OK, NULL, NULL }, + { "ambient.humidity.high", 0, 1.0, ".1.3.6.1.4.1.534.6.6.6.2.4.1.7.0", NULL, SU_FLAG_OK, NULL, NULL }, + /* instant commands. */ /* Note that load.cycle might be replaced by / mapped on shutdown.reboot */ /* no counterpart found! diff --git a/drivers/genericups.c b/drivers/genericups.c index 868f792..bc8ddc4 100644 --- a/drivers/genericups.c +++ b/drivers/genericups.c @@ -142,12 +142,12 @@ void upsdrv_initinfo(void) */ if ((v = getval("OL")) != NULL) { parse_input_signals(v, &upstab[upstype].line_ol, &upstab[upstype].val_ol); - upsdebugx(2, "parse_input_signals: OL overriden with %s\n", v); + upsdebugx(2, "parse_input_signals: OL overridden with %s\n", v); } if ((v = getval("LB")) != NULL) { parse_input_signals(v, &upstab[upstype].line_bl, &upstab[upstype].val_bl); - upsdebugx(2, "parse_input_signals: LB overriden with %s\n", v); + upsdebugx(2, "parse_input_signals: LB overridden with %s\n", v); } } @@ -318,12 +318,12 @@ void upsdrv_initups(void) */ if ((v = getval("CP")) != NULL) { parse_output_signals(v, &upstab[upstype].line_norm); - upsdebugx(2, "parse_output_signals: CP overriden with %s\n", v); + upsdebugx(2, "parse_output_signals: CP overridden with %s\n", v); } if ((v = getval("SD")) != NULL) { parse_output_signals(v, &upstab[upstype].line_sd); - upsdebugx(2, "parse_output_signals: SD overriden with %s\n", v); + upsdebugx(2, "parse_output_signals: SD overridden with %s\n", v); } if (ioctl(upsfd, TIOCMSET, &upstab[upstype].line_norm)) { diff --git a/drivers/libhid.c b/drivers/libhid.c index 78b1236..6fce6a9 100644 --- a/drivers/libhid.c +++ b/drivers/libhid.c @@ -141,7 +141,6 @@ static int refresh_report_buffer(reportbuf_t *rbuf, hid_dev_handle_t udev, HIDDa { int id = pData->ReportID; int r; - unsigned char buf[SMALLBUF]; if (rbuf->ts[id] + age > time(NULL)) { /* buffered report is still good; nothing to do */ @@ -149,17 +148,14 @@ static int refresh_report_buffer(reportbuf_t *rbuf, hid_dev_handle_t udev, HIDDa return 0; } - r = comm_driver->get_report(udev, id, buf, sizeof(buf)); + r = comm_driver->get_report(udev, id, rbuf->data[id], rbuf->len[id]); if (r <= 0) { return -1; } - /* broken report descriptors are common, so store whatever we can */ - memcpy(rbuf->data[id], buf, (r < rbuf->len[id]) ? r : rbuf->len[id]); - if (rbuf->len[id] != r) { upsdebugx(2, "%s: expected %d bytes, but got %d instead", __func__, rbuf->len[id], r); - upsdebug_hex(3, "Report[err]", buf, r); + upsdebug_hex(3, "Report[err]", rbuf->data[id], r); } else { upsdebug_hex(3, "Report[get]", rbuf->data[id], rbuf->len[id]); } @@ -399,7 +395,7 @@ char *HIDGetIndexString(hid_dev_handle_t udev, const int Index, char *buf, size_ if (comm_driver->get_string(udev, Index, buf, buflen) < 1) buf[0] = '\0'; - return buf; + return rtrim(buf, '\n'); } /* Return pointer to indexed string from HID path (empty if not found) diff --git a/drivers/liebert-esp2.c b/drivers/liebert-esp2.c index 06d486a..fca7c5e 100644 --- a/drivers/liebert-esp2.c +++ b/drivers/liebert-esp2.c @@ -23,8 +23,58 @@ #include "timehead.h" #include "nut_stdint.h" +#define sivann +#define IsBitSet(val, bit) ((val) & (1 << (bit))) + #define DRIVER_NAME "Liebert ESP-II serial UPS driver" -#define DRIVER_VERSION "0.02" +#define DRIVER_VERSION "0.03" +#define UPS_SHUTDOWN_DELAY 12 /* it means UPS will be shutdown 120 sec */ +#define SHUTDOWN_CMD_LEN 8 + +/* values for sending to UPS */ +enum mult_enum { + M_10, + M_0_1, + M_VOLTAGE_I, + M_VOLTAGE_O, + M_VOLTAGE_B, + M_CURRENT_I, + M_CURRENT_O, + M_CURRENT_B, + M_LOAD_VA, + M_LOAD_WATT, + M_FREQUENCY, + M_VOLT_DC, + M_TEMPERATURE, + M_CURRENT_DC , + M_BAT_RUNTIME, + M_NOMPOWER, + M_POWER, + M_REALPOWER, + M_LOADPERC +}; + +static float multi[19]={ + 10.0, + 0.1, + 0.1, /* volt */ + 0.1, + 0.1, + 0.1, /* curr */ + 0.1, + 0.1, + 100.0, /* va */ + 100.0, /* W */ + 0.01, /* FREQ */ + 0.1, /* V DC*/ + 0.1, /* TEMP*/ + 0.01, /* CUR DC*/ + 60.0, /* BAT RUNTIME*/ + 100.0, /* NOMPOWER*/ + 100.0, /* POWER*/ + 100.0, /* REAL POWER*/ + 1.0 /* LOADPERC*/ +}; static int instcmd(const char *cmdname, const char *extra); static int setvar(const char *varname, const char *val); @@ -33,7 +83,8 @@ static int setvar(const char *varname, const char *val); upsdrv_info_t upsdrv_info = { DRIVER_NAME, DRIVER_VERSION, - "Richard Gregory ", + "Richard Gregory \n" \ + "Robert Jobbagy 1){ + cmdin_p=vartab3i; + } + else { + cmdin_p=vartab1i; + } + + if (num_outphases>1){ + cmdout_p=vartab3o; + } + else { + cmdout_p=vartab1o; + } + + for (i = 0; cmdin_p[i].var; i++) { + int16_t val; + ret = do_command(cmdin_p[i].cmd, reply, 6); + if (ret < 8) { + continue; + } + val = (unsigned char)reply[5]; + val <<= 8; + val += (unsigned char)reply[6]; + dstate_setinfo(cmdin_p[i].var, cmdin_p[i].fmt, val * multi[cmdin_p[i].multindex]); + } + + for (i = 0; cmdout_p[i].var; i++) { + int16_t val; + ret = do_command(cmdout_p[i].cmd, reply, 6); + if (ret < 8) { + continue; + } + val = (unsigned char)reply[5]; + val <<= 8; + val += (unsigned char)reply[6]; + dstate_setinfo(cmdout_p[i].var, cmdout_p[i].fmt, val * multi[cmdout_p[i].multindex]); } status_init(); - ret = do_command(cmd_bitfield1, reply); + ret = do_command(cmd_bitfield1, reply, 6); if (ret < 8) { upslogx(LOG_ERR, "Failed reading bitfield #1"); dstate_datastale(); @@ -217,7 +430,7 @@ void upsdrv_updateinfo(void) } } - ret = do_command(cmd_bitfield2, reply); + ret = do_command(cmd_bitfield2, reply, 6); if (ret < 8) { upslogx(LOG_ERR, "Failed reading bitfield #2"); dstate_datastale(); @@ -240,7 +453,7 @@ void upsdrv_updateinfo(void) status_set("TRIM"); } - ret = do_command(cmd_bitfield3, reply); + ret = do_command(cmd_bitfield3, reply, 6); if (ret < 8) { upslogx(LOG_ERR, "Failed reading bitfield #3"); dstate_datastale(); @@ -262,8 +475,13 @@ void upsdrv_updateinfo(void) void upsdrv_shutdown(void) { - /* replace with a proper shutdown function */ - fatalx(EXIT_FAILURE, "shutdown not supported"); + char reply[8]; + + if(!(do_command(cmd_setOutOffMode, reply, 8) != -1) && + (do_command(cmd_setOutOffDelay, reply, 8) != -1) && + (do_command(cmd_sysLoadKey, reply, 6) != -1) && + (do_command(cmd_shutdown, reply, 8) != -1)) + upslogx(LOG_ERR, "Failed to shutdown UPS"); } static int instcmd(const char *cmdname, const char *extra) diff --git a/drivers/liebert-hid.c b/drivers/liebert-hid.c index 89ab03a..2cce0ee 100644 --- a/drivers/liebert-hid.c +++ b/drivers/liebert-hid.c @@ -29,8 +29,8 @@ #define LIEBERT_HID_VERSION "Liebert HID 0.3" /* FIXME: experimental flag to be put in upsdrv_info */ -/* Liebert */ -#define LIEBERT_VENDORID 0x06da +/* Phoenixtec */ +#define LIEBERT_VENDORID 0x06da /* USB IDs device table */ static usb_device_id_t liebert_usb_device_table[] = { diff --git a/drivers/main.c b/drivers/main.c index d14f990..aafee68 100644 --- a/drivers/main.c +++ b/drivers/main.c @@ -258,6 +258,11 @@ static int main_arg(char *var, char *val) return 1; /* handled */ } + if (!strcmp(var, "ignorelb")) { + dstate_setinfo("driver.flag.ignorelb", "enabled"); + return 1; /* handled */ + } + /* any other flags are for the driver code */ if (!val) return 0; @@ -600,6 +605,28 @@ int main(int argc, char **argv) upsdrv_initinfo(); upsdrv_updateinfo(); + if (dstate_getinfo("driver.flag.ignorelb")) { + int have_lb_method = 0; + + if (dstate_getinfo("battery.charge") && dstate_getinfo("battery.charge.low")) { + upslogx(LOG_INFO, "using 'battery.charge' to set battery low state"); + have_lb_method++; + } + + if (dstate_getinfo("battery.runtime") && dstate_getinfo("battery.runtime.low")) { + upslogx(LOG_INFO, "using 'battery.runtime' to set battery low state"); + have_lb_method++; + } + + if (!have_lb_method) { + fatalx(EXIT_FAILURE, + "The 'ignorelb' flag is set, but there is no way to determine the\n" + "battery state of charge.\n\n" + "Only set this flag if both 'battery.charge' and 'battery.charge.low'\n" + "and/or 'battery.runtime' and 'battery.runtime.low' are available.\n"); + } + } + /* now we can start servicing requests */ dstate_init(progname, upsname); diff --git a/drivers/metasys.c b/drivers/metasys.c index 6a0b2d2..aa3a677 100644 --- a/drivers/metasys.c +++ b/drivers/metasys.c @@ -62,12 +62,12 @@ static int instcmd(const char *cmdname, const char *extra); /* Metasystem UPS data transfer are made with packet of the format: - STX DATA_LENGHT DATA CHECKSUM + STX DATA_LENGTH DATA CHECKSUM where: STX is 0x02 and is the start of transmission byte - DATA_LENGHT is number of data bytes + the checksum byte + DATA_LENGTH is number of data bytes + the checksum byte DATA ...... - CHECKSUM is the sum modulus 256 of all DATA bytes + DATA_LENGHT + CHECKSUM is the sum modulus 256 of all DATA bytes + DATA_LENGTH The answer from the UPS have the same packet format and the first data byte is equal to the command that the ups is answering to @@ -114,7 +114,7 @@ void dump_buffer(unsigned char *buffer, int buf_len) { } /* send a read command to the UPS, it retries 5 times before give up - it's a 4 byte request (STX, LENGHT, COMMAND and CHECKSUM) */ + it's a 4 byte request (STX, LENGTH, COMMAND and CHECKSUM) */ void send_read_command(char command) { int retry, sent; unsigned char buf[4]; @@ -122,9 +122,9 @@ void send_read_command(char command) { sent = 0; while ((sent != 4) && (retry < 5)) { buf[0]=0x02; /* STX Start of Transmission */ - buf[1]=0x02; /* data lenght(data + checksum byte) */ + buf[1]=0x02; /* data length(data + checksum byte) */ buf[2]=command; /* command to send */ - buf[3]=buf[1] + buf[2]; /* checksum (sum modulus 256 of data bytes + lenght) */ + buf[3]=buf[1] + buf[2]; /* checksum (sum modulus 256 of data bytes + length) */ if (retry == 4) send_zeros(); /* last retry is preceded by a serial reset...*/ sent = ser_send_buf(upsfd, buf, 4); retry += 1; @@ -134,29 +134,29 @@ void send_read_command(char command) { /* send a write command to the UPS, the write command and the value to be written are passed with a char* buffer it retries 5 times before give up */ -void send_write_command(unsigned char *command, int command_lenght) { +void send_write_command(unsigned char *command, int command_length) { int i, retry, sent, checksum; unsigned char raw_buf[255]; /* prepares the raw data */ raw_buf[0] = 0x02; /* STX byte */ - raw_buf[1] = (unsigned char)(command_lenght + 1); /* data lenght + checksum */ - memcpy(raw_buf+2, command, command_lenght); - command_lenght += 2; + raw_buf[1] = (unsigned char)(command_length + 1); /* data length + checksum */ + memcpy(raw_buf+2, command, command_length); + command_length += 2; /* calculate checksum */ checksum = 0; - for (i = 1; i < command_lenght; i++) checksum += raw_buf[i]; + for (i = 1; i < command_length; i++) checksum += raw_buf[i]; checksum = checksum % 256; - raw_buf[command_lenght] = (unsigned char)checksum; - command_lenght +=1; + raw_buf[command_length] = (unsigned char)checksum; + command_length +=1; retry = 0; sent = 0; - while ((sent != (command_lenght)) && (retry < 5)) { + while ((sent != (command_length)) && (retry < 5)) { if (retry == 4) send_zeros(); /* last retry is preceded by a serial reset... */ - sent = ser_send_buf(upsfd, raw_buf, (command_lenght)); - if (sent != (command_lenght)) printf("Error sending command %d\n", raw_buf[2]); + sent = ser_send_buf(upsfd, raw_buf, (command_length)); + if (sent != (command_length)) printf("Error sending command %d\n", raw_buf[2]); retry += 1; } } @@ -164,8 +164,8 @@ void send_write_command(unsigned char *command, int command_lenght) { /* get the answer of a command from the ups */ int get_answer(unsigned char *data) { - unsigned char my_buf[255]; /* packet has a maximum lenght of 256 bytes */ - int packet_lenght, checksum, i, res; + unsigned char my_buf[255]; /* packet has a maximum length of 256 bytes */ + int packet_length, checksum, i, res; /* Read STX byte */ res = ser_get_char(upsfd, my_buf, 1, 0); if (res < 1) { @@ -176,43 +176,43 @@ int get_answer(unsigned char *data) { ser_comm_fail("Receive error (STX): packet not on start!!\n"); return -1; } - /* Read data lenght byte */ + /* Read data length byte */ res = ser_get_char(upsfd, my_buf, 1, 0); if (res < 1) { - ser_comm_fail("Receive error (lenght): %d!!!\n", res); + ser_comm_fail("Receive error (length): %d!!!\n", res); return -1; } - packet_lenght = my_buf[0]; - if (packet_lenght < 2) { - ser_comm_fail("Receive error (lenght): packet lenght %d!!!\n", packet_lenght); + packet_length = my_buf[0]; + if (packet_length < 2) { + ser_comm_fail("Receive error (length): packet length %d!!!\n", packet_length); return -1; } - /* Try to read all the remainig bytes (packet_lenght) */ - res = ser_get_buf_len(upsfd, my_buf, packet_lenght, 1, 0); - if (res != packet_lenght) { - ser_comm_fail("Receive error (data): got %d bytes instead of %d!!!\n", res, packet_lenght); + /* Try to read all the remainig bytes (packet_length) */ + res = ser_get_buf_len(upsfd, my_buf, packet_length, 1, 0); + if (res != packet_length) { + ser_comm_fail("Receive error (data): got %d bytes instead of %d!!!\n", res, packet_length); return -1; } /* now we have the whole answer from the ups, we can checksum it - checksum byte is equal to the sum modulus 256 of all the data bytes + packet_lenght + checksum byte is equal to the sum modulus 256 of all the data bytes + packet_length (no STX no checksum byte itself) */ - checksum = packet_lenght; - for (i = 0; i < (packet_lenght - 1); i++) checksum += my_buf[i]; + checksum = packet_length; + for (i = 0; i < (packet_length - 1); i++) checksum += my_buf[i]; checksum = checksum % 256; - if (my_buf[packet_lenght-1] != checksum) { - ser_comm_fail("checksum error! got %x instad of %x, received %d bytes \n", my_buf[packet_lenght - 1], checksum, packet_lenght); - dump_buffer(my_buf, packet_lenght); + if (my_buf[packet_length-1] != checksum) { + ser_comm_fail("checksum error! got %x instad of %x, received %d bytes \n", my_buf[packet_length - 1], checksum, packet_length); + dump_buffer(my_buf, packet_length); return -1; } - packet_lenght-=1; /* get rid of the checksum byte */ - memcpy(data, my_buf, packet_lenght); - return packet_lenght; + packet_length-=1; /* get rid of the checksum byte */ + memcpy(data, my_buf, packet_length); + return packet_length; } /* send a read command and try get the answer, if something fails, it retries (5 times max) if it is on the 4th or 5th retry, it will flush the serial before sending commands - it returns the lenght of the received answer or -1 in case of failure */ + it returns the length of the received answer or -1 in case of failure */ int command_read_sequence(unsigned char command, unsigned char *data) { int bytes_read = 0; int retry = 0; @@ -234,13 +234,13 @@ int command_read_sequence(unsigned char command, unsigned char *data) { /* send a write command and try get the answer, if something fails, it retries (5 times max) if it is on the 4th or 5th retry, it will flush the serial before sending commands - it returns the lenght of the received answer or -1 in case of failure */ -int command_write_sequence(unsigned char *command, int command_lenght, unsigned char *answer) { + it returns the length of the received answer or -1 in case of failure */ +int command_write_sequence(unsigned char *command, int command_length, unsigned char *answer) { int bytes_read = 0; int retry = 0; while ((bytes_read < 1) && (retry < 5)) { - send_write_command(command, command_lenght); + send_write_command(command, command_length); bytes_read = get_answer(answer); if (retry > 2) ser_flush_in(upsfd, "", 0); retry += 1; diff --git a/drivers/mge-hid.c b/drivers/mge-hid.c index 7b3d59e..ccf1c9a 100644 --- a/drivers/mge-hid.c +++ b/drivers/mge-hid.c @@ -26,7 +26,7 @@ #include "usbhid-ups.h" #include "mge-hid.h" -#define MGE_HID_VERSION "MGE HID 1.19" +#define MGE_HID_VERSION "MGE HID 1.21" /* (prev. MGE Office Protection Systems, prev. MGE UPS SYSTEMS) */ /* Eaton */ @@ -35,6 +35,9 @@ /* Dell */ #define DELL_VENDORID 0x047c +/* Powerware */ +#define POWERWARE_VENDORID 0x0592 + #ifndef SHUT_MODE #include "usb-common.h" @@ -47,6 +50,9 @@ static usb_device_id_t mge_usb_device_table[] = { /* various models */ { USB_DEVICE(DELL_VENDORID, 0xffff), NULL }, + /* PW 9140 */ + { USB_DEVICE(POWERWARE_VENDORID, 0x0004), NULL }, + /* Terminating entry */ { -1, -1, NULL } }; @@ -492,7 +498,8 @@ static usage_lkp_t mge_usage_lkp[] = { { "HighHumidity", 0xffff0082 }, { "LowTemperature", 0xffff0083 }, { "HighTemperature", 0xffff0084 }, - /* 0xffff0085-0xffff008f => Reserved */ + /* 0xffff0085-0xffff008f (minus 0xffff0086) => Reserved */ + { "Efficiency", 0xffff0086 }, { "Count", 0xffff0090 }, { "Timer", 0xffff0091 }, { "Interval", 0xffff0092 }, @@ -582,11 +589,17 @@ static models_name_t mge_model_names [] = { "PROTECTIONCENTER", "500", MGE_DEFAULT, "Protection Center 500" }, { "PROTECTIONCENTER", "675", MGE_DEFAULT, "Protection Center 675" }, - /* Protection Station */ + /* Protection Station, supports Eco control */ { "Protection Station", "500", MGE_PEGASUS, NULL }, { "Protection Station", "650", MGE_PEGASUS, NULL }, { "Protection Station", "800", MGE_PEGASUS, NULL }, + /* Ellipse ECO, also supports Eco control */ + { "Ellipse ECO", "650", MGE_PEGASUS, NULL }, + { "Ellipse ECO", "800", MGE_PEGASUS, NULL }, + { "Ellipse ECO", "1200", MGE_PEGASUS, NULL }, + { "Ellipse ECO", "1600", MGE_PEGASUS, NULL }, + /* Evolution models */ { "Evolution", "500", MGE_DEFAULT, "Pulsar Evolution 500" }, { "Evolution", "800", MGE_DEFAULT, "Pulsar Evolution 800" }, @@ -689,6 +702,7 @@ static hid_info_t mge_hid2nut[] = { "battery.charge.restart", ST_FLAG_RW | ST_FLAG_STRING, 3, "UPS.PowerSummary.RestartLevel", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, { "battery.capacity", 0, 0, "UPS.BatterySystem.Battery.DesignCapacity", NULL, "%s", HU_FLAG_STATIC, mge_battery_capacity }, /* conversion needed from As to Ah */ { "battery.runtime", 0, 0, "UPS.PowerSummary.RunTimeToEmpty", NULL, "%.0f", 0, NULL }, + { "battery.runtime.low", ST_FLAG_RW | ST_FLAG_STRING, 10, "UPS.PowerSummary.RemainingTimeLimit", NULL, "%.0f", 0, NULL }, { "battery.runtime.elapsed", 0, 0, "UPS.StatisticSystem.Input.[1].Statistic.[1].Time", NULL, "%.0f", HU_FLAG_QUICK_POLL, NULL }, { "battery.temperature", 0, 0, "UPS.BatterySystem.Battery.Temperature", NULL, "%s", 0, kelvin_celsius_conversion }, { "battery.type", 0, 0, "UPS.PowerSummary.iDeviceChemistry", NULL, "%s", HU_FLAG_STATIC, stringid_conversion }, @@ -700,6 +714,7 @@ static hid_info_t mge_hid2nut[] = { "battery.energysave", ST_FLAG_RW | ST_FLAG_STRING, 5, "UPS.PowerConverter.Input.[3].EnergySaving", NULL, "%s", HU_FLAG_SEMI_STATIC, yes_no_info }, /* UPS page */ + { "ups.efficiency", 0, 0, "UPS.PowerConverter.Output.Efficiency", NULL, "%.0f", 0, NULL }, { "ups.firmware", 0, 0, "UPS.PowerSummary.iVersion", NULL, "%s", HU_FLAG_STATIC, stringid_conversion }, { "ups.load", 0, 0, "UPS.PowerSummary.PercentLoad", NULL, "%.0f", 0, NULL }, { "ups.load.high", ST_FLAG_RW | ST_FLAG_STRING, 5, "UPS.Flow.[4].ConfigPercentLoad", NULL, "%.0f", HU_FLAG_SEMI_STATIC, NULL }, @@ -767,7 +782,7 @@ static hid_info_t mge_hid2nut[] = /* Battery DC voltage too high! */ { "BOOL", 0, 0, "UPS.BatterySystem.Battery.PresentStatus.VoltageTooHigh", NULL, NULL, 0, battvolthi_info }, { "BOOL", 0, 0, "UPS.BatterySystem.Charger.PresentStatus.VoltageTooLow", NULL, NULL, 0, battvoltlo_info }, - { "BOOL", 0, 0, "UPS.PowerConverter.Input.[1].PresentStatus.VoltageTooLow", NULL, NULL, 0, battvoltlo_info }, + { "BOOL", 0, 0, "UPS.PowerConverter.Input.[1].PresentStatus.VoltageTooLow", NULL, NULL, 0, mge_onbatt_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.InternalFailure", NULL, NULL, 0, commfault_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.OverTemperature", NULL, NULL, 0, overheat_info }, { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ShutdownImminent", NULL, NULL, 0, shutdownimm_info }, diff --git a/drivers/microdowell.c b/drivers/microdowell.c index 319edf1..33acc8e 100644 --- a/drivers/microdowell.c +++ b/drivers/microdowell.c @@ -221,13 +221,13 @@ unsigned char * CmdSerial(unsigned char *OutBuffer, int Len, unsigned char *RetB unsigned char *p ; int BuffLen ; - // The default error code (no received character) + /* The default error code (no received character) */ ErrCode = ERR_COM_NO_CHARS ; SendCmdToSerial(OutBuffer, Len) ; - usleep(10000) ; // small delay (1/100 s)) + usleep(10000) ; /* small delay (1/100 s) */ - // get chars until timeout + /* get chars until timeout */ BuffLen = 0 ; while (ser_get_char(upsfd, TmpBuff, 0, 10000) == 1) { diff --git a/drivers/powercom.c b/drivers/powercom.c index 9c75680..28ce962 100644 --- a/drivers/powercom.c +++ b/drivers/powercom.c @@ -7,7 +7,7 @@ * This model is based on PowerCom (www.powercom.com) models. * -Socomec Sicon Egys 420 * - * $Id: powercom.c 2336 2010-02-11 20:16:43Z adkorte-guest $ + * $Id: powercom.c 2990 2011-05-19 18:34:09Z aquette $ * * Copyrights: * (C) 2002 Simon Rozman @@ -51,6 +51,15 @@ * - strange battery level on BNT1200AP in online mode( & may be on other models) * - i don't know how connect to IMP|IMD USB * - i havn't specs for BNT 100-120V models. Add BNT-other type for it + * + * rev 0.13: Keven Ates + * - Modified functions to work for BNT-other 100-120V models. + * - Modified BNT-other type defaults to work for the BNT 1500A 120VA model. + * - Documented the type[] values purpose in a condensed format. + * - BNT-other can be used to perform a complete user override of values for all PowerCom models, detected or not. + * + * Tested on: BNT-1500A + * */ #include "main.h" @@ -59,7 +68,7 @@ #include "math.h" #define DRIVER_NAME "PowerCom protocol UPS driver" -#define DRIVER_VERSION "0.12" +#define DRIVER_VERSION "0.13" /* driver description structure */ upsdrv_info_t upsdrv_info = { @@ -92,7 +101,28 @@ static unsigned int type = 0; static void dtr0rts1 (void); static void no_flow_control (void); -/* struct defining types */ +/* struct defining types + * --------------------- + * See powercom.h for detailed information and functions. + * + * The following type defaults use this definition: + * + * "TypeID", + * ByteCount, + * { "FlowControlString", FlowControlFuncPtr }, + * { { ValidationIndex, ValidationValue }, + * { ValidationIndex, ValidationValue }, + * { ValidationIndex, ValidationValue } }, + * { { DelayShutdownMinutes, DelayShutdownSeconds }, + * UseMinutesChar'y''n' }, + * { FrequencyFactor, FrequencyConstant }, + * { OfflineLoadFactor, OfflineLoadConstant, + * OnlineLoadFactor, OnlineLoadConstant }, + * { OfflineBatteryFactor, OfflineLoad%Factor, OfflineBatteryConstant, + * OnlineBatteryFactor, OnlineBatteryConstant }, + * { 240VoltageFactor, 240VoltageConstant, + * 120VoltageFactor, 120VoltageConstant }, + */ static struct type types[] = { { "Trust", @@ -166,10 +196,10 @@ static struct type types[] = { { "no_flow_control", no_flow_control }, { { 8U, 0U }, { 8U, 0U }, { 8U, 0U } }, { { 1U, 30U }, 'y' }, - { 0.00020803, 0.0 }, - { 1.4474, 0.0, 0.8594, 0.0 }, - { 5.0000, 0.3268, -825.00, 0.46511, 0 }, - { 1.9216, -0.0977, 0.82857, 0.0000 }, + { 0.00027778, 0.0000 }, + { 1.0000, 0.0000, 1.0000, 0.0000 }, + { 1.0000, 0.0000, 0.0000, 1.0000, 0.0000 }, + { 2.0000, 0.0000, 2.0000, 0.0000 }, }, }; @@ -217,10 +247,10 @@ enum status { OFF = 128U }; -unsigned int voltages[]={100,110,115,120,0,0,0,200,220,230,240}; -unsigned int BNTmodels[]={0,400,500,600,800,801,1000,1200,1500,2000}; -unsigned int KINmodels[]={0,425,500,525,625,800,1000,1200,1500,1600,2200,2200,2500,3000,5000}; -unsigned int IMPmodels[]={0,425,525,625,825,1025,1200,1500,2000}; +unsigned int voltages[]={100,110,115,120,0,0,0,200,220,230,240,0,0,0,0,0}; +unsigned int BNTmodels[]={0,400,500,600,800,801,1000,1200,1500,2000,0,0,0,0,0,0}; +unsigned int KINmodels[]={0,425,500,525,625,800,1000,1200,1500,1600,2200,2200,2500,3000,5000,0}; +unsigned int IMPmodels[]={0,425,525,625,825,1025,1200,1500,2000,0,0,0,0,0,0,0}; /* * local used functions @@ -338,6 +368,7 @@ static int ups_getinfo(void) /* optional dump of raw data */ if (nut_debug_level > 4) { + /* FIXME: use upsdebug_hex() ? */ printf("Raw data from UPS:\n"); for (i = 0; i < types[type].num_of_bytes_from_ups; i++) { printf("%2d 0x%02x (%c)\n", i, raw_data[i], raw_data[i]>=0x20 ? raw_data[i] : ' '); @@ -475,7 +506,7 @@ static float output_voltage(void) static float input_freq(void) { - if ( !strncmp(types[type].name, "BNT",3) || !strcmp(types[type].name, "KIN")) + if ( !strcmp(types[type].name, "BNT") || !strcmp(types[type].name, "KIN")) return 4807.0/raw_data[INPUT_FREQUENCY]; else if ( !strcmp(types[type].name, "IMP")) return raw_data[INPUT_FREQUENCY]; @@ -487,7 +518,7 @@ static float input_freq(void) static float output_freq(void) { - if ( !strncmp(types[type].name, "BNT",3) || !strcmp(types[type].name, "KIN")) + if ( !strcmp(types[type].name, "BNT") || !strcmp(types[type].name, "KIN")) return 4807.0/raw_data[OUTPUT_FREQUENCY]; else if ( !strcmp(types[type].name, "IMP")) return raw_data[OUTPUT_FREQUENCY]; @@ -574,7 +605,7 @@ static float batt_level(void) int bat0,bat29,bat100,model; float battval; - if ( !strncmp(types[type].name, "BNT",3) ) { + if ( !strcmp(types[type].name, "BNT") ) { bat0=157; bat29=165; bat100=193; @@ -617,11 +648,13 @@ static float batt_level(void) } if ( !strcmp(types[type].name, "IMP")) return raw_data[BATTERY_CHARGE]; - return raw_data[STATUS_A] & ONLINE ? + return raw_data[STATUS_A] & ONLINE ? /* Are we on battery power? */ + /* Yes */ types[type].battpct[0] * raw_data[BATTERY_CHARGE] + types[type].battpct[1] * load_level() + types[type].battpct[2] : + /* No */ types[type].battpct[3] * raw_data[BATTERY_CHARGE] + - types[type].battpct[4]; + types[type].battpct[4]; } /* @@ -852,27 +885,31 @@ void upsdrv_initups(void) /* setup flow control */ types[type].flowControl.setup_flow_control(); + + /* Setup Model and LineVoltage */ if (!strncmp(types[type].name, "BNT",3) || !strcmp(types[type].name, "KIN") || !strcmp(types[type].name, "IMP")){ if (!ups_getinfo()) return; - if (raw_data[UPSVERSION]==0xFF){ + /* Give "BNT-other" a chance! */ + if (raw_data[MODELNAME]==0x42 || raw_data[MODELNAME]==0x4B){ + model=BNTmodels[raw_data[MODELNUMBER]/16]; + if (!strcmp(types[type].name, "BNT-other")) + types[type].name="BNT-other"; + else if (raw_data[MODELNAME]==0x42) + types[type].name="BNT"; + else if (raw_data[MODELNAME]==0x4B){ + types[type].name="KIN"; + model=KINmodels[raw_data[MODELNUMBER]/16]; + } + } + else if (raw_data[UPSVERSION]==0xFF){ types[type].name="IMP"; model=IMPmodels[raw_data[MODELNUMBER]/16]; } - if (raw_data[MODELNAME]==0x42){ - if (!strcmp(types[type].name, "BNT-other")) - types[type].name="BNT-other"; - else - types[type].name="BNT"; - model=BNTmodels[raw_data[MODELNUMBER]/16]; - } - if (raw_data[MODELNAME]==0x4B){ - types[type].name="KIN"; - model=KINmodels[raw_data[MODELNUMBER]/16]; - } linevoltage=voltages[raw_data[MODELNUMBER]%16]; snprintf(buf,sizeof(buf),"%s-%dAP",types[type].name,model); - modelname=buf; - upsdebugx(1,"Detected: %s , %dV",modelname,linevoltage); + if (!strcmp(modelname, "Unknown")) + modelname=buf; + upsdebugx(1,"Detected: %s , %dV",buf,linevoltage); if (ser_send_char (upsfd, BATTERY_TEST) != 1) { upslogx(LOG_NOTICE, "writing error"); dstate_datastale(); @@ -922,23 +959,65 @@ void upsdrv_initups(void) /* display help */ void upsdrv_help(void) { - printf("You must specify type in ups.conf\n"); - printf("Type of UPS like 'Trust', 'Egys', 'KP625AP', 'IMP', 'KIN' or 'BNT' or 'BNT-other' (default: 'Trust')\n"); - printf("BNT-other - it's a special type for BNT 100-120V models \n"); - printf("You can additional cpecify next variables:\n"); - printf(" shutdownArguments: The number of delay arguments and their values for the shutdown operation\n"); - printf("Also, you can specify next variables (not work for 'IMP', 'KIN' or 'BNT', because detected automatically or known\n"); - printf(" manufacturer: Specify manufacturer name (default: 'PowerCom')\n"); - printf(" modelname: Specify model name, because it cannot detect automagically (default: Unknown)\n"); - printf(" serialnumber: Specify serial number, because it cannot detect automatically (default: Unknown)\n"); - printf(" linevoltage: Specify line voltage (110-120 or 220-240 V), if it cannot detect automatically (default: 230 V)\n"); - printf(" numOfBytesFromUPS: The number of bytes in a UPS frame\n"); - printf(" methodOfFlowControl: The flow control method engaged by the UPS\n"); - printf(" validationSequence: 3 pairs to be used for validating the UPS\n"); - printf(" voltage: A quad to convert the raw data to human readable voltage\n"); - printf(" frequency: A pair to convert the raw data to human readable freqency\n"); - printf(" batteryPercentage: A 5 tuple to convert the raw data to human readable battery percentage\n"); - printf(" loadPercentage: A quad to convert the raw data to human readable load percentage\n"); + // 1 2 3 4 5 6 7 8 + // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 MAX + printf("\n"); + printf("Specify UPS information in the ups.conf file.\n"); + printf(" type: Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT',\n"); + printf(" 'BNT-other' (default: 'Trust')\n"); + printf(" 'BNT-other' is a special type intended for BNT 100-120V models,\n"); + printf(" but can be used to override ALL models.\n"); + printf("You can additional specify these variables:\n"); + printf(" manufacturer: Manufacturer name (default: 'PowerCom')\n"); + printf(" modelname: Model name (default: 'Unknown' or autodetected)\n"); + printf(" serialnumber: Serial number (default: Unknown)\n"); + printf(" shutdownArguments: 3 delay arguments for the shutdown operation:\n"); + printf(" {{Minutes,Seconds},UseMinutes?}\n"); + printf(" where Minutes and Seconds are integer, UseMinutes? is either\n"); + printf(" 'y' or 'n'.\n"); + printf("You can specify these variables if not automagically detected for types\n"); + printf(" 'IMP','KIN','BNT'\n"); + printf(" linevoltage: Line voltage: 110-120 or 220-240 (default: 230)\n"); + printf(" numOfBytesFromUPS: Number of bytes in a UPS frame: 16 is common, 11 for 'Trust'\n"); + printf(" methodOfFlowControl: Flow control method for UPS:\n"); + printf(" 'dtr0rts1', 'dtr1' or 'no_flow_control'\n"); + printf(" validationSequence: 3 pairs of validation values: {{I,V},{I,V},{I,V}}\n"); + printf(" where I is the index into BytesFromUPS (see numOfBytesFromUPS)\n"); + printf(" and V is the value for the ByteIndex to match.\n"); + printf(" frequency: Input & Output Frequency conversion values: {A, B}\n"); + printf(" used in function: 1/(A*x+B)\n"); + printf(" If the raw value x IS the frequency, then A=1/(x^2), B=0\n"); + printf(" loadPercentage: Load conversion values for Battery and Line load: {BA,BB,LA,LB}\n"); + printf(" used in function: A*x+B\n"); + printf(" If the raw value x IS the Load Percent, then A=1, B=0\n"); + printf(" batteryPercentage: Battery conversion values for Battery and Line power:\n"); + printf(" {A,B,C,D,E}\n"); + printf(" used in functions: (Battery) A*x+B*y+C, (Line) D*x+E\n"); + printf(" If the raw value x IS the Battery Percent, then\n"); + printf(" A=1, B=0, C=0, D=1, E=0\n"); + printf(" voltage: Voltage conversion values for 240 and 120 voltage:\n"); + printf(" {240A,240B,120A,120B}\n"); + printf(" used in function: A*x+B\n"); + printf(" If the raw value x IS HALF the Voltage, then A=2, B=0\n\n"); + + printf("Example for BNT1500AP in ups.conf:\n"); + printf("[BNT1500AP]\n"); + printf(" driver = powercom\n"); + printf(" port = /dev/ttyS0\n"); + printf(" desc = \"PowerCom BNT 1500 AP\"\n"); + printf(" manufacturer = PowerCom\n"); + printf(" modelname = BNT1500AP\n"); + printf(" serialnumber = 13245678900\n"); + printf(" type = BNT-other\n"); + printf("# linevoltage = 120\n"); + printf("# numOfBytesFromUPS = 16\n"); + printf("# methodOfFlowControl = no_flow_control\n"); + printf("# validationSequence = {{8,0},{8,0},{8,0}}\n"); + printf("# shutdownArguments = {{1,30},y}\n"); + printf("# frequency = {0.00027778,0.0000}\n"); + printf("# loadPercentage = {1.0000,0.0,1.0000,0.0}\n"); + printf("# batteryPercentage = {1.0000,0.0000,0.0000,1.0000,0.0000}\n"); + printf("# voltage = {2.0000,0.0000,2.0000,0.0000}\n"); return; } @@ -962,20 +1041,36 @@ void upsdrv_initinfo(void) /* define possible arguments */ void upsdrv_makevartable(void) { - addvar(VAR_VALUE, "manufacturer", "Specify manufacturer name (default: 'PowerCom')"); - addvar(VAR_VALUE, "linevoltage", "Specify line voltage (110-120 or 220-240 V), if it cannot detect automatically (default: 230 V)"); - addvar(VAR_VALUE, "modelname", "Specify model name, because it cannot detect automagically (default: Unknown)"); - addvar(VAR_VALUE, "serialnumber", "Specify serial number, because it cannot detect automatically (default: Unknown)"); - addvar(VAR_VALUE, "type", "Type of UPS like 'Trust', 'Egys', 'KP625AP', 'IMP', 'KIN' or 'BNT' or 'BNT-other' (default: 'Trust')"); - addvar(VAR_VALUE, "numOfBytesFromUPS", "The number of bytes in a UPS frame"); - addvar(VAR_VALUE, "methodOfFlowControl", "The flow control method engaged by the UPS"); - addvar(VAR_VALUE, "shutdownArguments", "The number of delay arguments and their values for the shutdown operation"); - addvar(VAR_VALUE, "validationSequence", "3 pairs to be used for validating the UPS"); + // 1 2 3 4 5 6 7 8 + //2345678901234567890123456789012345678901234567890123456789012345678901234567890 MAX + addvar(VAR_VALUE, "type", + "Type of UPS: 'Trust','Egys','KP625AP','IMP','KIN','BNT','BNT-other'\n" + " (default: 'Trust')"); + addvar(VAR_VALUE, "manufacturer", + "Manufacturer name (default: 'PowerCom')"); + addvar(VAR_VALUE, "modelname", + "Model name [cannot be detected] (default: Unknown)"); + addvar(VAR_VALUE, "serialnumber", + "Serial number [cannot be detected] (default: Unknown)"); + addvar(VAR_VALUE, "shutdownArguments", + "Delay values for shutdown: Minutes, Seconds, UseMinutes?'y'or'n'"); + addvar(VAR_VALUE, "linevoltage", + "Line voltage 110-120 or 220-240 V (default: 230)"); + addvar(VAR_VALUE, "numOfBytesFromUPS", + "The number of bytes in a UPS frame"); + addvar(VAR_VALUE, "methodOfFlowControl", + "Flow control method for UPS: 'dtr0rts1' or 'no_flow_control'"); + addvar(VAR_VALUE, "validationSequence", + "Validation values: ByteIndex, ByteValue x 3"); if ( strcmp(types[type].name, "KIN") && strcmp(types[type].name, "BNT") && strcmp(types[type].name, "IMP")) { - addvar(VAR_VALUE, "voltage", "A quad to convert the raw data to human readable voltage"); - addvar(VAR_VALUE, "frequency", "A pair to convert the raw data to human readable freqency"); - addvar(VAR_VALUE, "batteryPercentage", "A 5 tuple to convert the raw data to human readable battery percentage"); - addvar(VAR_VALUE, "loadPercentage", "A quad to convert the raw data to human readable load percentage"); + addvar(VAR_VALUE, "frequency", + "Frequency conversion values: FreqFactor, FreqConst"); + addvar(VAR_VALUE, "loadPercentage", + "Load conversion values: OffFactor, OffConst, OnFactor, OnConst"); + addvar(VAR_VALUE, "batteryPercentage", + "Battery conversion values: OffFactor, LoadFactor, OffConst, OnFactor, OnConst"); + addvar(VAR_VALUE, "voltage", + "Voltage conversion values: 240VFactor, 240VConst, 120VFactor, 120VConst"); } } diff --git a/drivers/powercom.h b/drivers/powercom.h index 8209099..3286860 100644 --- a/drivers/powercom.h +++ b/drivers/powercom.h @@ -1,7 +1,7 @@ /* * powercom.h - defines for the newpowercom.c driver * - * $Id: powercom.h 2627 2010-10-26 21:09:34Z adkorte-guest $ + * $Id: powercom.h 2984 2011-05-13 13:18:34Z aquette $ * * Copyrights: * (C) 2002 Simon Rozman @@ -62,39 +62,39 @@ struct type { * the COUNTER commands while others are known to work with the * seconds argument alone. */ - struct deley_for_power_kill { + struct delay_for_power_kill { unsigned int delay[2]; /* { minutes, seconds } */ unsigned char minutesShouldBeUsed; - /* 'n' in case the minutes value, which is deley[0], should + /* 'n' in case the minutes value, which is delay[0], should * be skipped and not sent to the UPS. */ } shutdown_arguments; - /* parameters to calculate input and output freq., one pair for - * each type: - * Each pair defines parameters for 1/(A*x+B) to calculate freq. - * from raw data + /* parameters to calculate input and output freq., one pair used for + * both input and output functions: + * The pair [0],[1] defines parameters for 1/(A*x+B) to calculate freq. + * from raw data 'x'. */ float freq[2]; /* parameters to calculate load %, two pairs for each type: - * First pair defines the parameters for A*x+B to calculate load - * from raw data when offline and the second pair is used when + * First pair [0],[1] defines the parameters for A*x+B to calculate load + * from raw data when offline and the second pair [2],[3] is used when * online */ float loadpct[4]; /* parameters to calculate battery %, five parameters for each type: - * First three params defines the parameters for A*x+B*y+C to calculate + * First three params [0],[1],[2] defines the parameters for A*x+B*y+C to calculate * battery % (x is raw data, y is load %) when offline. - * Fourth and fifth parameters are used to calculate D*y+E when online. + * Fourth and fifth parameters [3],[4] are used to calculate D*x+E when online. */ float battpct[5]; /* parameters to calculate utility and output voltage, two pairs for * each type: - * First pair defines the parameters for A*x+B to calculate utility - * from raw data when line voltage is >=220 and the second pair + * First pair [0],[1] defines the parameters for A*x+B to calculate utility + * from raw data when line voltage is >=220 and the second pair [2],[3] * is used otherwise. */ float voltage[4]; diff --git a/drivers/rhino.c b/drivers/rhino.c index 6839fde..ca66169 100644 --- a/drivers/rhino.c +++ b/drivers/rhino.c @@ -22,7 +22,7 @@ 2005/10/26 - Version 0.40 - Operational-2 release 2005/11/29 - Version 0.50 - rhino commands release - + http://www.microsol.com.br */ @@ -63,28 +63,27 @@ typedef int bool_t; #define CMD_PASSOFF 0x0006 #define CMD_UPSCONT 0x0053 -/* xoff - xon protocol -#define _SOH = 0x01; // start of header -#define _EOT = 0x04; // end of transmission -#define _ACK = 0x06; // acknoledge (positive) -#define _DLE = 0x10; // data link escape -#define _XOn = 0x11; // transmit on -#define _XOff = 0x13; // transmit off -#define _NAK = 0x15; // negative acknoledge -#define _SYN = 0x16; // synchronous idle -#define _CAN = 0x18; // cancel -*/ +/* xoff - xon protocol */ +#define _SOH = 0x01; /* start of header */ +#define _EOT = 0x04; /* end of transmission */ +#define _ACK = 0x06; /* acknoledge (positive) */ +#define _DLE = 0x10; /* data link escape */ +#define _XOn = 0x11; /* transmit on */ +#define _XOff = 0x13; /* transmit off */ +#define _NAK = 0x15; /* negative acknoledge */ +#define _SYN = 0x16; /* synchronous idle */ +#define _CAN = 0x18; /* cancel */ static int const pacsize = 37; /* size of receive data package */ /* autonomy calcule */ -static double const AmpH = 40; // Amperes-hora da bateria -static double const VbatMin = 126; // Tensão mínina das baterias -static double const VbatNom = 144; // Tensão nominal das baterias -static double const FM = 0.32; // Fator multiplicativo de correção da autonomia -static double const FA = -2; // Fator aditivo de correção da autonomia -static double const ConstInt = 250; // Consumo interno sem o carregador -static double const Vin = 220; // Tensão de entrada +static double const AmpH = 40; /* Amperes-hora da bateria */ +static double const VbatMin = 126; /* Tensão mínina das baterias */ +static double const VbatNom = 144; /* Tensão nominal das baterias */ +static double const FM = 0.32; /* Fator multiplicativo de correção da autonomia */ +static double const FA = -2; /* Fator aditivo de correção da autonomia */ +static double const ConstInt = 250; /* Consumo interno sem o carregador */ +static double const Vin = 220; /* Tensão de entrada */ static int Day, Month, Year; static int dian=0, mesn=0, anon=0, weekn=0; @@ -93,8 +92,8 @@ static int ihour,imin, isec; /* char seman[4]; */ /* int FExpansaoBateria; */ -// internal variables -// package handshake ariables +/* internal variables */ +/* package handshake variables */ /* int ContadorEstouro; */ static bool_t detected; static bool_t SourceFail, Out110, RedeAnterior, OcorrenciaDeFalha; @@ -125,7 +124,7 @@ static int BoostVolt, Rendimento; static unsigned char StatusEntrada, StatusSaida, StatusBateria; /* events group */ static unsigned char EventosRede, EventosSaida, EventosBateria; -// Grupo de Programação +/* Grupo de Programação */ /* Methods */ static void ScanReceivePack(void); @@ -261,16 +260,16 @@ ScanReceivePack( void ) if( RecPack[0] ==0xC2 ) { LimInfBattSrc = 174; - LimSupBattSrc = 192;//180????? carregador eh 180 (SCOPOS) + LimSupBattSrc = 192;/* 180????? carregador eh 180 (SCOPOS) */ LimInfBattInv = 174; - LimSupBattInv = 192;//170????? (SCOPOS) + LimSupBattInv = 192;/* 170????? (SCOPOS) */ } else { LimInfBattSrc = 138; - LimSupBattSrc = 162;//180????? carregador eh 180 (SCOPOS) + LimSupBattSrc = 162;/* 180????? carregador eh 180 (SCOPOS) */ LimInfBattInv = 126; - LimSupBattInv = 156;//170????? (SCOPOS) + LimSupBattInv = 156;/* 170????? (SCOPOS) */ } BattNonValue = 144; @@ -300,10 +299,10 @@ ScanReceivePack( void ) if( BypassOn ) OutVoltage = ( InVoltage * 1.0 / 2 ) + 5; - if( SourceFail && RedeAnterior ) // falha pela primeira vez + if( SourceFail && RedeAnterior ) /* falha pela primeira vez */ OcorrenciaDeFalha = true; - if( !( SourceFail ) && !( RedeAnterior ) ) // retorno da rede + if( !( SourceFail ) && !( RedeAnterior ) ) /* retorno da rede */ RetornoDaRede = true; if( !( SourceFail ) == RedeAnterior ) @@ -333,7 +332,7 @@ ScanReceivePack( void ) RecPack[8] = 99; /* ??????????????????????????????????? */ } - if( OutputOn ) // Output Status + if( OutputOn ) /* Output Status */ StatusSaida = 2; else StatusSaida = 1; @@ -341,7 +340,7 @@ ScanReceivePack( void ) if( OverCharge ) StatusSaida = 3; - if( CriticBatt ) // Battery Status + if( CriticBatt ) /* Battery Status */ StatusBateria = 4; else StatusBateria = 1; @@ -494,7 +493,7 @@ send_command( int cmd ) if( i == 1) chk = cmd; else - chk = 0x00; // 0x20; + chk = 0x00; /* 0x20; */ } ch = chk; @@ -511,7 +510,7 @@ send_command( int cmd ) kount = 0; while ( kount < 5 ) { - /* ret = ser_send_buf_pace(upsfd, UPSDELAY, psend, sizes );// optional delay */ + /* ret = ser_send_buf_pace(upsfd, UPSDELAY, psend, sizes ); */ /* optional delay */ for(i=0; i < 19; i++) { @@ -564,7 +563,7 @@ static void getbaseinfo(void) while ( ( !detected ) && ( j < 10 ) ) { - temp[0] = 0; // flush temp buffer + temp[0] = 0; /* flush temp buffer */ tam = ser_get_buf_len(upsfd, temp, pacsize, 3, 0); if( tam == 37 ) { @@ -628,10 +627,10 @@ static void getbaseinfo(void) dstate_setinfo("input.transfer.high", "%03.1f", InUpLim); LimSupBattInv ? */ - dstate_addcmd("shutdown.stayoff"); // CMD_SHUT + dstate_addcmd("shutdown.stayoff"); /* CMD_SHUT */ /* there is no reserved words for CMD_INON and CMD_INOFF yet */ - /* dstate_addcmd("input.on"); // CMD_INON = 1 */ - /* dstate_addcmd("input.off"); // CMD_INOFF = 2 */ + /* dstate_addcmd("input.on"); */ /* CMD_INON = 1 */ + /* dstate_addcmd("input.off"); */ /* CMD_INOFF = 2 */ dstate_addcmd("load.on"); /* CMD_OUTON = 3 */ dstate_addcmd("load.off"); /* CMD_OUTOFF = 4 */ dstate_addcmd("bypass.start"); /* CMD_PASSON = 5 */ @@ -671,7 +670,7 @@ static int instcmd(const char *cmdname, const char *extra) if (!strcasecmp(cmdname, "shutdown.stayoff")) { - // shutdown now (one way) + /* shutdown now (one way) */ /* send_command( CMD_SHUT ); */ sendshut(); return STAT_INSTCMD_HANDLED; @@ -679,7 +678,7 @@ static int instcmd(const char *cmdname, const char *extra) if (!strcasecmp(cmdname, "load.on")) { - // liga Saida + /* liga Saida */ ret = send_command( 3 ); if ( ret < 1 ) upslogx(LOG_ERR, "send_command 3 failed"); @@ -688,7 +687,7 @@ static int instcmd(const char *cmdname, const char *extra) if (!strcasecmp(cmdname, "load.off")) { - // desliga Saida + /* desliga Saida */ ret = send_command( 4 ); if ( ret < 1 ) upslogx(LOG_ERR, "send_command 4 failed"); @@ -697,7 +696,7 @@ static int instcmd(const char *cmdname, const char *extra) if (!strcasecmp(cmdname, "bypass.start")) { - // liga Bypass + /* liga Bypass */ ret = send_command( 5 ); if ( ret < 1 ) upslogx(LOG_ERR, "send_command 5 failed"); @@ -706,7 +705,7 @@ static int instcmd(const char *cmdname, const char *extra) if (!strcasecmp(cmdname, "bypass.stop")) { - // desliga Bypass + /* desliga Bypass */ ret = send_command( 6 ); if ( ret < 1 ) upslogx(LOG_ERR, "send_command 6 failed"); @@ -771,7 +770,7 @@ void upsdrv_shutdown(void) /* on line: send normal shutdown, ups will return by itself on utility */ /* on battery: send shutdown+return, ups will cycle and return soon */ - if (!SourceFail) // on line + if (!SourceFail) /* on line */ { printf("On line, forcing shutdown command...\n"); send_command( CMD_SHUT ); diff --git a/drivers/snmp-ups.c b/drivers/snmp-ups.c index d852dc5..344f514 100644 --- a/drivers/snmp-ups.c +++ b/drivers/snmp-ups.c @@ -484,7 +484,7 @@ bool_t nut_snmp_get_str(const char *OID, char *buf, size_t buf_len, info_lkp_t * len = snprintf(buf, buf_len, "%ld", *pdu->variables->val.integer / 100); break; default: - upslogx(LOG_ERR, "[%s] unhandled ASN 0x%x recieved from %s", + upslogx(LOG_ERR, "[%s] unhandled ASN 0x%x received from %s", upsname?upsname:device_name, pdu->variables->type, OID); return FALSE; break; @@ -524,7 +524,7 @@ bool_t nut_snmp_get_int(const char *OID, long *pval) value = *pdu->variables->val.integer / 100; break; default: - upslogx(LOG_ERR, "[%s] unhandled ASN 0x%x recieved from %s", + upslogx(LOG_ERR, "[%s] unhandled ASN 0x%x received from %s", upsname?upsname:device_name, pdu->variables->type, OID); return FALSE; break; @@ -1459,7 +1459,7 @@ static int parse_mibconf_args(int numargs, char **arg) if (ret == FALSE) upslogx(LOG_ERR, "su_setvar: cannot set value %s for %s", arg[4], arg[3]); else - upsdebugx(1, "su_setvar: sucessfully set %s to \"%s\"", arg[0], arg[4]); + upsdebugx(1, "su_setvar: successfully set %s to \"%s\"", arg[0], arg[4]); return 1; } diff --git a/drivers/solis.c b/drivers/solis.c index 0ff49a7..f2e47f7 100644 --- a/drivers/solis.c +++ b/drivers/solis.c @@ -282,23 +282,12 @@ static unsigned char revertdays( unsigned char dweek ) static int IsHour( char *strx, int qual ) { - char shora[3], smin[3], sep[2]; - int hora=0, min = 0, len = 0; + int hora=0, min = 0; - len = strlen( strx ); - if ( len != 5 ) - return -1; - sscanf( strx, "%2s%1s%2s", shora, sep, smin); - if( sep[0] != ':' ) - return -1; - if( (!isdigit( shora[0] )) || (!isdigit( shora[1] )) ) - return -1; - if( (!isdigit( smin[0] )) || (!isdigit( smin[1] )) ) + if ((strlen(strx) != 5) || (sscanf(strx, "%d:%d", &hora, &min) != 2)) { return -1; + } - hora = atoi( shora ); - min = atoi( smin ); - if( qual ) { dhour = hora; dmin = min; @@ -408,7 +397,7 @@ static int IsToday( unsigned char dweek, int nweek) switch ( nweek ) { - case 0: // sunday + case 0: /* sunday */ return ( ( ( dweek & 0x40 ) == 0x40 ) ); case 1: return ( ( ( dweek & 0x20 ) == 0x20 ) ); @@ -420,7 +409,7 @@ static int IsToday( unsigned char dweek, int nweek) return ( ( ( dweek & 0x04 ) == 0x04 ) ); case 5: return ( ( ( dweek & 0x02 ) == 0x02 ) ); - case 6: // saturday + case 6: /* saturday */ return ( ( ( dweek & 0x01 ) == 0x01 ) ); } @@ -802,7 +791,7 @@ static void getbaseinfo(void) #else char DaysOfWeek[7][4]={"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"}; #endif - char mycmd[8]; // , ch; + char mycmd[8]; char *str1, *str2, *str3, *str4, *strx; unsigned char Pacote[25]; int i, i1=0, i2=0, j=0, tam, tpac=25; @@ -871,7 +860,7 @@ static void getbaseinfo(void) } } - } // end prgups 1 - 2 + } /* end prgups 1 - 2 */ /* dummy read attempt to sync - throw it out */ snprintf(mycmd, sizeof(mycmd), "%c%c",CMD_UPSCONT, ENDCHAR); @@ -879,7 +868,7 @@ static void getbaseinfo(void) /* trying detect solis model */ while ( ( !detected ) && ( j < 20 ) ) { - temp[0] = 0; // flush temp buffer + temp[0] = 0; /* flush temp buffer */ tam = ser_get_buf_len(upsfd, temp, tpac, 3, 0); if( tam == 25 ) { for( i = 0 ; i < tam ; i++ ) { @@ -1011,17 +1000,17 @@ static int instcmd(const char *cmdname, const char *extra) { if (!strcasecmp(cmdname, "shutdown.return")) { - // shutdown and restart - ser_send_char(upsfd, CMD_SHUTRET); // 0xDE - // ser_send_char(upsfd, ENDCHAR); + /* shutdown and restart */ + ser_send_char(upsfd, CMD_SHUTRET); /* 0xDE */ + /* ser_send_char(upsfd, ENDCHAR); */ return STAT_INSTCMD_HANDLED; } if (!strcasecmp(cmdname, "shutdown.stayoff")) { - // shutdown now (one way) - ser_send_char(upsfd, CMD_SHUT); // 0xDD - // ser_send_char(upsfd, ENDCHAR); + /* shutdown now (one way) */ + ser_send_char(upsfd, CMD_SHUT); /* 0xDD */ + /* ser_send_char(upsfd, ENDCHAR); */ return STAT_INSTCMD_HANDLED; } @@ -1082,7 +1071,7 @@ void upsdrv_shutdown(void) /* on battery: send normal shutdown, ups will return by itself on utility */ /* on line: send shutdown+return, ups will cycle and return soon */ - if (!SourceFail) { // on line + if (!SourceFail) { /* on line */ printf("On line, sending shutdown+return command...\n"); ser_send_char(upsfd, CMD_SHUTRET ); diff --git a/drivers/usb-common.h b/drivers/usb-common.h index 8df0b5a..9ab1fce 100644 --- a/drivers/usb-common.h +++ b/drivers/usb-common.h @@ -71,7 +71,10 @@ void USBFreeExactMatcher(USBDeviceMatcher_t *matcher); void USBFreeRegexMatcher(USBDeviceMatcher_t *matcher); /* dummy USB function and macro, inspired from the Linux kernel - * this allows USB information extraction */ + * this allows USB information extraction + * CAUTION: only use with *valid* device identifiers, Ie the following is not + * valid (from blazer_usb, krauler subdriver): 0x0001:0x0000 + */ #define USB_DEVICE(vendorID, productID) vendorID, productID typedef struct { diff --git a/include/Makefile.am b/include/Makefile.am index bd2ee4b..51894b6 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -1,9 +1,8 @@ EXTRA_DIST = attribute.h common.h extstate.h parseconf.h proto.h \ - state.h timehead.h upsconf.h + state.h timehead.h upsconf.h nut_stdint.h # http://www.gnu.org/software/automake/manual/automake.html#Clean -BUILT_SOURCES = nut_version.h nut_stdint.h -DISTCLEANFILES = nut_stdint.h +BUILT_SOURCES = nut_version.h CLEANFILES = nut_version.h # magic to include SVN revision number in NUT version string diff --git a/include/Makefile.in b/include/Makefile.in index 81a05c6..6767600 100644 --- a/include/Makefile.in +++ b/include/Makefile.in @@ -39,7 +39,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -226,12 +225,11 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ udevdir = @udevdir@ EXTRA_DIST = attribute.h common.h extstate.h parseconf.h proto.h \ - state.h timehead.h upsconf.h + state.h timehead.h upsconf.h nut_stdint.h # http://www.gnu.org/software/automake/manual/automake.html#Clean -BUILT_SOURCES = nut_version.h nut_stdint.h -DISTCLEANFILES = nut_stdint.h +BUILT_SOURCES = nut_version.h CLEANFILES = nut_version.h all: $(BUILT_SOURCES) config.h $(MAKE) $(AM_MAKEFLAGS) all-am @@ -355,7 +353,6 @@ clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) - -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" diff --git a/include/config.h.in b/include/config.h.in index e2df661..ae5bb0a 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -288,21 +288,6 @@ /* User to switch to if started as root */ #undef RUN_AS_USER -/* The size of `char', as computed by sizeof. */ -#undef SIZEOF_CHAR - -/* The size of `int', as computed by sizeof. */ -#undef SIZEOF_INT - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `short', as computed by sizeof. */ -#undef SIZEOF_SHORT - -/* The size of `void*', as computed by sizeof. */ -#undef SIZEOF_VOIDP - /* Path for UPS driver state files */ #undef STATEPATH diff --git a/include/nut_stdint.h b/include/nut_stdint.h new file mode 100644 index 0000000..35292ee --- /dev/null +++ b/include/nut_stdint.h @@ -0,0 +1,34 @@ +/* + * nut_stdint.h - Network UPS Tools sets of integer types having specified widths + * + * Copyright (C) 2011 Arjen de Korte + * + * 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 + */ + +#ifndef NUT_STDINT_H_SEEN +#define NUT_STDINT_H_SEEN + +#include "config.h" + +#if defined HAVE_INTTYPES_H +# include +#endif + +#if defined HAVE_STDINT_H +# include +#endif + +#endif /* NUT_STDINT_H_SEEN */ diff --git a/include/nut_version.h b/include/nut_version.h index b830a50..42cfb0c 100644 --- a/include/nut_version.h +++ b/include/nut_version.h @@ -1,3 +1,3 @@ /* Autogenerated file. Do not change. */ /* This file was generated by "make". */ -#define NUT_VERSION_MACRO "2.6.0-2831:2832" +#define NUT_VERSION_MACRO "2.6.1-3015:3023" diff --git a/lib/Makefile.in b/lib/Makefile.in index e3e5b8a..73e3a58 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -43,7 +43,6 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/libupsclient-config.in $(srcdir)/libupsclient.pc.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/lib/libupsclient-config.in b/lib/libupsclient-config.in index a7de7d5..2a59f70 100644 --- a/lib/libupsclient-config.in +++ b/lib/libupsclient-config.in @@ -10,7 +10,7 @@ Version="@PACKAGE_VERSION@" prefix=@prefix@ exec_prefix=@exec_prefix@ -Libs="-L@libdir@ -lupsclient @LIBSSL_LDFLAGS@" +Libs="-L@libdir@ -lupsclient @LIBSSL_LIBS@" Cflags="-I@includedir@ @LIBSSL_CFLAGS@" case "$1" in diff --git a/lib/libupsclient.pc.in b/lib/libupsclient.pc.in index eb6826c..4ad31fb 100644 --- a/lib/libupsclient.pc.in +++ b/lib/libupsclient.pc.in @@ -9,5 +9,5 @@ nutuser=@RUN_AS_USER@ Name: libupsclient Description: UPS monitoring with Network UPS Tools Version: @PACKAGE_VERSION@ -Libs: -L${libdir} -lupsclient @LIBSSL_LDFLAGS@ +Libs: -L${libdir} -lupsclient @LIBSSL_LIBS@ Cflags: -I${includedir} @LIBSSL_CFLAGS@ diff --git a/ltmain.sh b/ltmain.sh index 7ed280b..fa4b1e1 100755 --- a/ltmain.sh +++ b/ltmain.sh @@ -65,7 +65,7 @@ # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu1 +# $progname: (GNU libtool) 2.2.6b Debian-2.2.6b-2ubuntu3 # automake: $automake_version # autoconf: $autoconf_version # @@ -73,7 +73,7 @@ PROGRAM=ltmain.sh PACKAGE=libtool -VERSION="2.2.6b Debian-2.2.6b-2ubuntu1" +VERSION="2.2.6b Debian-2.2.6b-2ubuntu3" TIMESTAMP="" package_revision=1.3017 diff --git a/m4/ax_create_stdint_h.m4 b/m4/ax_create_stdint_h.m4 deleted file mode 100644 index f2a94e1..0000000 --- a/m4/ax_create_stdint_h.m4 +++ /dev/null @@ -1,725 +0,0 @@ -# =========================================================================== -# http://www.nongnu.org/autoconf-archive/ax_create_stdint_h.html -# =========================================================================== -# -# SYNOPSIS -# -# AX_CREATE_STDINT_H [( HEADER-TO-GENERATE [, HEDERS-TO-CHECK])] -# -# DESCRIPTION -# -# the "ISO C9X: 7.18 Integer types " section requires the -# existence of an include file that defines a set of typedefs, -# especially uint8_t,int32_t,uintptr_t. Many older installations will not -# provide this file, but some will have the very same definitions in -# . In other enviroments we can use the inet-types in -# which would define the typedefs int8_t and u_int8_t -# respectivly. -# -# This macros will create a local "_stdint.h" or the headerfile given as -# an argument. In many cases that file will just "#include " or -# "#include ", while in other environments it will provide the -# set of basic 'stdint's definitions/typedefs: -# -# int8_t,uint8_t,int16_t,uint16_t,int32_t,uint32_t,intptr_t,uintptr_t -# int_least32_t.. int_fast32_t.. intmax_t -# -# which may or may not rely on the definitions of other files, or using -# the AC_CHECK_SIZEOF macro to determine the actual sizeof each type. -# -# if your header files require the stdint-types you will want to create an -# installable file mylib-int.h that all your other installable header may -# include. So if you have a library package named "mylib", just use -# -# AX_CREATE_STDINT_H(mylib-int.h) -# -# in configure.ac and go to install that very header file in Makefile.am -# along with the other headers (mylib.h) - and the mylib-specific headers -# can simply use "#include " to obtain the stdint-types. -# -# Remember, if the system already had a valid , the generated -# file will include it directly. No need for fuzzy HAVE_STDINT_H things... -# (oops, GCC 4.2.x has deliberatly disabled its stdint.h for non-c99 -# compilation and the c99-mode is not the default. Therefore this macro -# will not use the compiler's stdint.h - please complain to the GCC -# developers). -# -# LICENSE -# -# Copyright (c) 2008 Guido U. Draheim -# -# 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, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -AC_DEFUN([AX_CHECK_DATA_MODEL],[ - AC_CHECK_SIZEOF(char) - AC_CHECK_SIZEOF(short) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(long) - AC_CHECK_SIZEOF(void*) - ac_cv_char_data_model="" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_char" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_short" - ac_cv_char_data_model="$ac_cv_char_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_int" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_long" - ac_cv_long_data_model="$ac_cv_long_data_model$ac_cv_sizeof_voidp" - AC_MSG_CHECKING([data model]) - case "$ac_cv_char_data_model/$ac_cv_long_data_model" in - 122/242) ac_cv_data_model="IP16" ; n="standard 16bit machine" ;; - 122/244) ac_cv_data_model="LP32" ; n="standard 32bit machine" ;; - 122/*) ac_cv_data_model="i16" ; n="unusual int16 model" ;; - 124/444) ac_cv_data_model="ILP32" ; n="standard 32bit unixish" ;; - 124/488) ac_cv_data_model="LP64" ; n="standard 64bit unixish" ;; - 124/448) ac_cv_data_model="LLP64" ; n="unusual 64bit unixish" ;; - 124/*) ac_cv_data_model="i32" ; n="unusual int32 model" ;; - 128/888) ac_cv_data_model="ILP64" ; n="unusual 64bit numeric" ;; - 128/*) ac_cv_data_model="i64" ; n="unusual int64 model" ;; - 222/*2) ac_cv_data_model="DSP16" ; n="strict 16bit dsptype" ;; - 333/*3) ac_cv_data_model="DSP24" ; n="strict 24bit dsptype" ;; - 444/*4) ac_cv_data_model="DSP32" ; n="strict 32bit dsptype" ;; - 666/*6) ac_cv_data_model="DSP48" ; n="strict 48bit dsptype" ;; - 888/*8) ac_cv_data_model="DSP64" ; n="strict 64bit dsptype" ;; - 222/*|333/*|444/*|666/*|888/*) : - ac_cv_data_model="iDSP" ; n="unusual dsptype" ;; - *) ac_cv_data_model="none" ; n="very unusual model" ;; - esac - AC_MSG_RESULT([$ac_cv_data_model ($ac_cv_long_data_model, $n)]) -]) - -dnl AX_CHECK_HEADER_STDINT_X([HEADERLIST][,ACTION-IF]) -AC_DEFUN([AX_CHECK_HEADER_STDINT_X],[ -AC_CACHE_CHECK([for stdint uintptr_t], [ac_cv_header_stdint_x],[ - ac_cv_header_stdint_x="" # the 1997 typedefs (inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[stdint.h inttypes.h sys/inttypes.h sys/types.h]) - do - unset ac_cv_type_uintptr_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uintptr_t,[ac_cv_header_stdint_x=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$2],[$2]) break - done - AC_MSG_CHECKING([for stdint uintptr_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_O],[ -AC_CACHE_CHECK([for stdint uint32_t], [ac_cv_header_stdint_o],[ - ac_cv_header_stdint_o="" # the 1995 typedefs (sys/inttypes.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[inttypes.h sys/inttypes.h sys/types.h stdint.h]) - do - unset ac_cv_type_uint32_t - unset ac_cv_type_uint64_t - AC_CHECK_TYPE(uint32_t,[ac_cv_header_stdint_o=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(uint64_t,[and64="/uint64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$2],[$2]) break - break; - done - AC_MSG_CHECKING([for stdint uint32_t]) - ]) -]) - -AC_DEFUN([AX_CHECK_HEADER_STDINT_U],[ -AC_CACHE_CHECK([for stdint u_int32_t], [ac_cv_header_stdint_u],[ - ac_cv_header_stdint_u="" # the BSD typedefs (sys/types.h) - AC_MSG_RESULT([(..)]) - for i in m4_ifval([$1],[$1],[sys/types.h inttypes.h sys/inttypes.h]) ; do - unset ac_cv_type_u_int32_t - unset ac_cv_type_u_int64_t - AC_CHECK_TYPE(u_int32_t,[ac_cv_header_stdint_u=$i],continue,[#include <$i>]) - AC_CHECK_TYPE(u_int64_t,[and64="/u_int64_t"],[and64=""],[#include<$i>]) - m4_ifvaln([$2],[$2]) break - break; - done - AC_MSG_CHECKING([for stdint u_int32_t]) - ]) -]) - -AC_DEFUN([AX_CREATE_STDINT_H], -[# ------ AX CREATE STDINT H ------------------------------------- -AC_MSG_CHECKING([for stdint types]) -ac_stdint_h=`echo ifelse($1, , _stdint.h, $1)` -# try to shortcircuit - if the default include path of the compiler -# can find a "stdint.h" header then we assume that all compilers can. -AC_CACHE_VAL([ac_cv_header_stdint_t],[ -old_CXXFLAGS="$CXXFLAGS" ; CXXFLAGS="" -old_CPPFLAGS="$CPPFLAGS" ; CPPFLAGS="" -old_CFLAGS="$CFLAGS" ; CFLAGS="" -AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], -[ac_cv_stdint_result="(assuming C99 compatible system)" - ac_cv_header_stdint_t="stdint.h"; ], -[ac_cv_header_stdint_t=""]) -if test "$GCC" = "yes" && test ".$ac_cv_header_stdint_t" = "."; then -CFLAGS="-std=c99" -AC_TRY_COMPILE([#include ],[int_least32_t v = 0;], -[AC_MSG_WARN(your GCC compiler has a defunct stdint.h for its default-mode)]) -fi -CXXFLAGS="$old_CXXFLAGS" -CPPFLAGS="$old_CPPFLAGS" -CFLAGS="$old_CFLAGS" ]) - -v="... $ac_cv_header_stdint_h" -if test "$ac_stdint_h" = "stdint.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./stdint.h?)]) -elif test "$ac_stdint_h" = "inttypes.h" ; then - AC_MSG_RESULT([(are you sure you want them in ./inttypes.h?)]) -elif test "_$ac_cv_header_stdint_t" = "_" ; then - AC_MSG_RESULT([(putting them into $ac_stdint_h)$v]) -else - ac_cv_header_stdint="$ac_cv_header_stdint_t" - AC_MSG_RESULT([$ac_cv_header_stdint (shortcircuit)]) -fi - -if test "_$ac_cv_header_stdint_t" = "_" ; then # can not shortcircuit.. - -dnl .....intro message done, now do a few system checks..... -dnl btw, all old CHECK_TYPE macros do automatically "DEFINE" a type, -dnl therefore we use the autoconf implementation detail CHECK_TYPE_NEW -dnl instead that is triggered with 3 or more arguments (see types.m4) - -inttype_headers=`echo $2 | sed -e 's/,/ /g'` - -ac_cv_stdint_result="(no helpful system typedefs seen)" -AX_CHECK_HEADER_STDINT_X(dnl - stdint.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen uintptr_t$and64 in $i)") - -if test "_$ac_cv_header_stdint_x" = "_" ; then -AX_CHECK_HEADER_STDINT_O(dnl, - inttypes.h sys/inttypes.h stdint.h $inttype_headers, - ac_cv_stdint_result="(seen uint32_t$and64 in $i)") -fi - -if test "_$ac_cv_header_stdint_x" = "_" ; then -if test "_$ac_cv_header_stdint_o" = "_" ; then -AX_CHECK_HEADER_STDINT_U(dnl, - sys/types.h inttypes.h sys/inttypes.h $inttype_headers, - ac_cv_stdint_result="(seen u_int32_t$and64 in $i)") -fi fi - -dnl if there was no good C99 header file, do some typedef checks... -if test "_$ac_cv_header_stdint_x" = "_" ; then - AC_MSG_CHECKING([for stdint datatype model]) - AC_MSG_RESULT([(..)]) - AX_CHECK_DATA_MODEL -fi - -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_x" -elif test "_$ac_cv_header_stdint_o" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_o" -elif test "_$ac_cv_header_stdint_u" != "_" ; then - ac_cv_header_stdint="$ac_cv_header_stdint_u" -else - ac_cv_header_stdint="stddef.h" -fi - -AC_MSG_CHECKING([for extra inttypes in chosen header]) -AC_MSG_RESULT([($ac_cv_header_stdint)]) -dnl see if int_least and int_fast types are present in _this_ header. -unset ac_cv_type_int_least32_t -unset ac_cv_type_int_fast32_t -AC_CHECK_TYPE(int_least32_t,,,[#include <$ac_cv_header_stdint>]) -AC_CHECK_TYPE(int_fast32_t,,,[#include<$ac_cv_header_stdint>]) -AC_CHECK_TYPE(intmax_t,,,[#include <$ac_cv_header_stdint>]) - -fi # shortcircut to system "stdint.h" -# ------------------ PREPARE VARIABLES ------------------------------ -if test "$GCC" = "yes" ; then -ac_cv_stdint_message="using gnu compiler "`$CC --version | head -1` -else -ac_cv_stdint_message="using $CC" -fi - -AC_MSG_RESULT([make use of $ac_cv_header_stdint in $ac_stdint_h dnl -$ac_cv_stdint_result]) - -dnl ----------------------------------------------------------------- -# ----------------- DONE inttypes.h checks START header ------------- -AC_CONFIG_COMMANDS([$ac_stdint_h],[ -AC_MSG_NOTICE(creating $ac_stdint_h : $_ac_stdint_h) -ac_stdint=$tmp/_stdint.h - -echo "#ifndef" $_ac_stdint_h >$ac_stdint -echo "#define" $_ac_stdint_h "1" >>$ac_stdint -echo "#ifndef" _GENERATED_STDINT_H >>$ac_stdint -echo "#define" _GENERATED_STDINT_H '"'$PACKAGE $VERSION'"' >>$ac_stdint -echo "/* generated $ac_cv_stdint_message */" >>$ac_stdint -if test "_$ac_cv_header_stdint_t" != "_" ; then -echo "#define _STDINT_HAVE_STDINT_H" "1" >>$ac_stdint -echo "#include " >>$ac_stdint -echo "#endif" >>$ac_stdint -echo "#endif" >>$ac_stdint -else - -cat >>$ac_stdint < -#else -#include - -/* .................... configured part ............................ */ - -STDINT_EOF - -echo "/* whether we have a C99 compatible stdint header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_x" != "_" ; then - ac_header="$ac_cv_header_stdint_x" - echo "#define _STDINT_HEADER_INTPTR" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_INTPTR */" >>$ac_stdint -fi - -echo "/* whether we have a C96 compatible inttypes header file */" >>$ac_stdint -if test "_$ac_cv_header_stdint_o" != "_" ; then - ac_header="$ac_cv_header_stdint_o" - echo "#define _STDINT_HEADER_UINT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_UINT32 */" >>$ac_stdint -fi - -echo "/* whether we have a BSD compatible inet types header */" >>$ac_stdint -if test "_$ac_cv_header_stdint_u" != "_" ; then - ac_header="$ac_cv_header_stdint_u" - echo "#define _STDINT_HEADER_U_INT32" '"'"$ac_header"'"' >>$ac_stdint -else - echo "/* #undef _STDINT_HEADER_U_INT32 */" >>$ac_stdint -fi - -echo "" >>$ac_stdint - -if test "_$ac_header" != "_" ; then if test "$ac_header" != "stddef.h" ; then - echo "#include <$ac_header>" >>$ac_stdint - echo "" >>$ac_stdint -fi fi - -echo "/* which 64bit typedef has been found */" >>$ac_stdint -if test "$ac_cv_type_uint64_t" = "yes" ; then -echo "#define _STDINT_HAVE_UINT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_UINT64_T */" >>$ac_stdint -fi -if test "$ac_cv_type_u_int64_t" = "yes" ; then -echo "#define _STDINT_HAVE_U_INT64_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_U_INT64_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* which type model has been detected */" >>$ac_stdint -if test "_$ac_cv_char_data_model" != "_" ; then -echo "#define _STDINT_CHAR_MODEL" "$ac_cv_char_data_model" >>$ac_stdint -echo "#define _STDINT_LONG_MODEL" "$ac_cv_long_data_model" >>$ac_stdint -else -echo "/* #undef _STDINT_CHAR_MODEL // skipped */" >>$ac_stdint -echo "/* #undef _STDINT_LONG_MODEL // skipped */" >>$ac_stdint -fi -echo "" >>$ac_stdint - -echo "/* whether int_least types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_least32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_LEAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_LEAST32_T */" >>$ac_stdint -fi -echo "/* whether int_fast types were detected */" >>$ac_stdint -if test "$ac_cv_type_int_fast32_t" = "yes"; then -echo "#define _STDINT_HAVE_INT_FAST32_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INT_FAST32_T */" >>$ac_stdint -fi -echo "/* whether intmax_t type was detected */" >>$ac_stdint -if test "$ac_cv_type_intmax_t" = "yes"; then -echo "#define _STDINT_HAVE_INTMAX_T" "1" >>$ac_stdint -else -echo "/* #undef _STDINT_HAVE_INTMAX_T */" >>$ac_stdint -fi -echo "" >>$ac_stdint - - cat >>$ac_stdint <= 199901L -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; - -#elif !defined __STRICT_ANSI__ -#if defined _MSC_VER || defined __WATCOMC__ || defined __BORLANDC__ -#define _HAVE_UINT64_T -typedef __int64 int64_t; -typedef unsigned __int64 uint64_t; - -#elif defined __GNUC__ || defined __MWERKS__ || defined __ELF__ -/* note: all ELF-systems seem to have loff-support which needs 64-bit */ -#if !defined _NO_LONGLONG -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef long long int64_t; -typedef unsigned long long uint64_t; -#endif - -#elif defined __alpha || (defined __mips && defined _ABIN32) -#if !defined _NO_LONGLONG -typedef long int64_t; -typedef unsigned long uint64_t; -#endif - /* compiler/cpu type to define int64_t */ -#endif -#endif -#endif - -#if defined _STDINT_HAVE_U_INT_TYPES -/* int8_t int16_t int32_t defined by inet code, redeclare the u_intXX types */ -typedef u_int8_t uint8_t; -typedef u_int16_t uint16_t; -typedef u_int32_t uint32_t; - -/* glibc compatibility */ -#ifndef __int8_t_defined -#define __int8_t_defined -#endif -#endif - -#ifdef _STDINT_NEED_INT_MODEL_T -/* we must guess all the basic types. Apart from byte-adressable system, */ -/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */ -/* (btw, those nibble-addressable systems are way off, or so we assume) */ - -dnl /* have a look at "64bit and data size neutrality" at */ -dnl /* http://unix.org/version2/whatsnew/login_64bit.html */ -dnl /* (the shorthand "ILP" types always have a "P" part) */ - -#if defined _STDINT_BYTE_MODEL -#if _STDINT_LONG_MODEL+0 == 242 -/* 2:4:2 = IP16 = a normal 16-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned long uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef long int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL == 444 -/* 2:4:4 = LP32 = a 32-bit system derived from a 16-bit */ -/* 4:4:4 = ILP32 = a normal 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 484 || _STDINT_LONG_MODEL+0 == 488 -/* 4:8:4 = IP32 = a 32-bit system prepared for 64-bit */ -/* 4:8:8 = LP64 = a normal 64-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* this system has a "long" of 64bit */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -typedef unsigned long uint64_t; -typedef long int64_t; -#endif -#elif _STDINT_LONG_MODEL+0 == 448 -/* LLP64 a 64-bit system derived from a 32-bit system */ -typedef unsigned char uint8_t; -typedef unsigned short uint16_t; -typedef unsigned int uint32_t; -#ifndef __int8_t_defined -#define __int8_t_defined -typedef char int8_t; -typedef short int16_t; -typedef int int32_t; -#endif -/* assuming the system has a "long long" */ -#ifndef _HAVE_UINT64_T -#define _HAVE_UINT64_T -#define _HAVE_LONGLONG_UINT64_T -typedef unsigned long long uint64_t; -typedef long long int64_t; -#endif -#else -#define _STDINT_NO_INT32_T -#endif -#else -#define _STDINT_NO_INT8_T -#define _STDINT_NO_INT32_T -#endif -#endif - -/* - * quote from SunOS-5.8 sys/inttypes.h: - * Use at your own risk. As of February 1996, the committee is squarely - * behind the fixed sized types; the "least" and "fast" types are still being - * discussed. The probability that the "fast" types may be removed before - * the standard is finalized is high enough that they are not currently - * implemented. - */ - -#if defined _STDINT_NEED_INT_LEAST_T -typedef int8_t int_least8_t; -typedef int16_t int_least16_t; -typedef int32_t int_least32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_least64_t; -#endif - -typedef uint8_t uint_least8_t; -typedef uint16_t uint_least16_t; -typedef uint32_t uint_least32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_least64_t; -#endif - /* least types */ -#endif - -#if defined _STDINT_NEED_INT_FAST_T -typedef int8_t int_fast8_t; -typedef int int_fast16_t; -typedef int32_t int_fast32_t; -#ifdef _HAVE_UINT64_T -typedef int64_t int_fast64_t; -#endif - -typedef uint8_t uint_fast8_t; -typedef unsigned uint_fast16_t; -typedef uint32_t uint_fast32_t; -#ifdef _HAVE_UINT64_T -typedef uint64_t uint_fast64_t; -#endif - /* fast types */ -#endif - -#ifdef _STDINT_NEED_INTMAX_T -#ifdef _HAVE_UINT64_T -typedef int64_t intmax_t; -typedef uint64_t uintmax_t; -#else -typedef long intmax_t; -typedef unsigned long uintmax_t; -#endif -#endif - -#ifdef _STDINT_NEED_INTPTR_T -#ifndef __intptr_t_defined -#define __intptr_t_defined -/* we encourage using "long" to store pointer values, never use "int" ! */ -#if _STDINT_LONG_MODEL+0 == 242 || _STDINT_LONG_MODEL+0 == 484 -typedef unsigned int uintptr_t; -typedef int intptr_t; -#elif _STDINT_LONG_MODEL+0 == 244 || _STDINT_LONG_MODEL+0 == 444 -typedef unsigned long uintptr_t; -typedef long intptr_t; -#elif _STDINT_LONG_MODEL+0 == 448 && defined _HAVE_UINT64_T -typedef uint64_t uintptr_t; -typedef int64_t intptr_t; -#else /* matches typical system types ILP32 and LP64 - but not IP16 or LLP64 */ -typedef unsigned long uintptr_t; -typedef long intptr_t; -#endif -#endif -#endif - -/* The ISO C99 standard specifies that in C++ implementations these - should only be defined if explicitly requested. */ -#if !defined __cplusplus || defined __STDC_CONSTANT_MACROS -#ifndef UINT32_C - -/* Signed. */ -# define INT8_C(c) c -# define INT16_C(c) c -# define INT32_C(c) c -# ifdef _HAVE_LONGLONG_UINT64_T -# define INT64_C(c) c ## L -# else -# define INT64_C(c) c ## LL -# endif - -/* Unsigned. */ -# define UINT8_C(c) c ## U -# define UINT16_C(c) c ## U -# define UINT32_C(c) c ## U -# ifdef _HAVE_LONGLONG_UINT64_T -# define UINT64_C(c) c ## UL -# else -# define UINT64_C(c) c ## ULL -# endif - -/* Maximal type. */ -# ifdef _HAVE_LONGLONG_UINT64_T -# define INTMAX_C(c) c ## L -# define UINTMAX_C(c) c ## UL -# else -# define INTMAX_C(c) c ## LL -# define UINTMAX_C(c) c ## ULL -# endif - - /* literalnumbers */ -#endif -#endif - -/* These limits are merily those of a two complement byte-oriented system */ - -/* Minimum of signed integral types. */ -# define INT8_MIN (-128) -# define INT16_MIN (-32767-1) -# define INT32_MIN (-2147483647-1) -# define INT64_MIN (-__INT64_C(9223372036854775807)-1) -/* Maximum of signed integral types. */ -# define INT8_MAX (127) -# define INT16_MAX (32767) -# define INT32_MAX (2147483647) -# define INT64_MAX (__INT64_C(9223372036854775807)) - -/* Maximum of unsigned integral types. */ -# define UINT8_MAX (255) -# define UINT16_MAX (65535) -# define UINT32_MAX (4294967295U) -# define UINT64_MAX (__UINT64_C(18446744073709551615)) - -/* Minimum of signed integral types having a minimum size. */ -# define INT_LEAST8_MIN INT8_MIN -# define INT_LEAST16_MIN INT16_MIN -# define INT_LEAST32_MIN INT32_MIN -# define INT_LEAST64_MIN INT64_MIN -/* Maximum of signed integral types having a minimum size. */ -# define INT_LEAST8_MAX INT8_MAX -# define INT_LEAST16_MAX INT16_MAX -# define INT_LEAST32_MAX INT32_MAX -# define INT_LEAST64_MAX INT64_MAX - -/* Maximum of unsigned integral types having a minimum size. */ -# define UINT_LEAST8_MAX UINT8_MAX -# define UINT_LEAST16_MAX UINT16_MAX -# define UINT_LEAST32_MAX UINT32_MAX -# define UINT_LEAST64_MAX UINT64_MAX - - /* shortcircuit*/ -#endif - /* once */ -#endif -#endif -STDINT_EOF -fi - if cmp -s $ac_stdint_h $ac_stdint 2>/dev/null; then - AC_MSG_NOTICE([$ac_stdint_h is unchanged]) - else - ac_dir=`AS_DIRNAME(["$ac_stdint_h"])` - AS_MKDIR_P(["$ac_dir"]) - rm -f $ac_stdint_h - mv $ac_stdint $ac_stdint_h - fi -],[# variables for create stdint.h replacement -PACKAGE="$PACKAGE" -VERSION="$VERSION" -ac_stdint_h="$ac_stdint_h" -_ac_stdint_h=AS_TR_CPP(_$PACKAGE-$ac_stdint_h) -ac_cv_stdint_message="$ac_cv_stdint_message" -ac_cv_header_stdint_t="$ac_cv_header_stdint_t" -ac_cv_header_stdint_x="$ac_cv_header_stdint_x" -ac_cv_header_stdint_o="$ac_cv_header_stdint_o" -ac_cv_header_stdint_u="$ac_cv_header_stdint_u" -ac_cv_type_uint64_t="$ac_cv_type_uint64_t" -ac_cv_type_u_int64_t="$ac_cv_type_u_int64_t" -ac_cv_char_data_model="$ac_cv_char_data_model" -ac_cv_long_data_model="$ac_cv_long_data_model" -ac_cv_type_int_least32_t="$ac_cv_type_int_least32_t" -ac_cv_type_int_fast32_t="$ac_cv_type_int_fast32_t" -ac_cv_type_intmax_t="$ac_cv_type_intmax_t" -]) -]) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 6c318fb..4a3f064 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -8,6 +8,7 @@ HP-UX/nut-upsmon \ HP-UX/nut-upsmon.sh \ misc/nut.bash_completion \ misc/osd-notify \ +perl/Nut.pm \ RedHat/halt.patch \ RedHat/README \ RedHat/ups \ diff --git a/scripts/Makefile.in b/scripts/Makefile.in index ce6a171..895ca91 100644 --- a/scripts/Makefile.in +++ b/scripts/Makefile.in @@ -38,7 +38,6 @@ subdir = scripts DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ @@ -274,6 +273,7 @@ HP-UX/nut-upsmon \ HP-UX/nut-upsmon.sh \ misc/nut.bash_completion \ misc/osd-notify \ +perl/Nut.pm \ RedHat/halt.patch \ RedHat/README \ RedHat/ups \ diff --git a/scripts/augeas/Makefile.in b/scripts/augeas/Makefile.in index d1724f9..f35554d 100644 --- a/scripts/augeas/Makefile.in +++ b/scripts/augeas/Makefile.in @@ -43,7 +43,6 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/nutupssetconf.aug.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/scripts/augeas/nutupsconf.aug.in b/scripts/augeas/nutupsconf.aug.in index 86afa99..1c5918e 100644 --- a/scripts/augeas/nutupsconf.aug.in +++ b/scripts/augeas/nutupsconf.aug.in @@ -51,6 +51,7 @@ let ups_fields = "driver" | "OffDelay" | "OnDelay" | "SD" + | "advorder" | "authPassword" | "authProtocol" | "batteryPercentage" @@ -143,6 +144,7 @@ let ups_fields = "driver" | "vendorid" | "voltage" | "wait" + | "wugrace" let ups_entry = IniFile.indented_entry (ups_global|ups_fields) ups_sep ups_comment diff --git a/scripts/hal/Makefile.in b/scripts/hal/Makefile.in index f362c11..ed3dc02 100644 --- a/scripts/hal/Makefile.in +++ b/scripts/hal/Makefile.in @@ -40,7 +40,6 @@ DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/ups-nut-device.fdi.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/scripts/hal/ups-nut-device.fdi.in b/scripts/hal/ups-nut-device.fdi.in index 147edf1..609c17d 100644 --- a/scripts/hal/ups-nut-device.fdi.in +++ b/scripts/hal/ups-nut-device.fdi.in @@ -2,15 +2,6 @@ - - - - battery - battery - hald-addon-blazer_usb - ups - - @@ -195,27 +186,16 @@ hald-addon-bcmxcp_usb ups - - - - + + battery battery - hald-addon-blazer_usb - ups - - - - - - battery - battery - hald-addon-blazer_usb + hald-addon-usbhid-ups ups - + @@ -275,15 +255,6 @@ ups - - - - battery - battery - hald-addon-richcomm_usb - ups - - @@ -544,15 +515,6 @@ ups - - - - battery - battery - hald-addon-blazer_usb - ups - - @@ -564,15 +526,6 @@ ups - - - - battery - battery - hald-addon-blazer_usb - ups - - diff --git a/scripts/hotplug/Makefile.in b/scripts/hotplug/Makefile.in index 0630762..ae6a80f 100644 --- a/scripts/hotplug/Makefile.in +++ b/scripts/hotplug/Makefile.in @@ -42,7 +42,6 @@ DIST_COMMON = README $(am__dist_hotplugusb_DATA_DIST) \ $(srcdir)/libhidups.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/scripts/hotplug/libhid.usermap b/scripts/hotplug/libhid.usermap index facf548..9b301a6 100644 --- a/scripts/hotplug/libhid.usermap +++ b/scripts/hotplug/libhid.usermap @@ -4,8 +4,6 @@ # libhidups 0x0003 0xVVVV 0xPPPP 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # # usb module match_flags idVendor idProduct bcdDevice_lo bcdDevice_hi bDeviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass bInterfaceSubClass bInterfaceProtocol driver_info -# Krauler UP-M500VA -libhidups 0x0003 0x0001 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Hewlett Packard # T500 @@ -64,12 +62,10 @@ libhidups 0x0003 0x051d 0x0003 0x0000 0x0000 0x00 # Powerware # various models libhidups 0x0003 0x0592 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Agiler UPS -libhidups 0x0003 0x05b8 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Belkin F6C1200-UNV -libhidups 0x0003 0x0665 0x5161 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 +# PW 9140 +libhidups 0x0003 0x0592 0x0004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Liebert +# Phoenixtec # various models libhidups 0x0003 0x06da 0x0002 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Mustek Powermust @@ -88,8 +84,6 @@ libhidups 0x0003 0x0764 0x0005 0x0000 0x0000 0x00 libhidups 0x0003 0x0764 0x0501 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # OR2200LCDRM2U libhidups 0x0003 0x0764 0x0601 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Sweex 1000VA -libhidups 0x0003 0x0925 0x1234 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # TrippLite # e.g. OMNIVS1000, SMART550USB, ... @@ -166,11 +160,7 @@ libhidups 0x0003 0x0d9f 0x00a4 0x0000 0x0000 0x00 libhidups 0x0003 0x0d9f 0x00a5 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # PowerCOM BNT - Black Knight Pro libhidups 0x0003 0x0d9f 0x00a6 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Unitek Alpha 1200Sx -libhidups 0x0003 0x0f03 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 # Liebert # Liebert PowerSure PSA UPS libhidups 0x0003 0x10af 0x0001 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 -# Ablerex 625L USB -libhidups 0x0003 0xffff 0x0000 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000 diff --git a/scripts/perl/Nut.pm b/scripts/perl/Nut.pm new file mode 100644 index 0000000..8263c0d --- /dev/null +++ b/scripts/perl/Nut.pm @@ -0,0 +1,959 @@ +# UPS::Nut - a class to talk to a UPS via the Network Utility Tools upsd. +# Original author Kit Peters +# Rewritten by Gabor Kiss +# Idea to implement TLS:http://www.logix.cz/michal/devel/smtp-cli/smtp-client.pl + +# ### changelog: made debug messages slightly more descriptive, improved +# ### changelog: comments in code +# ### changelog: Removed timeleft() function. + +package UPS::Nut; +use strict; +use Carp; +use FileHandle; +use IO::Socket; +use IO::Select; +use Dumpvalue; my $dumper = Dumpvalue->new; + +# The following globals dictate whether the accessors and instant-command +# functions are created. +# ### changelog: tie hash interface and AUTOLOAD contributed by +# ### changelog: Wayne Wylupski + +my $_eol = "\n"; + +BEGIN { + use Exporter (); + use vars qw ($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); + $VERSION = 1.51; + @ISA = qw(Exporter IO::Socket::INET); + @EXPORT = qw(); + @EXPORT_OK = qw(); + %EXPORT_TAGS = (); +} + +sub new { +# Author: Kit Peters + my $proto = shift; + my $class = ref($proto) || $proto; + my %arg = @_; # hash of arguments + my $self = {}; # _initialize will fill it later + bless $self, $class; + unless ($self->_initialize(%arg)) { # can't initialize + carp "Can't initialize: $self->{err}"; + return undef; + } + return $self; +} + +# accessor functions. Return a value if successful, return undef +# otherwise. + +sub BattPercent { # get battery percentage + return shift->GetVar('battery.charge'); +} + +sub LoadPercent { # get load percentage + my $self = shift; + my $context = shift; + $context = "L$context" if $context =~ /^[123]$/; + $context = ".$context" if $context; + return $self->GetVar("output$context.power.percent"); +} + +sub LineVoltage { # get line voltage + my $self = shift; + my $context = shift; + $context = "L$context-N" if $context =~ /^[123]$/; + $context = ".$context" if $context; + return $self->GetVar("input$context.voltage"); +} + +sub Status { # get status of UPS + return shift->GetVar('ups.status'); +} + +sub Temperature { # get the internal temperature of UPS + return shift->GetVar('battery.temperature'); +} + +# control functions: they control our relationship to upsd, and send +# commands to upsd. + +sub Login { # login to upsd, so that it won't shutdown unless we say we're + # ok. This should only be used if you're actually connected + # to the ups that upsd is monitoring. + +# Author: Kit Peters +# ### changelog: modified login logic a bit. Now it doesn't check to see +# ### changelog: if we got OK, ERR, or something else from upsd. It +# ### changelog: simply checks for a response beginning with OK from upsd. +# ### changelog: Anything else is an error. +# +# ### changelog: uses the new _send command +# + my $self = shift; # myself + my $user = shift; # username + my $pass = shift; # password + my $errmsg; # error message, sent to _debug and $self->{err} + my $ans; # scalar to hold responses from upsd + + $self->Authenticate($user, $pass) or return; + $ans = $self->_send( "LOGIN $self->{name}" ); + if (defined $ans && $ans =~ /^OK/) { # Login successful. + $self->_debug("LOGIN successful."); + return 1; + } + if (defined $ans) { + $errmsg = "LOGIN failed. Last message from upsd: $ans"; + } + else { + $errmsg = "Network error: $!"; + } + $self->_debug($self->{err} = $errmsg); + return undef; +} + +sub Authenticate { # Announce to the UPS who we are to set up the proper + # management level. See upsd.conf man page for details. + +# Contributor: Wayne Wylupski + my $self = shift; # myself + my $user = shift; # username + my $pass = shift; # password + + my $errmsg; # error message, sent to _debug and $self->{err} + my $ans; # scalar to hold responses from upsd + + # only attempt authentication if username and password given + if (defined $user and defined $pass) { + $ans = $self->_send("USERNAME $user"); + if (defined $ans && $ans =~ /^OK/) { # username OK, send password + + $ans = $self->_send("PASSWORD $pass"); + return 1 if (defined $ans && $ans =~ /^OK/); + } + } + if (defined $ans) { + $errmsg = "Authentication failed. Last message from upsd: $ans"; + } + else { + $errmsg = "Network error: $!"; + } + $self->_debug($self->{err} = $errmsg); + return undef; +} + +sub Logout { # logout of upsd +# Author: Kit Peters +# ### changelog: uses the new _send command +# + my $self = shift; + if ($self->{srvsock}) { # are we still connected to upsd? + my $ans = $self->_send( "LOGOUT" ); + close ($self->{srvsock}); + delete ($self->{srvsock}); + } +} + +# internal functions. These are only used by UPS::Nut internally, so +# please don't use them otherwise. If you really think an internal +# function should be externalized, let me know. + +sub _initialize { +# Author: Kit Peters + my $self = shift; + my %arg = @_; + my $host = $arg{HOST} || 'localhost'; # Host running master upsd + my $port = $arg{PORT} || '3493'; # 3493 is IANA assigned port for NUT + my $proto = $arg{PROTO} || 'tcp'; # use tcp unless user tells us to + my $user = $arg{USERNAME} || undef; # username passed to upsd + my $pass = $arg{PASSWORD} || undef; # password passed to upsd + my $login = $arg{LOGIN} || 0; # login to upsd on init? + + + $self->{name} = $arg{NAME} || 'default'; # UPS name in etc/ups.conf on $host + $self->{timeout} = $arg{TIMEOUT} || 30; # timeout + $self->{debug} = $arg{DEBUG} || 0; # debugging? + $self->{debugout} = $arg{DEBUGOUT} || undef; # where to send debug messages + + my $srvsock = $self->{srvsock} = # establish connection to upsd + IO::Socket::INET->new( + PeerAddr => $host, + PeerPort => $port, + Proto => $proto + ); + + unless ( defined $srvsock) { # can't connect + $self->{err} = "Unable to connect via $proto to $host:$port: $!"; + return undef; + } + + $self->{select} = IO::Select->new( $srvsock ); + + if ($user and $pass) { # attempt login to upsd if that option is specified + if ($login) { # attempt login to upsd if that option is specified + $self->Login($user, $pass) or carp $self->{err}; + } + else { + $self->Authenticate($user, $pass) or carp $self->{err}; + } + } + + # get a hash of vars for both the TIE functions as well as for + # expanding vars. + $self->{vars} = $self->ListVar; + + unless ( defined $self->{vars} ) { + $self->{err} = "Network error: $!"; + return undef; + } + + return $self; +} + +# +# _send +# +# Sends a command to the server and retrieves the results. +# If there was a network error, return undef; $! will contain the +# error. +sub _send +{ +# Contributor: Wayne Wylupski + my $self = shift; + my $cmd = shift; + my @handles; + my $result; # undef by default + + my $socket = $self->{srvsock}; + my $select = $self->{select}; + + @handles = IO::Select->select( undef, $select, $select, $self->{timeout} ); + return undef if ( !scalar $handles[1] ); + + $socket->print( $cmd . $_eol ); + + @handles = IO::Select->select( $select, undef, $select, $self->{timeout} ); + return undef if ( !scalar $handles[0]); + + $result = $socket->getline; + return undef if ( !defined ( $result ) ); + chomp $result; + + return $result; +} + +sub _getline +{ +# Contributor: Wayne Wylupski + my $self = shift; + my $result; # undef by default + + my $socket = $self->{srvsock}; + my $select = $self->{select}; + + # Different versions of IO::Socket has different error detection routines. + return undef if ( $IO::Socket::{has_error} && $select->has_error(0) ); + return undef if ( $IO::Socket::{has_exception} && $select->has_exception(0) ); + + chomp ( $result = $socket->getline ); + return $result; +} + +# Compatibility layer +sub Request { goto &GetVar; } + +sub GetVar { # request a variable from the UPS +# Author: Kit Peters + my $self = shift; +# ### changelog: 8/3/2002 - KP - Request() now returns undef if not +# ### changelog: connected to upsd via $srvsock +# ### changelog: uses the new _send command +# +# Modified by Gabor Kiss according to protocol version 1.5+ + my $var = shift; + my $req = "GET VAR $self->{name} $var"; # build request + my $ans = $self->_send( $req ); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans. Requested $var."; + return undef; + } + elsif ($ans =~ /^VAR/) { + my $checkvar; # to make sure the var we asked for is the var we got. + my $retval; # returned value for requested VAR + (undef, undef, $checkvar, $retval) = split(' ', $ans, 4); + # get checkvar and retval from the answer + if ($checkvar ne $var) { # did not get expected var + $self->{err} = "requested $var, received $checkvar"; + return undef; + } + $retval =~ s/^"(.*)"$/$1/; + return $retval; # return the requested value + } + else { # unrecognized response + $self->{err} = "Unrecognized response from upsd: $ans"; + return undef; + } +} + +sub Set { +# Contributor: Wayne Wylupski +# ### changelog: uses the new _send command +# + my $self = shift; + my $var = shift; + (my $value = shift) =~ s/^"?(.*)"?$/"$1"/; # add quotes if missing + + my $req = "SET VAR $self->{name} $var $value"; # build request + my $ans = $self->_send( $req ); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans"; + return undef; + } + elsif ($ans =~ /^OK/) { + return $value; + } + else { # unrecognized response + $self->{err} = "Unrecognized response from upsd: $ans"; + return undef; + } +} + +sub FSD { # set forced shutdown flag +# Author: Kit Peters +# ### changelog: uses the new _send command +# + my $self = shift; + + my $req = "FSD $self->{name}"; # build request + my $ans = $self->_send( $req ); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { # can't set forced shutdown flag + $self->{err} = "Can't set FSD flag. Upsd reports: $ans"; + return undef; + } + elsif ($ans =~ /^OK FSD-SET/) { # forced shutdown flag set + $self->_debug("FSD flag set successfully."); + return 1; + } + else { + $self->{err} = "Unrecognized response from upsd: $ans"; + return undef; + } +} + +sub InstCmd { # send instant command to ups +# Contributor: Wayne Wylupski + my $self = shift; + + chomp (my $cmd = shift); + + my $req = "INSTCMD $self->{name} $cmd"; + my $ans = $self->_send( $req ); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { # error reported from upsd + $self->{err} = "Can't send instant command $cmd. Reason: $ans"; + return undef; + } + elsif ($ans =~ /^OK/) { # command successful + $self->_debug("Instant command $cmd sent successfully."); + return 1; + } + else { # unrecognized response + $self->{err} = "Can't send instant command $cmd. Unrecognized response from upsd: $ans"; + return undef; + } +} + +sub ListUPS { + my $self = shift; + return $self->_get_list("LIST UPS", 2, 1); +} + +sub ListVar { + my $self = shift; + my $vars = $self->_get_list("LIST VAR $self->{name}", 3, 2); + return $vars unless @_; # return all variables + return {map { $_ => $vars->{$_} } @_}; # return selected ones +} + +sub ListRW { + my $self = shift; + return $self->_get_list("LIST RW $self->{name}", 3, 2); +} + +sub ListCmd { + my $self = shift; + return $self->_get_list("LIST CMD $self->{name}", 2); +} + +sub ListEnum { + my $self = shift; + my $var = shift; + return $self->_get_list("LIST ENUM $self->{name} $var", 3); +} + +sub _get_list { + my $self = shift; + my ($req, $valueidx, $keyidx) = @_; + my $ans = $self->_send($req); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans"; + return undef; + } + elsif ($ans =~ /^BEGIN LIST/) { # command successful + my $retval = $keyidx ? {} : []; + my $line; + while ($line = $self->_getline) { + last if $line =~ /^END LIST/; + my @fields = split(' ', $line, $valueidx+1); + (my $value = $fields[$valueidx]) =~ s/^"(.*)"$/$1/; + if ($keyidx) { + $retval->{$fields[$keyidx]} = $value; + } + else { + push(@$retval, $value); + } + } + unless ($line) { + $self->{err} = "Network error: $!"; + return undef; + }; + $self->_debug("$req command sent successfully."); + return $retval; + } + else { # unrecognized response + $self->{err} = "Can't send $req. Unrecognized response from upsd: $ans"; + return undef; + } +} + +# Compatibility layer +sub VarDesc { goto &GetDesc; } + +sub GetDesc { +# Contributor: Wayne Wylupski +# Modified by Gabor Kiss according to protocol version 1.5+ + my $self = shift; + my $var = shift; + + my $req = "GET DESC $self->{name} $var"; + my $ans = $self->_send( $req ); + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans"; + return undef; + } + elsif ($ans =~ /^DESC/) { # command successful + $self->_debug("$req command sent successfully."); + (undef, undef, undef, $ans) = split(' ', $ans, 4); + $ans =~ s/^"(.*)"$/$1/; + return $ans; + } + else { # unrecognized response + $self->{err} = "Can't send $req. Unrecognized response from upsd: $ans"; + return undef; + } +} + +# Compatibility layer +sub VarType { goto &GetType; } + +sub GetType { +# Contributor: Wayne Wylupski +# Modified by Gabor Kiss according to protocol version 1.5+ + my $self = shift; + my $var = shift; + + my $req = "GET TYPE $self->{name} $var"; + my $ans = $self->_send( $req ); + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans"; + return undef; + } + elsif ($ans =~ /^TYPE/) { # command successful + $self->_debug("$req command sent successfully."); + (undef, undef, undef, $ans) = split(' ', $ans, 4); + return $ans; + } + else { # unrecognized response + $self->{err} = "Can't send $req. Unrecognized response from upsd: $ans"; + return undef; + } +} + +# Compatibility layer +sub InstCmdDesc { goto &GetCmdDesc; } + +sub GetCmdDesc { +# Contributor: Wayne Wylupski +# Modified by Gabor Kiss according to protocol version 1.5+ + my $self = shift; + my $cmd = shift; + + my $req = "GET CMDDESC $self->{name} $cmd"; + my $ans = $self->_send( $req ); + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^ERR/) { + $self->{err} = "Error: $ans"; + return undef; + } + elsif ($ans =~ /^DESC/) { # command successful + $self->_debug("$req command sent successfully."); + (undef, undef, undef, $ans) = split(' ', $ans, 4); + $ans =~ s/^"(.*)"$/$1/; + return $ans; + } + else { # unrecognized response + $self->{err} = "Can't send $req. Unrecognized response from upsd: $ans"; + return undef; + } +} + +sub DESTROY { # destructor, all it does is call Logout +# Author: Kit Peters + my $self = shift; + $self->_debug("Object destroyed."); + $self->Logout(); +} + +sub _debug { # print debug messages to stdout or file +# Author: Kit Peters + my $self = shift; + if ($self->{debug}) { + chomp (my $msg = shift); + my $out; # filehandle for output + if ($self->{debugout}) { # if filename is given, use that + $out = new FileHandle ($self->{debugout}, ">>") or warn "Error: $!"; + } + if ($out) { # if out was set to a filehandle, create nifty timestamp + my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(); + $year = sprintf("%02d", $year % 100); # Y2.1K compliant, even! + my $timestamp = join '/', ($mon + 1), $mday, $year; # today + $timestamp .= " "; + $timestamp .= join ':', $hour, $min, $sec; + print $out "$timestamp $msg\n"; + } + else { print "DEBUG: $msg\n"; } # otherwise, print to stdout + } +} + +sub Error { # what was the last thing that went bang? +# Author: Kit Peters + my $self = shift; + if ($self->{err}) { return $self->{err}; } + else { return "No error explanation available."; } +} + +sub Master { # check for MASTER level access +# Author: Kit Peters +# ### changelog: uses the new _send command +# + my $self = shift; + + my $req = "MASTER $self->{name}"; # build request + my $ans = $self->_send( $req ); + + unless (defined $ans) { + $self->{err} = "Network error: $!"; + return undef; + }; + + if ($ans =~ /^OK/) { # access granted + $self->_debug("MASTER level access granted. Upsd reports: $ans"); + return 1; + } + else { # access denied, or unrecognized reponse + $self->{err} = "MASTER level access denied. Upsd responded: $ans"; +# ### changelog: 8/3/2002 - KP - Master() returns undef rather than 0 on +# ### failure. this makes it consistent with other methods + return undef; + } +} + +sub AUTOLOAD { +# Contributor: Wayne Wylupski + my $self = shift; + my $name = $UPS::Nut::AUTOLOAD; + $name =~ s/^.*:://; + + # for a change we will only load cmds if needed. + if (!defined $self->{cmds} ) { + %{$self->{cmds}} = map{ $_ =>1 } @{$self->ListCmd}; + } + + croak "No such InstCmd: $name" if (! $self->{cmds}{$name} ); + + return $self->InstCmd( $name ); +} + +#------------------------------------------------------------------------- +# tie hash interface +# +# The variables of the array, including the hidden 'numlogins' can +# be accessed as a hash array through this method. +# +# Example: +# tie %ups, 'UPS::Nut', +# NAME => "myups", +# HOST => "somemachine.somewhere.com", +# ... # same options as new(); +# ; +# +# $ups{UPSIDENT} = "MyUPS"; +# print $ups{MFR}, " " $ups{MODEL}, "\n"; +# +#------------------------------------------------------------------------- +sub TIEHASH { + my $class = shift || 'UPS::Nut'; + return $class->new( @_ ); +} + +sub FETCH { + my $self = shift; + my $key = shift; + + return $self->Request( $key ); +} + +sub STORE { + my $self = shift; + my $key = shift; + my $value = shift; + + return $self->Set( $key, $value ); +} + +sub DELETE { + croak "DELETE operation not supported"; +} + +sub CLEAR { + croak "CLEAR operation not supported"; +} + +sub EXISTS { + exists shift->{vars}{shift}; +} + +sub FIRSTKEY { + my $self = shift; + my $a = keys %{$self->{vars}}; + return scalar each %{$self->{vars}}; +} + +sub NEXTKEY { + my $self = shift; + return scalar each %{$self->{vars}}; +} + +sub UNTIE { + $_[0]->Logout; +} + +=head1 NAME + +Nut - a module to talk to a UPS via NUT (Network UPS Tools) upsd + +=head1 SYNOPSIS + + use UPS::Nut; + + $ups = new UPS::Nut( NAME => "myups", + HOST => "somemachine.somewhere.com", + PORT => "3493", + USERNAME => "upsuser", + PASSWORD => "upspasswd", + TIMEOUT => 30, + DEBUG => 1, + DEBUGOUT => "/some/file/somewhere", + ); + if ($ups->Status() =~ /OB/) { + print "Oh, no! Power failure!\n"; + } + + tie %other_ups, 'UPS::Nut', + NAME => "myups", + HOST => "somemachine.somewhere.com", + ... # same options as new(); + ; + + print $other_ups{MFR}, " ", $other_ups{MODEL}, "\n"; + +=head1 DESCRIPTION + +This is an object-oriented (whoo!) interface between Perl and upsd from +the Network UPS Tools package version 1.5 and above +(http://www.networkupstools.org/). +Note that it only talks to upsd for you in a Perl-ish way. +It doesn't monitor the UPS continously. + +=head1 CONSTRUCTOR + +Shown with defaults: new UPS::Nut( NAME => "default", + HOST => "localhost", + PORT => "3493", + USERNAME => "", + PASSWORD => "", + DEBUG => 0, + DEBUGOUT => "", + ); +* NAME is the name of the UPS to monitor, as specified in ups.conf +* HOST is the host running upsd +* PORT is the port that upsd is running on +* USERNAME and PASSWORD are those that you use to login to upsd. This + gives you the right to do certain things, as specified in upsd.conf. +* DEBUG turns on debugging output, set to 1 or 0 +* DEBUGOUT is de thing you do when de s*** hits the fan. Actually, it's + the filename where you want debugging output to go. If it's not + specified, debugging output comes to standard output. + +=head1 Important notice + +This version of UPS::Nut is not compatible with version 0.04. It is totally +rewritten in order to talk the new protocol of NUT 1.5+. You should not use +this module as a drop-in replacement of previous version from 2002. +Allmost all method has changed slightly. + +=head1 Methods + +Unlike in version 0.04 no methods return list values but a +single reference or undef. + +=head2 Methods for querying UPS status + +=over 4 + +=item Getvar($varname) + +returns value of the specified variable. Returns undef if variable +unsupported. +Old method named Request() is also supported for compatibility. + +=item Set($varname, $value) + +sets the value of the specified variable. Returns undef if variable +unsupported, or if variable cannot be set for some other reason. See +Authenticate() if you wish to use this function. + +=item BattPercent() + +returns percentage of battery left. Returns undef if we can't get +battery percentage for some reason. Same as GetVar('battery.charge'). + +=item LoadPercent($context) + +returns percentage of the load on the UPS. Returns undef if load +percentage is unavailable. $context is a selector of 3 phase systems. +Possibled values are 1, 2, 3, 'L1', 'L2', 'L3'. It should be omitted +in case of single phase UPS. + +=item LineVoltage($context) + +returns input line (e.g. the outlet) voltage. Returns undef if line +voltage is unavailable. $context is a selector of 3 phase systems. +Possibled values are 1, 2, 3, 'L1', 'L2', 'L3'. It should be omitted +in case of single phase UPS. + +=item Status() + +returns UPS status, one of OL or OB. OL or OB may be followed by LB, +which signifies low battery state. OL or OB may also be followed by +FSD, which denotes that the forced shutdown state +( see UPS::Nut->FSD() ) has been set on upsd. Returns undef if status +unavailable. Same as GetVar('ups.status'). + +=item Temperature() + +returns UPS internal temperature. Returns undef if internal +temperature unavailable. Same as GetVar('battery.temperature'). + +=back + +=head2 Other methods + +These all operate on the UPS specified in the NAME argument to the +constructor. + +=over 4 + +=item Authenticate($username, $password) + +With NUT certain operations are only available if the user has the +privilege. The program has to authenticate with one of the accounts +defined in upsd.conf. + +=item Login($username, $password) + +Notify upsd that client is drawing power from the given UPS. +It is automatically done if new() is called with USERNAME, PASSWORD +and LOGIN parameters. + +=item Logout() + +Notify upsd that client is released UPS. (E.g. it is shutting down.) +It is automatically done if connection closed. + +=item Master() + +Use this to find out whether or not we have MASTER privileges for +this UPS. Returns 1 if we have MASTER privileges, returns 0 otherwise. + +=item ListVar($variable, ...) + +This is an implementation of "LIST VAR" command. +Returns a hash reference to selected variable names and values supported +by the UPS. If no variables given it returns all. +Returns undef if "LIST VAR" failed. +(Note: This method significally differs from the old ListVars() +and ListRequest().) + +=item ListRW() + +Similar to ListVar() but cares only with read/writeable variables. + +=item ListEnum($variable) + +Returns a reference to the list of all possible values of $variable. +List is empty if $variable is not an ENUM type. (See GetType().) +Returns undef if error occurred. + +=item ListCmd() + +Returns a reference to the list of all instant commands supported +by the UPS. Returns undef if these are unavailable. +This method replaces the old ListInstCmds(). + +=item InstCmd($command) + +Send an instant command to the UPS. Returns 1 on success. Returns +undef if the command can't be completed. + +=item FSD() + +Set the FSD (forced shutdown) flag for the UPS. This means that we're +planning on shutting down the UPS very soon, so the attached load should +be shut down as well. Returns 1 on success, returns undef on failure. +This cannot be unset, so don't set it unless you mean it. + +=item Error() + +why did the previous operation fail? The answer is here. It will +return a concise, well-written, and brilliantly insightful few words as +to why whatever you just did went bang. + +=item GetDesc($variable) + +Returns textual description of $variable or undef in case of error. +Old method named VarDesc() is also supported for compatibility. + +=item GetCmdDesc($command) + +This is like GetDesc() above but applies to the instant commands. +Old method named InstCmdDesc() is also supported for compatibility. + +=item GetType($variable) + +Returns a string UNKNOWN or constructed one or more words of RW, +ENUM and STRING:n (where n is a number). (Seems to be not working +perfectly at upsd 2.2.) +Old method named VarType() is also supported for compatibility. + +=item ListUPS() + +Returns a reference to hash of all available UPS names and descriptions. + +=back + +=head1 AUTOLOAD + +The "instant commands" are available as methods of the UPS object. They +are AUTOLOADed when called. For example, if the instant command is FPTEST, +then it can be called by $ups->FPTEST. + +=head1 TIE Interface + +If you wish to simply query or set values, you can tie a hash value to +UPS::Nut and pass as extra options what you need to connect to the host. +If you need to exercise an occasional command, you may find the return +value of 'tie' useful, as in: + + my %ups; + my $ups_obj = tie %ups, 'UPS::Nut', HOSTNAME=>"firewall"; + + print $ups{UPSIDENT}, "\n"; + + $ups_obj->Authenticate( "user", "pass" ); + + $ups{UPSIDENT} = "MyUPS"; + +=head1 AUTHOR + + Original version made by Kit Peters + perl@clownswilleatyou.com + http://www.awod.com/staff/kpeters/perl/ + + Rewritten by Gabor Kiss . + +=head1 CREDITS + +Developed with the kind support of A World Of Difference, Inc. + + +Many thanks to Ryan Jessen at CyberPower +Systems for much-needed assistance. + +Thanks to Wayne Wylupski for the code to make +accessor methods for all supported vars. + +=head1 LICENSE + +This module is distributed under the same license as Perl itself. + +=cut + +1; +__END__ + diff --git a/scripts/python/Makefile.in b/scripts/python/Makefile.in index d3b1f4e..dc8d7ba 100644 --- a/scripts/python/Makefile.in +++ b/scripts/python/Makefile.in @@ -40,7 +40,6 @@ subdir = scripts/python DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/scripts/udev/Makefile.in b/scripts/udev/Makefile.in index 9594e8d..678ff5c 100644 --- a/scripts/udev/Makefile.in +++ b/scripts/udev/Makefile.in @@ -40,7 +40,6 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/nut-usbups.rules.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/scripts/udev/nut-usbups.rules.in b/scripts/udev/nut-usbups.rules.in index 2be5a41..9331e60 100644 --- a/scripts/udev/nut-usbups.rules.in +++ b/scripts/udev/nut-usbups.rules.in @@ -6,8 +6,6 @@ SUBSYSTEM=="usb", GOTO="nut-usbups_rules_real" SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end" LABEL="nut-usbups_rules_real" -# Krauler UP-M500VA - blazer_usb -ATTR{idVendor}=="0001", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@" # Hewlett Packard # T500 - bcmxcp_usb @@ -66,12 +64,10 @@ ATTR{idVendor}=="051d", ATTR{idProduct}=="0003", MODE="664", GROUP="@RUN_AS_GROU # Powerware # various models - bcmxcp_usb ATTR{idVendor}=="0592", ATTR{idProduct}=="0002", MODE="664", GROUP="@RUN_AS_GROUP@" -# Agiler UPS - blazer_usb -ATTR{idVendor}=="05b8", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@" -# Belkin F6C1200-UNV - blazer_usb -ATTR{idVendor}=="0665", ATTR{idProduct}=="5161", MODE="664", GROUP="@RUN_AS_GROUP@" +# PW 9140 - usbhid-ups +ATTR{idVendor}=="0592", ATTR{idProduct}=="0004", MODE="664", GROUP="@RUN_AS_GROUP@" -# Liebert +# Phoenixtec # various models - bcmxcp_usb ATTR{idVendor}=="06da", ATTR{idProduct}=="0002", MODE="664", GROUP="@RUN_AS_GROUP@" # Mustek Powermust - blazer_usb @@ -90,8 +86,6 @@ ATTR{idVendor}=="0764", ATTR{idProduct}=="0005", MODE="664", GROUP="@RUN_AS_GROU ATTR{idVendor}=="0764", ATTR{idProduct}=="0501", MODE="664", GROUP="@RUN_AS_GROUP@" # OR2200LCDRM2U - usbhid-ups ATTR{idVendor}=="0764", ATTR{idProduct}=="0601", MODE="664", GROUP="@RUN_AS_GROUP@" -# Sweex 1000VA - richcomm_usb -ATTR{idVendor}=="0925", ATTR{idProduct}=="1234", MODE="664", GROUP="@RUN_AS_GROUP@" # TrippLite # e.g. OMNIVS1000, SMART550USB, ... - tripplite_usb @@ -168,13 +162,9 @@ ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a4", MODE="664", GROUP="@RUN_AS_GROU ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a5", MODE="664", GROUP="@RUN_AS_GROUP@" # PowerCOM BNT - Black Knight Pro - usbhid-ups ATTR{idVendor}=="0d9f", ATTR{idProduct}=="00a6", MODE="664", GROUP="@RUN_AS_GROUP@" -# Unitek Alpha 1200Sx - blazer_usb -ATTR{idVendor}=="0f03", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@" # Liebert # Liebert PowerSure PSA UPS - usbhid-ups ATTR{idVendor}=="10af", ATTR{idProduct}=="0001", MODE="664", GROUP="@RUN_AS_GROUP@" -# Ablerex 625L USB - blazer_usb -ATTR{idVendor}=="ffff", ATTR{idProduct}=="0000", MODE="664", GROUP="@RUN_AS_GROUP@" LABEL="nut-usbups_rules_end" diff --git a/scripts/upower/95-upower-hid.rules b/scripts/upower/95-upower-hid.rules index ac1138c..25c267d 100644 --- a/scripts/upower/95-upower-hid.rules +++ b/scripts/upower/95-upower-hid.rules @@ -17,7 +17,8 @@ ATTRS{idVendor}=="0463", ENV{UPOWER_VENDOR}="Eaton" ATTRS{idVendor}=="047c", ENV{UPOWER_VENDOR}="Dell" ATTRS{idVendor}=="050d", ENV{UPOWER_VENDOR}="Belkin" ATTRS{idVendor}=="051d", ENV{UPOWER_VENDOR}="APC" -ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Liebert" +ATTRS{idVendor}=="0592", ENV{UPOWER_VENDOR}="Powerware" +ATTRS{idVendor}=="06da", ENV{UPOWER_VENDOR}="Phoenixtec" ATTRS{idVendor}=="075d", ENV{UPOWER_VENDOR}="iDowell" ATTRS{idVendor}=="0764", ENV{UPOWER_VENDOR}="Cyber Power Systems" ATTRS{idVendor}=="09ae", ENV{UPOWER_VENDOR}="TrippLite" @@ -54,7 +55,10 @@ ATTRS{idVendor}=="050d", ATTRS{idProduct}=="1100", ENV{UPOWER_BATTERY_TYPE}="ups ATTRS{idVendor}=="051d", ATTRS{idProduct}=="0002", ENV{UPOWER_BATTERY_TYPE}="ups" ATTRS{idVendor}=="051d", ATTRS{idProduct}=="0003", ENV{UPOWER_BATTERY_TYPE}="ups" -# Liebert +# Powerware +ATTRS{idVendor}=="0592", ATTRS{idProduct}=="0004", ENV{UPOWER_BATTERY_TYPE}="ups" + +# Phoenixtec ATTRS{idVendor}=="06da", ATTRS{idProduct}=="ffff", ENV{UPOWER_BATTERY_TYPE}="ups" # iDowell diff --git a/server/Makefile.in b/server/Makefile.in index ed50361..6decd15 100644 --- a/server/Makefile.in +++ b/server/Makefile.in @@ -47,7 +47,6 @@ subdir = server DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/server/netinstcmd.c b/server/netinstcmd.c index 90275ca..7411e2b 100644 --- a/server/netinstcmd.c +++ b/server/netinstcmd.c @@ -29,12 +29,12 @@ #include "netinstcmd.h" static void send_instcmd(ctype_t *client, const char *upsname, - const char *cmdname) + const char *cmdname, const char *value) { int found; upstype_t *ups; const cmdlist_t *ctmp; - char sockcmd[SMALLBUF]; + char sockcmd[SMALLBUF], esc[SMALLBUF]; ups = get_ups_ptr(upsname); @@ -70,11 +70,20 @@ static void send_instcmd(ctype_t *client, const char *upsname, return; } - upslogx(LOG_INFO, "Instant command: %s@%s did %s on %s", - client->username, client->addr, cmdname, - ups->name); + /* see if the user has also passed a value for this command */ + if (value != NULL) { + upslogx(LOG_INFO, "Instant command: %s@%s did %s with value \"%s\" on %s", + client->username, client->addr, cmdname, value, ups->name); - snprintf(sockcmd, sizeof(sockcmd), "INSTCMD %s\n", cmdname); + snprintf(sockcmd, sizeof(sockcmd), "INSTCMD %s %s\n", + cmdname, pconf_encode(value, esc, sizeof(esc))); + } + else { + upslogx(LOG_INFO, "Instant command: %s@%s did %s on %s", + client->username, client->addr, cmdname, ups->name); + + snprintf(sockcmd, sizeof(sockcmd), "INSTCMD %s\n", cmdname); + } if (!sstate_sendline(ups, sockcmd)) { upslogx(LOG_INFO, "Set command send failed"); @@ -82,6 +91,7 @@ static void send_instcmd(ctype_t *client, const char *upsname, return; } + /* FIXME: need to retrieve the cookie number */ sendback(client, "OK\n"); } @@ -92,7 +102,7 @@ void net_instcmd(ctype_t *client, int numarg, const char **arg) return; } - /* INSTCMD */ - send_instcmd(client, arg[0], arg[1]); + /* INSTCMD []*/ + send_instcmd(client, arg[0], arg[1], (numarg == 3)?arg[2]:NULL); return; } diff --git a/server/netlist.c b/server/netlist.c index 39ff826..104026c 100644 --- a/server/netlist.c +++ b/server/netlist.c @@ -204,7 +204,7 @@ static void list_ups(ctype_t *client) utmp->name, esc); } else { - ret = sendback(client, "UPS %s \"Unavailable\"\n", + ret = sendback(client, "UPS %s \"Description unavailable\"\n", utmp->name); } diff --git a/server/upsd.c b/server/upsd.c index a5a0c42..662284e 100644 --- a/server/upsd.c +++ b/server/upsd.c @@ -452,7 +452,11 @@ static void parse_net(ctype_t *client) static void client_connect(stype_t *server) { struct sockaddr_storage csock; +#if defined(__hpux) && !defined(_XOPEN_SOURCE_EXTENDED) + int clen; +#else socklen_t clen; +#endif int fd; ctype_t *client; diff --git a/tools/Makefile.in b/tools/Makefile.in index 9eba5b4..103b72d 100644 --- a/tools/Makefile.in +++ b/tools/Makefile.in @@ -38,7 +38,6 @@ subdir = tools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_compare_version.m4 \ - $(top_srcdir)/m4/ax_create_stdint_h.m4 \ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 \ diff --git a/tools/nut-usbinfo.pl b/tools/nut-usbinfo.pl index 1bbf3aa..606d89d 100755 --- a/tools/nut-usbinfo.pl +++ b/tools/nut-usbinfo.pl @@ -196,7 +196,9 @@ sub find_usbdevs my $VendorName=""; # special thing for backward declaration using #DEFINE - # Format: #define VENDORID 0x???? /* vendor name */ + # Format: + # /* vendor name */ + # #define VENDORID 0x???? if(!($VendorID=~/\dx(\d|\w)+/)) { open my $fh,$nameFile or die "error open file $nameFile"; @@ -228,9 +230,12 @@ sub find_usbdevs die "In file $nameFile, for product $ProductID, can't find the declaration of the constant"; } } - - # store date (to be optimized) - $vendorName{$VendorID}=trim($VendorName); + + # store data (to be optimized) + if (($vendorName{$VendorID} eq "") && ($VendorName)) + { + $vendorName{$VendorID}=trim($VendorName); + } $vendor{$VendorID}{$ProductID}{"comment"}=$lastComment; # process the driver name my $driver=$nameFile;