Imported Upstream version 2.7.1
This commit is contained in:
parent
a1fa151fc7
commit
0121794af9
451 changed files with 41339 additions and 10887 deletions
|
|
@ -20,10 +20,13 @@
|
|||
#ifndef UPSCLIENT_H_SEEN
|
||||
#define UPSCLIENT_H_SEEN
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
#include <openssl/err.h>
|
||||
#include <openssl/ssl.h>
|
||||
#endif
|
||||
#ifdef WITH_OPENSSL
|
||||
#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 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
|
|
@ -49,13 +52,13 @@ typedef struct {
|
|||
|
||||
char errbuf[UPSCLI_ERRBUF_LEN];
|
||||
|
||||
#ifdef HAVE_SSL
|
||||
SSL_CTX *ssl_ctx;
|
||||
#ifdef WITH_OPENSSL
|
||||
SSL *ssl;
|
||||
#else
|
||||
void *ssl_ctx;
|
||||
void *ssl;
|
||||
#endif
|
||||
#elif defined(WITH_NSS) /* WITH_OPENSSL */
|
||||
PRFileDesc *ssl;
|
||||
#else /* WITH_OPENSSL | WITH_NSS */
|
||||
void *ssl;
|
||||
#endif /* WITH_OPENSSL | WITH_NSS */
|
||||
|
||||
char readbuf[64];
|
||||
size_t readlen;
|
||||
|
|
@ -65,10 +68,14 @@ typedef struct {
|
|||
|
||||
const char *upscli_strerror(UPSCONN_t *ups);
|
||||
|
||||
int upscli_tryconnect(UPSCONN_t *ups, const char *host, int port, int flags, struct timeval *tv);
|
||||
int upscli_init(int certverify, const char *certpath, const char *certname, const char *certpasswd);
|
||||
int upscli_cleanup();
|
||||
|
||||
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);
|
||||
|
||||
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,
|
||||
|
|
@ -88,8 +95,6 @@ int upscli_splitname(const char *buf, char **upsname, char **hostname,
|
|||
|
||||
int upscli_splitaddr(const char *buf, char **hostname, int *port);
|
||||
|
||||
int upscli_sslcert(UPSCONN_t *ups, const char *file, const char *path, int verify);
|
||||
|
||||
int upscli_disconnect(UPSCONN_t *ups);
|
||||
|
||||
/* these functions return elements from UPSCONN_t to avoid direct references */
|
||||
|
|
@ -156,10 +161,11 @@ int upscli_ssl(UPSCONN_t *ups);
|
|||
|
||||
/* flags for use with upscli_connect */
|
||||
|
||||
#define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */
|
||||
#define UPSCLI_CONN_REQSSL 0x0002 /* try SSL, fail if not supported */
|
||||
#define UPSCLI_CONN_INET 0x0004 /* IPv4 only */
|
||||
#define UPSCLI_CONN_INET6 0x0008 /* IPv6 only */
|
||||
#define UPSCLI_CONN_TRYSSL 0x0001 /* try SSL, OK if not supported */
|
||||
#define UPSCLI_CONN_REQSSL 0x0002 /* try SSL, fail if not supported */
|
||||
#define UPSCLI_CONN_INET 0x0004 /* IPv4 only */
|
||||
#define UPSCLI_CONN_INET6 0x0008 /* IPv6 only */
|
||||
#define UPSCLI_CONN_CERTVERIF 0x0010 /* Verify certificates for SSL */
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* *INDENT-OFF* */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue