From 0a28a93c6e060081267dc686e342d45ef03358e7 Mon Sep 17 00:00:00 2001 From: Xenofon Karamanos <22965395+xkaraman@users.noreply.github.com> Date: Mon, 8 Apr 2024 09:42:49 +0000 Subject: [PATCH] tcp_main: Update comment docs --- src/core/tcp_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c index 0ea1b541ea6..e3323736cc0 100644 --- a/src/core/tcp_main.c +++ b/src/core/tcp_main.c @@ -1697,8 +1697,8 @@ void tcpconn_rm(struct tcp_connection *c) /* finds a connection, if id=0 uses the ip addr, port, local_ip and local port * (host byte order) and tries to find the connection that matches all of - * them. Wild cards can be used for local_ip and local_port (a 0 filled - * ip address and/or a 0 local port). + * them. Wild cards can be used for local_ip, local_port and proto (a 0 filled + * ip address and/or a 0 local port and/or PROTO_NONE). * WARNING: unprotected (locks) use tcpconn_get unless you really * know what you are doing */ struct tcp_connection *_tcpconn_find(int id, struct ip_addr *ip, int port, @@ -1754,7 +1754,7 @@ struct tcp_connection *_tcpconn_find(int id, struct ip_addr *ip, int port, /** - * find if a tcp connection exits by id or remote+local address/port + * find if a tcp connection exits by id or remote+local address/port and protocol * - return: 1 if found; 0 if not found */ int tcpconn_exists(int conn_id, ip_addr_t *peer_ip, int peer_port, @@ -1774,6 +1774,7 @@ int tcpconn_exists(int conn_id, ip_addr_t *peer_ip, int peer_port, /* TCP connection find with locks and timeout * - local_addr contains the desired local ip:port. If null any local address * will be used. IN*ADDR_ANY or 0 port are wild cards. + * - proto is the protocol to match (PROTO_NONE for any) * - try_local_port makes the search use it first, instead of port from local_addr * If found, the connection's reference counter will be incremented, you might * want to decrement it after use.