2 * Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
3 * Copyright (C) 2001 Internet Software Consortium.
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 * PERFORMANCE OF THIS SOFTWARE.
18 /* $Id: syslog.c,v 1.1.2.1 2004/03/09 06:12:12 marka Exp $ */
26 #include <isc/result.h>
27 #include <isc/syslog.h>
30 static struct dsn_c_pvt_sfnt
{
37 { LOG_DAEMON
, "daemon" },
39 { LOG_SYSLOG
, "syslog" },
51 { LOG_AUTHPRIV
, "authpriv" },
56 { LOG_LOCAL0
, "local0"},
57 { LOG_LOCAL1
, "local1"},
58 { LOG_LOCAL2
, "local2"},
59 { LOG_LOCAL3
, "local3"},
60 { LOG_LOCAL4
, "local4"},
61 { LOG_LOCAL5
, "local5"},
62 { LOG_LOCAL6
, "local6"},
63 { LOG_LOCAL7
, "local7"},
68 isc_syslog_facilityfromstring(const char *str
, int *facilityp
) {
72 REQUIRE(facilityp
!= NULL
);
74 for (i
= 0 ; facilities
[i
].strval
!= NULL
; i
++) {
75 if (strcasecmp(facilities
[i
].strval
, str
) == 0) {
76 *facilityp
= facilities
[i
].val
;
77 return (ISC_R_SUCCESS
);
80 return (ISC_R_NOTFOUND
);