[WSD] Add support for controlling SA timeout/retry settings, as well as
[mirror/winof/.git] / ulp / wsd / user / ibspdll.c
index aa0f389..f8a5daf 100644 (file)
@@ -52,6 +52,9 @@ static const GUID provider_guid = {
 static DWORD   no_read = 0;\r
 uint32_t               g_max_inline = 0xFFFFFFFF;\r
 uint32_t               g_max_poll = 500;\r
+uint32_t               g_sa_timeout = 500;\r
+uint32_t               g_sa_retries = 4;\r
+int                            g_connect_err = WSAEADDRNOTAVAIL;\r
 \r
 \r
 /*\r
@@ -120,6 +123,18 @@ _DllMain(
                if( i && i <= 16 )\r
                        g_max_poll = _tcstoul( env_var, NULL, 10 );\r
 \r
+               i = GetEnvironmentVariable( "IBWSD_SA_RETRY", env_var, sizeof(env_var) );\r
+               if( i && i <= 16 )\r
+                       g_sa_retries = _tcstoul( env_var, NULL, 10 );\r
+\r
+               i = GetEnvironmentVariable( "IBWSD_SA_TIMEOUT", env_var, sizeof(env_var) );\r
+               if( i && i <= 16 )\r
+                       g_sa_timeout = _tcstoul( env_var, NULL, 10 );\r
+\r
+               i = GetEnvironmentVariable( "IBWSD_NO_IPOIB", env_var, sizeof(env_var) );\r
+               if( i )\r
+                       g_connect_err = WSAENETDOWN;\r
+\r
                if( init_globals() )\r
                        return FALSE;\r
 \r
@@ -755,7 +770,7 @@ IBSPConnect(
                IBSP_ERROR_EXIT(\r
                        ("query_guid_address failed for IP %08x\n",\r
                        addr->sin_addr.s_addr) );\r
-               *lpErrno = WSAEADDRNOTAVAIL;\r
+               *lpErrno = g_connect_err;\r
                return SOCKET_ERROR;\r
        }\r
 \r
@@ -775,7 +790,7 @@ IBSPConnect(
        {\r
                IBSP_ERROR_EXIT(\r
                        ("query_pr failed for IP %08x\n", addr->sin_addr.s_addr) );\r
-               *lpErrno = WSAEADDRNOTAVAIL;\r
+               *lpErrno = g_connect_err;\r
                return SOCKET_ERROR;\r
        }\r
 \r