/* S+? - (re)JOIN a stream */
/* S++ - NEW a stream */
-int msrp_test_cmd_parse_join_or_new_stream(
+int msrp_cmd_parse_join_or_new_stream(
char *buf, int buflen,
struct msrpdu_talker_fail *talker_ad,
int *err_index
return 0;
}
-/* * S-- - LV a stream */
+/* S-- - LV a stream */
int msrp_cmd_parse_leave_stream(
char *buf, int buflen,
struct msrpdu_talker_fail *talker_ad,
}
int msrp_cmd_withdraw_listener_status(
- struct msrpdu_talker_fail *talker_ad,
- uint32_t substate
+ struct msrpdu_talker_fail *talker_ad
)
{
struct msrp_attribute *attrib;
uint8_t macvec_parsestr[64];
unsigned vlan, size, interval, prio, latency;
int i;
+ unsigned int substate;
+ struct msrpdu_domain t0;
struct msrpdu_talker_fail t1;
int err_index;
sizeof(respbuf));
goto out;
}
+ rc = msrp_cmd_parse_withdraw_listener_status(buf, buflen, &t1, &err_index);
+ if (rc)
+ printf("error msrp_cmd_parse_withdraw_listener_status\n");
/* buf[] should look similar to 'S-L:xxyyzz...' */
attrib = msrp_alloc();
if (NULL == attrib) {
memcpy(attrib->attribute.talk_listen.StreamID,
streamid_firstval, 8);
memset(attrib->registrar.macaddr, 0, 6);
+ if(0 == memcmp(&t1, &attrib->attribute.talk_listen, sizeof(t1)))
+ printf("S-L, old and new parse match\n");
+ else
+ printf("S-L, old and new parse DO NOT match\n");
msrp_event(MRP_EVENT_LV, attrib);
break;
mrpd_send_ctl_msg(client, respbuf, sizeof(respbuf));
goto out;
}
+ rc = msrp_cmd_parse_domain_status(buf, buflen, &t0, &err_index);
+ if (rc)
+ printf("error msrp_test_cmd_parse_domain_status\n");
+
/* buf[] should look similar to 'S-D:C:%d:P:%d:V:%04x" */
attrib = msrp_alloc();
if (NULL == attrib) {
memset(attrib->registrar.macaddr, 0, 6);
+ if(0 == memcmp(&t0, &attrib->attribute.domain, sizeof(t0)))
+ printf("S-D, old and new parse match\n");
+ else
+ printf("S-D, old and new parse DO NOT match\n");
+
msrp_event(MRP_EVENT_LV, attrib);
break;
case '-':
sizeof(respbuf));
goto out;
}
+ rc = msrp_cmd_parse_leave_stream(buf, buflen, &t1, &err_index);
+ if (rc)
+ printf("error msrp_cmd_parse_leave_stream\n");
+
/* buf[] should look similar to 'S--S:xxyyzz...' */
attrib = msrp_alloc();
if (NULL == attrib) {
streamid_firstval, 8);
memset(attrib->registrar.macaddr, 0, 6);
+ if(0 == memcmp(&t1, &attrib->attribute.talk_listen, sizeof(t1)))
+ printf("S--, old and new parse match\n");
+ else
+ printf("S--, old and new parse DO NOT match\n");
+
msrp_event(MRP_EVENT_LV, attrib);
break;
default:
sizeof(respbuf));
goto out;
}
+ rc = msrp_cmd_parse_report_listener_status(buf, buflen, &t1, &substate, &err_index);
+ if (rc)
+ printf("error msrp_cmd_parse_report_listener_status\n");
+
/* buf[] should look similar to 'S+L:xxyyzz...:D:a' */
attrib = msrp_alloc();
if (NULL == attrib) {
}
memset(attrib->registrar.macaddr, 0, 6);
+ if((0 == memcmp(&t1, &attrib->attribute.talk_listen, sizeof(t1))) &&
+ (attrib->substate == substate))
+ printf("S+L, old and new parse match\n");
+ else
+ printf("S+L, old and new parse DO NOT match\n");
msrp_event(MRP_EVENT_JOIN, attrib);
break;
sizeof(respbuf));
goto out;
}
+ rc = msrp_cmd_parse_domain_status(buf, buflen, &t0, &err_index);
+ if (rc)
+ printf("error msrp_cmd_parse_domain_status\n");
+
/* buf[] should look similar to 'S+D:C:%d:P:%d:V:%04x" */
attrib = msrp_alloc();
if (NULL == attrib) {
}
memset(attrib->registrar.macaddr, 0, 6);
+ if(0 == memcmp(&t0, &attrib->attribute.domain, sizeof(t0)))
+ printf("S+D, old and new parse match\n");
+ else
+ printf("S+D, old and new parse DO NOT match\n");
msrp_event(MRP_EVENT_JOIN, attrib);
break;
":P:%d" \
":L:%d" \
*/
- rc = msrp_test_cmd_parse_join_or_new_stream(buf, buflen, &t1, &err_index);
+ rc = msrp_cmd_parse_join_or_new_stream(buf, buflen, &t1, &err_index);
if (rc)
- printf("error 2\n");
+ printf("error msrp_cmd_parse_join_or_new_stream\n");
i = 0;
latency;
if(0 == memcmp(&t1, &attrib->attribute.talk_listen, sizeof(t1)))
- printf("old and new parse match\n");
+ printf("S+? or S++, old and new parse match\n");
else
- printf("old and new parse DO NOT match\n");
+ printf("S+? or S++, old and new parse DO NOT match\n");
if (join)
msrp_event(MRP_EVENT_JOIN, attrib);