grpc in shape
This commit is contained in:
parent
5ead099d0b
commit
b711faade9
4 changed files with 30 additions and 27 deletions
|
|
@ -452,6 +452,7 @@ text_modify(clicon_handle h,
|
|||
* Check if namespace exists in x0 parent
|
||||
* if not add new binding and replace in x0.
|
||||
* See also xmlns copying of attributes in the body section below
|
||||
* Note that this may add "unnecessary" namespace declarations
|
||||
*/
|
||||
if (assign_namespace_element(x1, x0, x0p) < 0)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -86,14 +86,17 @@ APPSRC += clixon_util_xpath.c
|
|||
APPSRC += clixon_util_path.c
|
||||
APPSRC += clixon_util_datastore.c
|
||||
APPSRC += clixon_util_regexp.c
|
||||
ifdef with_restconf
|
||||
APPSRC += clixon_util_stream.c # Needs curl
|
||||
endif
|
||||
APPSRC += clixon_util_socket.c
|
||||
APPSRC += clixon_netconf_ssh_callhome.c
|
||||
APPSRC += clixon_netconf_ssh_callhome_client.c
|
||||
#APPSRC += clixon_util_ssl.c
|
||||
#APPSRC += clixon_util_grpc.c
|
||||
ifdef with_restconf
|
||||
APPSRC += clixon_util_stream.c # Needs curl
|
||||
endif
|
||||
ifdef with_http2
|
||||
APPSRC += clixon_util_ssl.c # requires http/2
|
||||
#APPSRC += clixon_util_grpc.c # work in progress
|
||||
endif
|
||||
|
||||
|
||||
APPS = $(APPSRC:.c=)
|
||||
|
||||
|
|
@ -132,19 +135,19 @@ clixon_util_xml_mod: clixon_util_xml_mod.c $(LIBDEPS)
|
|||
clixon_util_regexp: clixon_util_regexp.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) -I /usr/include/libxml2 $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
ifdef with_restconf
|
||||
clixon_util_stream: clixon_util_stream.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@
|
||||
endif
|
||||
|
||||
clixon_util_socket: clixon_util_socket.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
#clixon_util_ssl: clixon_util_ssl.c $(LIBDEPS)
|
||||
# $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lnghttp2 -lssl -lcrypto -o $@
|
||||
ifdef with_restconf
|
||||
clixon_util_stream: clixon_util_stream.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lcurl -o $@
|
||||
|
||||
#clixon_util_grpc: clixon_util_grpc.c $(LIBDEPS)
|
||||
# $(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -lnghttp2 -lssl -lcrypto -o $@
|
||||
clixon_util_ssl: clixon_util_ssl.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
clixon_util_grpc: clixon_util_grpc.c $(LIBDEPS)
|
||||
$(CC) $(INCLUDES) $(CPPFLAGS) @CFLAGS@ $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
endif
|
||||
|
||||
distclean: clean
|
||||
rm -f Makefile *~ .depend
|
||||
|
|
|
|||
|
|
@ -33,14 +33,11 @@
|
|||
|
||||
***** END LICENSE BLOCK *****
|
||||
|
||||
* XML support functions.
|
||||
* @see https://www.w3.org/TR/2008/REC-xml-20081126
|
||||
* https://www.w3.org/TR/2009/REC-xml-names-20091208
|
||||
* The function can do yang validation, process xml and json, etc.
|
||||
* On success, nothing is printed and exitcode 0
|
||||
* On failure, an error is printed on stderr and exitcode != 0
|
||||
* Failure error prints are different, it would be nice to make them more
|
||||
* uniform. (see clixon_netconf_error)
|
||||
*
|
||||
* HTTP2 + OPENSSL client integrated with clixon events
|
||||
* Ubuntu package:
|
||||
* apt install libnghttp2-dev
|
||||
* Example run: clixon_util_ssl -H nghttp2.org
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
|
|
@ -130,7 +127,7 @@ send_callback(nghttp2_session *session,
|
|||
int ret;
|
||||
|
||||
|
||||
clicon_debug(1, "%s %d:", __FUNCTION__, length);
|
||||
clicon_debug(1, "%s %zu:", __FUNCTION__, length);
|
||||
#if 0
|
||||
{
|
||||
int i;
|
||||
|
|
@ -481,6 +478,7 @@ main(int argc,
|
|||
int ret;
|
||||
nghttp2_session *session = NULL;
|
||||
session_data *sd = NULL;
|
||||
int dbg = 0;
|
||||
|
||||
/* In the startup, logs to stderr & debug flag set later */
|
||||
clicon_log_init(__FILE__, LOG_INFO, CLICON_LOG_STDERR);
|
||||
|
|
@ -493,7 +491,7 @@ main(int argc,
|
|||
usage(argv[0]);
|
||||
break;
|
||||
case 'D':
|
||||
if (sscanf(optarg, "%d", &debug) != 1)
|
||||
if (sscanf(optarg, "%d", &dbg) != 1)
|
||||
usage(argv[0]);
|
||||
break;
|
||||
case 'H': /* hostname */
|
||||
|
|
@ -507,6 +505,7 @@ main(int argc,
|
|||
fprintf(stderr, "-H <hostname> is mandatory\n");
|
||||
usage(argv[0]);
|
||||
}
|
||||
clicon_debug_init(dbg, NULL);
|
||||
SSL_library_init();
|
||||
if ((ctx = InitCTX()) == NULL)
|
||||
goto done;
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@
|
|||
|
||||
***** END LICENSE BLOCK *****
|
||||
|
||||
*
|
||||
* HTTP2 + OPENSSL client integrated with clixon events
|
||||
* Actually HTTP2 + OPENSSL client integrated with clixon events
|
||||
* Ubuntu package:
|
||||
* apt install libnghttp2-dev
|
||||
* Example run: clixon_util_ssl -H nghttp2.org
|
||||
|
|
@ -54,9 +53,10 @@
|
|||
#include <arpa/inet.h> /* inet_pton */
|
||||
#include <netinet/tcp.h> /* TCP_NODELAY */
|
||||
|
||||
|
||||
#include <openssl/ssl.h>
|
||||
#ifdef HAVE_LIBNGHTTP2
|
||||
#include <nghttp2/nghttp2.h>
|
||||
#endif
|
||||
|
||||
/* cligen */
|
||||
#include <cligen/cligen.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue