From ae48d2d142946e58c483f4e85e0b4365a68b61f2 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 1 Jul 2021 06:37:44 +0900 Subject: network: make IPv6Token private, and ipv6token_new() static --- src/network/networkd-ndisc.c | 17 ++++++++++++++++- src/network/networkd-ndisc.h | 19 ------------------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/network/networkd-ndisc.c b/src/network/networkd-ndisc.c index cc09732cfd..e2c178aad0 100644 --- a/src/network/networkd-ndisc.c +++ b/src/network/networkd-ndisc.c @@ -38,6 +38,21 @@ #define NDISC_APP_ID SD_ID128_MAKE(13,ac,81,a7,d5,3f,49,78,92,79,5d,0c,29,3a,bc,7e) +typedef enum IPv6TokenAddressGeneration { + IPV6_TOKEN_ADDRESS_GENERATION_NONE, + IPV6_TOKEN_ADDRESS_GENERATION_STATIC, + IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE, + _IPV6_TOKEN_ADDRESS_GENERATION_MAX, + _IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -EINVAL, +} IPv6TokenAddressGeneration; + +typedef struct IPv6Token { + IPv6TokenAddressGeneration address_generation_type; + + uint8_t dad_counter; + struct in6_addr prefix; +} IPv6Token; + bool link_ipv6_accept_ra_enabled(Link *link) { assert(link); @@ -1430,7 +1445,7 @@ void ndisc_flush(Link *link) { link->ndisc_dnssl = set_free(link->ndisc_dnssl); } -int ipv6token_new(IPv6Token **ret) { +static int ipv6token_new(IPv6Token **ret) { IPv6Token *p; p = new(IPv6Token, 1); diff --git a/src/network/networkd-ndisc.h b/src/network/networkd-ndisc.h index 2ff9a8969d..2660794b5c 100644 --- a/src/network/networkd-ndisc.h +++ b/src/network/networkd-ndisc.h @@ -7,16 +7,6 @@ #include "networkd-route.h" #include "time-util.h" -typedef struct IPv6Token IPv6Token; - -typedef enum IPv6TokenAddressGeneration { - IPV6_TOKEN_ADDRESS_GENERATION_NONE, - IPV6_TOKEN_ADDRESS_GENERATION_STATIC, - IPV6_TOKEN_ADDRESS_GENERATION_PREFIXSTABLE, - _IPV6_TOKEN_ADDRESS_GENERATION_MAX, - _IPV6_TOKEN_ADDRESS_GENERATION_INVALID = -EINVAL, -} IPv6TokenAddressGeneration; - typedef enum IPv6AcceptRAStartDHCP6Client { IPV6_ACCEPT_RA_START_DHCP6_CLIENT_NO, IPV6_ACCEPT_RA_START_DHCP6_CLIENT_ALWAYS, @@ -55,15 +45,6 @@ typedef struct NDiscDNSSL { /* The domain name follows immediately. */ } NDiscDNSSL; -struct IPv6Token { - IPv6TokenAddressGeneration address_generation_type; - - uint8_t dad_counter; - struct in6_addr prefix; -}; - -int ipv6token_new(IPv6Token **ret); - static inline char* NDISC_DNSSL_DOMAIN(const NDiscDNSSL *n) { return ((char*) n) + ALIGN(sizeof(NDiscDNSSL)); } -- cgit v1.2.1