Add AOS message to update sctp auth key in message_bridge
Message bridge now listens to /aos aos.message_bridge.SctpConfig
channel to update the SCTP authentication key. This change only takes
effect if `--wants_sctp_authentication=true` and the kernel supports
SCTP authentication.
Change-Id: Id9e743471668cd26892a12e4fc9b03a73445df10
Signed-off-by: James Kuszmaul <james.kuszmaul@bluerivertech.com>
diff --git a/aos/network/message_bridge_client.cc b/aos/network/message_bridge_client.cc
index 82a59fb..ef727eb 100644
--- a/aos/network/message_bridge_client.cc
+++ b/aos/network/message_bridge_client.cc
@@ -8,6 +8,9 @@
DEFINE_string(config, "aos_config.json", "Path to the config.");
DEFINE_int32(rt_priority, -1, "If > 0, run as this RT priority");
+DEFINE_bool(
+ wants_sctp_authentication, false,
+ "When set, try to use SCTP authentication if provided by the kernel");
namespace aos {
namespace message_bridge {
@@ -23,7 +26,10 @@
event_loop.SetRuntimeRealtimePriority(FLAGS_rt_priority);
}
- MessageBridgeClient app(&event_loop, Sha256(config.span()));
+ MessageBridgeClient app(&event_loop, Sha256(config.span()),
+ FLAGS_wants_sctp_authentication
+ ? SctpAuthMethod::kAuth
+ : SctpAuthMethod::kNoAuth);
logging::DynamicLogging dynamic_logging(&event_loop);
// TODO(austin): Save messages into a vector to be logged. One file per