Skip to content

Commit

Permalink
Merge pull request #17 from gerickson/user/gerickson/github-issue-16-…
Browse files Browse the repository at this point in the history
…network-schema

Add Support across hlxc, hlxproxyd, hlxsimd and Their Attendant Libraries for the Network Schema
  • Loading branch information
gerickson authored Jan 5, 2022
2 parents a109164 + c945fd5 commit f23a825
Show file tree
Hide file tree
Showing 55 changed files with 7,122 additions and 333 deletions.
2 changes: 1 addition & 1 deletion .default-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.1
1.2
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Install Open HLX Host Package Dependencies
run: |
sudo apt-get -y install libboost-dev libboost-filesystem-dev libboost-system-dev libtre-dev libcppunit-dev asciidoc xmlto doxygen
sudo apt-get -y install libboost-dev libboost-filesystem-dev libboost-system-dev libnl-3-dev libnl-route-3-dev libtre-dev libcppunit-dev asciidoc xmlto doxygen
- name: Download OpenCFLite Distribution Archive Dependencies
run: |
Expand Down Expand Up @@ -128,7 +128,7 @@ jobs:
- name: Bootstrap and Configure
run: |
export PATH="$(brew --prefix m4)/bin:${PATH}"
./bootstrap-configure -C ${{matrix.configuration['options']}} --enable-coverage --with-boost=/usr/local --with-corefoundation-source=cflite --disable-docs
./bootstrap-configure -C ${{matrix.configuration['options']}} --enable-coverage --with-boost=/usr/local --with-libnl-includes=/usr/include/libnl3 --with-corefoundation-source=cflite --disable-docs
- name: Coding Style
run: |
Expand Down
24 changes: 23 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
1.2 (2022-01-05)

* Added full, first-class observe (that is, read-only) support for HLX
network schema properties, including DHCPv4 enabled state, Ethernet
network interface EUI-48 hardware address, HLX server host default
router / gateway IP address, HLX server host IP address, HLX server
host IP netmask, and Control4 SDDP enabled state.

- The `hlxc` client program and client library both handle
asynchronous notifications for changes in these properties.

- The `hlxproxyd` program fully proxies these properties rather than
returning previously-composed, canned data.

- Finally, `hlxsimd` and the server library accurately generate the
property data based on the connection in use.

- Even though physical HLX hardware only ever supported IPv4, the
implementation supports both IPv4 and IPv6 and, in fact, `hlxsimd`
and the server library will emit IPv6 property data if the
connection is using IPv6.

1.1.1 (2021-09-26)

* Addressed an issue in which hlxproxyd was not correctly deriving and
Expand Down Expand Up @@ -26,4 +48,4 @@

1.0 (2021-05-21)

* First public release to Github.
* First public release to Github.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ Open HLX
# Introduction

