#ifndef _SYS_IB_IB_TYPES_H
#define _SYS_IB_IB_TYPES_H
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define IB_EUI64_COMPANYID_MASK 0x0000000000FFFFFF
#define IB_EUI64_COMPANYID_SHIFT 40
#define IB_EUI64_IDENTIFIER_MASK 0x000000FFFFFFFFFF
#define IB_LID_UC_FIRST 0x0001
#define IB_LID_UC_LAST 0xBFFF
#define IB_LID_MC_FIRST 0xC000
#define IB_LID_MC_LAST 0xFFFE
#define IB_LID_PERMISSIVE 0xFFFF
typedef uint64_t ib_guid_t;
typedef uint64_t ib_sn_prefix_t;
typedef struct ib_ucast_gid_s {
ib_sn_prefix_t ugid_prefix;
ib_guid_t ugid_guid;
} ib_ucast_gid_t;
typedef struct ib_mcast_gid_s {
uint32_t mcast_gid_prefix;
uint8_t mcast_gid_bytes[12];
} ib_mcast_gid_t;
typedef struct ib_gid_s {
union {
ib_ucast_gid_t ucast_gid;
ib_mcast_gid_t mcast_gid;
} gid;
} ib_gid_t;
#define gid_prefix gid.ucast_gid.ugid_prefix
#define gid_guid gid.ucast_gid.ugid_guid
#define mgid_prefix gid.mcast_gid.mcast_gid_prefix
#define mgid_bytes gid.mcast_gid.mcast_gid_bytes
#define IB_GID_DEFAULT_PREFIX 0xFE80000000000000
#define IB_GID_SUBNET_LOCAL_PREFIX IB_GID_DEFAULT_PREFIX
#define IB_GID_SITE_LOCAL_PREFIX 0xFEC0000000000000
#define IB_GID_SITE_LOCAL_SUBNET_MASK 0x000000000000FFFF
#define IB_MCGID_PREFIX 0xFF000000
#define IB_MCGID_TRANSIENT_FLAG 0x00100000
#define IB_MC_SCOPE_SUBNET_LOCAL 0x02
#define IB_MC_SCOPE_SITE_LOCAL 0x05
#define IB_MC_SCOPE_ORG_LOCAL 0x08
#define IB_MC_SCOPE_GLOBAL 0x0E
#define IB_MC_JSTATE_FULL 0x01
#define IB_MC_JSTATE_NON 0x02
#define IB_MC_JSTATE_SEND_ONLY_NON 0x04
#define IB_MC_QPN 0xFFFFFF
#define IB_MCGID_IPV4_PREFIX 0xFF10401B
#define IB_MCGID_IPV6_PREFIX 0xFF10601B
#define IB_MCGID_SA_PREFIX 0xFF10A01B
typedef uint16_t ib_lid_t;
typedef uint8_t ib_path_bits_t;
#define IB_PKEY_DEFAULT_FULL 0xFFFF
#define IB_PKEY_DEFAULT_LIMITED 0x7FFF
#define IB_PKEY_INVALID_FULL 0x8000
#define IB_PKEY_INVALID_LIMITED 0x0000
#define IB_GSI_QKEY 0x80010000
#define IB_PRIVILEGED_QKEY_BIT 0x80000000
typedef uint16_t ib_pkey_t;
typedef uint32_t ib_qkey_t;
typedef uint16_t ib_pkey_cntr_t;
typedef uint16_t ib_qkey_cntr_t;
typedef uint64_t ib_smkey_t;
typedef uint16_t ib_ethertype_t;
typedef uint32_t ib_qpn_t;
typedef uint32_t ib_eecn_t;
#define IB_QPN_MASK 0xFFFFFF
typedef uint32_t ib_msglen_t;
typedef uint64_t ib_vaddr_t;
typedef uint64_t ib_memlen_t;
typedef uint64_t ib_svc_id_t;
#define IB_SVC_NAME_LEN 64
#define IB_SVC_DATA_LEN 64
typedef enum {
IB_MTU_NOT_SPECIFIED = 0,
IB_MTU_256 = 1,
IB_MTU_512 = 2,
IB_MTU_1K = 3,
IB_MTU_2K = 4,
IB_MTU_4K = 5
} ib_mtu_t;
typedef uint8_t ib_time_t;
#define IB_TIME_EXP_MASK 0x3F
#define IB_SID_MASK 0x00FFFFFFFFFFFFFF
#define IB_SID_AGN_MASK 0xFF00000000000000
#define IB_SID_AGN_IBTA 0x0000000000000000
#define IB_SID_AGN_IETF 0x0100000000000000
#define IB_SID_AGN_LOCAL 0x0200000000000000
#define IB_SID_IPADDR_PREFIX 0x0000000001000000
#define IB_SID_IPADDR_PREFIX_MASK 0xFFFFFFFFFE000000
#define IB_SID_IPADDR_IPNUM_MASK 0x0000000000FF0000
#define IB_SID_IPADDR_PORTNUM_MASK 0x000000000000FFFF
#ifdef __cplusplus
}
#endif
#endif