Network UPS Tools Developer Guide

Russell Kroll, Arnaud Quette, Charles Lepple and Peter Selinger


Table of Contents

1. Introduction
2. NUT design document
2.1. The layering
2.2. How information gets around
2.3. Instant commands
2.4. Setting variables
2.5. Example data path
2.6. History
3. Information for developers
3.1. General stuff - common subdirectory
3.2. Device drivers - main.c
3.3. Portability
3.4. Coding style
3.5. Miscellaneous coding style tools
3.6. Submitting patches
3.7. Patch cohesion
3.8. The completion touch: manual pages and device entry in HCL
3.9. Source code management
3.10. Repository etiquette and quality assurance
3.11. Distributed SCM systems
4. Creating a new driver to support another device
4.1. Smart vs. Contact-closure
4.2. Serial vs. USB vs. SNMP and more
4.3. Overall concept
4.4. Skeleton driver
4.5. Essential structure
4.6. Essential functions
4.7. Data types
4.8. Manipulating the data
4.9. UPS alarms
4.10. Staleness control
4.11. Serial port handling
4.12. USB port handling
4.13. Variable names
4.14. Message passing support
4.15. Enumerated types
4.16. Writable strings
4.17. Instant commands
4.18. Delays and ser_* functions
4.19. Canonical input mode processing
4.20. Contact closure hardware information
4.21. How to make a new subdriver to support another USB/HID UPS
5. Driver/server socket protocol
5.1. Formatting
5.2. Commands used by the drivers
5.3. Commands sent by the server
5.4. Design notes
6. NUT configuration management with Augeas
6.1. Introduction
6.2. Requirements
6.3. Create a test sandbox
6.4. Start testing and using
7. Creating new client
7.1. C / C++
7.2. Python
7.3. Perl
8. Network protocol information
8.1. Old command removal notice
8.2. Command reference
8.3. GET
8.4. LIST
8.5. SET
8.6. INSTCMD
8.7. LOGOUT
8.8. LOGIN
8.9. MASTER
8.10. FSD
8.11. PASSWORD
8.12. USERNAME
8.13. STARTTLS
8.14. Other commands
8.15. Error responses
8.16. Future ideas
9. NUT developers tools
9.1. Device simulation
9.2. Device recording
10. NUT core development and maintenance
10.1. NUT-specific autoconf macros
10.2. NUT roadmap and ideas for future expansion
A. NUT command and variable naming scheme
A.1. Variables
device: General unit information
ups: General unit information
input: Incoming line/power information
output: Outgoing power/inverter information
Three-phase additions
EXAMPLES
battery: Any battery details
ambient: Conditions from external probe equipment
outlet: Smart outlet management
driver: Internal driver information
server: Internal server information
A.2. Instant commands