*/
#define MAXTOKENS 20 /* 20 tokens on line */
#define MAXLINE 1024 /* maximum length of line */
-#define MAXPHONE 5 /* maximum number of phone strings */
+#define MAXPHONE 10 /* maximum number of phone strings */
#define MAXPPS 20 /* maximum length of PPS device string */
#define MAXINCLUDELEVEL 5 /* maximum include file levels */
* Definitions of things either imported from or exported to outside
*/
char const *progname;
-char sys_phone[MAXPHONE][MAXDIAL]; /* ACTS phone numbers */
+char *sys_phone[MAXPHONE] = {NULL}; /* ACTS phone numbers */
char *keysdir = NTP_KEYSDIR; /* crypto keys directory */
#if defined(HAVE_SCHED_SETSCHEDULER)
int config_priority_override = 0;
#endif /* SYS_WINNT */
progname = argv[0];
res_fp = NULL;
- memset((char *)sys_phone, 0, sizeof(sys_phone));
ntp_syslogmask = NLOG_SYNCMASK; /* set more via logconfig */
/*
break;
case CONFIG_PHONE:
- for (i = 1; i < ntokens && i < MAXPHONE; i++) {
- (void)strncpy(sys_phone[i - 1],
- tokens[i], MAXDIAL);
+ for (i = 1; i < ntokens && i < MAXPHONE - 1; i++) {
+ sys_phone[i - 1] =
+ emalloc(strlen(tokens[i]) + 1);
+ strcpy(sys_phone[i - 1], tokens[i]);
}
- sys_phone[i - 1][0] = '\0';
+ sys_phone[i] = NULL;
break;
case CONFIG_ADJ: {
*
* The calling program is initiated by setting fudge flag1, either
* manually or automatically. When flag1 is set, the calling program
- * dials each number listed in the phones command of the configuration
- * file in turn. The number is specified by the Hayes ATDT prefix
- * followed by the number itself, including the prefix and long-distance
- * digits and delay code, if necessary. The flag1 is reset and the
- * calling program terminated if (a) a valid clock update has been
- * determined, (b) no more numbers remain in the list, (c) a device
- * fault or timeout occurs or (d) fudge flag1 is reset manually.
+ * dials the first number in the phone command of the configuration
+ * file. If that call fails, the calling program dials the second number
+ * and so on. The number is specified by the Hayes ATDT prefix followed
+ * by the number itself, including the prefix and long-distance digits
+ * and delay code, if necessary. The flag1 is reset and the calling
+ * program terminated if (a) a valid clock update has been determined,
+ * (b) no more numbers remain in the list, (c) a device fault or timeout
+ * occurs or (d) fudge flag1 is reset manually.
*
* The driver is transparent to each of the modem time services and
* Spectracom radios. It selects the parsing algorithm depending on the
/*
* We are waiting for the OK response to the modem setup
- * command. When this happens dial the number.
+ * command. When this happens dial the number followed by a \r.
*/
case S_OK:
if (strcmp(pp->a_lastcode, "OK") != 0) {
acts_disc(peer);
return;
}
+ write(pp->io.fd, "\r", 1);
up->state = S_CONNECT;
up->timer = ANSWER;
return;
/*
* For USNO format on-time character '*', which is on a line by
- * itself. By sure a timecode has been received.
+ * itself. Be sure a timecode has been received.
*/
case 1:
if (*pp->a_lastcode == '*' && up->state == S_MSG)