network: make several functions static

This commit is contained in:
Yu Watanabe 2020-09-30 00:05:18 +09:00
parent 19f8cffce1
commit 0d6e933eac
2 changed files with 6 additions and 10 deletions

View file

@ -32,6 +32,8 @@ void neighbor_free(Neighbor *neighbor) {
free(neighbor);
}
DEFINE_NETWORK_SECTION_FUNCTIONS(Neighbor, neighbor_free);
static int neighbor_new_static(Network *network, const char *filename, unsigned section_line, Neighbor **ret) {
_cleanup_(network_config_section_freep) NetworkConfigSection *n = NULL;
_cleanup_(neighbor_freep) Neighbor *neighbor = NULL;
@ -118,7 +120,7 @@ static int neighbor_compare_func(const Neighbor *a, const Neighbor *b) {
DEFINE_PRIVATE_HASH_OPS_WITH_KEY_DESTRUCTOR(neighbor_hash_ops, Neighbor, neighbor_hash_func, neighbor_compare_func, neighbor_free);
int neighbor_get(Link *link, const Neighbor *in, Neighbor **ret) {
static int neighbor_get(Link *link, const Neighbor *in, Neighbor **ret) {
Neighbor *existing;
assert(link);
@ -202,7 +204,7 @@ int neighbor_add(Link *link, const Neighbor *in, Neighbor **ret) {
return 0;
}
int neighbor_add_foreign(Link *link, const Neighbor *in, Neighbor **ret) {
static int neighbor_add_foreign(Link *link, const Neighbor *in, Neighbor **ret) {
return neighbor_add_internal(link, &link->neighbors_foreign, in, ret);
}
@ -242,7 +244,7 @@ static int neighbor_configure_handler(sd_netlink *rtnl, sd_netlink_message *m, L
return 1;
}
int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback) {
static int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *req = NULL;
int r;

View file

@ -32,19 +32,13 @@ struct Neighbor {
};
void neighbor_free(Neighbor *neighbor);
int neighbor_section_verify(Neighbor *neighbor);
DEFINE_NETWORK_SECTION_FUNCTIONS(Neighbor, neighbor_free);
int neighbor_configure(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
int neighbor_remove(Neighbor *neighbor, Link *link, link_netlink_message_handler_t callback);
int neighbor_get(Link *link, const Neighbor *in, Neighbor **ret);
int neighbor_add(Link *link, const Neighbor *in, Neighbor **ret);
int neighbor_add_foreign(Link *link, const Neighbor *in, Neighbor **ret);
bool neighbor_equal(const Neighbor *n1, const Neighbor *n2);
int neighbor_section_verify(Neighbor *neighbor);
int link_set_neighbors(Link *link);
int manager_rtnl_process_neighbor(sd_netlink *rtnl, sd_netlink_message *message, Manager *m);