extern void signal_no_reset P((int, RETSIGTYPE (*func)(int)));
-extern void getauthkeys P((char *));
+extern void getauthkeys P((const char *));
extern void auth_agekeys P((void));
extern void rereadkeys P((void));
extern char * add_var P((struct ctl_var **, u_long, u_short));
extern void free_varlist P((struct ctl_var *));
extern void set_var P((struct ctl_var **, const char *, u_long, u_short));
-extern void set_sys_var P((char *, u_long, u_short));
+extern void set_sys_var P((const char *, u_long, u_short));
/* ntp_intres.c */
extern void ntp_res_name P((struct sockaddr_storage, u_short));
/* ntp_util.c */
extern void init_util P((void));
extern void hourly_stats P((void));
-extern void stats_config P((int, char *));
+extern void stats_config P((int, const char *));
extern void record_peer_stats P((struct sockaddr_storage *, int, double, double, double, double));
extern void record_loop_stats P((double, double, double, double, int));
extern void record_clock_stats P((struct sockaddr_storage *, const char *));
port = 0;
/*
- /*
+ *
* Set up the port number
*/
if (ai->ai_family == AF_INET)
char *argv[]
)
{
- extern char *config_file;
+ extern const char *config_file;
int errflg;
tOptions myOptions =
#ifdef SIM
if (HAVE_OPT( PROPAGATIONDELAY ))
do {
double tmp;
- char *ntp_optarg = OPT_ARG( PROPAGATIONDELAY );
+ const char *my_ntp_optarg = OPT_ARG( PROPAGATIONDELAY );
- if (sscanf(ntp_optarg, "%lf", &tmp) != 1) {
+ if (sscanf(my_ntp_optarg, "%lf", &tmp) != 1) {
msyslog(LOG_ERR,
"command line broadcast delay value %s undecodable",
- ntp_optarg);
+ my_ntp_optarg);
} else {
proto_config(PROTO_BROADDELAY, 0, tmp, NULL);
}
stats_config(STATS_STATSDIR, OPT_ARG( STATSDIR ));
if (HAVE_OPT( TRUSTEDKEY )) {
- int ct = STACKCT_OPT( TRUSTEDKEY );
- char** pp = STACKLST_OPT( TRUSTEDKEY );
+ int ct = STACKCT_OPT( TRUSTEDKEY );
+ const char** pp = STACKLST_OPT( TRUSTEDKEY );
do {
u_long tkey;
- char* p = *pp++;
+ const char* p = *pp++;
tkey = (int)atol(p);
if (tkey <= 0 || tkey > NTP_MAXKEY) {
}
if (HAVE_OPT( VAR )) {
- int ct = STACKCT_OPT( VAR );
- char** pp = STACKLST_OPT( VAR );
+ int ct = STACKCT_OPT( VAR );
+ const char** pp = STACKLST_OPT( VAR );
do {
- char* ntp_optarg = *pp++;
+ const char* my_ntp_optarg = *pp++;
- set_sys_var(ntp_optarg, strlen(ntp_optarg)+1,
+ set_sys_var(my_ntp_optarg, strlen(my_ntp_optarg)+1,
(u_short) (RW));
} while (--ct > 0);
}
if (HAVE_OPT( DVAR )) {
- int ct = STACKCT_OPT( DVAR );
- char** pp = STACKLST_OPT( DVAR );
+ int ct = STACKCT_OPT( DVAR );
+ const char** pp = STACKLST_OPT( DVAR );
do {
- char* ntp_optarg = *pp++;
+ const char* my_ntp_optarg = *pp++;
- set_sys_var(ntp_optarg, strlen(ntp_optarg)+1,
+ set_sys_var(my_ntp_optarg, strlen(my_ntp_optarg)+1,
(u_short) (RW | DEF));
} while (--ct > 0);
}
static void ctl_putarray P((const char *, double *, int));
static void ctl_putsys P((int));
static void ctl_putpeer P((int, struct peer *));
+#ifdef OPENSSL
static void ctl_putfs P((const char *, tstamp_t));
+#endif
#ifdef REFCLOCK
static void ctl_putclock P((int, struct refclockstat *, int));
#endif /* REFCLOCK */
/*
* ctl_putfs - write a decoded filestamp into the response
*/
+#ifdef OPENSSL
static void
ctl_putfs(
const char *tag,
cp++;
ctl_putdata(buffer, (unsigned)( cp - buffer ), 0);
}
+#endif
/*
void
set_sys_var(
- char *data,
+ const char *data,
u_long size,
u_short def
)
void
stats_config(
int item,
- char *invalue /* only one type so far */
+ const char *invalue /* only one type so far */
)
{
FILE *fp;
- char *value;
+ const char *value;
int len;
/*
*/
void
getauthkeys(
- char *keyfile
+ const char *keyfile
)
{
int len;
void
init_logging(char const *name)
{
- char *cp;
+ const char *cp;
/*
* Logging. This may actually work on the gizmo board. Find a name
*/
cp = strrchr(name, '/');
if (cp == 0)
- cp = (char*)name;
+ cp = name;
else
cp++;
)
{
if (HAVE_OPT( LOGFILE )) {
- const char *optarg = OPT_ARG( LOGFILE );
+ const char *my_optarg = OPT_ARG( LOGFILE );
FILE *new_file;
- if(strcmp(optarg, "stderr") == 0)
+ if(strcmp(my_optarg, "stderr") == 0)
new_file = stderr;
- else if(strcmp(optarg, "stdout") == 0)
+ else if(strcmp(my_optarg, "stdout") == 0)
new_file = stdout;
else
- new_file = fopen(optarg, "a");
+ new_file = fopen(my_optarg, "a");
if (new_file != NULL) {
NLOG(NLOG_SYSINFO)
- msyslog(LOG_NOTICE, "logging to file %s", optarg);
+ msyslog(LOG_NOTICE, "logging to file %s", my_optarg);
if (syslog_file != NULL &&
fileno(syslog_file) != fileno(new_file))
(void)fclose(syslog_file);
else
msyslog(LOG_ERR,
"Cannot open log file %s",
- optarg);
+ my_optarg);
}
}
up = (struct actsunit *)pp->unitptr;
#ifdef DEBUG
ioctl(pp->io.fd, TIOCMGET, (char *)&modem);
- sprintf(tbuf, "acts: %04x (%d %d) %d %s", modem, up->state,
+ sprintf(tbuf, "acts: %04x (%d %d) %lu %s", modem, up->state,
up->timer, strlen(pp->a_lastcode), pp->a_lastcode);
if (debug)
printf("%s\n", tbuf);
#if defined(NTP_PRE_420)
pp->msec
#else
- pp->nsec/1000
+ (int)(pp->nsec/1000)
#endif
);
}
}
if (HAVE_OPT(COMMAND)) {
- int cmdct = STACKCT_OPT( COMMAND );
- char** cmds = STACKLST_OPT( COMMAND );
+ int cmdct = STACKCT_OPT( COMMAND );
+ const char** cmds = STACKLST_OPT( COMMAND );
while (cmdct-- > 0) {
ADDCMD(*cmds++);
}
if (HAVE_OPT(COMMAND)) {
- int cmdct = STACKCT_OPT( COMMAND );
- char** cmds = STACKLST_OPT( COMMAND );
+ int cmdct = STACKCT_OPT( COMMAND );
+ const char** cmds = STACKLST_OPT( COMMAND );
while (cmdct-- > 0) {
ADDCMD(*cmds++);
char *grpkey = NULL; /* identity extension */
int nid; /* X509 digest/signature scheme */
FILE *fstr = NULL; /* file handle */
+ u_int temp;
#define iffsw HAVE_OPT(ID_KEY)
#endif /* OPENSSL */
char hostbuf[MAXHOSTNAME + 1];
- u_int temp;
#ifdef SYS_WINNT
/* Initialize before OpenSSL checks */