diff options
author | Julia Kartseva <hex@fb.com> | 2021-06-25 17:14:40 -0700 |
---|---|---|
committer | Julia Kartseva <hex@fb.com> | 2021-06-29 14:37:07 -0700 |
commit | 159d68c3e09657b4fd252b2c5ea6ef3095a37ad2 (patch) | |
tree | 07acd8f9c9770d4e96b20ee10d0e3c450cb68b56 /src/shared/ip-protocol-list.h | |
parent | 560d76243fab5b7809996ac353fbc79da9a3bd92 (diff) | |
download | systemd-159d68c3e09657b4fd252b2c5ea6ef3095a37ad2.tar.gz |
shared: add ip_protocol_{from|to}_tcp_udp helpers
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.
Diffstat (limited to 'src/shared/ip-protocol-list.h')
-rw-r--r-- | src/shared/ip-protocol-list.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/shared/ip-protocol-list.h b/src/shared/ip-protocol-list.h index abe3f5fc28..b40ec08301 100644 --- a/src/shared/ip-protocol-list.h +++ b/src/shared/ip-protocol-list.h @@ -4,3 +4,6 @@ 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); |