mirror of
https://bitbucket.org/anguist/ntpa
synced 2025-10-06 11:04:40 +00:00
Version 0.7.0 prerelease changes
This commit is contained in:
26
Ntp.Analyzer.Monitor.Cli/AssemblyInfo.cs
Normal file
26
Ntp.Analyzer.Monitor.Cli/AssemblyInfo.cs
Normal file
@ -0,0 +1,26 @@
|
||||
//
|
||||
// Copyright (c) 2013-2016 Carsten Sonne Larsen <cs@innolan.dk>
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: AssemblyVersion("0.7.0.0")]
|
||||
[assembly: AssemblyCopyright("Copyright (c) 2013-2016 Carsten Sonne Larsen <cs@innolan.dk>")]
|
||||
[assembly: AssemblyCulture("")]
|
62
Ntp.Analyzer.Monitor.Cli/Ntp.Analyzer.Monitor.Cli.csproj
Normal file
62
Ntp.Analyzer.Monitor.Cli/Ntp.Analyzer.Monitor.Cli.csproj
Normal file
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{0349CF56-C07C-46B5-B9CD-2BCB2709EE0A}</ProjectGuid>
|
||||
<OutputType>Exe</OutputType>
|
||||
<RootNamespace>Ntp.Analyzer.Monitor.Cli</RootNamespace>
|
||||
<ReleaseVersion>0.7.0</ReleaseVersion>
|
||||
<AssemblyName>Ntp.Analyzer.Monitor.Cli</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\bin</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>none</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\bin</OutputPath>
|
||||
<DefineConstants>TRACE;</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<ConsolePause>false</ConsolePause>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>Ntp.Analyzer.Monitor.Cli.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="AssemblyInfo.cs" />
|
||||
<Compile Include="Program.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Ntp.Analyzer.Monitor.Client\Ntp.Analyzer.Monitor.Client.csproj">
|
||||
<Project>{44d739da-4cd4-4214-88ee-a9a293bb32b5}</Project>
|
||||
<Name>Ntp.Analyzer.Monitor.Client</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Ntp.Common\Ntp.Common.csproj">
|
||||
<Project>{86848f80-2692-47ab-a68a-bfb2990b632e}</Project>
|
||||
<Name>Ntp.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ProjectExtensions>
|
||||
<MonoDevelop>
|
||||
<Properties>
|
||||
<Deployment.LinuxDeployData scriptName="ntpac" />
|
||||
</Properties>
|
||||
</MonoDevelop>
|
||||
</ProjectExtensions>
|
||||
</Project>
|
76
Ntp.Analyzer.Monitor.Cli/Program.cs
Normal file
76
Ntp.Analyzer.Monitor.Cli/Program.cs
Normal file
@ -0,0 +1,76 @@
|
||||
//
|
||||
// Copyright (c) 2013-2016 Carsten Sonne Larsen <cs@innolan.dk>
|
||||
//
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
// of this software and associated documentation files (the "Software"), to deal
|
||||
// in the Software without restriction, including without limitation the rights
|
||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
// copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be included in
|
||||
// all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
// THE SOFTWARE.
|
||||
|
||||
using System;
|
||||
using System.Net;
|
||||
using Ntp.Analyzer.Monitor.Client;
|
||||
|
||||
namespace Ntp.Analyzer.Monitor.Cli
|
||||
{
|
||||
public static class Program
|
||||
{
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
if (args.Length >= 1 && args[0] == "help")
|
||||
{
|
||||
ShowUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length != 3)
|
||||
{
|
||||
ShowUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
IPAddress address;
|
||||
|
||||
if (!IPAddress.TryParse(args[0], out address))
|
||||
{
|
||||
Console.WriteLine("IP address is not valid.");
|
||||
ShowUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
int port;
|
||||
|
||||
if (!int.TryParse(args[1], out port))
|
||||
{
|
||||
Console.WriteLine("Port number is not valid.");
|
||||
ShowUsage();
|
||||
return;
|
||||
}
|
||||
|
||||
string command = args[2];
|
||||
|
||||
var req = new TextRequest(address, port);
|
||||
string result = req.Send(command);
|
||||
|
||||
Console.WriteLine(result);
|
||||
}
|
||||
|
||||
private static void ShowUsage()
|
||||
{
|
||||
Console.WriteLine("NTP Analyzer command query tool.");
|
||||
Console.WriteLine("Usage: ntpac host port command");
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user