From 79e0d4f89c4d532189aae06cc5dfbc14e3269703 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Mon, 11 Feb 2019 10:44:29 +0100 Subject: [HICN-50] Added udp application connector. Change-Id: I0c5afad4b404ec485f50b1342b81e70ef85a5163 Signed-off-by: Mauro Sardara Signed-off-by: michele papalini --- hicn-light/src/core/connection.c | 7 +++++++ hicn-light/src/core/connection.h | 6 ++++++ hicn-light/src/core/forwarder.c | 5 +++++ hicn-light/src/core/forwarder.h | 6 ++++++ 4 files changed, 24 insertions(+) (limited to 'hicn-light/src/core') diff --git a/hicn-light/src/core/connection.c b/hicn-light/src/core/connection.c index 505bba081..525fe29c4 100644 --- a/hicn-light/src/core/connection.c +++ b/hicn-light/src/core/connection.c @@ -112,6 +112,13 @@ bool connection_Send(const Connection *conn, Message *message) { return false; } +bool connection_SendCommandResponse(const Connection *conn, struct iovec *msg){ + parcAssertNotNull(conn, "Parameter conn must be non-null"); + parcAssertNotNull(msg, "Parameter message must be non-null"); + + return ioOperations_SendCommandResponse(conn->ops, msg); +} + static void _sendProbe(Connection *conn, unsigned probeType, uint8_t *message) { parcAssertNotNull(conn, "Parameter conn must be non-null"); diff --git a/hicn-light/src/core/connection.h b/hicn-light/src/core/connection.h index b5c703527..56fa131b5 100644 --- a/hicn-light/src/core/connection.h +++ b/hicn-light/src/core/connection.h @@ -64,6 +64,12 @@ Connection *connection_Acquire(Connection *connection); */ bool connection_Send(const Connection *conn, Message *message); +/** + * @function connection_SendCommandResponse + * @abstract Sends a response (ack/nack) for a command + */ +bool connection_SendCommandResponse(const Connection *conn, struct iovec *msg); + /** * Return the `IoOperations` instance associated with the specified `Connection` * instance. diff --git a/hicn-light/src/core/forwarder.c b/hicn-light/src/core/forwarder.c index bceb206a3..2b00a35e5 100644 --- a/hicn-light/src/core/forwarder.c +++ b/hicn-light/src/core/forwarder.c @@ -277,6 +277,11 @@ void forwarder_SetupAllListeners(Forwarder *forwarder, uint16_t port, configurationListeners_SetupAll(forwarder->config, port, localPath); } +void forwarder_SetupLocalListeners(Forwarder *forwarder, uint16_t port) { + parcAssertNotNull(forwarder, "Parameter must be non-null"); + configurationListeners_SetutpLocalIPv4(forwarder->config, port); +} + void forwarder_SetupFromConfigFile(Forwarder *forwarder, const char *filename) { ConfigurationFile *configFile = configurationFile_Create(forwarder, filename); if (configFile) { diff --git a/hicn-light/src/core/forwarder.h b/hicn-light/src/core/forwarder.h index 6bc823294..de736a1f8 100644 --- a/hicn-light/src/core/forwarder.h +++ b/hicn-light/src/core/forwarder.h @@ -90,6 +90,12 @@ void forwarder_Destroy(Forwarder **ptr); */ void forwarder_SetupAllListeners(Forwarder *forwarder, uint16_t port, const char *localPath); +/** + * @function forwarder_SetupAllListeners + * @abstract Setup one tcp and one udp listener on address 127.0.0.1 and the + * given port + */ +void forwarder_SetupLocalListeners(Forwarder *forwarder, uint16_t port); /** * Configure hicn-light via a configuration file -- cgit 1.2.3-korg