-Add update flag support and source for Windows deployment
git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2101 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
parent
5a4cb12978
commit
310bf858a4
@ -8,6 +8,7 @@ then
|
||||
|
||||
cd `dirname $0`
|
||||
echo '.svn' > /tmp/xcat-excludes
|
||||
echo 'upflag' >> /tmp/xcat-excludes
|
||||
|
||||
tar -X /tmp/xcat-excludes -cf /opt/freeware/src/packages/SOURCES/postscripts.tar postscripts LICENSE.html
|
||||
gzip -f /opt/freeware/src/packages/SOURCES/postscripts.tar
|
||||
|
26
xCAT/postscripts/upflag/upflag.sln
Normal file
26
xCAT/postscripts/upflag/upflag.sln
Normal file
@ -0,0 +1,26 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upflag", "upflag\upflag.vcproj", "{465C9528-34DA-400A-8D4E-82263BE95BBC}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Debug|x64.Build.0 = Debug|x64
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Release|Win32.Build.0 = Release|Win32
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Release|x64.ActiveCfg = Release|x64
|
||||
{465C9528-34DA-400A-8D4E-82263BE95BBC}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
BIN
xCAT/postscripts/upflag/upflag.suo
Normal file
BIN
xCAT/postscripts/upflag/upflag.suo
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflag/upflag/Release/BuildLog.htm
Normal file
BIN
xCAT/postscripts/upflag/upflag/Release/BuildLog.htm
Normal file
Binary file not shown.
1
xCAT/postscripts/upflag/upflag/Release/mt.dep
Normal file
1
xCAT/postscripts/upflag/upflag/Release/mt.dep
Normal file
@ -0,0 +1 @@
|
||||
Manifest resource last updated at 15:51:24.03 on Fri 06/20/2008
|
@ -0,0 +1,10 @@
|
||||
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
|
||||
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
BIN
xCAT/postscripts/upflag/upflag/Release/upflag.obj
Normal file
BIN
xCAT/postscripts/upflag/upflag/Release/upflag.obj
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflag/upflag/Release/vc90.idb
Normal file
BIN
xCAT/postscripts/upflag/upflag/Release/vc90.idb
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflag/upflag/Release/vc90.pdb
Normal file
BIN
xCAT/postscripts/upflag/upflag/Release/vc90.pdb
Normal file
Binary file not shown.
126
xCAT/postscripts/upflag/upflag/upflag.cpp
Normal file
126
xCAT/postscripts/upflag/upflag/upflag.cpp
Normal file
@ -0,0 +1,126 @@
|
||||
|
||||
#include "winsock2.h"
|
||||
#include "windows.h"
|
||||
#include "stdio.h"
|
||||
|
||||
void Usage()
|
||||
{
|
||||
printf("upflag Ver 0.0.0.1\n");
|
||||
printf("\nusage: upflag [hostname][port_number][test_to_send]\n");
|
||||
|
||||
printf("\nExamples:");
|
||||
printf("\nupflag some_hostname 5000 ready");
|
||||
printf("\nupflag some_hostname 5000 \"I am ready\"");
|
||||
printf("\nupflag 192.168.0.1 5000 ready\n\n");
|
||||
|
||||
}
|
||||
|
||||
int SendMsg(SOCKET conn_socket, TCHAR *szMsg)
|
||||
{
|
||||
TCHAR szIncomingMsg[255];
|
||||
|
||||
szMsg[lstrlen(szMsg)]= '\n\0';
|
||||
|
||||
recv(conn_socket, szIncomingMsg, sizeof(szIncomingMsg),0);
|
||||
|
||||
printf("\nrecv %s Len: %d ", szIncomingMsg, (int)strlen(szIncomingMsg));
|
||||
|
||||
if(strstr(strlwr(szIncomingMsg), "ready") == NULL)
|
||||
return 1;
|
||||
|
||||
send(conn_socket, (const char *)szMsg, (int)strlen((const char *)szMsg), 0);
|
||||
|
||||
lstrcpy(szIncomingMsg, "");
|
||||
recv(conn_socket, szIncomingMsg, sizeof(szIncomingMsg),0);
|
||||
|
||||
printf("\nsend %s Len: %d ", szMsg, strlen((const char *)szMsg));
|
||||
printf("\nrecv %s Len: %d ", szIncomingMsg, (int)strlen(szIncomingMsg));
|
||||
|
||||
if(strstr(strlwr(szIncomingMsg), "done") != NULL)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
|
||||
}
|
||||
|
||||
int main(int argc, TCHAR* argv[])
|
||||
{
|
||||
SOCKET conn_socket;
|
||||
struct hostent *hp;
|
||||
unsigned int addr;
|
||||
struct sockaddr_in sa;
|
||||
WSADATA wsaData;
|
||||
int iPort;
|
||||
|
||||
if((argc < 2) || (lstrcmpi(argv[1] ,"/?") == 0) || (lstrcmpi(argv[1] ,"-?") == 0))
|
||||
{
|
||||
Usage();
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(argc == 1)
|
||||
{
|
||||
Usage();
|
||||
}
|
||||
|
||||
|
||||
if (WSAStartup(0x0101,&wsaData) == SOCKET_ERROR)
|
||||
{
|
||||
WSACleanup();
|
||||
printf("WSAStartup failed with error %d\n",WSAGetLastError());
|
||||
return 1;
|
||||
}
|
||||
|
||||
if((hp = gethostbyname((LPCSTR)argv[1])) == NULL)
|
||||
{
|
||||
addr = inet_addr((LPCSTR)argv[1]);
|
||||
hp = gethostbyaddr((LPCSTR)&addr,4,AF_INET);
|
||||
}
|
||||
|
||||
memset((LPSTR)&sa,0, sizeof(sa));
|
||||
memcpy((TCHAR*)&sa.sin_addr, hp->h_addr_list[0] , hp->h_length);
|
||||
|
||||
iPort = atoi((LPCSTR)argv[2]);
|
||||
|
||||
//sa.sin_addr = hp->h_addr_list[0];
|
||||
sa.sin_family = PF_INET;
|
||||
sa.sin_port = htons((u_short)iPort);
|
||||
|
||||
conn_socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
printf("\nConnecting... ");
|
||||
|
||||
int z = connect(conn_socket, (struct sockaddr*)&sa, sizeof(sa));
|
||||
|
||||
if(z == SOCKET_ERROR)
|
||||
{
|
||||
z = connect(conn_socket, (struct sockaddr*)&sa, sizeof(sa));
|
||||
|
||||
if(z == SOCKET_ERROR)
|
||||
{
|
||||
printf("\nUnable to connect to host.");
|
||||
printf("\nWSAStartup failed with error %d\n",WSAGetLastError());
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("connection was successfull.\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("connection was successfull.\n");
|
||||
}
|
||||
|
||||
if(SendMsg(conn_socket, argv[3]) == 0)
|
||||
{
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
WSACleanup();
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
347
xCAT/postscripts/upflag/upflag/upflag.vcproj
Normal file
347
xCAT/postscripts/upflag/upflag/upflag.vcproj
Normal file
@ -0,0 +1,347 @@
|
||||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="upflag"
|
||||
ProjectGUID="{465C9528-34DA-400A-8D4E-82263BE95BBC}"
|
||||
RootNamespace="upflag"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
<Platform
|
||||
Name="x64"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="2"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="ws2_32.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|x64"
|
||||
OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
UseOfMFC="1"
|
||||
CharacterSet="0"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions="ws2_32.lib"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="17"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\upflag.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
BIN
xCAT/postscripts/upflag/upflag/x64/Release/BuildLog.htm
Normal file
BIN
xCAT/postscripts/upflag/upflag/x64/Release/BuildLog.htm
Normal file
Binary file not shown.
1
xCAT/postscripts/upflag/upflag/x64/Release/mt.dep
Normal file
1
xCAT/postscripts/upflag/upflag/x64/Release/mt.dep
Normal file
@ -0,0 +1 @@
|
||||
Manifest resource last updated at 15:51:42.85 on Fri 06/20/2008
|
@ -0,0 +1,10 @@
|
||||
<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
|
||||
<assembly xmlns='urn:schemas-microsoft-com:asm.v1' manifestVersion='1.0'>
|
||||
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
|
||||
<security>
|
||||
<requestedPrivileges>
|
||||
<requestedExecutionLevel level='asInvoker' uiAccess='false' />
|
||||
</requestedPrivileges>
|
||||
</security>
|
||||
</trustInfo>
|
||||
</assembly>
|
BIN
xCAT/postscripts/upflag/upflag/x64/Release/upflag.obj
Normal file
BIN
xCAT/postscripts/upflag/upflag/x64/Release/upflag.obj
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflag/upflag/x64/Release/vc90.idb
Normal file
BIN
xCAT/postscripts/upflag/upflag/x64/Release/vc90.idb
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflag/upflag/x64/Release/vc90.pdb
Normal file
BIN
xCAT/postscripts/upflag/upflag/x64/Release/vc90.pdb
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflagx64.exe
Normal file
BIN
xCAT/postscripts/upflagx64.exe
Normal file
Binary file not shown.
BIN
xCAT/postscripts/upflagx86.exe
Normal file
BIN
xCAT/postscripts/upflagx86.exe
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user