1/*	$NetBSD: resultclass.h,v 1.1.1.1 2009/12/13 16:54:24 kardel Exp $	*/
2
3/*
4 * Copyright (C) 2004-2007  Internet Systems Consortium, Inc. ("ISC")
5 * Copyright (C) 1999-2001  Internet Software Consortium.
6 *
7 * Permission to use, copy, modify, and/or distribute this software for any
8 * purpose with or without fee is hereby granted, provided that the above
9 * copyright notice and this permission notice appear in all copies.
10 *
11 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
16 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 */
19
20/* Id: resultclass.h,v 1.18 2007/06/19 23:47:18 tbox Exp */
21
22#ifndef ISC_RESULTCLASS_H
23#define ISC_RESULTCLASS_H 1
24
25
26/*! \file isc/resultclass.h
27 * \brief Registry of Predefined Result Type Classes
28 *
29 * A result class number is an unsigned 16 bit number.  Each class may
30 * contain up to 65536 results.  A result code is formed by adding the
31 * result number within the class to the class number multiplied by 65536.
32 *
33 * Classes < 1024 are reserved for ISC use.
34 * Result classes >= 1024 and <= 65535 are reserved for application use.
35 */
36
37#define ISC_RESULTCLASS_FROMNUM(num)		((num) << 16)
38#define ISC_RESULTCLASS_TONUM(rclass)		((rclass) >> 16)
39#define ISC_RESULTCLASS_SIZE			65536
40#define ISC_RESULTCLASS_INCLASS(rclass, result) \
41	((rclass) == ((result) & 0xFFFF0000))
42
43
44#define	ISC_RESULTCLASS_ISC		ISC_RESULTCLASS_FROMNUM(0)
45#define	ISC_RESULTCLASS_DNS		ISC_RESULTCLASS_FROMNUM(1)
46#define	ISC_RESULTCLASS_DST		ISC_RESULTCLASS_FROMNUM(2)
47#define	ISC_RESULTCLASS_DNSRCODE	ISC_RESULTCLASS_FROMNUM(3)
48#define	ISC_RESULTCLASS_OMAPI		ISC_RESULTCLASS_FROMNUM(4)
49#define	ISC_RESULTCLASS_ISCCC		ISC_RESULTCLASS_FROMNUM(5)
50
51
52#endif /* ISC_RESULTCLASS_H */
53