1
0
Fork 0
mirror of https://repo.or.cz/socat.git synced 2025-07-18 00:53:25 +00:00

Mechanism for ai-* options; new option ai-addrconfig

This commit is contained in:
Gerhard Rieger 2023-11-05 13:56:58 +01:00
parent 8b2e0593f3
commit 4e00a345b4
28 changed files with 492 additions and 285 deletions

View file

@ -14,7 +14,12 @@
#include "xio-ip4.h"
int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
int xioparsenetwork_ip4(
const char *rangename,
struct xiorange *range,
const int ai_flags[2],
const unsigned long res_opts[2])
{
struct in_addr *netaddr_in = &range->netaddr.ip4.sin_addr;
struct in_addr *netmask_in = &range->netmask.ip4.sin_addr;
char *rangename1; /* a copy of rangename with writing allowed */
@ -46,7 +51,7 @@ int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
}
} else if (delimpos = strchr(rangename1, ':')) {
if ((rc = xioresolve(delimpos+1, NULL, PF_INET, 0, 0,
&sau, &socklen, 0, 0))
&sau, &socklen, ai_flags, res_opts))
!= STAT_OK) {
return rc;
}
@ -59,7 +64,7 @@ int xioparsenetwork_ip4(const char *rangename, struct xiorange *range) {
{
*delimpos = 0;
if ((rc = xioresolve(rangename1, NULL, PF_INET, 0, 0,
&sau, &socklen, 0, 0))
&sau, &socklen, ai_flags, res_opts))
!= STAT_OK) {
return rc;
}