diff options
author | Johan Hedberg <johan.hedberg@intel.com> | 2015-06-02 22:38:11 +0700 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2015-06-02 22:44:24 +0700 |
commit | 1ef26f22f8ab6f08053ae8f3f6c35c33bbdfc121 (patch) | |
tree | b8a6b95ea3af8fef2bd1950c421c2ed00c2a979e /monitor/control.c | |
parent | 4df7d9dd3788a6c70f0442ab362c1a556e3d874f (diff) | |
download | bluez-1ef26f22f8ab6f08053ae8f3f6c35c33bbdfc121.tar.gz |
monitor: Add full key type decoding for New Link Key events
Diffstat (limited to 'monitor/control.c')
-rw-r--r-- | monitor/control.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/monitor/control.c b/monitor/control.c index e61a79d64..10e8b7f76 100644 --- a/monitor/control.c +++ b/monitor/control.c @@ -261,16 +261,34 @@ static void mgmt_local_name_changed(uint16_t len, const void *buf) static void mgmt_new_link_key(uint16_t len, const void *buf) { const struct mgmt_ev_new_link_key *ev = buf; + const char *type; char str[18]; + static const char *types[] = { + "Combination key", + "Local Unit key", + "Remote Unit key", + "Debug Combination key", + "Unauthenticated Combination key from P-192", + "Authenticated Combination key from P-192", + "Changed Combination key", + "Unauthenticated Combination key from P-256", + "Authenticated Combination key from P-256", + }; if (len < sizeof(*ev)) { printf("* Malformed New Link Key control\n"); return; } + if (ev->key.type < NELEM(types)) + type = types[ev->key.type]; + else + type = "Reserved"; + ba2str(&ev->key.addr.bdaddr, str); - printf("@ New Link Key: %s (%d)\n", str, ev->key.addr.type); + printf("@ New Link Key: %s (%d) %s (%u)\n", str, + ev->key.addr.type, type, ev->key.type); buf += sizeof(*ev); len -= sizeof(*ev); |