yumapro  21.10T-8
YumaPro SDK
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 
34 date init comment
35 ----------------------------------------------------------------------
36 17Sep21 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
60 extern "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 
79 typedef struct agt_ypgrpc_stats_t_ {
82 
85 
88 
92 
93 
95 typedef struct agt_ypgrpc_server_t_ {
97  dlq_hdr_t qhdr;
98 
101 
103  xmlChar *server_name;
104 
106  xmlChar *server_address;
107 
109  uint16 server_port;
110 
112  xmlChar *server_sttime;
113 
117 
118 
120 typedef 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 
141  boolean server_stream;
143 
144 
145 /********************************************************************
146 * *
147 * F U N C T I O N S *
148 * *
149 *********************************************************************/
150 
151 
152 
171 extern status_t
172  agt_ypgrpc_init (void);
173 
174 
180 extern void
181  agt_ypgrpc_cleanup (void);
182 
183 
191 extern status_t
192  agt_ypgrpc_delete_server (const xmlChar *name);
193 
194 
203 extern status_t
204  agt_ypgrpc_delete_streams (const xmlChar *name);
205 
206 
212 extern agt_ypgrpc_server_t *
214 
215 
223 extern agt_ypgrpc_server_t *
224  agt_ypgrpc_get_next_server (const agt_ypgrpc_server_t *server_entry);
225 
226 
234 extern agt_ypgrpc_server_t *
235  agt_ypgrpc_get_server (const xmlChar *name);
236 
237 
243 extern agt_ypgrpc_stream_t *
245 
246 
254 extern agt_ypgrpc_stream_t *
256 
257 
268 extern boolean
270 
271 
282 extern boolean
284 
285 
291 extern 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
status_t agt_ypgrpc_init(void)
Initialize the YP-GRPC subsysystem handler.
Definition: agt_ypgrpc.c:1182
gRPC Server Control block struct
Definition: agt_ypgrpc.h:95
Streams Statistics.
Definition: agt_ypgrpc.h:79
uint32 active_server_streams
total active server streams
Definition: agt_ypgrpc.h:81
dlq provides general double-linked list and queue support:
xmlChar * server_name
gRPC Server name (aka subsystem name)
Definition: agt_ypgrpc.h:103
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:1348
xmlChar * server_name
RPC Server name (aka subsystem name)
Definition: agt_ypgrpc.h:125
boolean agt_ypgrpc_has_server_stream(void)
Check if there are any Server streams available.
Definition: agt_ypgrpc.c:1448
agt_ypgrpc_stats_t * agt_ypgrpc_get_total_stats(void)
Get a r/w pointer to the the totals stats.
Definition: agt_ypgrpc.c:1504
agt_ypgrpc_stats_t stats
gRPC Statistic information about Streams for this server
Definition: agt_ypgrpc.h:115
xmlChar * server_sttime
gRPC Server Start Time value
Definition: agt_ypgrpc.h:112
agt_ypgrpc_server_t * agt_ypgrpc_get_server(const xmlChar *name)
Get a specific gRPC server by name.
Definition: agt_ypgrpc.c:1372
gRPC Server and Client Streams Control block struct
Definition: agt_ypgrpc.h:120
xmlChar * location
Contains a URL that represents the RPC that uses this client or server stream.
Definition: agt_ypgrpc.h:136
uint32 total_closed_streams
total closed streams
Definition: agt_ypgrpc.h:90
boolean agt_ypgrpc_has_client_stream(void)
Check if there are any client streams available.
Definition: agt_ypgrpc.c:1478
val_value_t * server_val
gRPC Server val_value tree from the subsystem
Definition: agt_ypgrpc.h:100
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:1422
YANG module data structures Many internal representations of YANG module constructs.
xmlChar * server_address
gRPC Server Adress
Definition: agt_ypgrpc.h:106
uint32 total_active_streams
total active streams
Definition: agt_ypgrpc.h:87
agt_ypgrpc_stream_t * agt_ypgrpc_get_first_stream(void)
Get the first server or client stream entry in streamQ.
Definition: agt_ypgrpc.c:1394
Manage Server configuration edit transactions.
uint16 server_port
gRPC Server Port
Definition: agt_ypgrpc.h:109
one value to match one type
Definition: val.h:870
status_t
global error return code
Definition: status_enum.h:186
Multi-Protocol Network Management Server.
void agt_ypgrpc_cleanup(void)
Cleanup the YP-GRPC Module.
Definition: agt_ypgrpc.c:1234
uint32 active_client_streams
total active client streams
Definition: agt_ypgrpc.h:84
status_t agt_ypgrpc_delete_streams(const xmlChar *name)
Delete server and client streams associated with this gRPC server.
Definition: agt_ypgrpc.c:1297
Global error messages for status code enumerations.
agt_ypgrpc_server_t * agt_ypgrpc_get_first_server(void)
Get the first server entry in serverQ.
Definition: agt_ypgrpc.c:1320
status_t agt_ypgrpc_delete_server(const xmlChar *name)
Delete an existing server entry.
Definition: agt_ypgrpc.c:1272
xmlChar * sttime
Indicates the time the client or server stream was created.
Definition: agt_ypgrpc.h:131
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