new upstream 2.8.0
This commit is contained in:
parent
fc7f4b43c1
commit
b2b0c9995a
836 changed files with 137090 additions and 30018 deletions
|
@ -21,13 +21,26 @@
|
|||
#define UPSCLIENT_H_SEEN
|
||||
|
||||
#ifdef WITH_OPENSSL
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#elif defined(WITH_NSS) /* WITH_OPENSSL */
|
||||
#include <nss.h>
|
||||
#include <ssl.h>
|
||||
#endif /* WITH_OPENSSL | WITH_NSS */
|
||||
|
||||
/* Not including nut_stdint.h because this is part of end-user API */
|
||||
#if defined HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
|
||||
#if defined HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
extern "C" {
|
||||
|
@ -41,7 +54,7 @@ extern "C" {
|
|||
|
||||
typedef struct {
|
||||
char *host;
|
||||
int port;
|
||||
uint16_t port;
|
||||
int fd;
|
||||
int flags;
|
||||
int upserror;
|
||||
|
@ -69,31 +82,33 @@ typedef struct {
|
|||
const char *upscli_strerror(UPSCONN_t *ups);
|
||||
|
||||
int upscli_init(int certverify, const char *certpath, const char *certname, const char *certpasswd);
|
||||
int upscli_cleanup();
|
||||
int upscli_cleanup(void);
|
||||
|
||||
int upscli_tryconnect(UPSCONN_t *ups, const char *host, int port, int flags, struct timeval *tv);
|
||||
int upscli_connect(UPSCONN_t *ups, const char *host, int port, int flags);
|
||||
int upscli_tryconnect(UPSCONN_t *ups, const char *host, uint16_t port, int flags, struct timeval *tv);
|
||||
int upscli_connect(UPSCONN_t *ups, const char *host, uint16_t port, int flags);
|
||||
|
||||
void upscli_add_host_cert(const char* hostname, const char* certname, int certverify, int forcessl);
|
||||
|
||||
/* --- functions that only use the new names --- */
|
||||
|
||||
int upscli_get(UPSCONN_t *ups, unsigned int numq, const char **query,
|
||||
unsigned int *numa, char ***answer);
|
||||
int upscli_get(UPSCONN_t *ups, size_t numq, const char **query,
|
||||
size_t *numa, char ***answer);
|
||||
|
||||
int upscli_list_start(UPSCONN_t *ups, unsigned int numq, const char **query);
|
||||
int upscli_list_start(UPSCONN_t *ups, size_t numq, const char **query);
|
||||
|
||||
int upscli_list_next(UPSCONN_t *ups, unsigned int numq, const char **query,
|
||||
unsigned int *numa, char ***answer);
|
||||
int upscli_list_next(UPSCONN_t *ups, size_t numq, const char **query,
|
||||
size_t *numa, char ***answer);
|
||||
|
||||
int upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);
|
||||
ssize_t upscli_sendline_timeout(UPSCONN_t *ups, const char *buf, size_t buflen, const time_t timeout);
|
||||
ssize_t upscli_sendline(UPSCONN_t *ups, const char *buf, size_t buflen);
|
||||
|
||||
int upscli_readline(UPSCONN_t *ups, char *buf, size_t buflen);
|
||||
ssize_t upscli_readline_timeout(UPSCONN_t *ups, char *buf, size_t buflen, const time_t timeout);
|
||||
ssize_t upscli_readline(UPSCONN_t *ups, char *buf, size_t buflen);
|
||||
|
||||
int upscli_splitname(const char *buf, char **upsname, char **hostname,
|
||||
int *port);
|
||||
uint16_t *port);
|
||||
|
||||
int upscli_splitaddr(const char *buf, char **hostname, int *port);
|
||||
int upscli_splitaddr(const char *buf, char **hostname, uint16_t *port);
|
||||
|
||||
int upscli_disconnect(UPSCONN_t *ups);
|
||||
|
||||
|
@ -103,7 +118,7 @@ int upscli_fd(UPSCONN_t *ups);
|
|||
int upscli_upserror(UPSCONN_t *ups);
|
||||
|
||||
/* returns 1 if SSL mode is active for this connection */
|
||||
int upscli_ssl(UPSCONN_t *ups);
|
||||
int upscli_ssl(UPSCONN_t *ups);
|
||||
|
||||
/* upsclient error list */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue