mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2025-01-23 20:54:14 +01:00
monitor: Print netlink core control messages
Decode core control messages (NLMSG_ERROR and NLMSG_DONE).
This commit is contained in:
parent
4d7ff64f38
commit
fa40340d68
@ -1997,6 +1997,8 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv,
|
|||||||
char extra_str[32];
|
char extra_str[32];
|
||||||
const char *str;
|
const char *str;
|
||||||
bool out;
|
bool out;
|
||||||
|
int status;
|
||||||
|
struct nlmsgerr *err;
|
||||||
|
|
||||||
str = nlmsg_type_to_str(nlmsg->nlmsg_type);
|
str = nlmsg_type_to_str(nlmsg->nlmsg_type);
|
||||||
out = !!(nlmsg->nlmsg_flags & NLM_F_REQUEST);
|
out = !!(nlmsg->nlmsg_flags & NLM_F_REQUEST);
|
||||||
@ -2020,6 +2022,26 @@ void nlmon_print_rtnl(struct nlmon *nlmon, const struct timeval *tv,
|
|||||||
NLMSG_ALIGN(sizeof(*ifi)),
|
NLMSG_ALIGN(sizeof(*ifi)),
|
||||||
NLMSG_PAYLOAD(nlmsg, sizeof(*ifi)));
|
NLMSG_PAYLOAD(nlmsg, sizeof(*ifi)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case NLMSG_NOOP:
|
||||||
|
case NLMSG_OVERRUN:
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NLMSG_ERROR:
|
||||||
|
err = NLMSG_DATA(nlmsg);
|
||||||
|
status = -err->error;
|
||||||
|
if (status < 0)
|
||||||
|
print_field("Error: %d (%s)", status,
|
||||||
|
strerror(status));
|
||||||
|
else
|
||||||
|
print_field("ACK: %d", status);
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NLMSG_DONE:
|
||||||
|
status = *((int *) NLMSG_DATA(nlmsg));
|
||||||
|
print_field("Status: %d", status);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user