diff --git a/include/netlink/route/link.h b/include/netlink/route/link.h index 0dddaf7..d7d9cd3 100644 --- a/include/netlink/route/link.h +++ b/include/netlink/route/link.h @@ -187,8 +187,11 @@ extern uint64_t rtnl_link_get_stat(struct rtnl_link *, int); extern int rtnl_link_set_stat(struct rtnl_link *, const unsigned int, const uint64_t); -extern int rtnl_link_set_info_type(struct rtnl_link *, const char *); -extern char * rtnl_link_get_info_type(struct rtnl_link *); +extern int rtnl_link_set_type(struct rtnl_link *, const char *); +extern char * rtnl_link_get_type(struct rtnl_link *); + +extern int rtnl_link_set_info_type(struct rtnl_link *, const char *) __attribute__((deprecated)); +extern char * rtnl_link_get_info_type(struct rtnl_link *) __attribute__((deprecated)); #ifdef __cplusplus } diff --git a/lib/route/link.c b/lib/route/link.c index 8406edc..6268886 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -1977,17 +1977,17 @@ int rtnl_link_set_stat(struct rtnl_link *link, const unsigned int id, } /** - * Specify the info type of a link - * @arg link link object - * @arg type info type + * Set link type + * @arg link Link object + * @arg type Type of link * - * Looks up the info type and prepares the link to store info type - * specific attributes. If an info type has been assigned already - * it will be released with all changes lost. + * Looks up the link type modules and prepares the link to store type + * specific attributes. If a type has been assigned already it will + * be released with all link type specific attributes lost. * * @return 0 on success or a negative errror code. */ -int rtnl_link_set_info_type(struct rtnl_link *link, const char *type) +int rtnl_link_set_type(struct rtnl_link *link, const char *type) { struct rtnl_link_info_ops *io; int err; @@ -2008,13 +2008,12 @@ int rtnl_link_set_info_type(struct rtnl_link *link, const char *type) } /** - * Return info type of a link - * @arg link link object + * Get type of link + * @arg link Link object * - * @note The returned pointer is only valid as long as the link exists - * @return Info type name or NULL if unknown. + * @return Name of link type or NULL if unknown. */ -char *rtnl_link_get_info_type(struct rtnl_link *link) +char *rtnl_link_get_type(struct rtnl_link *link) { if (link->l_info_ops) return link->l_info_ops->io_name; @@ -2022,6 +2021,16 @@ char *rtnl_link_get_info_type(struct rtnl_link *link) return NULL; } +int rtnl_link_set_info_type(struct rtnl_link *link, const char *type) +{ + return rtnl_link_set_type(link, type); +} + +char *rtnl_link_get_info_type(struct rtnl_link *link) +{ + return rtnl_link_get_type(link); +} + /** @} */ static struct nl_object_ops link_obj_ops = {