actube/src/nlt/nlt_parse.c
7u83@mail.ru d018af6c22 Testing ...
FossilOrigin-Name: 999caf53552b7c715dae435715917e98c4b88f19e9afdc5e1cda30c88e97e3d6
2016-03-24 01:18:00 +00:00

21 lines
405 B
C

#include <netlink/genl/genl.h>
#include "nlt.h"
int nlt_parse(struct nl_msg *msg, struct nlt_msg *r)
{
struct nlmsghdr *msghdr = nlmsg_hdr(msg);
struct genlmsghdr *ghdr = (struct genlmsghdr *) nlmsg_data(msghdr);
int rc;
rc = nla_parse(r->attribs, NL80211_ATTR_MAX, genlmsg_attrdata(ghdr, 0),
genlmsg_attrlen(ghdr, 0), NULL);
if (rc < 0)
return rc;
r->cmd = ghdr->cmd;
return 0;
}