The link is the 'object', so make this in line with our usual naming convention.
Suggested by Kay and Lennart.
return network_get_strv("NTP", ret);
}
return network_get_strv("NTP", ret);
}
-_public_ int sd_network_get_link_state(int ifindex, char **state) {
+_public_ int sd_network_link_get_state(int ifindex, char **state) {
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
-_public_ int sd_network_get_link_operational_state(int ifindex, char **state) {
+_public_ int sd_network_link_get_operational_state(int ifindex, char **state) {
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
-_public_ int sd_network_get_link_llmnr(int ifindex, char **llmnr) {
+_public_ int sd_network_link_get_llmnr(int ifindex, char **llmnr) {
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
_cleanup_free_ char *s = NULL, *p = NULL;
int r;
-_public_ int sd_network_get_link_dns(int ifindex, char ***ret) {
+_public_ int sd_network_link_get_dns(int ifindex, char ***ret) {
return network_get_link_strv("DNS", ifindex, ret);
}
return network_get_link_strv("DNS", ifindex, ret);
}
-_public_ int sd_network_get_link_ntp(int ifindex, char ***ret) {
+_public_ int sd_network_link_get_ntp(int ifindex, char ***ret) {
return network_get_link_strv("NTP", ifindex, ret);
}
return network_get_link_strv("NTP", ifindex, ret);
}
char devid[2 + DECIMAL_STR_MAX(int)];
_cleanup_free_ char *t = NULL;
char devid[2 + DECIMAL_STR_MAX(int)];
_cleanup_free_ char *t = NULL;
- sd_network_get_link_state(links[i].ifindex, &state);
- sd_network_get_link_operational_state(links[i].ifindex, &operational_state);
+ sd_network_link_get_state(links[i].ifindex, &state);
+ sd_network_link_get_operational_state(links[i].ifindex, &operational_state);
sprintf(devid, "n%i", links[i].ifindex);
d = udev_device_new_from_device_id(udev, devid);
sprintf(devid, "n%i", links[i].ifindex);
d = udev_device_new_from_device_id(udev, devid);
sd_rtnl_message_read_u32(reply, IFLA_MTU, &mtu);
sd_rtnl_message_read_u32(reply, IFLA_MTU, &mtu);
- sd_network_get_link_state(ifindex, &state);
- sd_network_get_link_operational_state(ifindex, &operational_state);
+ sd_network_link_get_state(ifindex, &state);
+ sd_network_link_get_operational_state(ifindex, &operational_state);
- sd_network_get_link_dns(ifindex, &dns);
- sd_network_get_link_ntp(ifindex, &ntp);
+ sd_network_link_get_dns(ifindex, &dns);
+ sd_network_link_get_ntp(ifindex, &ntp);
sprintf(devid, "n%i", ifindex);
d = udev_device_new_from_device_id(udev, devid);
sprintf(devid, "n%i", ifindex);
d = udev_device_new_from_device_id(udev, devid);
free(l->operational_state);
l->operational_state = NULL;
free(l->operational_state);
l->operational_state = NULL;
- sd_network_get_link_operational_state(l->ifindex, &l->operational_state);
+ sd_network_link_get_operational_state(l->ifindex, &l->operational_state);
free(l->state);
l->state = NULL;
free(l->state);
l->state = NULL;
- sd_network_get_link_state(l->ifindex, &l->state);
+ sd_network_link_get_state(l->ifindex, &l->state);
- r = sd_network_get_link_dns(l->ifindex, &nameservers);
+ r = sd_network_link_get_dns(l->ifindex, &nameservers);
- r = sd_network_get_link_llmnr(l->ifindex, &b);
+ r = sd_network_link_get_llmnr(l->ifindex, &b);
if ((l->flags & (IFF_UP|IFF_LOWER_UP|IFF_MULTICAST)) != (IFF_UP|IFF_LOWER_UP|IFF_MULTICAST))
return false;
if ((l->flags & (IFF_UP|IFF_LOWER_UP|IFF_MULTICAST)) != (IFF_UP|IFF_LOWER_UP|IFF_MULTICAST))
return false;
- sd_network_get_link_operational_state(l->ifindex, &state);
+ sd_network_link_get_operational_state(l->ifindex, &state);
if (state && !STR_IN_SET(state, "unknown", "degraded", "routable"))
return false;
if (state && !STR_IN_SET(state, "unknown", "degraded", "routable"))
return false;
* Possible return codes:
* -ENODATA: networkd is not aware of the link
*/
* Possible return codes:
* -ENODATA: networkd is not aware of the link
*/
-int sd_network_get_link_state(int ifindex, char **state);
+int sd_network_link_get_state(int ifindex, char **state);
/* Get operatinal state from ifindex.
* Possible states: down, up, dormant, carrier, degraded, routable
* Possible return codes:
* -ENODATA: networkd is not aware of the link
*/
/* Get operatinal state from ifindex.
* Possible states: down, up, dormant, carrier, degraded, routable
* Possible return codes:
* -ENODATA: networkd is not aware of the link
*/
-int sd_network_get_link_operational_state(int ifindex, char **state);
+int sd_network_link_get_operational_state(int ifindex, char **state);
/* Get DNS entries for a given link. These are string representations of
* IP addresses */
/* Get DNS entries for a given link. These are string representations of
* IP addresses */
-int sd_network_get_link_dns(int ifindex, char ***addr);
+int sd_network_link_get_dns(int ifindex, char ***addr);
/* Get NTP entries for a given link. These are domain names or string
* reperesentations of IP addresses */
/* Get NTP entries for a given link. These are domain names or string
* reperesentations of IP addresses */
-int sd_network_get_link_ntp(int ifindex, char ***addr);
+int sd_network_link_get_ntp(int ifindex, char ***addr);
/* Indicates whether or not LLMNR should be enabled for the link
* Possible levels of support: yes, no, resolve
* Possible return codes:
* -ENODATA: networkd is not aware of the link*/
/* Indicates whether or not LLMNR should be enabled for the link
* Possible levels of support: yes, no, resolve
* Possible return codes:
* -ENODATA: networkd is not aware of the link*/
-int sd_network_get_link_llmnr(int ifindex, char **llmnr);
+int sd_network_link_get_llmnr(int ifindex, char **llmnr);
/* Monitor object */
typedef struct sd_network_monitor sd_network_monitor;
/* Monitor object */
typedef struct sd_network_monitor sd_network_monitor;