Use 'link type' instead of 'link info type'
The term 'link type' is much more easier to understand than 'link info type' rtnl_link_set/get_info_type() left around for backwards compatibility
This commit is contained in:
parent
49d29e9c2d
commit
16d38a49d1
2 changed files with 26 additions and 14 deletions
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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 = {
|
||||
|
|
Loading…
Add table
Reference in a new issue