1*0Sstevel@tonic-gate /*
2*0Sstevel@tonic-gate * CDDL HEADER START
3*0Sstevel@tonic-gate *
4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the
5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance
7*0Sstevel@tonic-gate * with the License.
8*0Sstevel@tonic-gate *
9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
11*0Sstevel@tonic-gate * See the License for the specific language governing permissions
12*0Sstevel@tonic-gate * and limitations under the License.
13*0Sstevel@tonic-gate *
14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
19*0Sstevel@tonic-gate *
20*0Sstevel@tonic-gate * CDDL HEADER END
21*0Sstevel@tonic-gate */
22*0Sstevel@tonic-gate /*
23*0Sstevel@tonic-gate * Copyright 1992-2003 Sun Microsystems, Inc. All rights reserved.
24*0Sstevel@tonic-gate * Use is subject to license terms.
25*0Sstevel@tonic-gate */
26*0Sstevel@tonic-gate
27*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI"
28*0Sstevel@tonic-gate
29*0Sstevel@tonic-gate /*
30*0Sstevel@tonic-gate * Just in case we're not in a build environment, make sure that
31*0Sstevel@tonic-gate * TEXT_DOMAIN gets set to something.
32*0Sstevel@tonic-gate */
33*0Sstevel@tonic-gate #if !defined(TEXT_DOMAIN)
34*0Sstevel@tonic-gate #define TEXT_DOMAIN "SYS_TEST"
35*0Sstevel@tonic-gate #endif
36*0Sstevel@tonic-gate
37*0Sstevel@tonic-gate #include <meta.h>
38*0Sstevel@tonic-gate #include <metamed.h>
39*0Sstevel@tonic-gate
40*0Sstevel@tonic-gate char *
med_errnum_to_str(int errnum)41*0Sstevel@tonic-gate med_errnum_to_str(int errnum)
42*0Sstevel@tonic-gate {
43*0Sstevel@tonic-gate switch (errnum) {
44*0Sstevel@tonic-gate case MDE_MED_NOERROR:
45*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN, "No Error"));
46*0Sstevel@tonic-gate case MDE_MED_HOSTNOMED:
47*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
48*0Sstevel@tonic-gate "mediator host has no mediator data for host"));
49*0Sstevel@tonic-gate case MDE_MED_DBNOTINIT:
50*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
51*0Sstevel@tonic-gate "mediator database is not initialized"));
52*0Sstevel@tonic-gate case MDE_MED_DBSZBAD:
53*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
54*0Sstevel@tonic-gate "mediator database size is not valid"));
55*0Sstevel@tonic-gate case MDE_MED_DBKEYADDFAIL:
56*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
57*0Sstevel@tonic-gate "unable to add key to mediator database"));
58*0Sstevel@tonic-gate case MDE_MED_DBKEYDELFAIL:
59*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
60*0Sstevel@tonic-gate "unable to delete key from mediator database"));
61*0Sstevel@tonic-gate case MDE_MED_DBHDRSZBAD:
62*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
63*0Sstevel@tonic-gate "mediator database header record size is not valid"));
64*0Sstevel@tonic-gate case MDE_MED_DBHDRMAGBAD:
65*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
66*0Sstevel@tonic-gate "mediator database header magic is not valid"));
67*0Sstevel@tonic-gate case MDE_MED_DBHDRREVBAD:
68*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
69*0Sstevel@tonic-gate "mediator database header revision is not valid"));
70*0Sstevel@tonic-gate case MDE_MED_DBHDRCKSBAD:
71*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
72*0Sstevel@tonic-gate "mediator database header checksum is not valid"));
73*0Sstevel@tonic-gate case MDE_MED_DBRECSZBAD:
74*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
75*0Sstevel@tonic-gate "mediator database record record size is not valid"));
76*0Sstevel@tonic-gate case MDE_MED_DBRECMAGBAD:
77*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
78*0Sstevel@tonic-gate "mediator database record magic is not valid"));
79*0Sstevel@tonic-gate case MDE_MED_DBRECREVBAD:
80*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
81*0Sstevel@tonic-gate "mediator database record revision is not valid"));
82*0Sstevel@tonic-gate case MDE_MED_DBRECCKSBAD:
83*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
84*0Sstevel@tonic-gate "mediator database record checksum is not valid"));
85*0Sstevel@tonic-gate case MDE_MED_DBRECOFFBAD:
86*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
87*0Sstevel@tonic-gate "mediator database record offset in not valid"));
88*0Sstevel@tonic-gate case MDE_MED_DBRECNOENT:
89*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN,
90*0Sstevel@tonic-gate "no matching mediator record found"));
91*0Sstevel@tonic-gate case MDE_MED_DBARGSMISMATCH:
92*0Sstevel@tonic-gate return (dgettext(TEXT_DOMAIN, "set number in arguments "
93*0Sstevel@tonic-gate "different from set number in data"));
94*0Sstevel@tonic-gate default:
95*0Sstevel@tonic-gate return (NULL);
96*0Sstevel@tonic-gate }
97*0Sstevel@tonic-gate }
98