From 94ce7a9af734912b28e96f25e7cb1db0fe87fda6 Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Thu, 30 Sep 2021 10:36:20 -0400 Subject: [PATCH] make function pointer arguments named --- include/lokinet/lokinet_stream.h | 2 +- include/lokinet/lokinet_udp.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/lokinet/lokinet_stream.h b/include/lokinet/lokinet_stream.h index 545049c9b..385a67fc8 100644 --- a/include/lokinet/lokinet_stream.h +++ b/include/lokinet/lokinet_stream.h @@ -37,7 +37,7 @@ extern "C" /// return 0 to accept /// return -1 to explicitly reject /// return -2 to silently drop - typedef int (*lokinet_stream_filter)(const char* remote, uint16_t port, void*); + typedef int (*lokinet_stream_filter)(const char* remote, uint16_t port, void* userdata); /// set stream accepter filter /// passes user parameter into stream filter as void * diff --git a/include/lokinet/lokinet_udp.h b/include/lokinet/lokinet_udp.h index 7e5b6ca2b..15b503809 100644 --- a/include/lokinet/lokinet_udp.h +++ b/include/lokinet/lokinet_udp.h @@ -27,25 +27,25 @@ extern "C" /// flow acceptor hook, return 0 success, return nonzero with errno on failure typedef int (*lokinet_udp_flow_filter)( - void* /*user*/, - const struct lokinet_udp_flowinfo* /* remote address */, - void** /* flow-userdata */, - int* /* timeout seconds */); + void* userdata, + const struct lokinet_udp_flowinfo* remote_address, + void** flow_userdata, + int* timeout_seconds); /// callback to make a new outbound flow typedef void(lokinet_udp_create_flow_func)( - void* /*userdata*/, void** /*flow userdata*/, int* /* flowtimeout */); + void* userdata, void** flow_userdata, int* timeout_seconds); /// hook function for handling packets typedef void (*lokinet_udp_flow_recv_func)( - const struct lokinet_udp_flowinfo* /* remote address */, - const char* /* data pointer */, - size_t /* data length */, - void* /* flow-userdata */); + const struct lokinet_udp_flowinfo* remote_address, + const char* pkt_data, + size_t pkt_length, + void* flow_userdata); /// hook function for flow timeout typedef void (*lokinet_udp_flow_timeout_func)( - const struct lokinet_udp_flowinfo* /* remote address */, void* /* flow-userdata */); + const struct lokinet_udp_flowinfo* remote_address, void* flow_userdata); /// inbound listen udp socket /// expose udp port exposePort to the void