Introduce nla_strdup() to help parse strings attributes
This commit is contained in:
parent
5ab9421111
commit
d49018fd78
2 changed files with 6 additions and 0 deletions
|
@ -109,6 +109,7 @@ extern int nla_put_u64(struct nl_msg *, int, uint64_t);
|
|||
|
||||
/* String attribute */
|
||||
extern char * nla_get_string(struct nlattr *);
|
||||
extern char * nla_strdup(struct nlattr *);
|
||||
extern int nla_put_string(struct nl_msg *, int, const char *);
|
||||
|
||||
/* Flag attribute */
|
||||
|
|
|
@ -1023,6 +1023,11 @@ char *nla_get_string(struct nlattr *nla)
|
|||
return (char *) nla_data(nla);
|
||||
}
|
||||
|
||||
char *nla_strdup(struct nlattr *nla)
|
||||
{
|
||||
return strdup(nla_get_string(nla));
|
||||
}
|
||||
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue