1 /* sstate.h - Network UPS Tools server-side state management
4 2003 Russell Kroll <rkroll@exploits.org>
5 2008 Arjen de Korte <adkorte-guest@alioth.debian.org>
6 2012 Arnaud Quette <arnaud.quette@free.fr>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #ifndef NUT_SSTATE_H_SEEN
24 #define NUT_SSTATE_H_SEEN 1
26 #include "common.h" /* TYPE_FD */
30 #define SS_CONNFAIL_INT 300 /* complain about a dead driver every 5 mins */
31 #define SS_MAX_READ 256 /* don't let drivers tie us up in read() */
39 TYPE_FD
sstate_connect(upstype_t
*ups
);
40 void sstate_disconnect(upstype_t
*ups
);
41 void sstate_readline(upstype_t
*ups
);
42 const char *sstate_getinfo(const upstype_t
*ups
, const char *var
);
43 int sstate_getflags(const upstype_t
*ups
, const char *var
);
44 long sstate_getaux(const upstype_t
*ups
, const char *var
);
45 const enum_t
*sstate_getenumlist(const upstype_t
*ups
, const char *var
);
46 const range_t
*sstate_getrangelist(const upstype_t
*ups
, const char *var
);
47 const cmdlist_t
*sstate_getcmdlist(const upstype_t
*ups
);
48 void sstate_makeinfolist(const upstype_t
*ups
, char *buf
, size_t bufsize
);
49 void sstate_makerwlist(const upstype_t
*ups
, char *buf
, size_t bufsize
);
50 void sstate_makeinstcmdlist_t(const upstype_t
*ups
, char *buf
, size_t bufsize
);
51 int sstate_dead(upstype_t
*ups
, int maxage
);
52 void sstate_infofree(upstype_t
*ups
);
53 void sstate_cmdfree(upstype_t
*ups
);
54 int sstate_sendline(upstype_t
*ups
, const char *buf
);
55 const st_tree_t
*sstate_getnode(const upstype_t
*ups
, const char *varname
);
63 #endif /* NUT_SSTATE_H_SEEN */