diff --git a/man/systemd.link.xml b/man/systemd.link.xml index 1a405e989d..9104dd7f8f 100644 --- a/man/systemd.link.xml +++ b/man/systemd.link.xml @@ -69,7 +69,13 @@ The following keys are accepted: - + + + MACAddress= A whitespace-separated list of hardware addresses. Use full colon-, hyphen- or dot-delimited hexadecimal. See the example below. @@ -80,7 +86,8 @@ MACAddress=01:23:45:67:89:ab 00-11-22-33-44-55 AABB.CCDD.EEFF - + + PermanentMACAddress= A whitespace-separated list of hardware's permanent addresses. While @@ -91,18 +98,8 @@ of hardware addresses defined prior to this is reset. - - OriginalName= - - A whitespace-separated list of shell-style globs matching - the device name, as exposed by the udev property - "INTERFACE". This cannot be used to match on names that have - already been changed from userspace. Caution is advised when matching on - kernel-assigned names, as they are known to be unstable - between reboots. - - - + + Path= A whitespace-separated list of shell-style globs matching @@ -110,23 +107,27 @@ ID_PATH. - + + Driver= A whitespace-separated list of shell-style globs matching the driver currently bound to the - device, as exposed by the udev property ID_NET_DRIVER of its parent device, or if that - is not set, the driver as exposed by ethtool -i of the device itself. + device, as exposed by the udev property ID_NET_DRIVER of its parent device, or + if that is not set, the driver as exposed by ethtool -i of the device itself. + If the list is prefixed with a "!", the test is inverted. - + + Type= - A whitespace-separated list of shell-style globs matching - the device type, as exposed by the udev - property DEVTYPE. + A whitespace-separated list of shell-style globs matching the device type, as exposed by + the udev property DEVTYPE. If the list is prefixed with a "!", the test is + inverted. - + + Property= A whitespace-separated list of udev property name with its value after a equal @@ -141,7 +142,18 @@ + + OriginalName= + + A whitespace-separated list of shell-style globs matching the device name, as exposed by the + udev property "INTERFACE". This cannot be used to match on names that have already been changed + from userspace. Caution is advised when matching on kernel-assigned names, as they are known to be + unstable between reboots. + + + + Host= Matches against the hostname or machine ID of the host. See ConditionHost= in @@ -151,7 +163,8 @@ - + + Virtualization= Checks whether the system is executed in a virtualized environment and optionally test @@ -162,7 +175,8 @@ - + + KernelCommandLine= Checks whether a specific kernel command line option is set. See @@ -173,7 +187,8 @@ - + + KernelVersion= Checks whether the kernel version (as reported by uname -r) matches a certain @@ -184,7 +199,8 @@ - + + Architecture= Checks whether the system is running on a specific architecture. See diff --git a/man/systemd.network.xml b/man/systemd.network.xml index 0e3c1d7283..36acc4dfeb 100644 --- a/man/systemd.network.xml +++ b/man/systemd.network.xml @@ -3,7 +3,8 @@ "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> - + systemd.network @@ -86,60 +87,13 @@ The following keys are accepted: - - MACAddress= - - A whitespace-separated list of hardware addresses. Use full colon-, hyphen- or dot-delimited hexadecimal. See the example below. - This option may appear more than once, in which case the lists are merged. If the empty string is assigned to this option, the list - of hardware addresses defined prior to this is reset. + + + + + + - Example: - MACAddress=01:23:45:67:89:ab 00-11-22-33-44-55 AABB.CCDD.EEFF - - - - PermanentMACAddress= - - A whitespace-separated list of hardware's permanent addresses. While - MACAddress= matches the device's current MAC address, this matches the - device's permanent MAC address, which may be different from the current one. Use full - colon-, hyphen- or dot-delimited hexadecimal. This option may appear more than once, in - which case the lists are merged. If the empty string is assigned to this option, the list - of hardware addresses defined prior to this is reset. - - - - Path= - - A whitespace-separated list of shell-style globs - matching the persistent path, as exposed by the udev - property ID_PATH. If the list is - prefixed with a "!", the test is inverted; i.e. it is - true when ID_PATH does not match any - item in the list. - - - - Driver= - - A whitespace-separated list of shell-style globs - matching the driver currently bound to the device, as - exposed by the udev property ID_NET_DRIVER - of its parent device, or if that is not set the driver - as exposed by ethtool -i of the - device itself. If the list is prefixed with a "!", the - test is inverted. - - - - Type= - - A whitespace-separated list of shell-style globs - matching the device type, as exposed by the udev property - DEVTYPE. If the list is prefixed with - a "!", the test is inverted. - - Name= @@ -148,21 +102,7 @@ list is prefixed with a "!", the test is inverted. - - Property= - - A whitespace-separated list of udev property name with its value after a equal - (=). If multiple properties are specified, the test results are ANDed. - If the list is prefixed with a "!", the test is inverted. If a value contains white - spaces, then please quote whole key and value pair. If a value contains quotation, then - please escape the quotation with \. - Example: if a .network file has the following: - Property=ID_MODEL_ID=9999 "ID_VENDOR_FROM_DATABASE=vendor name" "KEY=with \"quotation\"" - then, the .network file matches only when an interface has all the above three properties. - - - WLANInterfaceType= @@ -175,6 +115,7 @@ + SSID= @@ -183,6 +124,7 @@ + BSSID= @@ -193,61 +135,12 @@ prior to this is reset. - - Host= - - Matches against the hostname or machine ID of the host. See - ConditionHost= in - systemd.unit5 - for details. When prefixed with an exclamation mark (!), the result is negated. - If an empty string is assigned, then previously assigned value is cleared. - - - - - Virtualization= - - Checks whether the system is executed in a virtualized environment and optionally test - whether it is a specific implementation. See ConditionVirtualization= in - systemd.unit5 - for details. When prefixed with an exclamation mark (!), the result is negated. - If an empty string is assigned, then previously assigned value is cleared. - - - - - KernelCommandLine= - - Checks whether a specific kernel command line option is set. See - ConditionKernelCommandLine= in - systemd.unit5 - for details. When prefixed with an exclamation mark (!), the result is negated. - If an empty string is assigned, then previously assigned value is cleared. - - - - - KernelVersion= - - Checks whether the kernel version (as reported by uname -r) matches a - certain expression. See ConditionKernelVersion= in - systemd.unit5 - for details. When prefixed with an exclamation mark (!), the result is negated. - If an empty string is assigned, then previously assigned value is cleared. - - - - - Architecture= - - Checks whether the system is running on a specific architecture. See - ConditionArchitecture= in - systemd.unit5 - for details. When prefixed with an exclamation mark (!), the result is negated. - If an empty string is assigned, then previously assigned value is cleared. - - - + + + + + + diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index 17d232f9db..fb9db47105 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -391,22 +391,20 @@ static int source_io_register( int enabled, uint32_t events) { - struct epoll_event ev; - int r; - assert(s); assert(s->type == SOURCE_IO); assert(enabled != SD_EVENT_OFF); - ev = (struct epoll_event) { + struct epoll_event ev = { .events = events | (enabled == SD_EVENT_ONESHOT ? EPOLLONESHOT : 0), .data.ptr = s, }; + int r; - if (s->io.registered) - r = epoll_ctl(s->event->epoll_fd, EPOLL_CTL_MOD, s->io.fd, &ev); - else - r = epoll_ctl(s->event->epoll_fd, EPOLL_CTL_ADD, s->io.fd, &ev); + r = epoll_ctl(s->event->epoll_fd, + s->io.registered ? EPOLL_CTL_MOD : EPOLL_CTL_ADD, + s->io.fd, + &ev); if (r < 0) return -errno; @@ -441,9 +439,7 @@ static int source_child_pidfd_register(sd_event_source *s, int enabled) { assert(enabled != SD_EVENT_OFF); if (EVENT_SOURCE_WATCH_PIDFD(s)) { - struct epoll_event ev; - - ev = (struct epoll_event) { + struct epoll_event ev = { .events = EPOLLIN | (enabled == SD_EVENT_ONESHOT ? EPOLLONESHOT : 0), .data.ptr = s, }; @@ -549,7 +545,6 @@ static int event_make_signal_data( int sig, struct signal_data **ret) { - struct epoll_event ev; struct signal_data *d; bool added = false; sigset_t ss_copy; @@ -616,7 +611,7 @@ static int event_make_signal_data( d->fd = fd_move_above_stdio(r); - ev = (struct epoll_event) { + struct epoll_event ev = { .events = EPOLLIN, .data.ptr = d, }; @@ -1042,33 +1037,31 @@ static int event_setup_timer_fd( struct clock_data *d, clockid_t clock) { - struct epoll_event ev; - int r, fd; - assert(e); assert(d); if (_likely_(d->fd >= 0)) return 0; + _cleanup_close_ int fd = -1; + int r; + fd = timerfd_create(clock, TFD_NONBLOCK|TFD_CLOEXEC); if (fd < 0) return -errno; fd = fd_move_above_stdio(fd); - ev = (struct epoll_event) { + struct epoll_event ev = { .events = EPOLLIN, .data.ptr = d, }; r = epoll_ctl(e->epoll_fd, EPOLL_CTL_ADD, fd, &ev); - if (r < 0) { - safe_close(fd); + if (r < 0) return -errno; - } - d->fd = fd; + d->fd = TAKE_FD(fd); return 0; } @@ -1552,7 +1545,6 @@ static int event_make_inotify_data( _cleanup_close_ int fd = -1; struct inotify_data *d; - struct epoll_event ev; int r; assert(e); @@ -1591,7 +1583,7 @@ static int event_make_inotify_data( return r; } - ev = (struct epoll_event) { + struct epoll_event ev = { .events = EPOLLIN, .data.ptr = d, }; @@ -3844,8 +3836,6 @@ _public_ int sd_event_set_watchdog(sd_event *e, int b) { return e->watchdog; if (b) { - struct epoll_event ev; - r = sd_watchdog_enabled(false, &e->watchdog_period); if (r <= 0) return r; @@ -3862,7 +3852,7 @@ _public_ int sd_event_set_watchdog(sd_event *e, int b) { if (r < 0) goto fail; - ev = (struct epoll_event) { + struct epoll_event ev = { .events = EPOLLIN, .data.ptr = INT_TO_PTR(SOURCE_WATCHDOG), }; diff --git a/src/network/networkctl.c b/src/network/networkctl.c index 1cf8797fed..e6dc70a0e2 100644 --- a/src/network/networkctl.c +++ b/src/network/networkctl.c @@ -324,9 +324,8 @@ static int decode_link(sd_netlink_message *m, LinkInfo *info, char **patterns) { sd_netlink_message_read_ether_addr(m, IFLA_ADDRESS, &info->mac_address) >= 0 && memcmp(&info->mac_address, ÐER_ADDR_NULL, sizeof(struct ether_addr)) != 0; - _cleanup_close_ int fd = -1; info->has_permanent_mac_address = - ethtool_get_permanent_macaddr(&fd, info->name, &info->permanent_mac_address) >= 0 && + ethtool_get_permanent_macaddr(NULL, info->name, &info->permanent_mac_address) >= 0 && memcmp(&info->permanent_mac_address, ÐER_ADDR_NULL, sizeof(struct ether_addr)) != 0 && memcmp(&info->permanent_mac_address, &info->mac_address, sizeof(struct ether_addr)) != 0; diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c index 4ff9c13510..f353833e0d 100644 --- a/src/network/networkd-link.c +++ b/src/network/networkd-link.c @@ -618,8 +618,7 @@ static int link_new(Manager *manager, sd_netlink_message *message, Link **ret) { if (r < 0) log_link_debug_errno(link, r, "MAC address not found for new device, continuing without"); - _cleanup_close_ int fd = -1; - r = ethtool_get_permanent_macaddr(&fd, link->ifname, &link->permanent_mac); + r = ethtool_get_permanent_macaddr(NULL, link->ifname, &link->permanent_mac); if (r < 0) log_link_debug_errno(link, r, "Permanent MAC address not found for new device, continuing without: %m"); diff --git a/src/shared/ethtool-util.c b/src/shared/ethtool-util.c index e10948d612..a9059a3ab7 100644 --- a/src/shared/ethtool-util.c +++ b/src/shared/ethtool-util.c @@ -9,6 +9,7 @@ #include "conf-parser.h" #include "ethtool-util.h" #include "extract-word.h" +#include "fd-util.h" #include "log.h" #include "memory-util.h" #include "socket-util.h" @@ -145,7 +146,7 @@ static int ethtool_connect_or_warn(int *ret, bool warn) { return 0; } -int ethtool_get_driver(int *fd, const char *ifname, char **ret) { +int ethtool_get_driver(int *ethtool_fd, const char *ifname, char **ret) { struct ethtool_drvinfo ecmd = { .cmd = ETHTOOL_GDRVINFO }; @@ -155,15 +156,15 @@ int ethtool_get_driver(int *fd, const char *ifname, char **ret) { char *d; int r; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, true); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, true); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; @@ -175,7 +176,7 @@ int ethtool_get_driver(int *fd, const char *ifname, char **ret) { return 0; } -int ethtool_get_link_info(int *fd, const char *ifname, +int ethtool_get_link_info(int *ethtool_fd, const char *ifname, int *ret_autonegotiation, size_t *ret_speed, Duplex *ret_duplex, NetDevPort *ret_port) { struct ethtool_cmd ecmd = { @@ -186,15 +187,15 @@ int ethtool_get_link_info(int *fd, const char *ifname, }; int r; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, false); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, false); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; @@ -218,47 +219,48 @@ int ethtool_get_link_info(int *fd, const char *ifname, return 0; } -int ethtool_get_permanent_macaddr(int *fd, const char *ifname, struct ether_addr *ret) { - _cleanup_free_ struct ethtool_perm_addr *epaddr = NULL; - struct ifreq ifr; +int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct ether_addr *ret) { + _cleanup_close_ int fd = -1; + struct { + struct ethtool_perm_addr addr; + uint8_t space[MAX_ADDR_LEN]; + } epaddr = { + .addr.cmd = ETHTOOL_GPERMADDR, + .addr.size = MAX_ADDR_LEN, + }; + struct ifreq ifr = { + .ifr_data = (caddr_t) &epaddr, + }; int r; - assert(fd); assert(ifname); assert(ret); - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, false); + if (!ethtool_fd) + ethtool_fd = &fd; + + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, false); if (r < 0) return r; } - epaddr = malloc(offsetof(struct ethtool_perm_addr, data) + MAX_ADDR_LEN); - if (!epaddr) - return -ENOMEM; - - epaddr->cmd = ETHTOOL_GPERMADDR; - epaddr->size = MAX_ADDR_LEN; - - ifr = (struct ifreq) { - .ifr_data = (caddr_t) epaddr, - }; strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; - if (epaddr->size != 6) + if (epaddr.addr.size != 6) return -EOPNOTSUPP; - for (size_t i = 0; i < epaddr->size; i++) - ret->ether_addr_octet[i] = epaddr->data[i]; + for (size_t i = 0; i < epaddr.addr.size; i++) + ret->ether_addr_octet[i] = epaddr.addr.data[i]; return 0; } -int ethtool_set_speed(int *fd, const char *ifname, unsigned speed, Duplex duplex) { +int ethtool_set_speed(int *ethtool_fd, const char *ifname, unsigned speed, Duplex duplex) { struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET }; @@ -271,15 +273,15 @@ int ethtool_set_speed(int *fd, const char *ifname, unsigned speed, Duplex duplex if (speed == 0 && duplex == _DUP_INVALID) return 0; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, true); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, true); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; @@ -308,7 +310,7 @@ int ethtool_set_speed(int *fd, const char *ifname, unsigned speed, Duplex duplex if (need_update) { ecmd.cmd = ETHTOOL_SSET; - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; } @@ -316,7 +318,7 @@ int ethtool_set_speed(int *fd, const char *ifname, unsigned speed, Duplex duplex return 0; } -int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol) { +int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol) { struct ethtool_wolinfo ecmd = { .cmd = ETHTOOL_GWOL }; @@ -329,15 +331,15 @@ int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol) { if (wol == _WOL_INVALID) return 0; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, true); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, true); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; @@ -397,7 +399,7 @@ int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol) { if (need_update) { ecmd.cmd = ETHTOOL_SWOL; - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; } @@ -405,7 +407,7 @@ int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol) { return 0; } -int ethtool_set_nic_buffer_size(int *fd, const char *ifname, netdev_ring_param *ring) { +int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring_param *ring) { struct ethtool_ringparam ecmd = { .cmd = ETHTOOL_GRINGPARAM }; @@ -415,15 +417,15 @@ int ethtool_set_nic_buffer_size(int *fd, const char *ifname, netdev_ring_param * bool need_update = false; int r; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, true); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, true); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; @@ -444,7 +446,7 @@ int ethtool_set_nic_buffer_size(int *fd, const char *ifname, netdev_ring_param * if (need_update) { ecmd.cmd = ETHTOOL_SRINGPARAM; - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return -errno; } @@ -452,7 +454,7 @@ int ethtool_set_nic_buffer_size(int *fd, const char *ifname, netdev_ring_param * return 0; } -static int get_stringset(int fd, struct ifreq *ifr, int stringset_id, struct ethtool_gstrings **gstrings) { +static int get_stringset(int ethtool_fd, struct ifreq *ifr, int stringset_id, struct ethtool_gstrings **gstrings) { _cleanup_free_ struct ethtool_gstrings *strings = NULL; struct { struct ethtool_sset_info info; @@ -468,7 +470,7 @@ static int get_stringset(int fd, struct ifreq *ifr, int stringset_id, struct eth ifr->ifr_data = (void *) &buffer.info; - r = ioctl(fd, SIOCETHTOOL, ifr); + r = ioctl(ethtool_fd, SIOCETHTOOL, ifr); if (r < 0) return -errno; @@ -487,7 +489,7 @@ static int get_stringset(int fd, struct ifreq *ifr, int stringset_id, struct eth ifr->ifr_data = (void *) strings; - r = ioctl(fd, SIOCETHTOOL, ifr); + r = ioctl(ethtool_fd, SIOCETHTOOL, ifr); if (r < 0) return -errno; @@ -507,21 +509,21 @@ static int find_feature_index(struct ethtool_gstrings *strings, const char *feat return -ENODATA; } -int ethtool_set_features(int *fd, const char *ifname, int *features) { +int ethtool_set_features(int *ethtool_fd, const char *ifname, int *features) { _cleanup_free_ struct ethtool_gstrings *strings = NULL; struct ethtool_sfeatures *sfeatures; int block, bit, i, r; struct ifreq ifr = {}; - if (*fd < 0) { - r = ethtool_connect_or_warn(fd, true); + if (*ethtool_fd < 0) { + r = ethtool_connect_or_warn(ethtool_fd, true); if (r < 0) return r; } strscpy(ifr.ifr_name, IFNAMSIZ, ifname); - r = get_stringset(*fd, &ifr, ETH_SS_FEATURES, &strings); + r = get_stringset(*ethtool_fd, &ifr, ETH_SS_FEATURES, &strings); if (r < 0) return log_warning_errno(r, "ethtool: could not get ethtool features for %s", ifname); @@ -553,7 +555,7 @@ int ethtool_set_features(int *fd, const char *ifname, int *features) { ifr.ifr_data = (void *) sfeatures; - r = ioctl(*fd, SIOCETHTOOL, &ifr); + r = ioctl(*ethtool_fd, SIOCETHTOOL, &ifr); if (r < 0) return log_warning_errno(r, "ethtool: could not set ethtool features for %s", ifname); diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 80bfffd6e9..8468a26bc2 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -88,19 +88,19 @@ typedef struct netdev_ring_param { bool tx_pending_set; } netdev_ring_param; -int ethtool_get_driver(int *fd, const char *ifname, char **ret); -int ethtool_get_link_info(int *fd, const char *ifname, +int ethtool_get_driver(int *ethtool_fd, const char *ifname, char **ret); +int ethtool_get_link_info(int *ethtool_fd, const char *ifname, int *ret_autonegotiation, size_t *ret_speed, Duplex *ret_duplex, NetDevPort *ret_port); -int ethtool_get_permanent_macaddr(int *fd, const char *ifname, struct ether_addr *ret); -int ethtool_set_speed(int *fd, const char *ifname, unsigned speed, Duplex duplex); -int ethtool_set_wol(int *fd, const char *ifname, WakeOnLan wol); -int ethtool_set_nic_buffer_size(int *fd, const char *ifname, netdev_ring_param *ring); -int ethtool_set_features(int *fd, const char *ifname, int *features); -int ethtool_set_glinksettings(int *fd, const char *ifname, +int ethtool_get_permanent_macaddr(int *ethtool_fd, const char *ifname, struct ether_addr *ret); +int ethtool_set_speed(int *ethtool_fd, const char *ifname, unsigned speed, Duplex duplex); +int ethtool_set_wol(int *ethtool_fd, const char *ifname, WakeOnLan wol); +int ethtool_set_nic_buffer_size(int *ethtool_fd, const char *ifname, netdev_ring_param *ring); +int ethtool_set_features(int *ethtool_fd, const char *ifname, int *features); +int ethtool_set_glinksettings(int *ethtool_fd, const char *ifname, int autonegotiation, uint32_t advertise[static N_ADVERTISE], size_t speed, Duplex duplex, NetDevPort port); -int ethtool_set_channels(int *fd, const char *ifname, netdev_channels *channels); +int ethtool_set_channels(int *ethtool_fd, const char *ifname, netdev_channels *channels); const char *duplex_to_string(Duplex d) _const_; Duplex duplex_from_string(const char *d) _pure_;