yumapro  23.10T-7
YumaPro SDK
Loading...
Searching...
No Matches
agt_callhome.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 - 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_CALLHOME
12#ifndef _H_agt_callhome
13#define _H_agt_callhome
14
15/* FILE: agt_callhome
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----------------------------------------------------------------------
3615-jan-17 abb Begun
37*/
38
39#include <xmlstring.h>
40#include <unistd.h>
41
42#ifndef _H_agt
43#include "agt.h"
44#endif
45
46#ifndef _H_dlq
47#include "dlq.h"
48#endif
49
50#ifndef _H_status_enum
51#include "status_enum.h"
52#endif
53
54#ifndef _H_ses
55#include "ses.h"
56#endif
57
58#ifdef __cplusplus
59extern "C" {
60#endif
61
62/********************************************************************
63* *
64* C O N S T A N T S *
65* *
66*********************************************************************/
67
68/********************************************************************
69* *
70* T Y P E S *
71* *
72*********************************************************************/
73
87typedef struct agt_callhome_cb_t_ {
89 dlq_hdr_t qhdr;
90
92 const xmlChar *ch_sshd_path;
93
95 const xmlChar *ch_subsys_path;
96
98 xmlChar *ch_name;
99
102
105
108
111
114
117
120
122 boolean ch_enabled;
123
126
129
131 boolean ch_from_cli;
132
135
138
140 pid_t ch_pid;
142
143
144/********************************************************************
145* *
146* F U N C T I O N S *
147* *
148*********************************************************************/
149
150
156extern status_t
157 agt_callhome_init (void);
158
159
165extern status_t
167
168
174extern status_t
175 agt_callhome_init2 (void);
176
177
183extern void
185
186
193extern boolean
194 agt_callhome_connecting (const xmlChar *addr);
195
196
209extern status_t
210 agt_callhome_add_server_cli (const xmlChar *valstr,
211 agt_ch_proto_t ch_proto);
212
213
228extern status_t
229 agt_callhome_add_server (const xmlChar *ch_name,
230 const xmlChar *ch_addr,
231 uint16 ch_port,
232 agt_ch_proto_t ch_proto,
233 boolean start_now);
234
235
236
244extern status_t
245 agt_callhome_remove_server (const xmlChar *ch_name);
246
247
253extern status_t
255
256
257
267extern void
269
270
275#ifdef __cplusplus
276} /* end extern 'C' */
277#endif
278
279#endif /* _H_agt_callhome */
280
281#endif // WITH_CALLHOME
Multi-Protocol Network Management Server.
dlq provides general double-linked list and queue support:
agt_ch_proto_t
server callhome protocol
Definition: agt.h:784
status_t agt_callhome_init(void)
Initialize the Callhome module.
Definition: agt_callhome.c:636
void agt_callhome_check_reconnect(ses_cb_t *scb)
Check if the session is a callhome session that needs reconnect.
Definition: agt_callhome.c:1188
boolean agt_callhome_connecting(const xmlChar *addr)
Check if the source address is connecting in a callhome session.
Definition: agt_callhome.c:796
status_t agt_callhome_remove_server(const xmlChar *ch_name)
Remove a CallHome server entry added from a YANG module at run-time.
Definition: agt_callhome.c:1103
void agt_callhome_cleanup(void)
Cleanup the Callhome module.
Definition: agt_callhome.c:760
status_t agt_callhome_remove_all_servers(void)
Remove all CallHome server entries added from a YANG module at run-time.
Definition: agt_callhome.c:1143
status_t agt_callhome_add_server(const xmlChar *ch_name, const xmlChar *ch_addr, uint16 ch_port, agt_ch_proto_t ch_proto, boolean start_now)
Add a CallHome server entry from a YANG module at run-time.
Definition: agt_callhome.c:996
status_t agt_callhome_init2(void)
Initialize the Callhome module (Init phase II)
Definition: agt_callhome.c:678
status_t agt_callhome_init_postcli(void)
Initialize the Callhome module POST CLI parms.
Definition: agt_callhome.c:656
status_t agt_callhome_add_server_cli(const xmlChar *valstr, agt_ch_proto_t ch_proto)
Add a CallHome server entry from the –callhome-server CLI parm.
Definition: agt_callhome.c:839
status_t
global error return code
Definition: status_enum.h:210
NETCONF Session Common definitions module.
global error status code enumerations
control block for each client for a callhome connection
Definition: agt_callhome.h:87
uint16 ch_retry_count
retry connection count if reconnect in progress
Definition: agt_callhome.h:134
boolean ch_from_cli
callhome entry is from CLI config, F: from YANG
Definition: agt_callhome.h:131
uint32 ch_timer_id
timer ID used for reconnect interval
Definition: agt_callhome.h:137
xmlChar * ch_client_addr
callhome client address
Definition: agt_callhome.h:101
dlq_hdr_t qhdr
queue header
Definition: agt_callhome.h:89
const xmlChar * ch_subsys_path
back-ptr to global subsystem path config
Definition: agt_callhome.h:95
uint16 ch_retry_interval
callhome retry interval
Definition: agt_callhome.h:110
pid_t ch_pid
callhome child process ID running SSHd server
Definition: agt_callhome.h:140
uint16 ch_client_port
callhome client port
Definition: agt_callhome.h:107
xmlChar * ch_name
callhome server name
Definition: agt_callhome.h:98
boolean ch_connecting
callhome is connecting
Definition: agt_callhome.h:125
boolean ch_connected
callhome is connected
Definition: agt_callhome.h:128
boolean ch_reconnect
enable callhome reconnects
Definition: agt_callhome.h:119
uint16 ch_retry_max
callhome retry max tries
Definition: agt_callhome.h:113
const xmlChar * ch_sshd_path
back-ptr to global sshd path config
Definition: agt_callhome.h:92
xmlChar * ch_sshd_config
callhome sshd config
Definition: agt_callhome.h:104
boolean ch_enabled
begin state, callhome enabled flag
Definition: agt_callhome.h:122
agt_ch_proto_t ch_proto
callhome protocol to use
Definition: agt_callhome.h:116
Session Control Block.
Definition: ses.h:573