diff options
Diffstat (limited to 'hicn-light/src/hicn/core/connection.h')
-rw-r--r-- | hicn-light/src/hicn/core/connection.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/hicn-light/src/hicn/core/connection.h b/hicn-light/src/hicn/core/connection.h index 45d341ab8..186cad5c3 100644 --- a/hicn-light/src/hicn/core/connection.h +++ b/hicn-light/src/hicn/core/connection.h @@ -21,11 +21,12 @@ #ifndef HICNLIGHT_CONNECTION_H #define HICNLIGHT_CONNECTION_H -#include <hicn/core/address_pair.h> -#include <hicn/core/listener.h> -#include <hicn/core/msgbuf.h> #include <hicn/face.h> +#include "address_pair.h" +#include "listener.h" +#include "msgbuf.h" + #ifdef WITH_POLICY #include <hicn/policy.h> #endif /* WITH_POLICY */ @@ -86,7 +87,8 @@ typedef struct { #define connection_id_is_valid(ID) (ID != CONNECTION_ID_UNDEFINED) #define connection_get_name(C) ((C)->name) #define connection_get_type(C) ((C)->type) -#define connection_has_valid_id(C) (connection_id_is_valid(connection_get_id(C)) +#define connection_has_valid_id(C) (connection_id_is_valid(connection_get_id(C))) +#define connection_has_valid_type(C) (face_type_is_valid(connection_get_type(C))) #define connection_get_pair(C) (&(C)->pair) #define connection_get_local(C) (address_pair_local(connection_get_pair(C))) #define connection_get_remote(C) (address_pair_remote(connection_get_pair(C))) @@ -191,7 +193,9 @@ int connection_finalize(connection_t * connection); int connection_send_packet(const connection_t * connection, const uint8_t * packet, size_t size); -bool connection_send(const connection_t * connection, msgbuf_t * msgbuf, +bool connection_flush(const connection_t * connection); + +bool connection_send(const connection_t * connection, off_t msgbuf_id, bool queue); size_t connection_process_buffer(connection_t * connection, const uint8_t * buffer, size_t size); @@ -200,14 +204,16 @@ size_t connection_process_buffer(connection_t * connection, const uint8_t * buff void connection_wldr_allow_autostart(connection_t * connection, bool value); -bool connection_wldr_autostart_is_allowed(connection_t * connection); +bool connection_wldr_autostart_is_allowed(const connection_t * connection); void connection_wldr_enable(connection_t * connection, bool value); bool connection_has_wldr(const connection_t * connection); -void connection_wldr_detect_losses(const connection_t * connection, msgbuf_t * msgbuf); +void connection_wldr_detect_losses(const connection_t * connection, const msgbuf_t * msgbuf); + +void connection_wldr_handle_notification(const connection_t * connection, const msgbuf_t * msgbuf); -void connection_wldr_handle_notification(const connection_t * connection, msgbuf_t * msgbuf); +#define connection_get_forwarder(connection) (connection->forwarder) #endif /* HICNLIGHT_CONNECTION_H */ |