cmd: remove sparc-only virtinfo
[unleashed.git] / usr / src / cmd / picl / plugins / sun4v / lib / snmp / debug.h
blobbc228a20d2145bbb5e2abb64cd6fcf48056ad129
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _DEBUG_H
28 #define _DEBUG_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
36 #ifdef SNMP_DEBUG
39 * ASN Debugging keys
41 #define SNMP_DASN_SEQUENCE 1
42 #define SNMP_DASN_LENGTH 2
43 #define SNMP_DASN_INT 3
44 #define SNMP_DASN_OCTET_STR 4
45 #define SNMP_DASN_OID 5
46 #define SNMP_DASN_NULL 6
49 * Debug tags
51 #define TAG_CMD_REQUEST 0
52 #define TAG_NULL_VAR 1
53 #define TAG_RESPONSE_VAR 2
54 #define TAG_REQUEST_PDU 3
55 #define TAG_RESPONSE_PDU 4
56 #define TAG_REQUEST_PKT 5
57 #define TAG_RESPONSE_PKT 6
58 #define TAG_WRITE 7
59 #define TAG_IOCTL 8
60 #define TAG_READ 9
61 #define TAG_SENDTO 10
62 #define TAG_RECVFROM 11
65 * Debug macros
67 #define LOGINIT() \
68 snmp_debug_init()
70 #define LOGGET(tag, prefix, row) \
71 snmp_log_cmd(tag, SNMP_MSG_GET, 1, prefix, row)
73 #define LOGBULK(tag, n_oids, oidstrs, row) \
74 snmp_log_cmd(tag, SNMP_MSG_GETBULK, n_oids, oidstrs, row)
76 #define LOGNEXT(tag, prefix, row) \
77 snmp_log_cmd(tag, SNMP_MSG_GETNEXT, 1, prefix, row)
79 #define LOGVAR(tag, vp) \
80 snmp_log_var(tag, vp)
82 #define LOGPDU(tag, pdu) \
83 snmp_log_pdu(tag, pdu)
85 #define LOGASNSEQ(pkt, pktsz) \
86 snmp_log_asn(SNMP_DASN_SEQUENCE, pkt, pktsz)
88 #define LOGASNLENGTH(pkt, pktsz) \
89 snmp_log_asn(SNMP_DASN_LENGTH, pkt, pktsz)
91 #define LOGASNINT(pkt, pktsz) \
92 snmp_log_asn(SNMP_DASN_INT, pkt, pktsz)
94 #define LOGASNOCTSTR(pkt, pktsz) \
95 snmp_log_asn(SNMP_DASN_OCTET_STR, pkt, pktsz)
97 #define LOGASNOID(pkt, pktsz) \
98 snmp_log_asn(SNMP_DASN_OID, pkt, pktsz)
100 #define LOGASNNULL(pkt, pktsz) \
101 snmp_log_asn(SNMP_DASN_NULL, pkt, pktsz)
103 #define LOGPKT(tag, pkt, sz) \
104 snmp_log_pkt(tag, pkt, sz)
106 #define LOGIO(tag, a1, a2, a3) \
107 snmp_log_io(tag, (int)a1, (uint_t)a2, (uint_t)a3)
110 * Exported debug interfaces
112 extern void snmp_debug_init(void);
113 extern void snmp_log_cmd(uint_t tag, int cmd, int n_oids,
114 char *oidstr, int row);
115 extern void snmp_log_var(uint_t tag, pdu_varlist_t *vp);
116 extern void snmp_log_pdu(uint_t tag, snmp_pdu_t *pdu);
117 extern void snmp_log_asn(int key, uchar_t *pkt, size_t pktsz);
118 extern void snmp_log_pkt(uint_t tag, uchar_t *pkt, size_t pktsz);
119 extern void snmp_log_io(uint_t tag, int a1, uint_t a2, uint_t a3);
121 #else /* SNMP_DEBUG */
123 #define LOGINIT()
124 #define LOGGET(tag, prefix, row)
125 #define LOGBULK(tag, n_oids, oidstrs, row)
126 #define LOGNEXT(tag, prefix, row)
127 #define LOGVAR(tag, vp)
128 #define LOGPDU(tag, pdu)
129 #define LOGASNSEQ(pkt, pktsz)
130 #define LOGASNLENGTH(pkt, pktsz)
131 #define LOGASNINT(pkt, pktsz)
132 #define LOGASNOCTSTR(pkt, pktsz)
133 #define LOGASNOID(pkt, pktsz)
134 #define LOGASNNULL(pkt, pktsz)
135 #define LOGPKT(tag, pkt, sz)
136 #define LOGIO(tag, a1, a2, a3)
138 #endif /* SNMP_DEBUG */
140 #ifdef __cplusplus
142 #endif
144 #endif /* _DEBUG_H */