+static void parse_failure(char *p, int cnt)
+{
+ DBG("Parse 4: <%s> cnt=%d", p, cnt);
+
+ // Decode attributes
+ bool done = 0;
+ char *rhost = NULL;
+ while (!done)
+ {
+ while (*p == ' ')
+ p++;
+ if (!*p)
+ break;
+
+ char *key = p;
+ while (*p && *p != ' ' && *p != '=')
+ p++;
+ if (*p != '=')
+ continue;
+ *p++ = 0;
+
+ char *val = p;
+ while (*p && *p != ' ')
+ p++;
+ if (*p)
+ *p++ = 0;
+ else
+ done = 1;
+
+ DBG("Parse KV: %s=<%s>", key, val);
+ if (!strcmp(key, "rhost"))
+ rhost = val;
+ }
+
+ // Act on the message
+ struct addr addr;
+ if (addr_parse(&addr, rhost))
+ handle_failed_login(addr, cnt);
+ else
+ msg(L_WARN, "Unable to parse address %s", rhost);
+}
+