Commit d9d6e53b authored by Sumit Narayan's avatar Sumit Narayan
Browse files

Added new BMI get info option - BMI_QUERY_TRANSPORT_METHOD to query if

BMI supports the given protocol.
parent c2f6be3c
...@@ -85,7 +85,8 @@ enum ...@@ -85,7 +85,8 @@ enum
BMI_TCP_CLOSE_SOCKET = 13, BMI_TCP_CLOSE_SOCKET = 13,
BMI_OPTIMISTIC_BUFFER_REG = 14, BMI_OPTIMISTIC_BUFFER_REG = 14,
BMI_TCP_CHECK_UNEXPECTED = 15, BMI_TCP_CHECK_UNEXPECTED = 15,
BMI_ZOID_POST_TIMEOUT = 16 BMI_ZOID_POST_TIMEOUT = 16,
BMI_QUERY_TRANSPORT_METHOD = 17,
}; };
enum BMI_io_type enum BMI_io_type
......
...@@ -1428,6 +1428,34 @@ int BMI_get_info(BMI_addr_t addr, ...@@ -1428,6 +1428,34 @@ int BMI_get_info(BMI_addr_t addr,
} }
break; break;
case BMI_QUERY_TRANSPORT_METHOD:
{
int i = 0;
int kmc = sizeof(static_methods) / sizeof(static_methods[0]) - 1;
int length = strlen("bmi_") + strlen((char*) inout_parameter) + 1;
char *method = malloc(length);
if (method == NULL)
{
return -1;
}
memset(method, 0, length);
strcpy(method, "bmi_");
strcat(method, (char*) inout_parameter);
for (i = 0; i < kmc; ++i)
{
if (strcmp(static_methods[i]->method_name, method) == 0)
{
free(method);
return 1;
}
}
free(method);
}
break;
default: default:
return (bmi_errno_to_pvfs(-ENOSYS)); return (bmi_errno_to_pvfs(-ENOSYS));
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment