network: make all xxx_new_static() static

These functions are called from only config parsers, and the parsers are
in the same files. So, let's make them static.
This commit is contained in:
Yu Watanabe 2019-03-01 13:19:53 +09:00
parent fa7cd7117f
commit 9560e5b323
10 changed files with 6 additions and 11 deletions

View File

@ -39,7 +39,7 @@ int address_new(Address **ret) {
return 0;
}
int address_new_static(Network *network, const char *filename, unsigned section_line, Address **ret) {
static int address_new_static(Network *network, const char *filename, unsigned section_line, Address **ret) {
_cleanup_(network_config_section_freep) NetworkConfigSection *n = NULL;
_cleanup_(address_freep) Address *address = NULL;
int r;

View File

@ -46,7 +46,6 @@ struct Address {
LIST_FIELDS(Address, addresses);
};
int address_new_static(Network *network, const char *filename, unsigned section, Address **ret);
int address_new(Address **ret);
void address_free(Address *address);
int address_add_foreign(Link *link, int family, const union in_addr_union *in_addr, unsigned char prefixlen, Address **ret);

View File

@ -18,7 +18,7 @@
#define STATIC_FDB_ENTRIES_PER_NETWORK_MAX 1024U
/* create a new FDB entry or get an existing one. */
int fdb_entry_new_static(
static int fdb_entry_new_static(
Network *network,
const char *filename,
unsigned section_line,

View File

@ -24,7 +24,6 @@ struct FdbEntry {
LIST_FIELDS(FdbEntry, static_fdb_entries);
};
int fdb_entry_new_static(Network *network, const char *filename, unsigned section_line, FdbEntry **ret);
void fdb_entry_free(FdbEntry *fdb_entry);
int fdb_entry_configure(Link *link, FdbEntry *fdb_entry);

View File

@ -50,7 +50,7 @@ static int ipv6_proxy_ndp_set(Link *link) {
return 0;
}
int ipv6_proxy_ndp_address_new_static(Network *network, IPv6ProxyNDPAddress **ret) {
static int ipv6_proxy_ndp_address_new_static(Network *network, IPv6ProxyNDPAddress **ret) {
_cleanup_(ipv6_proxy_ndp_address_freep) IPv6ProxyNDPAddress *ipv6_proxy_ndp_address = NULL;
assert(network);

View File

@ -16,7 +16,6 @@ struct IPv6ProxyNDPAddress {
LIST_FIELDS(IPv6ProxyNDPAddress, ipv6_proxy_ndp_addresses);
};
int ipv6_proxy_ndp_address_new_static(Network *network, IPv6ProxyNDPAddress ** ipv6_proxy_ndp_address);
void ipv6_proxy_ndp_address_free(IPv6ProxyNDPAddress *ipv6_proxy_ndp_address);
int ipv6_proxy_ndp_address_configure(Link *link, IPv6ProxyNDPAddress *ipv6_proxy_ndp_address);
int ipv6_proxy_ndp_addresses_configure(Link *link);

View File

@ -124,8 +124,8 @@ int prefix_new(Prefix **ret) {
return 0;
}
int prefix_new_static(Network *network, const char *filename,
unsigned section_line, Prefix **ret) {
static int prefix_new_static(Network *network, const char *filename,
unsigned section_line, Prefix **ret) {
_cleanup_(network_config_section_freep) NetworkConfigSection *n = NULL;
_cleanup_(prefix_freep) Prefix *prefix = NULL;
int r;

View File

@ -22,7 +22,6 @@ struct Prefix {
int prefix_new(Prefix **ret);
void prefix_free(Prefix *prefix);
int prefix_new_static(Network *network, const char *filename, unsigned section, Prefix **ret);
DEFINE_TRIVIAL_CLEANUP_FUNC(Prefix*, prefix_free);

View File

@ -67,7 +67,7 @@ int route_new(Route **ret) {
return 0;
}
int route_new_static(Network *network, const char *filename, unsigned section_line, Route **ret) {
static int route_new_static(Network *network, const char *filename, unsigned section_line, Route **ret) {
_cleanup_(network_config_section_freep) NetworkConfigSection *n = NULL;
_cleanup_(route_freep) Route *route = NULL;
int r;

View File

@ -43,7 +43,6 @@ struct Route {
LIST_FIELDS(Route, routes);
};
int route_new_static(Network *network, const char *filename, unsigned section_line, Route **ret);
int route_new(Route **ret);
void route_free(Route *route);
int route_configure(Route *route, Link *link, link_netlink_message_handler_t callback);