Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions definitions/Definitions.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,20 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)../interfaces/json/JIOConnector.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JIOConnector.h</Outputs>
</CustomBuild>
<CustomBuild Include="..\interfaces\IDHCPServer.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ClInclude</OutputItemType>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ClInclude</OutputItemType>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ClInclude</OutputItemType>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ClInclude</OutputItemType>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JDHCPServer.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)../interfaces/json/JDHCPServer.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)../interfaces/json/JDHCPServer.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JDHCPServer.h</Outputs>
</CustomBuild>
<ClInclude Include="ValuePoint.h" />
<CustomBuild Include="..\interfaces\IMath.h">
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JMath.h</Outputs>
Expand Down Expand Up @@ -370,9 +384,6 @@
<CustomBuild Include="..\jsonrpc\DeviceInfo.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\DHCPServer.json">
<FileType>Document</FileType>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\DIALServer.json">
<FileType>Document</FileType>
</CustomBuild>
Expand Down
13 changes: 4 additions & 9 deletions definitions/Definitions.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@
<ClCompile Include="..\interfaces\json\JsonEnum_PerformanceMonitor.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_Power.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_Provisioning.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -152,9 +149,6 @@
<CustomBuild Include="..\jsonrpc\DeviceInfo.json">
<Filter>JSON Files</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\DHCPServer.json">
<Filter>JSON Files</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\DIALServer.json">
<Filter>JSON Files</Filter>
</CustomBuild>
Expand Down Expand Up @@ -230,9 +224,6 @@
<CustomBuild Include="..\jsonrpc\PerformanceMonitor.json">
<Filter>JSON Files</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Power.json">
<Filter>JSON Files</Filter>
</CustomBuild>
<CustomBuild Include="..\jsonrpc\Provisioning.json">
<Filter>JSON Files</Filter>
</CustomBuild>
Expand Down Expand Up @@ -260,6 +251,10 @@
<CustomBuild Include="..\interfaces\IIOConnector.h">
<Filter>Interface Files</Filter>
</CustomBuild>
<CustomBuild Include="..\interfaces\IPower.h" />
<CustomBuild Include="..\interfaces\IDHCPServer.h">
<Filter>Interface Files</Filter>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<None Include="..\jsonrpc\common.json">
Expand Down
76 changes: 76 additions & 0 deletions interfaces/IDHCPServer.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2021 Metrological
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#pragma once

#include "Module.h"

// @insert <com/IIteratorType.h>

namespace Thunder {

namespace Exchange {

// @json 1.0.0 @text:legacy_lowercase
struct EXTERNAL IDHCPServer : virtual public Core::IUnknown {

enum { ID = ID_DHCP_SERVER };

struct Lease {
string name /* @brief Client identifier (or client hardware address if identifier is absent) (e.g. 00e04c326c56) */;
string ip /* @brief Client IP address (e.g. 192.168.0.10) */;
Core::OptionalType<Core::Time> expires /* @brief Client IP expiration time (in ISO8601 format, empty: never expires) (e.g. 2019-05-07T07:20:26Z) */;
};

struct Server {
string interface /* @brief Network interface name (e.g. eth0) */;
bool active /* @brief Denotes if server is currently active (e.g. true) */;
Core::OptionalType<string> begin /* @brief IP address pool start (e.g. 192.168.0.10) */;
Core::OptionalType<string> end /* @brief IP address pool end (e.g. 192.168.0.100) */;
Core::OptionalType<string> router /* @brief Router IP address (e.g. 192.168.0.1) */;
Core::OptionalType<std::vector<Lease>> leases /* @brief List of IP address leases @restrict:100 */;
};

typedef RPC::IIteratorType<Server, ID_DHCP_SERVER_SERVERS> IServerIterator;

// @brief Activates a DHCP server
// @param interface: Network interface name (e.g. eth0)
// @retval ERROR_GENERAL: Failed to activate server
// @retval ERROR_UNKNOWN_KEY: Invalid interface name given
// @retval ERROR_ILLEGAL_STATE: Server is already activated
virtual Core::hresult Activate(const string& interface) = 0;

// @brief Deactivates a DHCP server
// @param interface: Network interface name (e.g. eth0)
// @retval ERROR_GENERAL: Failed to deactivate server
// @retval ERROR_UNKNOWN_KEY: Invalid interface name given
// @retval ERROR_ILLEGAL_STATE: Server is not activated
virtual Core::hresult Deactivate(const string& interface) = 0;

// @property
// @brief Server status
// @param interface: Server name, if omitted, status of all configured servers is returned (e.g. eth0)
// @param servers: List of configured servers
// @retval ERROR_UNKNOWN_KEY: Invalid server name given
virtual Core::hresult Status(const Core::OptionalType<string>& interface /* @index */, IServerIterator*& servers /* @out @extract */) const = 0;
};

} // namespace Exchange

}
5 changes: 4 additions & 1 deletion interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,10 @@ namespace Exchange {
ID_MEMORY_MONITOR_NOTIFICATION = ID_MEMORY_MONITOR + 1,

ID_IOCONNECTOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x580,
ID_IOCONNECTOR_NOTIFICATION = ID_IOCONNECTOR + 1
ID_IOCONNECTOR_NOTIFICATION = ID_IOCONNECTOR + 1,

ID_DHCP_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x590,
ID_DHCP_SERVER_SERVERS = ID_DHCP_SERVER + 1
};
}
}
1 change: 1 addition & 0 deletions interfaces/Interfaces.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@
<ClInclude Include="ICryptography.h" />
<ClInclude Include="IDeviceIdentification.h" />
<ClInclude Include="IDeviceInfo.h" />
<ClInclude Include="IDHCPServer.h" />
<ClInclude Include="IDIALServer.h" />
<ClInclude Include="IDictionary.h" />
<ClInclude Include="IDisplayInfo.h" />
Expand Down
1 change: 1 addition & 0 deletions interfaces/Interfaces.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
<ClInclude Include="Module.h" />
<ClInclude Include="ValuePoint.h" />
<ClInclude Include="IIOConnector.h" />
<ClInclude Include="IDHCPServer.h" />
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
Expand Down
168 changes: 0 additions & 168 deletions jsonrpc/DHCPServer.json

This file was deleted.

Loading