Parse address family, ip protocol and ports, any of them can be optional. If neither is specified, a special value 'any' is expected. Helper is placed in shared to be reused in both fragment and dbus. Add unit tests with valid and invalid examples.
13 lines
250 B
C
13 lines
250 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
|
|
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
int parse_socket_bind_item(
|
|
const char *str,
|
|
int *address_family,
|
|
int *ip_protocol,
|
|
uint16_t *nr_ports,
|
|
uint16_t *port_min);
|