/**************************************************************************************** * * PUBLIC: st_clearsettings * ***************************************************************************************/ TResult CSvcUuinterface::st_clearsettings( TConfigValue aArgs ) { TResult rv; int ret; char commandLine [MAX_COMMANDLINE]; char finalSrc[TOTAL_MAX_ADDRESS_LEN]; char finalDst[TOTAL_MAX_ADDRESS_LEN]; // check the values in the config values structure ret = CheckConfigValue( aArgs, finalSrc, finalDst ); if ( ret == ERR_INVALIDARG ) { memset( &rv, 0, sizeof(rv) ); rv.iStandardResult = ERR_INVALIDARG; return rv; } // construct the command line snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -r %s %s", finalSrc, finalDst ); // execute the command and return the result ret = execute(commandLine, &rv); assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) ); return rv; }
/**************************************************************************************** * * PUBLIC: st_setdelay * ***************************************************************************************/ TResult CSvcUuinterface::st_setdelay( TConfigValue aArgs ) { TResult rv; int ret; char commandLine[MAX_COMMANDLINE]; char finalSrc[TOTAL_MAX_ADDRESS_LEN]; char finalDst[TOTAL_MAX_ADDRESS_LEN]; // check the values in the config values structure ret = CheckConfigValue( aArgs, finalSrc, finalDst ); if ( ret == ERR_INVALIDARG ) { memset( &rv, 0, sizeof(rv) ); rv.iStandardResult = ERR_INVALIDARG; return rv; } // construct the command line snprintf( commandLine, MAX_COMMANDLINE, "./config_nistnet_add.pl -u -a %s %s --delay %d.%d %d.%d/%d.%d", finalSrc, finalDst, aArgs.iValueIntegerPart, aArgs.iValueFractionPart, aArgs.iSigmaIntegerPart, aArgs.iSigmaFractionPart, aArgs.iCorrelationIntegerPart, aArgs.iCorrelationFractionPart ); // execute the command and return the result ret = execute(commandLine, &rv); assert ( (ret == ERR_FAILEDTOEXECUTECOMMAND) || (ret == ERR_NONE) ); return rv; }
GLXFBConfig* GLXGraphicsystem::GetMatchingPixmapConfig(Display *curDisplay) { int neededMaskAttribute[] = { GLX_DRAWABLE_TYPE,GLX_PIXMAP_BIT, GLX_DRAWABLE_TYPE,GLX_WINDOW_BIT, GLX_BIND_TO_TEXTURE_TARGETS_EXT,GLX_TEXTURE_2D_BIT_EXT, None }; int neededValueAttribute[] = { GLX_BUFFER_SIZE,32, GLX_ALPHA_SIZE,8, GLX_BIND_TO_TEXTURE_RGBA_EXT,True, None }; LOG_DEBUG("GLXGraphicsystem", "Choose pixmap GL configuration"); int screen = DefaultScreen(curDisplay); GLXFBConfig *currentFBconfigs; int i = 0; int j = 0; int nConfigs = 0; currentFBconfigs = glXGetFBConfigs(curDisplay, screen, &nConfigs); for (i = 0; i < nConfigs; i++) { GLXFBConfig config = currentFBconfigs[i]; bool result = true; /* check first all mask values */ j = 0; while ( neededMaskAttribute[j] != None && result == true ) { result = CheckConfigMask(curDisplay,config, neededMaskAttribute[j], neededMaskAttribute[j+1]); j += 2; } /* no matching found in needed mask attribute, skip config take next */ if (result == false ) { continue; } /* check all fixed values */ /* reset attribute counter */ j = 0; /* check all fixed values */ while ( neededValueAttribute[j] != None && result == true ) { result = CheckConfigValue(curDisplay,config, neededValueAttribute[j], neededValueAttribute[j+1]); j += 2; } /* no matching found in needed fixed value attribute, skip config take next */ if (result == false ) { continue; } break; } if (i == nConfigs) { LOG_ERROR("GLXGraphicsystem", "Unable to find FBconfig for texturing"); return NULL; } LOG_DEBUG("GLXGraphicsystem", "Done choosing GL Pixmap configuration"); return ¤tFBconfigs[i]; }