1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H
28 #define	_SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 #include <sys/ib/mgt/sa_recs.h>
35 
36 /*
37  * The defines, sizes, and functions used in ibmf_saa_utils.h are currently
38  * based on version 1.1 of the IB spec.  With each iteration of the
39  * spec this file and ibmf_saa_utils.c must be updated.
40  */
41 int
42 ibmf_saa_utils_pack_sa_hdr(ib_sa_hdr_t *sa_hdr, void **packed_class_hdr,
43     size_t *packed_class_hdr_len, int km_sleep_flag);
44 
45 int
46 ibmf_saa_utils_unpack_sa_hdr(void *packed_class_hdr,
47     size_t packed_class_hdr_len, ib_sa_hdr_t **sa_hdr, int km_sleep_flag);
48 
49 int
50 ibmf_saa_utils_unpack_payload(uchar_t *buf_payload, size_t buf_payload_length,
51     uint16_t attr_id, void **structs_payloadp, size_t *structs_payload_lengthp,
52     uint16_t attr_offset, boolean_t is_get_resp, int km_sleep_flag);
53 
54 int
55 ibmf_saa_utils_pack_payload(uchar_t *structs_payload, size_t
56     structs_payload_length, uint16_t attr_id, void **buf_payloadp,
57     size_t *buf_payload_lengthp, int km_sleep_flag);
58 
59 void
60 ibmf_saa_gid_trap_parse_buffer(uchar_t *buffer, sm_trap_64_t *sm_trap_64);
61 
62 void
63 ibmf_saa_capmask_chg_trap_parse_buffer(uchar_t *buffer,
64     sm_trap_144_t *sm_trap_144);
65 
66 void
67 ibmf_saa_sysimg_guid_chg_trap_parse_buffer(uchar_t *buffer,
68     sm_trap_145_t *sm_trap_145);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif	/* _SYS_IB_MGT_IBMF_IBMF_SAA_UTILS_H */
75