Compare commits
7 Commits
cdc6c95737
...
12ef8fb6f1
Author | SHA1 | Date |
---|---|---|
Susant Sahani | 12ef8fb6f1 | |
Zbigniew Jędrzejewski-Szmek | 2e7d6d1d32 | |
pelzvieh | 137d448751 | |
Arusekk | 71180f8e57 | |
Susant Sahani | 1f807af6de | |
Susant Sahani | eb46288cca | |
Susant Sahani | be1af90585 |
|
@ -310,7 +310,8 @@ bool fstype_is_network(const char *fstype) {
|
||||||
"glusterfs",
|
"glusterfs",
|
||||||
"pvfs2", /* OrangeFS */
|
"pvfs2", /* OrangeFS */
|
||||||
"ocfs2",
|
"ocfs2",
|
||||||
"lustre");
|
"lustre",
|
||||||
|
"davfs");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool fstype_is_api_vfs(const char *fstype) {
|
bool fstype_is_api_vfs(const char *fstype) {
|
||||||
|
|
|
@ -1175,7 +1175,7 @@ int dhcp_lease_load(sd_dhcp_lease **ret, const char *lease_file) {
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
log_debug_errno(r, "Failed to deserialize SIP servers %s, ignoring: %m", sip);
|
log_debug_errno(r, "Failed to deserialize SIP servers %s, ignoring: %m", sip);
|
||||||
else
|
else
|
||||||
lease->ntp_size = r;
|
lease->sip_size = r;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mtu) {
|
if (mtu) {
|
||||||
|
|
|
@ -240,6 +240,10 @@ _public_ int sd_network_link_get_ntp(int ifindex, char ***ret) {
|
||||||
return network_link_get_strv(ifindex, "NTP", ret);
|
return network_link_get_strv(ifindex, "NTP", ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_public_ int sd_network_link_get_sip(int ifindex, char ***ret) {
|
||||||
|
return network_link_get_strv(ifindex, "SIP", ret);
|
||||||
|
}
|
||||||
|
|
||||||
_public_ int sd_network_link_get_search_domains(int ifindex, char ***ret) {
|
_public_ int sd_network_link_get_search_domains(int ifindex, char ***ret) {
|
||||||
return network_link_get_strv(ifindex, "DOMAINS", ret);
|
return network_link_get_strv(ifindex, "DOMAINS", ret);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <linux/if_bridge.h>
|
||||||
#include <linux/if_tunnel.h>
|
#include <linux/if_tunnel.h>
|
||||||
|
|
||||||
#include "sd-bus.h"
|
#include "sd-bus.h"
|
||||||
|
@ -145,8 +146,10 @@ typedef struct LinkInfo {
|
||||||
uint32_t max_age;
|
uint32_t max_age;
|
||||||
uint32_t ageing_time;
|
uint32_t ageing_time;
|
||||||
uint32_t stp_state;
|
uint32_t stp_state;
|
||||||
|
uint32_t cost;
|
||||||
uint16_t priority;
|
uint16_t priority;
|
||||||
uint8_t mcast_igmp_version;
|
uint8_t mcast_igmp_version;
|
||||||
|
uint8_t port_state;
|
||||||
|
|
||||||
/* vxlan info */
|
/* vxlan info */
|
||||||
VxLanInfo vxlan_info;
|
VxLanInfo vxlan_info;
|
||||||
|
@ -235,8 +238,10 @@ static int decode_netdev(sd_netlink_message *m, LinkInfo *info) {
|
||||||
(void) sd_netlink_message_read_u32(m, IFLA_BR_MAX_AGE, &info->max_age);
|
(void) sd_netlink_message_read_u32(m, IFLA_BR_MAX_AGE, &info->max_age);
|
||||||
(void) sd_netlink_message_read_u32(m, IFLA_BR_AGEING_TIME, &info->ageing_time);
|
(void) sd_netlink_message_read_u32(m, IFLA_BR_AGEING_TIME, &info->ageing_time);
|
||||||
(void) sd_netlink_message_read_u32(m, IFLA_BR_STP_STATE, &info->stp_state);
|
(void) sd_netlink_message_read_u32(m, IFLA_BR_STP_STATE, &info->stp_state);
|
||||||
|
(void) sd_netlink_message_read_u32(m, IFLA_BRPORT_COST, &info->cost);
|
||||||
(void) sd_netlink_message_read_u16(m, IFLA_BR_PRIORITY, &info->priority);
|
(void) sd_netlink_message_read_u16(m, IFLA_BR_PRIORITY, &info->priority);
|
||||||
(void) sd_netlink_message_read_u8(m, IFLA_BR_MCAST_IGMP_VERSION, &info->mcast_igmp_version);
|
(void) sd_netlink_message_read_u8(m, IFLA_BR_MCAST_IGMP_VERSION, &info->mcast_igmp_version);
|
||||||
|
(void) sd_netlink_message_read_u8(m, IFLA_BRPORT_STATE, &info->port_state);
|
||||||
} if (streq(received_kind, "bond")) {
|
} if (streq(received_kind, "bond")) {
|
||||||
(void) sd_netlink_message_read_u8(m, IFLA_BOND_MODE, &info->mode);
|
(void) sd_netlink_message_read_u8(m, IFLA_BOND_MODE, &info->mode);
|
||||||
(void) sd_netlink_message_read_u32(m, IFLA_BOND_MIIMON, &info->miimon);
|
(void) sd_netlink_message_read_u32(m, IFLA_BOND_MIIMON, &info->miimon);
|
||||||
|
@ -1221,7 +1226,7 @@ static int link_status_one(
|
||||||
sd_hwdb *hwdb,
|
sd_hwdb *hwdb,
|
||||||
const LinkInfo *info) {
|
const LinkInfo *info) {
|
||||||
|
|
||||||
_cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **search_domains = NULL, **route_domains = NULL;
|
_cleanup_strv_free_ char **dns = NULL, **ntp = NULL, **sip = NULL, **search_domains = NULL, **route_domains = NULL;
|
||||||
_cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL;
|
_cleanup_free_ char *setup_state = NULL, *operational_state = NULL, *tz = NULL;
|
||||||
_cleanup_free_ char *t = NULL, *network = NULL;
|
_cleanup_free_ char *t = NULL, *network = NULL;
|
||||||
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
|
const char *driver = NULL, *path = NULL, *vendor = NULL, *model = NULL, *link = NULL;
|
||||||
|
@ -1247,6 +1252,7 @@ static int link_status_one(
|
||||||
(void) sd_network_link_get_search_domains(info->ifindex, &search_domains);
|
(void) sd_network_link_get_search_domains(info->ifindex, &search_domains);
|
||||||
(void) sd_network_link_get_route_domains(info->ifindex, &route_domains);
|
(void) sd_network_link_get_route_domains(info->ifindex, &route_domains);
|
||||||
(void) sd_network_link_get_ntp(info->ifindex, &ntp);
|
(void) sd_network_link_get_ntp(info->ifindex, &ntp);
|
||||||
|
(void) sd_network_link_get_sip(info->ifindex, &sip);
|
||||||
|
|
||||||
if (info->sd_device) {
|
if (info->sd_device) {
|
||||||
(void) sd_device_get_property_value(info->sd_device, "ID_NET_LINK_FILE", &link);
|
(void) sd_device_get_property_value(info->sd_device, "ID_NET_LINK_FILE", &link);
|
||||||
|
@ -1473,10 +1479,29 @@ static int link_status_one(
|
||||||
TABLE_BOOLEAN, info->stp_state > 0,
|
TABLE_BOOLEAN, info->stp_state > 0,
|
||||||
TABLE_EMPTY,
|
TABLE_EMPTY,
|
||||||
TABLE_STRING, "Multicast IGMP Version:",
|
TABLE_STRING, "Multicast IGMP Version:",
|
||||||
TABLE_UINT8, info->mcast_igmp_version);
|
TABLE_UINT8, info->mcast_igmp_version,
|
||||||
|
TABLE_EMPTY,
|
||||||
|
TABLE_STRING, "Cost:",
|
||||||
|
TABLE_UINT32, info->cost);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return table_log_add_error(r);
|
return table_log_add_error(r);
|
||||||
|
|
||||||
|
if (info->port_state <= BR_STATE_BLOCKING) {
|
||||||
|
static const struct {
|
||||||
|
const char *state;
|
||||||
|
} state_table[] = {
|
||||||
|
{ "disabled" },
|
||||||
|
{ "listening" },
|
||||||
|
{ "learning" },
|
||||||
|
{ "forwarding" },
|
||||||
|
{ "blocking" },
|
||||||
|
};
|
||||||
|
|
||||||
|
r = table_add_many(table,
|
||||||
|
TABLE_EMPTY,
|
||||||
|
TABLE_STRING, "Port State:",
|
||||||
|
TABLE_STRING, state_table[info->port_state]);
|
||||||
|
}
|
||||||
} else if (streq_ptr(info->netdev_kind, "bond")) {
|
} else if (streq_ptr(info->netdev_kind, "bond")) {
|
||||||
static const struct {
|
static const struct {
|
||||||
const char *mode;
|
const char *mode;
|
||||||
|
@ -1749,6 +1774,9 @@ static int link_status_one(
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
r = dump_list(table, "NTP:", ntp);
|
r = dump_list(table, "NTP:", ntp);
|
||||||
|
if (r < 0)
|
||||||
|
return r;
|
||||||
|
r = dump_list(table, "SIP:", sip);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return r;
|
return r;
|
||||||
r = dump_ifindexes(table, "Carrier Bound To:", carrier_bound_to);
|
r = dump_ifindexes(table, "Carrier Bound To:", carrier_bound_to);
|
||||||
|
|
|
@ -547,6 +547,9 @@ int main(int argc, char *argv[]) {
|
||||||
/* Child */
|
/* Child */
|
||||||
|
|
||||||
execv(args[0], (char * const *) args);
|
execv(args[0], (char * const *) args);
|
||||||
|
|
||||||
|
/* execv failed (kexec binary missing?), so try simply reboot(RB_KEXEC) */
|
||||||
|
(void) reboot(cmd);
|
||||||
_exit(EXIT_FAILURE);
|
_exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -118,6 +118,10 @@ int sd_network_link_get_dhcp4_address(int ifindex, char **ret);
|
||||||
* representations of IP addresses */
|
* representations of IP addresses */
|
||||||
int sd_network_link_get_ntp(int ifindex, char ***ret);
|
int sd_network_link_get_ntp(int ifindex, char ***ret);
|
||||||
|
|
||||||
|
/* Get SIP entries for a given link. These are string
|
||||||
|
* representations of IP addresses */
|
||||||
|
int sd_network_link_get_sip(int ifindex, char ***ret);
|
||||||
|
|
||||||
/* Indicates whether or not LLMNR should be enabled for the link
|
/* Indicates whether or not LLMNR should be enabled for the link
|
||||||
* Possible levels of support: yes, no, resolve
|
* Possible levels of support: yes, no, resolve
|
||||||
* Possible return codes:
|
* Possible return codes:
|
||||||
|
|
Loading…
Reference in New Issue