Thin wrappers of ip_protocol_{from|to}_name targeting IPPROTO_TCP and
IPPROTO_UDP only.
Used to parse IP protocol configuration restricted only to TCP and UDP,
e.g. in SocketBind{Allow|Deny}= unit property.
These helpers are inspired by af_{from|to}_ipv4_ipv6 and potentially
extendable with other IP protocols if there is a use-case to expose
them.
10 lines
287 B
C
10 lines
287 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
const char *ip_protocol_to_name(int id);
|
|
int ip_protocol_from_name(const char *name);
|
|
int parse_ip_protocol(const char *s);
|
|
|
|
const char *ip_protocol_to_tcp_udp(int id);
|
|
int ip_protocol_from_tcp_udp(const char *ip_protocol);
|