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/io/ioOperations.h | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'hicn-light/src/io/ioOperations.h') diff --git a/hicn-light/src/io/ioOperations.h b/hicn-light/src/io/ioOperations.h index dee66030d..48319c259 100644 --- a/hicn-light/src/io/ioOperations.h +++ b/hicn-light/src/io/ioOperations.h @@ -15,38 +15,6 @@ /** * Defines the interface all connections use to communicate with the forwarder. - * - * @code - * - * static IoOperations _template = { - * .closure = NULL, - * .send = &_etherConnection_Send, - * .getRemoteAddress = &_etherConnection_GetRemoteAddress, - * .getAddressPair = &_etherConnection_GetAddressPair, - * .getConnectionId = &_etherConnection_GetConnectionId, - * .isUp = &_etherConnection_IsUp, - * .isLocal = &_etherConnection_IsLocal, - * .destroy = &_etherConnection_DestroyOperations, - * .class = &_etherConnection_Class, - * .getConnectionType = &_etherConnection_getConnectionType - * }; - * - * IoOperations * - * etherConnection_Create(Forwarder *forwarder, GenericEther *ether, - * AddressPair *pair) - * { - * _EtherState *etherConnState = parcMemory_Allocate(sizeof(_EtherState)); - * // Fill in etherConnState with instance variables - * - * IoOperations *io_ops = parcMemory_Allocate(sizeof(IoOperations)); - * memcpy(io_ops, &_template, sizeof(IoOperations)); - * io_ops->closure = etherConnState; - * // Add to connection table, send missives about connection state - * - * return op_ops; - * } - * @endcode - * */ /** @@ -95,6 +63,7 @@ typedef struct io_ops IoOperations; struct io_ops { void *closure; bool (*send)(IoOperations *ops, const Address *nexthop, Message *message); + bool (*sendCommandResponse)(IoOperations *ops, struct iovec *message); const Address *(*getRemoteAddress)(const IoOperations *ops); const AddressPair *(*getAddressPair)(const IoOperations *ops); bool (*isUp)(const IoOperations *ops); @@ -201,6 +170,9 @@ void ioOperations_Release(IoOperations **opsPtr); bool ioOperations_Send(IoOperations *ops, const Address *nexthop, Message *message); +bool ioOperations_SendCommandResponse(IoOperations *ops, + struct iovec *message); + /** * A connection is made up of a local and a remote address. This function * returns the remote address. -- cgit 1.2.3-korg