210 lines
6.5 KiB
C++
210 lines
6.5 KiB
C++
/*
|
||
E1.37-2.h.h
|
||
|
||
Copyright (c) 2021 Kevin Matz (kevin.matz@gmail.com)
|
||
|
||
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.
|
||
*/
|
||
#pragma once
|
||
|
||
#include <cstdint>
|
||
#include "parameterdescription.h"
|
||
|
||
/**
|
||
* \ingroup RDM
|
||
* \details ANSI E1.37-2 – 2015 Entertainment Technology
|
||
* Additional Message Sets for ANSI E1.20 (RDM) – Part 2,
|
||
* IPv4 & DNS Configuration Messages
|
||
*/
|
||
namespace RDM {
|
||
// Appendix A: Defined Parameters (Normative)
|
||
|
||
static const uint32_t IPV4_UNCONFIGURED = 0x00000000;
|
||
static const uint32_t NO_DEFAULT_ROUTE = 0x00000000;
|
||
|
||
|
||
// Table A-1: RDM Parameter ID
|
||
/// \cite e137-2 4.1 Get Interface List (LIST_INTERFACES)
|
||
constexpr ParameterDescription LIST_INTERFACES = {
|
||
.pid = 0x0700,
|
||
.command_class = CC_GET,
|
||
.description = "Interface List",
|
||
};
|
||
/// \cite e137-2 4.2 Get Interface Name (INTERFACE_LABEL)
|
||
constexpr ParameterDescription INTERFACE_LABEL = {
|
||
.pid = 0x0701,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 4,
|
||
},
|
||
.command_class = CC_GET,
|
||
.description = "Interface Name",
|
||
};
|
||
/// \cite e137-2 4.3 Get Hardware Address (INTERFACE_HARDWARE_ADDRESS_TYPE1)
|
||
constexpr ParameterDescription INTERFACE_HARDWARE_ADDRESS_TYPE1 = {
|
||
.pid = 0x0702,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 0x0a,
|
||
},
|
||
.command_class = CC_GET,
|
||
.description = "Hardware Address",
|
||
};
|
||
/// \cite e137-2 4.4 Get/Set DHCP (IPV4_DHCP_MODE)
|
||
constexpr ParameterDescription IPV4_DHCP_MODE = {
|
||
.pid = 0x0703,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 5,
|
||
.set = 5,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "DHCP Mode",
|
||
};
|
||
/// \cite e137-2 4.5 Get/Set Zeroconf Mode (IPV4_ZEROCONF_MODE)
|
||
constexpr ParameterDescription IPV4_ZEROCONF_MODE = {
|
||
.pid = 0x0704,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 5,
|
||
.set = 5,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "Zeroconf Mode",
|
||
};
|
||
/// \cite e137-2 4.6 Get IPv4 Address / Netmask (IPV4_CURRENT_ADDRESS)
|
||
constexpr ParameterDescription IPV4_CURRENT_ADDRESS = {
|
||
.pid = 0x0705,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 0x0a,
|
||
},
|
||
.command_class = CC_GET,
|
||
.description = "IPv4 Address / Netmask",
|
||
};
|
||
/// \cite e137-2 4.7 Get/Set IPv4 Static Address (IPV4_STATIC_ADDRESS)
|
||
constexpr ParameterDescription IPV4_STATIC_ADDRESS = {
|
||
.pid = 0x0706,
|
||
.pdl = {
|
||
.get = 4,
|
||
.get_response = 9,
|
||
.set = 9,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "IPv4 Static Address",
|
||
};
|
||
/// \cite e137-2 4.9 Renew DHCP Lease (INTERFACE_RENEW_DHCP)
|
||
constexpr ParameterDescription INTERFACE_RENEW_DHCP = {
|
||
.pid = 0x0707,
|
||
.pdl = {
|
||
.set = 4,
|
||
},
|
||
.command_class = CC_SET,
|
||
.description = "Renew DHCP Lease",
|
||
};
|
||
/// \cite e137-2 4.10 Release DHCP Lease (INTERFACE_RELEASE_DHCP)
|
||
constexpr ParameterDescription INTERFACE_RELEASE_DHCP = {
|
||
.pid = 0x0708,
|
||
.pdl = {
|
||
.set = 4,
|
||
},
|
||
.command_class = CC_SET,
|
||
.description = "Release DHCP Lease",
|
||
};
|
||
/// \cite e137-2 4.8 Apply Interface Configuration (INTERFACE_APPLY_CONFIGURATION)
|
||
constexpr ParameterDescription INTERFACE_APPLY_CONFIGURATION = {
|
||
.pid = 0x0709,
|
||
.pdl = {
|
||
.set = 4,
|
||
},
|
||
.command_class = CC_SET,
|
||
.description = "Apply Interface Configuration",
|
||
};
|
||
/// \cite e137-2 4.11 Get/Set Default Route (IPV4_DEFAULT_ROUTE)
|
||
constexpr ParameterDescription IPV4_DEFAULT_ROUTE = {
|
||
.pid = 0x070A,
|
||
.pdl = {
|
||
.get_response = 8,
|
||
.set = 8,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "Default Route",
|
||
};
|
||
/// \cite e137-2 4.12 Get/Set Name Servers (DNS_IPV4_NAME_SERVER)
|
||
constexpr ParameterDescription DNS_IPV4_NAME_SERVER = {
|
||
.pid = 0x070B,
|
||
.pdl = {
|
||
.get = 1,
|
||
.get_response = 5,
|
||
.set = 5,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "Name Servers",
|
||
};
|
||
/// \cite e137-2 4.13 Get/Set Host Name (DNS_HOSTNAME)
|
||
constexpr ParameterDescription DNS_HOSTNAME = {
|
||
.pid = 0x070C,
|
||
.pdl = {
|
||
.get_response = 1,
|
||
.set = 1,
|
||
},
|
||
.command_class = CC_GET_SET,
|
||
.description = "Host Name",
|
||
};
|
||
/// \cite e137-2 4.14 Get/Set Domain Name (DNS_DOMAIN_NAME)
|
||
constexpr ParameterDescription DNS_DOMAIN_NAME = {
|
||
.pid = 0x070D,
|
||
.command_class = CC_GET_SET,
|
||
.description = "Domain Name",
|
||
};
|
||
|
||
/// \cite e137-2 Table A-1: RDM Parameter ID Defines
|
||
constexpr const ParameterDescription *PIDs_E137_2[] =
|
||
{
|
||
// IP & DNS Configuration
|
||
&LIST_INTERFACES,
|
||
&INTERFACE_LABEL,
|
||
&INTERFACE_HARDWARE_ADDRESS_TYPE1,
|
||
&IPV4_DHCP_MODE,
|
||
&IPV4_ZEROCONF_MODE,
|
||
&IPV4_CURRENT_ADDRESS,
|
||
&IPV4_STATIC_ADDRESS,
|
||
&INTERFACE_RENEW_DHCP,
|
||
&INTERFACE_RELEASE_DHCP,
|
||
&INTERFACE_APPLY_CONFIGURATION,
|
||
&IPV4_DEFAULT_ROUTE,
|
||
&DNS_IPV4_NAME_SERVER,
|
||
&DNS_HOSTNAME,
|
||
&DNS_DOMAIN_NAME,
|
||
};
|
||
|
||
|
||
// Table A-2: Additional NACK Reason Codes
|
||
// superseded in E1.37-7
|
||
// static const uint16_t NR_ACTION_NOT_SUPPORTED = 0x000B; //!< The parameter data is valid but the SET operation cannot be performed with the current configuration.
|
||
|
||
|
||
// Table A-3: DHCP Mode
|
||
|
||
static const uint8_t DHCP_STATUS_INACTIVE = 0x00;
|
||
static const uint8_t DHCP_STATUS_ACTIVE = 0x01; //!< The IP address was not obtained via DHCP.
|
||
static const uint8_t DHCP_STATUS_UNKNOWN = 0x02; //!< The IP address was obtained via DHCP.
|
||
|
||
} // namespace RDM
|