Files: Rearranged backend .h files: moved client_entry to clixon_backend_client.h

This commit is contained in:
Olof hagsand 2023-02-26 16:09:53 +01:00
parent d6c523d27a
commit 5f2978d06c
14 changed files with 46 additions and 39 deletions

View file

@ -65,7 +65,7 @@
/* clicon */
#include <clixon/clixon.h>
#include "clixon_backend_handle.h"
#include "clixon_backend_client.h"
#include "clixon_backend_plugin.h"
#include "clixon_backend_commit.h"
#include "backend_handle.h"

View file

@ -37,34 +37,6 @@
#ifndef _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
*/

View file

@ -67,6 +67,7 @@
#include "clixon_backend_transaction.h"
#include "clixon_backend_plugin.h"
#include "clixon_backend_client.h"
#include "backend_handle.h"
#include "clixon_backend_commit.h"
#include "backend_client.h"

View file

@ -67,6 +67,7 @@
#include "clixon_backend_transaction.h"
#include "clixon_backend_plugin.h"
#include "clixon_backend_client.h"
#include "backend_handle.h"
#include "clixon_backend_commit.h"
#include "backend_client.h"

View file

@ -66,7 +66,7 @@
/* clicon */
#include <clixon/clixon.h>
#include "clixon_backend_handle.h"
#include "clixon_backend_client.h"
#include "clixon_backend_plugin.h"
#include "clixon_backend_commit.h"
#include "backend_client.h"

View file

@ -43,7 +43,6 @@
* Prototypes
* not exported.
*/
/* backend handles. Defined in clixon_backend_handle.c */
clicon_handle backend_handle_init(void);
int backend_handle_exit(clicon_handle h);

View file

@ -71,6 +71,7 @@
#include "clixon_backend_transaction.h"
#include "backend_socket.h"
#include "clixon_backend_client.h"
#include "backend_client.h"
#include "clixon_backend_plugin.h"
#include "clixon_backend_commit.h"

View file

@ -72,6 +72,7 @@
#include <clixon/clixon.h>
#include "backend_socket.h"
#include "clixon_backend_client.h"
#include "backend_client.h"
#include "backend_handle.h"

View file

@ -50,7 +50,7 @@ extern "C" {
*/
/* 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_commit.h>
#include <clixon/clixon_backend_plugin.h>

View file

@ -39,15 +39,39 @@
* Internal code should include this
*/
#ifndef _CLIXON_BACKEND_HANDLE_H_
#define _CLIXON_BACKEND_HANDLE_H_
#ifndef _CLIXON_BACKEND_CLIENT_H_
#define _CLIXON_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
*/
#endif /* _CLIXON_BACKEND_HANDLE_H_ */
#endif /* _CLIXON_BACKEND_CLIENT_H_ */

View file

@ -61,7 +61,7 @@
/* clicon */
#include <clixon/clixon.h>
#include "clixon_backend_handle.h"
#include "clixon_backend_client.h"
#include "backend_client.h"
#include "backend_handle.h"