Open HLX provides a set of command line programs and associated
libraries for interacting with the Audio Authority HLX Series Modular
Matrix System High Definition Audio/Video Switching System, which has
libraries for interacting with the [Audio Authority](https://www.audioauthority.com) [HLX Series Modular
Matrix System High Definition Audio/Video Switching System](https://www.cs1.net/products/audio_authority/HLX.htm), which has
gone end-of-life and, as a result, is no longer manufacturered or sold
by Audio Authority.

Expand Down Expand Up @@ -66,7 +66,7 @@ among actively-sold and -produced competitive products.

In most situations, an HLX system will find itself with its
telnet-based Ethernet network interface disabled and tethered, via a
serial cable to an AMX, Crestron, Control4, or other controller where
serial cable to an [AMX](https://www.amx.com/), [Crestron](https://www.crestron.com), [Control4](https://www.control4.com), or other controller where
those systems act as the primary user interface and experience surface
with the HLX acting silently in the background.

Expand Down Expand Up @@ -140,6 +140,7 @@ C++ Standard Template Library (STL), Open HLX depends on:
- [OpenCFLite](https://github.com/gerickson/opencflite) (Linux only)
- [OpenCFNetwork](https://github.com/gerickson/opencfnetwork) (Linux only)
* [LogUtilities](https://github.com/Nuovations/LogUtilities)
* [libnl](https://www.infradead.org/~tgr/libnl/) (Linux only)
* [libtelnet](https://github.com/seanmiddleditch/libtelnet)
* [nlassert](https://github.com/nestlabs/nlassert)
* [nlunit-test](https://github.com/nestlabs/nlunit-test)
Expand All @@ -166,7 +167,7 @@ satisfied by building them directly from source, or on system
such as Linux, installing them using a package management system.
For example, on Debian systems:

% sudo apt-get install libboost-dev libboost-filesystem-dev libboost-system-dev libtre-dev libcppunit-dev asciidoc xmlto
% sudo apt-get install libboost-dev libboost-filesystem-dev libboost-system-dev libnl-3-dev libnl-route-3-dev libtre-dev libcppunit-dev asciidoc xmlto

## Installing Open HLX

Expand Down
48 changes: 48 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -344,13 +344,15 @@ AC_MSG_RESULT(${with_corefoundation_source})
#
# At minimum, the following packages are required:
#
# * Boost
# * CFUtilities
# * LogUtilities
# * libtelnet
# * nlassert
#
# The following packages are optional, depending on configuration:
#
# * libnl (Netlink Protocol Library Suite)
# * nlunit-test
# * [Open]CFLite
# * TRE
Expand Down Expand Up @@ -491,6 +493,39 @@ fi
AC_SUBST(LOGUTILITIES_SUBDIRS, [${maybe_logutilities_dirstem}])
AM_CONDITIONAL([OPENHLX_WITH_LOGUTILITIES_INTERNAL], [test "${nl_with_logutilities}" = "internal"])

#
# Libnl
#

case ${nl_filtered_target_os} in

*linux*)
NL_WITH_REQUIRED_EXTERNAL_PACKAGE([libnl],
[LIBNL],
[libnl],
[-lnl-3 -lnl-route-3],
[
# Check for required libnl and libnl-route library headers.
AC_LANG_PUSH([C])
AC_CHECK_HEADERS([netlink/addr.h] [netlink/cache.h] [netlink/socket.h] [netlink/route/route.h],
[],
[
AC_MSG_ERROR(The libnl header "$ac_header" is required but cannot be found.)
]
)
AC_LANG_POP
]
)
;;

*)
;;

esac

#
# Libtelnet
#
Expand Down Expand Up @@ -837,6 +872,12 @@ CPPFLAGS="${CPPFLAGS} ${LOGUTILITIES_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${LOGUTILITIES_LDFLAGS}"
LIBS="${LIBS} ${LOGUTILITIES_LIBS}"

# Add any libnl CPPFLAGS, LDFLAGS, and LIBS

CPPFLAGS="${CPPFLAGS} ${LIBNL_CPPFLAGS}"
LDFLAGS="${LDFLAGS} ${LIBNL_LDFLAGS}"
LIBS="${LIBS} ${LIBNL_LIBS}"

# Add any libtelnet CPPFLAGS, LDFLAGS, and LIBS

CPPFLAGS="${CPPFLAGS} ${LIBTELNET_CPPFLAGS}"
Expand Down Expand Up @@ -923,6 +964,7 @@ src/hlxsimd/Makefile
src/include/Makefile
src/lib/Makefile
src/lib/client/Makefile
src/lib/client/tests/Makefile
src/lib/common/Makefile
src/lib/common/tests/Makefile
src/lib/model/Makefile
Expand Down Expand Up @@ -957,6 +999,9 @@ AC_MSG_NOTICE([
Target system : ${target}
Target architecture : ${target_cpu}
Target OS : ${target_os}
Filtered target system : ${nl_filtered_target}
Filtered target architecture : ${nl_filtered_target_cpu}
Filtered target OS : ${nl_filtered_target_os}
Cross compiling : ${cross_compiling}
Build shared libraries : ${enable_shared}
Build static libraries : ${enable_static}
Expand Down Expand Up @@ -984,6 +1029,9 @@ AC_MSG_NOTICE([
CoreFoundation compile flags : ${CF_CPPFLAGS:--}
CoreFoundation link flags : ${CF_LDFLAGS:--}
CoreFoundation link libraries : ${CF_LIBS:--}
Libnl compile flags : ${LIBNL_CPPFLAGS:--}
Libnl link flags : ${LIBNL_LDFLAGS:--}
Libnl link libraries : ${LIBNL_LIBS:--}
Libtelnet source : ${nl_with_libtelnet:--}
Libtelnet compile flags : ${LIBTELNET_CPPFLAGS:--}
Libtelnet link flags : ${LIBTELNET_LDFLAGS:--}
Expand Down
74 changes: 74 additions & 0 deletions src/hlxc/hlxc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
#include <OpenHLX/Client/FrontPanelStateChangeNotifications.hpp>
#include <OpenHLX/Client/GroupsStateChangeNotifications.hpp>
#include <OpenHLX/Client/InfraredStateChangeNotifications.hpp>
#include <OpenHLX/Client/NetworkStateChangeNotifications.hpp>
#include <OpenHLX/Client/SourcesStateChangeNotifications.hpp>
#include <OpenHLX/Client/ZonesStateChangeNotifications.hpp>
#include <OpenHLX/Common/ConnectionManagerBasis.hpp>
Expand Down Expand Up @@ -975,6 +976,79 @@ void HLXClient :: ControllerStateDidChange(Client::Application::ControllerBasis
}
break;

case StateChange::kStateChangeType_NetworkDHCPv4Enabled:
{
const StateChange::NetworkDHCPv4EnabledNotification &lSCN = static_cast<const StateChange::NetworkDHCPv4EnabledNotification &>(aStateChangeNotification);
Log::Debug().Write("Ethernet network interface DHCPv4 is %s\n",
(lSCN.GetEnabled() ? "enabled" : "disabled"));
}
break;

case StateChange::kStateChangeType_NetworkEthernetEUI48:
{
const StateChange::NetworkEthernetEUI48Notification &lSCN = static_cast<const StateChange::NetworkEthernetEUI48Notification &>(aStateChangeNotification);
const NetworkModel::EthernetEUI48Type &lEthernetEUI48 = lSCN.GetEthernetEUI48();

Log::Debug().Write("Ethernet network interface EUI-48 address is %02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx\n",
lEthernetEUI48[0],
lEthernetEUI48[1],
lEthernetEUI48[2],
lEthernetEUI48[3],
lEthernetEUI48[4],
lEthernetEUI48[5]);
}
break;

case StateChange::kStateChangeType_NetworkIPDefaultRouterAddress:
{
const StateChange::NetworkIPDefaultRouterAddressNotification &lSCN = static_cast<const StateChange::NetworkIPDefaultRouterAddressNotification &>(aStateChangeNotification);
const Common::IPAddress &lIPAddress = lSCN.GetIPAddress();
char lBuffer[INET6_ADDRSTRLEN];
Status lStatus;

lStatus = lIPAddress.ToString(&lBuffer[0], ElementsOf(lBuffer));
nlREQUIRE_SUCCESS(lStatus, done);

Log::Debug().Write("Ethernet network interface default router IP address is %s\n", lBuffer);
}
break;

case StateChange::kStateChangeType_NetworkIPHostAddress:
{
const StateChange::NetworkIPHostAddressNotification &lSCN = static_cast<const StateChange::NetworkIPHostAddressNotification &>(aStateChangeNotification);
const Common::IPAddress &lIPAddress = lSCN.GetIPAddress();
char lBuffer[INET6_ADDRSTRLEN];
Status lStatus;

lStatus = lIPAddress.ToString(&lBuffer[0], ElementsOf(lBuffer));
nlREQUIRE_SUCCESS(lStatus, done);

Log::Debug().Write("Ethernet network interface host IP address is %s\n", lBuffer);
}
break;

case StateChange::kStateChangeType_NetworkIPNetmask:
{
const StateChange::NetworkIPNetmaskNotification &lSCN = static_cast<const StateChange::NetworkIPNetmaskNotification &>(aStateChangeNotification);
const Common::IPAddress &lIPAddress = lSCN.GetIPNetmask();
char lBuffer[INET6_ADDRSTRLEN];
Status lStatus;

lStatus = lIPAddress.ToString(&lBuffer[0], ElementsOf(lBuffer));
nlREQUIRE_SUCCESS(lStatus, done);

Log::Debug().Write("Ethernet network interface IP netmask is %s\n", lBuffer);
}
break;

case StateChange::kStateChangeType_NetworkSDDPEnabled:
{
const StateChange::NetworkSDDPEnabledNotification &lSCN = static_cast<const StateChange::NetworkSDDPEnabledNotification &>(aStateChangeNotification);
Log::Debug().Write("Ethernet network interface Control4 SDDP is %s\n",
(lSCN.GetEnabled() ? "enabled" : "disabled"));
}
break;

case StateChange::kStateChangeType_SourceName:
{
const StateChange::SourcesNameNotification &lSCN = static_cast<const StateChange::SourcesNameNotification &>(aStateChangeNotification);
Expand Down
6 changes: 4 additions & 2 deletions src/hlxproxyd/FrontPanelController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@ FrontPanelController :: HandleQueryReceived(Common::ConnectionBuffer::MutableCou
return (lRetval);
}

Status FrontPanelController :: HandleBrightnessResponse(const FrontPanelModel::BrightnessType &aBrightness, ConnectionBuffer::MutableCountedPointer &aBuffer)
Status
FrontPanelController :: HandleBrightnessResponse(const FrontPanelModel::BrightnessType &aBrightness, ConnectionBuffer::MutableCountedPointer &aBuffer)
{
Server::Command::FrontPanel::BrightnessResponse lBrightnessResponse;
const uint8_t * lBuffer;
Expand All @@ -563,7 +564,8 @@ Status FrontPanelController :: HandleBrightnessResponse(const FrontPanelModel::B
return (lStatus);
}

Status FrontPanelController :: HandleLockedResponse(const FrontPanelModel::LockedType &aLocked, ConnectionBuffer::MutableCountedPointer &aBuffer)
Status
FrontPanelController :: HandleLockedResponse(const FrontPanelModel::LockedType &aLocked, ConnectionBuffer::MutableCountedPointer &aBuffer)
{
Server::Command::FrontPanel::LockedResponse lLockedResponse;
const uint8_t * lBuffer;
Expand Down
2 changes: 2 additions & 0 deletions src/hlxproxyd/FrontPanelController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ class FrontPanelController :
FrontPanelController(void);
virtual ~FrontPanelController(void);

// Initializer(s)

Common::Status Init(Client::CommandManager &aCommandManager, Server::CommandManager &aServerCommandManager, const Common::Timeout &aTimeout) final;

// Configuration Management Methods
Expand Down
2 changes: 1 addition & 1 deletion src/hlxproxyd/InfraredController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ class InfraredController :

// Server-facing Client Notification Handlers

void BrightnessNotificationReceivedHandler(const uint8_t *aBuffer, const size_t &aSize, const Common::RegularExpression::Matches &aMatches);
void DisabledNotificationReceivedHandler(const uint8_t *aBuffer, const size_t &aSize, const Common::RegularExpression::Matches &aMatches);

// Client-facing Server Command Completion Handlers

void QueryRequestReceivedHandler(Server::ConnectionBasis &aConnection, const uint8_t *aBuffer, const size_t &aSize, const Common::RegularExpression::Matches &aMatches);
void SetDisabledRequestReceivedHandler(Server::ConnectionBasis &aConnection, const uint8_t *aBuffer, const size_t &aSize, const Common::RegularExpression::Matches &aMatches);

Expand Down
Loading

0 comments on commit f23a825

Please sign in to comment.