[misc] Add utility function to get interface name from IP address

This commit is contained in:
ejurgensen
2022-07-14 21:12:31 +02:00
parent 680c27eb66
commit 3754871c73
2 changed files with 40 additions and 3 deletions

View File

@@ -43,6 +43,9 @@ net_address_get(char *addr, size_t addr_len, union net_sockaddr *naddr);
int
net_port_get(short unsigned *port, union net_sockaddr *naddr);
int
net_if_get(char *ifname, size_t ifname_len, const char *addr);
// Returns the socket fd from socket(), -1 on error
int
net_connect(const char *addr, unsigned short port, int type, const char *log_service_name);