socket-label: move prototype of socket_address_listen() and string table for SocketAddressBindIPv6Only
The function socket_address_listen() is declared at shared/socket-label.c,
however its prototype was in basic/socket-util.h. This moves the
prototype to shared/socket-label.h.
Also, enum SocketAddressBindIPv6Only is not used anymore in basic/*.[ch].
Let's move the definition and its string table to shared/socket-label.[ch].
Follow-up for b25a930f0e.
This commit is contained in:
@@ -669,26 +669,6 @@ static const char* const netlink_family_table[] = {
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP_WITH_FALLBACK(netlink_family, int, INT_MAX);
|
||||
|
||||
static const char* const socket_address_bind_ipv6_only_table[_SOCKET_ADDRESS_BIND_IPV6_ONLY_MAX] = {
|
||||
[SOCKET_ADDRESS_DEFAULT] = "default",
|
||||
[SOCKET_ADDRESS_BOTH] = "both",
|
||||
[SOCKET_ADDRESS_IPV6_ONLY] = "ipv6-only"
|
||||
};
|
||||
|
||||
DEFINE_STRING_TABLE_LOOKUP(socket_address_bind_ipv6_only, SocketAddressBindIPv6Only);
|
||||
|
||||
SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *n) {
|
||||
int r;
|
||||
|
||||
r = parse_boolean(n);
|
||||
if (r > 0)
|
||||
return SOCKET_ADDRESS_IPV6_ONLY;
|
||||
if (r == 0)
|
||||
return SOCKET_ADDRESS_BOTH;
|
||||
|
||||
return socket_address_bind_ipv6_only_from_string(n);
|
||||
}
|
||||
|
||||
bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b) {
|
||||
assert(a);
|
||||
assert(b);
|
||||
|
||||
Reference in New Issue
Block a user