Introduce nla_strdup() to help parse strings attributes

This commit is contained in:
Thomas Graf 2008-06-13 16:40:41 +02:00
parent 5ab9421111
commit d49018fd78
2 changed files with 6 additions and 0 deletions

View file

@ -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 */

View file

@ -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));
}
/** @} */
/**