4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
23 * Copyright 1994 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
28 /* All Rights Reserved */
31 #pragma ident "%Z%%M% %I% %E% SMI"
34 * Convert an error number from the Common Control into a string
37 static char SCCSID
[] = "@(#)dkerr.c 2.6+BNU DKHOST 87/03/05";
40 * COMMKIT(TM) Software - Datakit(R) VCS Interface Release 2.0 V1
48 "Call Failed", /* code 0 - Something is Wrong */
49 "All channels busy", /* code 1 - busy */
50 "Remote node not answering", /* code 2 - trunk down */
51 "Server not answering", /* code 3 - termporary no dest */
52 "Non-assigned number", /* code 4 - permonent no dest (INTERT) */
53 "All trunk channels busy", /* code 5 - System Overload (REORT) */
54 "Server already exists", /* code 6 - already exists */
55 "Access denied", /* code 7 - denied by remote server */
56 "", /* code 8 - directory assistance req */
60 char *dialer_msgs
[] = {
62 "Please supply a valid phone number", /* code 1 - phone # missing */
63 "No response from auto-dialer. Try again", /* code 2- bad port */
64 "Auto dialer failed to initiate call. Try again", /* code 3 - dial failure */
65 "No initial dial tone detected", /* code 4 - bad telephone line */
66 "No secondary dial tone detected", /* code 5 - no sec. dial tone */
67 "Dialed number is busy", /* code 6 - busy signal detected */
68 "No answer fron dialed number", /* code 7 - auto-dialer didn't get ans. */
69 "No carrier tone was detected", /* code 8 - no carrier tone det. */
70 "Could not complete your call. Try again.", /* code 9 - auto dialer didn't complete */
71 "Wrong number", /*code 10 - bad number*/
75 char *dk_hostmsgs
[] = {
76 "Dkserver: Can't open line: See System Administrator", /* Code 130 */
79 "Dkserver: Dksrvtab not readable: See System Administrator", /* Code 133 */
80 "Dkserver: Can't chroot: See System Administrator",
83 #define NDKMSGS (sizeof(dk_msgs)/sizeof(dk_msgs[0]))
84 #define NDKHOMSGS (sizeof(dk_hostmsgs)/sizeof(dk_hostmsgs[0]))
87 GLOBAL
int dk_verbose
= 1; /* Print error messages on stderr if 1 */
88 GLOBAL
int dk_errno
= 0; /* Saved error number from iocb.req_error */
90 static char generalmsg
[32];
96 if ((err
& 0377) == DIALERCODE
)
97 return(dialer_msgs
[err
>>8]);
99 if ((err
>= 0 && err
<= 99) && err
< NDKMSGS
&& dk_msgs
[err
] != 0)
100 return(dk_msgs
[err
]);
101 if ((err
>= 100) && (err
< (NDKHOMSGS
+ 130)) && (dk_hostmsgs
[err
-130] != 0))
102 return(dk_hostmsgs
[err
-130]);
103 sprintf(generalmsg
, "Error code %d", err
) ;
125 return(EX_CANTCREAT
);