yumapro  24.10-2
YumaPro SDK
Loading...
Searching...
No Matches
agt_ypgrpc.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2021, YumaWorks, Inc., All Rights Reserved.
3 *
4 * Unless required by applicable law or agreed to in writing,
5 * software distributed under the License is distributed on an
6 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7 * KIND, either express or implied. See the License for the
8 * specific language governing permissions and limitations
9 * under the License.
10 */
11#ifdef WITH_GRPC
12#ifndef _H_agt_ypgrpc
13#define _H_agt_ypgrpc
14
15/* FILE: agt_ypgrpc.h
16*********************************************************************
17* *
18* P U R P O S E *
19* *
20*********************************************************************/
21
28/********************************************************************
29* *
30* C H A N G E H I S T O R Y *
31* *
32*********************************************************************
33
34date init comment
35----------------------------------------------------------------------
3617Sep21 am begin
37*/
38
39#ifndef _H_agt
40#include "agt.h"
41#endif
42
43#ifndef _H_agt_cfg
44#include "agt_cfg.h"
45#endif
46
47#ifndef _H_ncxtypes
48#include "ncxtypes.h"
49#endif
50
51#ifndef _H_dlq
52#include "dlq.h"
53#endif
54
55#ifndef _H_status
56#include "status.h"
57#endif
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
63/********************************************************************
64* *
65* C O N S T A N T S *
66* *
67*********************************************************************/
68
69#define YPGRPC_SERVER_NAME (const xmlChar *)"server-name"
70
71
72/********************************************************************
73* *
74* T Y P E S *
75* *
76*********************************************************************/
77
79typedef struct agt_ypgrpc_stats_t_ {
82
85
88
92
93
95typedef struct agt_ypgrpc_server_t_ {
97 dlq_hdr_t qhdr;
98
101
103 xmlChar *server_name;
104
107
110
113
117
118
120typedef struct agt_ypgrpc_stream_t_ {
122 dlq_hdr_t qhdr;
123
125 xmlChar *server_name;
126
128 xmlChar *name;
129
131 xmlChar *sttime;
132
136 xmlChar *location;
137
143
144
145/********************************************************************
146* *
147* F U N C T I O N S *
148* *
149*********************************************************************/
150
151
152
171extern status_t
172 agt_ypgrpc_init (void);
173
174
180extern void
181 agt_ypgrpc_cleanup (void);
182
183
191extern status_t
192 agt_ypgrpc_delete_server (const xmlChar *name);
193
194
203extern status_t
204 agt_ypgrpc_delete_streams (const xmlChar *name);
205
206
212extern agt_ypgrpc_server_t *
214
215
223extern agt_ypgrpc_server_t *
225
226
234extern agt_ypgrpc_server_t *
235 agt_ypgrpc_get_server (const xmlChar *name);
236
237
243extern agt_ypgrpc_stream_t *
245
246
254extern agt_ypgrpc_stream_t *
256
257
268extern boolean
270
271
282extern boolean
284
285
291extern agt_ypgrpc_stats_t *
293
294
298#ifdef __cplusplus
299} /* end extern 'C' */
300#endif
301
302#endif /* _H_agt_ypgrpc */
303#endif // WITH_GRPC
Multi-Protocol Network Management Server.
Manage Server configuration edit transactions.
dlq provides general double-linked list and queue support:
boolean agt_ypgrpc_has_server_stream(void)
Check if there are any Server streams available.
Definition: agt_ypgrpc.c:1458
boolean agt_ypgrpc_has_client_stream(void)
Check if there are any client streams available.
Definition: agt_ypgrpc.c:1488
status_t agt_ypgrpc_init(void)
Initialize the YP-GRPC subsysystem handler.
Definition: agt_ypgrpc.c:1184
void agt_ypgrpc_cleanup(void)
Cleanup the YP-GRPC Module.
Definition: agt_ypgrpc.c:1236
status_t agt_ypgrpc_delete_streams(const xmlChar *name)
Delete server and client streams associated with this gRPC server.
Definition: agt_ypgrpc.c:1301
status_t agt_ypgrpc_delete_server(const xmlChar *name)
Delete an existing server entry.
Definition: agt_ypgrpc.c:1274
agt_ypgrpc_stream_t * agt_ypgrpc_get_next_stream(const agt_ypgrpc_stream_t *entry)
Get the next server or client entry in streamQ.
Definition: agt_ypgrpc.c:1430
agt_ypgrpc_stats_t * agt_ypgrpc_get_total_stats(void)
Get a r/w pointer to the the totals stats.
Definition: agt_ypgrpc.c:1514
agt_ypgrpc_server_t * agt_ypgrpc_get_server(const xmlChar *name)
Get a specific gRPC server by name.
Definition: agt_ypgrpc.c:1380
agt_ypgrpc_stream_t * agt_ypgrpc_get_first_stream(void)
Get the first server or client stream entry in streamQ.
Definition: agt_ypgrpc.c:1402
agt_ypgrpc_server_t * agt_ypgrpc_get_next_server(const agt_ypgrpc_server_t *server_entry)
Get the next serverentry in serverQ.
Definition: agt_ypgrpc.c:1354
agt_ypgrpc_server_t * agt_ypgrpc_get_first_server(void)
Get the first server entry in serverQ.
Definition: agt_ypgrpc.c:1326
status_t
global error return code
Definition: status_enum.h:210
YANG module data structures Many internal representations of YANG module constructs.
Global error messages for status code enumerations.
gRPC Server Control block struct
Definition: agt_ypgrpc.h:95
dlq_hdr_t qhdr
in case added to a queue
Definition: agt_ypgrpc.h:97
xmlChar * server_name
gRPC Server name (aka subsystem name)
Definition: agt_ypgrpc.h:103
xmlChar * server_sttime
gRPC Server Start Time value
Definition: agt_ypgrpc.h:112
agt_ypgrpc_stats_t stats
gRPC Statistic information about Streams for this server
Definition: agt_ypgrpc.h:115
val_value_t * server_val
gRPC Server val_value tree from the subsystem
Definition: agt_ypgrpc.h:100
xmlChar * server_address
gRPC Server Adress
Definition: agt_ypgrpc.h:106
uint16 server_port
gRPC Server Port
Definition: agt_ypgrpc.h:109
Streams Statistics.
Definition: agt_ypgrpc.h:79
uint32 active_server_streams
total active server streams
Definition: agt_ypgrpc.h:81
uint32 total_closed_streams
total closed streams
Definition: agt_ypgrpc.h:90
uint32 active_client_streams
total active client streams
Definition: agt_ypgrpc.h:84
uint32 total_active_streams
total active streams
Definition: agt_ypgrpc.h:87
gRPC Server and Client Streams Control block struct
Definition: agt_ypgrpc.h:120
boolean server_stream
TRUE if current stream if a server stream; FALSE for client stream.
Definition: agt_ypgrpc.h:141
xmlChar * name
Name of a client or server stream.
Definition: agt_ypgrpc.h:128
xmlChar * location
Contains a URL that represents the RPC that uses this client or server stream.
Definition: agt_ypgrpc.h:136
dlq_hdr_t qhdr
in case added to a queue
Definition: agt_ypgrpc.h:122
xmlChar * sttime
Indicates the time the client or server stream was created.
Definition: agt_ypgrpc.h:131
xmlChar * server_name
RPC Server name (aka subsystem name)
Definition: agt_ypgrpc.h:125
one value to match one type
Definition: val.h:912