ib_mad.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_IB_MGT_IB_MAD_H
#define _SYS_IB_MGT_IB_MAD_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
#define MAD_SIZE_IN_BYTES 256
typedef struct _ib_mad_hdr_t {
/* perform based on mgmtclass */
} ib_mad_hdr_t;
#define MAD_CLASS_BASE_VERS_1 1
/* Defines and Masks that go with MAD header */
#define MAD_MGMT_CLASS_SUBN_LID_ROUTED 0x01
#define MAD_MGMT_CLASS_SUBN_DIRECT_ROUTE 0x81
#define MAD_MGMT_CLASS_SUBN_ADM 0x03
#define MAD_MGMT_CLASS_PERF 0x04
#define MAD_MGMT_CLASS_BM 0x05
#define MAD_MGMT_CLASS_DEV_MGT 0x06
#define MAD_MGMT_CLASS_COMM_MGT 0x07
#define MAD_MGMT_CLASS_SNMP 0x08
#define MAD_MGMT_CLASS_VENDOR_START 0x09
#define MAD_MGMT_CLASS_VENDOR_END 0x0F
#define MAD_MGMT_CLASS_VENDOR2_START 0x30
#define MAD_MGMT_CLASS_VENDOR2_END 0x4F
#define MAD_MGMT_CLASS_APPLICATION_START 0x10
#define MAD_MGMT_CLASS_APPLICATION_END 0x2F
#define MAD_RESPONSE_BIT 0x80
#define MAD_RESPONSE_BIT_MASK 0x80
#define MAD_METHOD_MASK 0x7F
#define MAD_METHOD_GET 0x01
#define MAD_METHOD_SET 0x02
#define MAD_METHOD_GET_RESPONSE 0x81
#define MAD_METHOD_SEND 0x03
#define MAD_METHOD_TRAP 0x05
#define MAD_METHOD_REPORT 0x06
#define MAD_METHOD_REPORT_RESPONSE 0x86
#define MAD_METHOD_TRAP_REPRESS 0x07
#define MAD_STATUS_BUSY 0x01
#define MAD_STATUS_REDIRECT_REQUIRED 0x02
#define MAD_STATUS_NO_INVALID_FIELDS 0x00
#define MAD_STATUS_BAD_VERSION 0x04
#define MAD_STATUS_UNSUPP_METHOD 0x08
#define MAD_STATUS_UNSUPP_METHOD_ATTR 0x0C
#define MAD_STATUS_INVALID_FIELD 0x1C
#define MAD_ATTR_ID_CLASSPORTINFO 0x01
#define MAD_ATTR_ID_NOTICE 0x02
#define MAD_ATTR_ID_INFORMINFO 0x03
/* ClassPortInfo: table 104 */
#if defined(_BIT_FIELDS_HTOL)
typedef struct ib_mad_classportinfo_s {
/* (lower 5 bit field, upper */
/* 27 bits are reserved) */
#elif defined(_BIT_FIELDS_LTOH)
typedef struct ib_mad_classportinfo_s {
/* (lower 5 bit field, upper */
/* 27 bits are reserved) */
#else
#endif /* _BIT_FIELDS_HTOL */
#define MAD_CLASSPORTINFO_CAP_MASK_TRAPS 0x01
#define MAD_CLASSPORTINFO_CAP_MASK_NOTICES 0x02
/*
*/
#if defined(_BIT_FIELDS_HTOL)
typedef struct ib_mad_notice_s {
/* if generic, indicates type of event's producer, else vendor id */
#elif defined(_BIT_FIELDS_LTOH)
typedef struct ib_mad_notice_s {
/* if generic, indicates type of event's producer, else vendor id */
#else
#endif /* _BIT_FIELDS_HTOL */
#define MAD_NOTICE_IS_GENERIC 0x1
#define MAD_NOTICE_TYPE_FATAL 0x0
#define MAD_NOTICE_TYPE_URGENT 0x1
#define MAD_NOTICE_TYPE_SECURITY 0x2
#define MAD_NOTICE_TYPE_SUBNET_MGMT 0x3
#define MAD_NOTICE_TYPE_INFO 0x4
#define MAD_NOTICE_NODETYPE_CA 0x1
#define MAD_NOTICE_NODETYPE_SWITCH 0x2
#define MAD_NOTICE_NODETYPE_ROUTER 0x3
#define MAD_NOTICE_NODETYPE_SUBNET_MANAGEMENT 0x4
#define MAD_NOTICE_TRAP_NUMBER_RESERVED 0xFFFF
/* InformInfo: Table 106 */
#if defined(_BIT_FIELDS_HTOL)
typedef struct ib_mad_informinfo_s {
#elif defined(_BIT_FIELDS_LTOH)
typedef struct ib_mad_informinfo_s {
#else
#endif /* _BIT_FIELDS_HTOL */
#define MAD_INFORMINFO_ALL_ENDPORTS_RANGE 0xFFFF
#define MAD_INFORMINFO_FORWARD_GENERIC 0x1
#define MAD_INFORMINFO_FORWARD_VENDOR_SPECIFIC 0x0
#define MAD_INFORMINFO_SUBSCRIBE 0x1
#define MAD_INFORMINFO_UNSUBSCRIBE 0x0
#define MAD_INFORMINFO_TRAP_NUMBER_FORWARD_ALL 0xFFFF
#define MAD_INFORMINFO_TRAP_TYPE_FATAL 0x0
#define MAD_INFORMINFO_TRAP_TYPE_URGENT 0x1
#define MAD_INFORMINFO_TRAP_TYPE_SECURITY 0x2
#define MAD_INFORMINFO_TRAP_TYPE_SUBNET_MGMT 0x3
#define MAD_INFORMINFO_TRAP_TYPE_INFORM 0x4
#define MAD_INFORMINFO_TRAP_TYPE_FORWARD_ALL 0xFFFF
#define MAD_INFORMINFO_NODETYPE_CA 0x1
#define MAD_INFORMINFO_NODETYPE_SWITCH 0x2
#define MAD_INFORMINFO_NODETYPE_ROUTER 0x3
#define MAD_INFORMINFO_NODETYPE_SUBNET_MANAGEMENT 0x4
#ifdef __cplusplus
}
#endif
#endif /* _SYS_IB_MGT_IB_MAD_H */