Rewrite sctp_create_new_listener() to handle DNS, IPv6

Rewrite sctp_create_new_listener() to use getaddrinfo() to look up
IPv4/IPv6 addresses via a common interface. This allows to use e.g. DNS,
and enables the SCTP library to listen on IPv6 ports.

To support the above, the corresponding message is changed to not take
an IPv4 address on 4 bytes (and separate IPv6), but a single name that
will be resolved via getaddrinfo()

The previous init message used to allow multiple IPv4/IPv6 addresses;
since this is not used anywhere, remove the corresponding functionality.

Modify all uses of this ITTI message to copy te SCTP init bind addr into
ITTI message.
This commit is contained in:
Robert Schmidt
2024-04-13 05:15:11 +02:00
parent 0d128f9cad
commit dfa012162b
9 changed files with 148 additions and 340 deletions
+1 -8
View File
@@ -128,14 +128,7 @@ typedef struct sctp_data_ind_s {
} sctp_data_ind_t;
typedef struct sctp_init_s {
/* Request usage of ipv4 */
unsigned ipv4:1;
/* Request usage of ipv6 */
unsigned ipv6:1;
uint8_t nb_ipv4_addr;
uint32_t ipv4_address[10];
uint8_t nb_ipv6_addr;
char *ipv6_address[10];
char *bind_address;
uint16_t port;
uint32_t ppid;
} sctp_init_t;