Files: Rearranged backend .h files: moved client_entry to clixon_backend_client.h
This commit is contained in:
parent
d6c523d27a
commit
5f2978d06c
14 changed files with 46 additions and 39 deletions
|
|
@ -42,9 +42,17 @@
|
||||||
## 6.2.0
|
## 6.2.0
|
||||||
Expected: April 2023
|
Expected: April 2023
|
||||||
|
|
||||||
|
### C/CLI-API changes on existing features
|
||||||
|
Developers may need to change their code
|
||||||
|
|
||||||
* C-API
|
* C-API
|
||||||
|
* Renamed include file: `clixon_backend_handle.h`to `clixon_backend_client.h`
|
||||||
* `candidate_commit()`: validate_level (added in 6.1) marked obsolete
|
* `candidate_commit()`: validate_level (added in 6.1) marked obsolete
|
||||||
|
|
||||||
|
### Minor features
|
||||||
|
|
||||||
|
* Fixed: [Add support decimal64 for SNMP](https://github.com/clicon/clixon/pull/422)
|
||||||
|
|
||||||
## 6.1.0
|
## 6.1.0
|
||||||
19 Feb 2023
|
19 Feb 2023
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,7 @@
|
||||||
/* clicon */
|
/* clicon */
|
||||||
#include <clixon/clixon.h>
|
#include <clixon/clixon.h>
|
||||||
|
|
||||||
#include "clixon_backend_handle.h"
|
#include "clixon_backend_client.h"
|
||||||
#include "clixon_backend_plugin.h"
|
#include "clixon_backend_plugin.h"
|
||||||
#include "clixon_backend_commit.h"
|
#include "clixon_backend_commit.h"
|
||||||
#include "backend_handle.h"
|
#include "backend_handle.h"
|
||||||
|
|
|
||||||
|
|
@ -37,34 +37,6 @@
|
||||||
#ifndef _BACKEND_CLIENT_H_
|
#ifndef _BACKEND_CLIENT_H_
|
||||||
#define _BACKEND_CLIENT_H_
|
#define _BACKEND_CLIENT_H_
|
||||||
|
|
||||||
/*
|
|
||||||
* Types
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
* Backend client entry.
|
|
||||||
* Keep state about every connected client.
|
|
||||||
* References from RFC 6022, ietf-netconf-monitoring.yang sessions container
|
|
||||||
*/
|
|
||||||
struct client_entry{
|
|
||||||
struct client_entry *ce_next; /* The clients linked list */
|
|
||||||
struct sockaddr ce_addr; /* The clients (UNIX domain) address */
|
|
||||||
int ce_s; /* stream socket to client */
|
|
||||||
int ce_nr; /* Client number (for dbg/tracing) */
|
|
||||||
uint32_t ce_id; /* Session id, accessor functions: clicon_session_id_get/set */
|
|
||||||
char *ce_username;/* Translated from peer user cred */
|
|
||||||
clicon_handle ce_handle; /* clicon config handle (all clients have same?) */
|
|
||||||
char *ce_transport; /* Identifies the transport for each session.
|
|
||||||
Clixon-lib.yang extends these values by prefixing with
|
|
||||||
"cl:", where cl is ensured to be declared ie by
|
|
||||||
netconf-monitoring state */
|
|
||||||
char *ce_source_host; /* Host identifier of the NETCONF client */
|
|
||||||
struct timeval ce_time; /* Time at the server at which the session was established. */
|
|
||||||
uint32_t ce_in_rpcs ; /* Number of correct <rpc> messages received. */
|
|
||||||
uint32_t ce_in_bad_rpcs; /* Not correct <rpc> messages */
|
|
||||||
uint32_t ce_out_rpc_errors; /* <rpc-error> messages*/
|
|
||||||
uint32_t ce_out_notifications; /* Outgoing notifications */
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prototypes
|
* Prototypes
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
#include "clixon_backend_transaction.h"
|
#include "clixon_backend_transaction.h"
|
||||||
#include "clixon_backend_plugin.h"
|
#include "clixon_backend_plugin.h"
|
||||||
|
#include "clixon_backend_client.h"
|
||||||
#include "backend_handle.h"
|
#include "backend_handle.h"
|
||||||
#include "clixon_backend_commit.h"
|
#include "clixon_backend_commit.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
|
|
|
||||||
|
|
@ -67,6 +67,7 @@
|
||||||
|
|
||||||
#include "clixon_backend_transaction.h"
|
#include "clixon_backend_transaction.h"
|
||||||
#include "clixon_backend_plugin.h"
|
#include "clixon_backend_plugin.h"
|
||||||
|
#include "clixon_backend_client.h"
|
||||||
#include "backend_handle.h"
|
#include "backend_handle.h"
|
||||||
#include "clixon_backend_commit.h"
|
#include "clixon_backend_commit.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@
|
||||||
/* clicon */
|
/* clicon */
|
||||||
#include <clixon/clixon.h>
|
#include <clixon/clixon.h>
|
||||||
|
|
||||||
#include "clixon_backend_handle.h"
|
#include "clixon_backend_client.h"
|
||||||
#include "clixon_backend_plugin.h"
|
#include "clixon_backend_plugin.h"
|
||||||
#include "clixon_backend_commit.h"
|
#include "clixon_backend_commit.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@
|
||||||
* Prototypes
|
* Prototypes
|
||||||
* not exported.
|
* not exported.
|
||||||
*/
|
*/
|
||||||
/* backend handles. Defined in clixon_backend_handle.c */
|
|
||||||
clicon_handle backend_handle_init(void);
|
clicon_handle backend_handle_init(void);
|
||||||
|
|
||||||
int backend_handle_exit(clicon_handle h);
|
int backend_handle_exit(clicon_handle h);
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@
|
||||||
|
|
||||||
#include "clixon_backend_transaction.h"
|
#include "clixon_backend_transaction.h"
|
||||||
#include "backend_socket.h"
|
#include "backend_socket.h"
|
||||||
|
#include "clixon_backend_client.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
#include "clixon_backend_plugin.h"
|
#include "clixon_backend_plugin.h"
|
||||||
#include "clixon_backend_commit.h"
|
#include "clixon_backend_commit.h"
|
||||||
|
|
|
||||||
|
|
@ -72,6 +72,7 @@
|
||||||
#include <clixon/clixon.h>
|
#include <clixon/clixon.h>
|
||||||
|
|
||||||
#include "backend_socket.h"
|
#include "backend_socket.h"
|
||||||
|
#include "clixon_backend_client.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
#include "backend_handle.h"
|
#include "backend_handle.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,7 +50,7 @@ extern "C" {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Common code (API and Backend daemon) */
|
/* Common code (API and Backend daemon) */
|
||||||
#include <clixon/clixon_backend_handle.h>
|
#include <clixon/clixon_backend_client.h>
|
||||||
#include <clixon/clixon_backend_transaction.h>
|
#include <clixon/clixon_backend_transaction.h>
|
||||||
#include <clixon/clixon_backend_commit.h>
|
#include <clixon/clixon_backend_commit.h>
|
||||||
#include <clixon/clixon_backend_plugin.h>
|
#include <clixon/clixon_backend_plugin.h>
|
||||||
|
|
|
||||||
|
|
@ -39,15 +39,39 @@
|
||||||
* Internal code should include this
|
* Internal code should include this
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef _CLIXON_BACKEND_HANDLE_H_
|
#ifndef _CLIXON_BACKEND_CLIENT_H_
|
||||||
#define _CLIXON_BACKEND_HANDLE_H_
|
#define _CLIXON_BACKEND_CLIENT_H_
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Types
|
* Types
|
||||||
*/
|
*/
|
||||||
|
/* Backend client entry.
|
||||||
|
* Keep state about every connected client.
|
||||||
|
* References from RFC 6022, ietf-netconf-monitoring.yang sessions container
|
||||||
|
*/
|
||||||
|
struct client_entry{
|
||||||
|
struct client_entry *ce_next; /* The clients linked list */
|
||||||
|
struct sockaddr ce_addr; /* The clients (UNIX domain) address */
|
||||||
|
int ce_s; /* Stream socket to client */
|
||||||
|
int ce_nr; /* Client number (for dbg/tracing) */
|
||||||
|
uint32_t ce_id; /* Session id, accessor functions: clicon_session_id_get/set */
|
||||||
|
char *ce_username;/* Translated from peer user cred */
|
||||||
|
clicon_handle ce_handle; /* clicon config handle (all clients have same?) */
|
||||||
|
char *ce_transport; /* Identifies the transport for each session.
|
||||||
|
Clixon-lib.yang extends these values by prefixing with
|
||||||
|
"cl:", where cl is ensured to be declared ie by
|
||||||
|
netconf-monitoring state */
|
||||||
|
char *ce_source_host; /* Host identifier of the NETCONF client */
|
||||||
|
struct timeval ce_time; /* Time at the server at which the session was established. */
|
||||||
|
uint32_t ce_in_rpcs ; /* Number of correct <rpc> messages received. */
|
||||||
|
uint32_t ce_in_bad_rpcs; /* Not correct <rpc> messages */
|
||||||
|
uint32_t ce_out_rpc_errors; /* <rpc-error> messages*/
|
||||||
|
uint32_t ce_out_notifications; /* Outgoing notifications */
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prototypes
|
* Prototypes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#endif /* _CLIXON_BACKEND_HANDLE_H_ */
|
#endif /* _CLIXON_BACKEND_CLIENT_H_ */
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
/* clicon */
|
/* clicon */
|
||||||
#include <clixon/clixon.h>
|
#include <clixon/clixon.h>
|
||||||
|
|
||||||
#include "clixon_backend_handle.h"
|
#include "clixon_backend_client.h"
|
||||||
#include "backend_client.h"
|
#include "backend_client.h"
|
||||||
#include "backend_handle.h"
|
#include "backend_handle.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1131,9 +1131,9 @@ static int
|
||||||
cli_notification_cb(int s,
|
cli_notification_cb(int s,
|
||||||
void *arg)
|
void *arg)
|
||||||
{
|
{
|
||||||
|
int retval = -1;
|
||||||
struct clicon_msg *reply = NULL;
|
struct clicon_msg *reply = NULL;
|
||||||
int eof;
|
int eof;
|
||||||
int retval = -1;
|
|
||||||
cxobj *xt = NULL;
|
cxobj *xt = NULL;
|
||||||
enum format_enum format = (enum format_enum)arg;
|
enum format_enum format = (enum format_enum)arg;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
|
||||||
|
|
@ -136,7 +136,7 @@ clicon_data_del(clicon_handle h,
|
||||||
/*! Get generic clixon data on the form <name>=<ptr> where <ptr> is void*
|
/*! Get generic clixon data on the form <name>=<ptr> where <ptr> is void*
|
||||||
* @param[in] h Clicon handle
|
* @param[in] h Clicon handle
|
||||||
* @param[in] name Data name
|
* @param[in] name Data name
|
||||||
* @param[out] val Data value as string
|
* @param[out] ptr Pointer
|
||||||
* @retval 0 OK
|
* @retval 0 OK
|
||||||
* @retval -1 Not found (or error)
|
* @retval -1 Not found (or error)
|
||||||
* @see clicon_option_str
|
* @see clicon_option_str
|
||||||
|
|
@ -162,7 +162,7 @@ clicon_ptr_get(clicon_handle h,
|
||||||
/*! Set generic clixon data on the form <name>=<ptr> where <ptr> is void*
|
/*! Set generic clixon data on the form <name>=<ptr> where <ptr> is void*
|
||||||
* @param[in] h Clicon handle
|
* @param[in] h Clicon handle
|
||||||
* @param[in] name Data name
|
* @param[in] name Data name
|
||||||
* @param[in] val Data value as null-terminated string
|
* @param[in] ptr Pointer
|
||||||
* @retval 0 OK
|
* @retval 0 OK
|
||||||
* @retval -1 Error
|
* @retval -1 Error
|
||||||
* @see clicon_option_str_set
|
* @see clicon_option_str_set
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue