153 lines
4.4 KiB
C
153 lines
4.4 KiB
C
/*
|
|
******************************************************************************
|
|
* INTERPEAK CONFIGURATION SOURCE FILE
|
|
*
|
|
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: ipntp_config.c,v $ $Revision: 1.3.10.2 $
|
|
* $Source: /home/interpeak/CVSRoot/ipntp/config/ipntp_config.c,v $
|
|
* $Author: lyang3 $
|
|
* $State: Exp $ $Locker: $
|
|
*
|
|
* INTERPEAK_COPYRIGHT_STRING
|
|
* Design and implementation by Jianqi Ren
|
|
******************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
modification history
|
|
--------------------
|
|
01a,06apr10,rjq written
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 1 DESCRIPTION
|
|
****************************************************************************
|
|
* NTP configuration
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 2 CONFIGURATION
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 3 INCLUDE FILES
|
|
****************************************************************************
|
|
*/
|
|
#include "ipntp_config.h"
|
|
#include "ipcom_config.h"
|
|
#include "ipcom_cstyle.h"
|
|
#include "ipcom_err.h"
|
|
#include "ipcom_sysvar.h"
|
|
#include "ipcom_shell.h"
|
|
#include "ipcom_os.h"
|
|
#include "ipntp.h"
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 4 DEFINES
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 5 TYPES
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 6 EXTERN PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
#if defined(INCLUDE_IPNTP_CMD) || !defined(IP_WB_BUILD)
|
|
IP_EXTERN int ipntp_cmd_ntp(int argc, char **argv);
|
|
#endif
|
|
|
|
#ifdef OPENSSL
|
|
IP_GLOBAL int ipntp_cmd_ntpkey(int argc, char **argv);
|
|
#endif
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 7 LOCAL PROTOTYPES
|
|
****************************************************************************
|
|
*/
|
|
IP_PUBLIC Ip_err ipntp_configure(void);
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 8 DATA
|
|
****************************************************************************
|
|
*/
|
|
|
|
/*
|
|
*===========================================================================
|
|
* SYSVAR CONFIGURATION
|
|
*===========================================================================
|
|
*/
|
|
IP_STATIC IP_CONST Ipcom_sysvar ipntp_conf_sysvar[] =
|
|
{
|
|
IP_SYSVAR("ipntp.config.filename", IP_NULL, NTP_CONFIG_FILENAME),
|
|
IP_SYSVAR("ipntp.config.param", "server 10.10.10.1; disable auth", NTP_CONFIG_PARAM),
|
|
IP_SYSVAR("ipntp.init.param", IP_NULL, NTP_INIT_PARAM),
|
|
{ IP_NULL, IP_NULL }
|
|
};
|
|
|
|
/*
|
|
****************************************************************************
|
|
* 9 PUBLIC FUNCTIONS
|
|
****************************************************************************
|
|
*/
|
|
|
|
|
|
/*
|
|
*===========================================================================
|
|
* ipntp_configure
|
|
*===========================================================================
|
|
* Description:
|
|
* Parameters:
|
|
* Returns:
|
|
*
|
|
*/
|
|
IP_PUBLIC Ip_err
|
|
ipntp_configure(void)
|
|
{
|
|
#if defined(INCLUDE_IPNTP_CMD) || !defined(IP_WB_BUILD)
|
|
Ip_err ret;
|
|
|
|
ret = ipcom_shell_add_cmd("ntp", "ntp [ options | <modifier..>",
|
|
"NTP tool",
|
|
(Ipcom_shell_cmd_type)ipntp_cmd_ntp,
|
|
IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_SMALL);
|
|
if(ret != IPCOM_SUCCESS)
|
|
return ret;
|
|
|
|
#ifdef OPENSSL
|
|
ret = ipcom_shell_add_cmd("ntpkey", "ntpkey [ options | <modifier..>",
|
|
"NTPKEY tool",
|
|
(Ipcom_shell_cmd_type)ipntp_cmd_ntpkey,
|
|
IPCOM_PRIORITY_DEFAULT, IPCOM_PROC_STACK_SMALL);
|
|
if(ret != IPCOM_SUCCESS)
|
|
return ret;
|
|
#endif
|
|
#endif
|
|
|
|
/* Initialize NTP system variables. */
|
|
return ipcom_sysvar_setv(ipntp_conf_sysvar, 0);
|
|
}
|
|
|
|
|
|
/*
|
|
****************************************************************************
|
|
* END OF FILE
|
|
****************************************************************************
|
|
*/
|
|
|