yumapro  20.10-12
YumaPro SDK
agt_openssl.h
Go to the documentation of this file.
1 #ifdef WITH_OPENSSL
2 /*
3  * Copyright (c) 2018 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_agt_openssl
13 #define _H_agt_openssl
14 
15 /* FILE: agt_openssl.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 02-mar-18 abb Begun
37 */
38 
39 #ifndef _H_ses
40 #include "ses.h"
41 #endif
42 
43 #ifndef _H_status_enum
44 #include "status_enum.h"
45 #endif
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 /********************************************************************
52 * *
53 * C O N S T A N T S *
54 * *
55 *********************************************************************/
56 
57 
58 /********************************************************************
59 * *
60 * T Y P E S *
61 * *
62 *********************************************************************/
63 
64 
65 /********************************************************************
66 * *
67 * F U N C T I O N S *
68 * *
69 *********************************************************************/
70 
87 extern status_t
88  agt_openssl_init (void);
89 
90 
96 extern void
97  agt_openssl_cleanup (void);
98 
99 
106 extern status_t
107  agt_openssl_start_session (ses_cb_t *scb);
108 
109 
115 extern void
116  agt_openssl_cleanup_session (ses_cb_t *scb);
117 
118 
122 #ifdef __cplusplus
123 } /* end extern 'C' */
124 #endif
125 
126 #endif /* _H_agt_openssl */
127 #endif // WITH_OPENSSL
ncx_str.h
NCX Module Library String Utility Functions.
ses.h
NETCONF Session Common definitions module.
log_info_append
void void void void void void log_info_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_INFO log entry.
agt_hello_send
status_t agt_hello_send(ses_cb_t *scb)
Send the server <hello> message to the manager on the specified session.
Definition: agt_hello.c:311
ERR_NCX_TIMEOUT
@ ERR_NCX_TIMEOUT
368
Definition: status_enum.h:411
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
ncxmod_test_filespec
boolean ncxmod_test_filespec(const xmlChar *filespec)
Check the exact filespec to see if it a file.
Definition: ncxmod.c:8275
val_find_child
val_value_t * val_find_child(const val_value_t *parent, const xmlChar *modname, const xmlChar *childname)
Find the first instance of the specified child node.
Definition: val.c:8560
agt_state.h
NETCONF State Monitoring Data Model Module support.
NCX_DEF_TRUST_STORE
#define NCX_DEF_TRUST_STORE
default ssl-trust-store value
Definition: ncxconst.h:356
log_error
void log_error(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_ERROR log entry.
AGT_CRL_MODE_NONE
@ AGT_CRL_MODE_NONE
not set
Definition: agt.h:702
val_next_child_same
val_value_t * val_next_child_same(val_value_t *curchild)
Get the next instance of the corresponding child node.
Definition: val.c:8456
status_enum.h
global error status code enumerations
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
ncx_num.h
NCX Module Library Number Utility Functions.
ses_msg_add_framing
void ses_msg_add_framing(ses_cb_t *scb, ses_msg_buff_t *buff)
Add the base:1.1 framing chars to the buffer and adjust the buffer size pointers.
Definition: ses_msg.c:1176
NCX_NF_HEX
@ NCX_NF_HEX
YANG hexidecimal format.
Definition: ncxtypes.h:336
ncx_init_num
void ncx_init_num(ncx_num_t *num)
Init a ncx_num_t struct.
Definition: ncx_num.c:162
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
ses_msg_free_buff
void ses_msg_free_buff(ses_cb_t *scb, ses_msg_buff_t *buff)
Free the session buffer chunk.
Definition: ses_msg.c:460
ses_msg.h
NETCONF Session Message Common definitions module.
agt_cb.h
NETCONF Server Data Model callback handler.
NCX_BT_UINT8
@ NCX_BT_UINT8
uint8
Definition: ncxtypes.h:211
log_info
void void void void void log_info(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_INFO log entry.
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
agt_yp_ha_mgmt_enabled
boolean agt_yp_ha_mgmt_enabled(void)
Check if MGMT protocols disabled because YP-HA Standby mode.
Definition: agt_yp_ha.c:877
agt_audit_handle_start_session
void agt_audit_handle_start_session(ses_cb_t *scb)
Generate a start (client or control) session event if enabled.
Definition: agt_audit.c:452
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
agt_openssl_cleanup
void agt_openssl_cleanup(void)
Cleanup the OpenSSL module.
Definition: agt_openssl.c:1049
ERR_NCX_SESSION_CLOSED
@ ERR_NCX_SESSION_CLOSED
1010
Definition: status_enum.h:499
SES_MY_USERNAME
#define SES_MY_USERNAME(S)
get username
Definition: ses.h:111
agt_check_allowed_user
status_t agt_check_allowed_user(const xmlChar *username)
Check a username in the allowed-user Q.
Definition: agt.c:4632
agt_audit.h
NETCONF protocol audit log support.
xml_strndup
xmlChar * xml_strndup(const xmlChar *copyFrom, uint32 maxlen)
String duplicate for max N xmlChars.
Definition: xml_util.c:1663
ERR_NCX_OPERATION_FAILED
@ ERR_NCX_OPERATION_FAILED
274
Definition: status_enum.h:315
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
agt_hello_start_hello_timer
void agt_hello_start_hello_timer(ses_cb_t *scb)
Set the timestamp to start the hello-timeout for the specified session.
Definition: agt_hello.c:421
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ERR_INTERNAL_INIT_SEQ
@ ERR_INTERNAL_INIT_SEQ
007
Definition: status_enum.h:197
get_error_string
const char * get_error_string(status_t res)
Get the error message for a specific internal error.
Definition: status.c:239
agt_openssl_cleanup_session
void agt_openssl_cleanup_session(ses_cb_t *scb)
Cleanup a NETCONF over TLS session.
Definition: agt_openssl.c:1243
agt_openssl_start_session
status_t agt_openssl_start_session(ses_cb_t *scb)
Start a NETCONF over TLS session.
Definition: agt_openssl.c:1096
log_debug
void void void void void void void log_debug(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG log entry.
NCX_DEF_TRUST_DIR
#define NCX_DEF_TRUST_DIR
Default SSL certificates directory.
Definition: ncxconst.h:359
yangconst.h
Contains YANG constants separated to prevent H file include loops.
AGT_CRL_MODE_OFF
@ AGT_CRL_MODE_OFF
CRL check off.
Definition: agt.h:703
LOGINFO
#define LOGINFO
Check if at least log-level=info.
Definition: log.h:279
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
agt.h
Multi-Protocol Network Management Server.
AGT_CRL_MODE_CLIENT
@ AGT_CRL_MODE_CLIENT
CRL check client cert.
Definition: agt.h:704
AGT_CRL_MODE_CA
@ AGT_CRL_MODE_CA
CRL check client and CA certs.
Definition: agt.h:705
agt_acm_session_is_superuser
boolean agt_acm_session_is_superuser(const ses_cb_t *scb)
Check if the specified session is the superuser.
Definition: agt_acm.c:868
NCX_SES_EVENT_START
@ NCX_SES_EVENT_START
session started event
Definition: ncxtypes.h:1411
agt_sys_send_sysSessionStart
void agt_sys_send_sysSessionStart(const ses_cb_t *scb)
Queue the Session Start notification.
Definition: agt_sys.c:1192
ncx_clean_num
void ncx_clean_num(ncx_btype_t btyp, ncx_num_t *num)
Scrub the memory in a ncx_num_t by freeing all the sub-fields.
Definition: ncx_num.c:189
log.h
NCX System Logging Manager.
log_flush
void log_flush(void)
Flush output buffers.
Definition: log.c:1880
agt_sys.h
NETCONF system.yang DM module support.
agt_cli.h
NETCONF Server Command Line Interface handler.
agt_hello.h
Handle the NETCONF <hello> (top-level) element.
LOGDEBUG
#define LOGDEBUG
Check if at least log-level=debug.
Definition: log.h:287
agt_state_add_session
status_t agt_state_add_session(ses_cb_t *scb)
Add a session entry to the netconf-state DM.
Definition: agt_state.c:2303
SES_STATE
#define SES_STATE(S)
get the session state
Definition: ses.h:177
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
agt_acm.h
NETCONF Server Access Control Entry Points.
log_debug2_append
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
agt_get_profile
agt_profile_t * agt_get_profile(void)
Get the server profile struct.
Definition: agt.c:4118
agt_cb_run_session_hook
void agt_cb_run_session_hook(ncx_ses_event_t ses_event, const ses_cb_t *scb)
Run Session Hook callbacks.
Definition: agt_cb.c:4742
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
ERR_NCX_ACCESS_DENIED
@ ERR_NCX_ACCESS_DENIED
267
Definition: status_enum.h:308
ncx_get_source
xmlChar * ncx_get_source(const xmlChar *fspec, status_t *res)
Expand a filespec into an absolute path.
Definition: ncx.c:8362
SES_ST_HELLO_WAIT
@ SES_ST_HELLO_WAIT
waiting for peer <hello>
Definition: ses.h:355
ncx.h
YANG module utility functions.
agt_yp_ha.h
YumaPro High Availability module (YP-HA)
SES_MY_SID
#define SES_MY_SID(S)
get session-id
Definition: ses.h:105
SES_MY_FD
#define SES_MY_FD(S)
get file descriptor
Definition: ses.h:108
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
ncx_convert_num
status_t ncx_convert_num(const xmlChar *numstr, ncx_numfmt_t numfmt, ncx_btype_t btyp, ncx_num_t *val)
Convert a number string to a numeric type.
Definition: ncx_num.c:717
agt_state_remove_session
void agt_state_remove_session(ses_cb_t *scb)
Remove a session entry from the netconf-state DM.
Definition: agt_state.c:2402
VAL_STR
#define VAL_STR(V)
Access the value as a string ONLY if typ_is_string() is true.
Definition: val.h:464
agt_init2_done
boolean agt_init2_done(void)
Check if the init2 phase is complete.
Definition: agt.c:4983
agt_openssl.h
OpenSSL support for netconf-tls.
ncxmod_test_subdir
boolean ncxmod_test_subdir(const xmlChar *dirspec)
Check if the specified string is a directory.
Definition: ncxmod.c:6515
agt_cli_get_valset
val_value_t * agt_cli_get_valset(void)
Retrieve the command line parameter set from boot time.
Definition: agt_cli.c:3427
status.h
Global error messages for status code enumerations.
log_debug3_append
void void void void void void void void void void void void log_debug3_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG3 log entry.
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297
agt_openssl_init
status_t agt_openssl_init(void)
Initialize the OpenSSL module.
Definition: agt_openssl.c:819