network: split out DBus related prototypes to networkd-link-bus.h

This commit is contained in:
Yu Watanabe 2019-05-27 05:35:02 +09:00
parent 4b381a9ef6
commit 6a1af3d4ca
7 changed files with 22 additions and 7 deletions

View File

@ -63,6 +63,7 @@ sources = files('''
networkd-ipv6-proxy-ndp.c
networkd-ipv6-proxy-ndp.h
networkd-link-bus.c
networkd-link-bus.h
networkd-link.c
networkd-link.h
networkd-lldp-rx.c

View File

@ -3,6 +3,7 @@
#include "alloc-util.h"
#include "bus-common-errors.h"
#include "bus-util.h"
#include "networkd-link-bus.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "parse-util.h"
@ -65,7 +66,7 @@ const sd_bus_vtable link_vtable[] = {
SD_BUS_VTABLE_END
};
static char *link_bus_path(Link *link) {
char *link_bus_path(Link *link) {
_cleanup_free_ char *ifindex = NULL;
char *p;
int r;

View File

@ -0,0 +1,15 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
#pragma once
#include "sd-bus.h"
#include "macro.h"
typedef struct Link Link;
extern const sd_bus_vtable link_vtable[];
char *link_bus_path(Link *link);
int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
int link_send_changed(Link *link, const char *property, ...) _sentinel_;

View File

@ -20,6 +20,8 @@
#include "network-internal.h"
#include "networkd-can.h"
#include "networkd-ipv6-proxy-ndp.h"
#include "networkd-link-bus.h"
#include "networkd-link.h"
#include "networkd-lldp-tx.h"
#include "networkd-manager.h"
#include "networkd-ndisc.h"

View File

@ -183,12 +183,6 @@ int link_stop_clients(Link *link, bool may_keep_dhcp);
const char* link_state_to_string(LinkState s) _const_;
LinkState link_state_from_string(const char *s) _pure_;
extern const sd_bus_vtable link_vtable[];
int link_node_enumerator(sd_bus *bus, const char *path, void *userdata, char ***nodes, sd_bus_error *error);
int link_object_find(sd_bus *bus, const char *path, const char *interface, void *userdata, void **found, sd_bus_error *error);
int link_send_changed(Link *link, const char *property, ...) _sentinel_;
uint32_t link_get_vrf_table(Link *link);
uint32_t link_get_dhcp_route_table(Link *link);
uint32_t link_get_ipv6_accept_ra_route_table(Link *link);

View File

@ -21,6 +21,7 @@
#include "local-addresses.h"
#include "netlink-util.h"
#include "network-internal.h"
#include "networkd-link-bus.h"
#include "networkd-manager.h"
#include "networkd-speed-meter.h"
#include "ordered-set.h"

View File

@ -5,6 +5,7 @@
#include "sd-event.h"
#include "sd-netlink.h"
#include "networkd-link-bus.h"
#include "networkd-link.h"
#include "networkd-manager.h"
#include "networkd-speed-meter.h"