|
From: Steve S. <sj...@us...> - 2004-05-14 16:23:07
|
Update of /cvsroot/dapl/dapl/ibapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3144/ibapi Modified Files: dapl_ibapi_cm.c Log Message: Cleaned up CM_BUSTED ifdefs & interface to provider layer; added comments for IBHOSTS_NAMING operations. Index: dapl_ibapi_cm.c =================================================================== RCS file: /cvsroot/dapl/dapl/ibapi/dapl_ibapi_cm.c,v retrieving revision 1.48 retrieving revision 1.49 diff -C10 -d -r1.48 -r1.49 *** dapl_ibapi_cm.c 28 Apr 2004 18:49:28 -0000 1.48 --- dapl_ibapi_cm.c 14 May 2004 16:22:56 -0000 1.49 *************** *** 41,60 **** --- 41,75 ---- #include "dapl_name_service.h" /* * Prototypes */ ib_lid_t dapli_ib_lookup_address (DAT_IA_ADDRESS_PTR); int g_dapl_loopback_connection = 0; + #ifdef CM_BUSTED + /* + * GLOBAL VARIABLE!! + * + * Can be set by the application program, or perhaps by DAPL. + * + * The remote LID is set to the least significant 16 bits of the + * specified host's IP address. This will guarantee uniqness within + * the test machines' IP subnet. + * + */ + ib_lid_t __RemoteLID = 0xabab; + #endif /* CM_BUSTED */ + + /* * simple inline macro to convert CM error codes to DAT */ STATIC _INLINE_ DAT_RETURN dapli_cm_status_convert ( IN ib_int32_t ib_status) { switch ( ib_status ) { case IB_CM_OK: *************** *** 79,137 **** { /* IB_CM_NETWORK_FAILURE */ /* IB_CM_DESTINATION_UNREACHABLE */ /* IB_CM_DESTINATION_REJECT */ return DAT_ERROR (DAT_INTERNAL_ERROR,0); } } } - #ifdef CM_BUSTED - - - /* - * GLOBAL VARIABLE!! - * - * Can be set by the application program, or perhaps by DAPL. - * - * The remote LID is set to the least significant 16 bits of the - * specified host's IP address. This will guarantee uniqness within - * the test machines' IP subnet. - * - */ - ib_lid_t __RemoteLID = 0xabab; - - DAT_RETURN - dapl_set_remote_lid ( - char *rhost_name ) - { - int result; - struct addrinfo *addr; - - result = dapls_osd_getaddrinfo (rhost_name, &addr); - if (0 != result) - { - dapl_dbg_log (DAPL_DBG_TYPE_WARN, - "getaddrinfo error: %s", gai_strerror (result)); - return DAT_ERROR (DAT_INVALID_PARAMETER,0); - } - - __RemoteLID = dapli_ib_lookup_address (addr->ai_addr); - - dapls_osd_freeaddrinfo (addr); - - return DAT_SUCCESS; - } - - #endif /* CM_BUSTED */ - /* * dapls_ib_connect * * Initiate a connection with the passive listener on another node * * Input: * ep_handle, * remote_ia_address, * remote_conn_qual, --- 94,113 ---- *************** *** 1122,1142 **** * * Returns: * DAT_SUCCESS * DAT_INSUFFICIENT_RESOURCES * DAT_INVALID_PARAMETER * */ DAT_RETURN dapls_ib_cm_remote_addr ( IN DAT_HANDLE dat_handle, - IN DAPL_PRIVATE *prd_ptr, OUT DAT_SOCK_ADDR6 *remote_ia_address ) { DAPL_HEADER *header; ib_int32_t ib_status; ib_cm_handle_t ib_cm_handle; header = (DAPL_HEADER *)dat_handle; ib_cm_handle = IB_INVALID_HANDLE; ib_status = IBA_OK; --- 1098,1117 ---- *************** *** 1145,1169 **** struct addrinfo *addr; (void) dapls_osd_getaddrinfo ("localhost", &addr); *remote_ia_address = *addr->ai_addr; } return DAT_SUCCESS; #endif #ifdef IBHOSTS_NAMING ! if (prd_ptr != NULL) ! { ! *(DAT_SOCK_ADDR *)remote_ia_address = prd_ptr->hca_address; ! } ! return DAT_SUCCESS; #endif /* IBHOSTS_NAMING */ #ifdef DAPL_ATS if (header->magic == DAPL_MAGIC_EP) { ib_cm_handle = ((DAPL_EP *) dat_handle)->cm_handle; } else if (header->magic == DAPL_MAGIC_CR) --- 1120,1142 ---- struct addrinfo *addr; (void) dapls_osd_getaddrinfo ("localhost", &addr); *remote_ia_address = *addr->ai_addr; } return DAT_SUCCESS; #endif #ifdef IBHOSTS_NAMING ! /* The address was extracted from the private data and saved into ! * the CR structure during a connection request. ! */ return DAT_SUCCESS; #endif /* IBHOSTS_NAMING */ #ifdef DAPL_ATS if (header->magic == DAPL_MAGIC_EP) { ib_cm_handle = ((DAPL_EP *) dat_handle)->cm_handle; } else if (header->magic == DAPL_MAGIC_CR) *************** *** 1250,1269 **** --- 1223,1246 ---- * * Returns: * length of private data * */ int dapls_ib_private_data_size ( IN DAPL_PRIVATE *prd_ptr, IN DAPL_PDATA_OP conn_op) { + #ifdef CM_BUSTED + conn_op = 0xffff; /* value for default case below */ + #endif + switch (conn_op) { case DAPL_PDATA_CONN_REQ: { return IB_MAX_REQ_PDATA_SIZE; break; } case DAPL_PDATA_CONN_REP: { return IB_MAX_REP_PDATA_SIZE; |