static int parse_msrp(char *sz, size_t len, struct mrpdhelper_notify *n) { if (parse_notification(&sz[1], n) < 0) return -1; if (parse_msrp_string(&sz[4], len - 4, n) < 0) return -1; return parse_registrar(sz, n, NULL); }
static int parse_msrp_query(char *sz, size_t len, struct mrpdhelper_notify *n) { char *r; if (parse_msrp_string(sz, len, n) < 0) return -1; if (parse_registrar(sz, n, &r) < 0) return -1; if (parse_app_state(&r[15], n) < 0) return -1; return parse_state(&r[18], n); }
static int parse_mmrp(char *sz, size_t len, struct mrpdhelper_notify *n) { if (len < 9) /* protect against sscanf(&sz[8],...) runaway */ return -1; if (parse_notification(&sz[1], n) < 0) return -1; if (parse_state(&sz[5], n) < 0) return -1; n->attrib = mrpdhelper_attribtype_mvrp; if (sscanf(&sz[8], "M=%" SCNx64, &n->u.m.mac) != 1) return -1; return parse_registrar(sz, n, NULL); }
static int parse_mmrp(char *sz, size_t len, struct mrpdhelper_notify *n) { /* format MIN MJO M=112233445566 R=112233445566 len = 38 */ if (len < 38) return -1; if (parse_notification(&sz[1], n) < 0) return -1; if (parse_state(&sz[5], n) < 0) return -1; n->attrib = mrpdhelper_attribtype_mvrp; if (sscanf(&sz[8], "M=%" SCNx64, &n->u.m.mac) != 1) return -1; return parse_registrar(sz, n, NULL); }
static int parse_mvrp(char *sz, size_t len, struct mrpdhelper_notify *n) { /* format VIN VJO 1234 R=112233445566 len = 28 */ if (len < 28) return -1; if (parse_notification(&sz[1], n) < 0) return -1; if (parse_state(&sz[5], n) < 0) return -1; n->attrib = mrpdhelper_attribtype_mvrp; if (sscanf(&sz[8], "%04x ", &n->u.v.vid) != 1) return -1; return parse_registrar(sz, n, NULL); }