Exemplo n.º 1
0
int cmd_rtp_ssrc (struct cli_def *cli, char *command, char *argv[], int argc)
{
	struct mops_ext_rtp * pd = clipkt->p_desc;
	unsigned long long int ssrc = 0xcafefeed;

	if ( (strcmp(argv[argc-1],"?")==0) || (argc!=1)) {
		cli_print(cli, "Configure the RTP SSRC (source identifier) (0..ffffffff, default: random!).\n");
		cli_print(cli, "NOTE: The SSRC value is used by another Mausezahn receiver to identify a original\r");
		cli_print(cli, "Mausezahn RTP stream. By default, Mausezahn receivers check for the magic number\r");
		cli_print(cli, "'cafebabe' (hex). Use another number for another RTP stream (e. g. bidirectional\r");
		cli_print(cli, "measurements).\n");
		return CLI_OK;
	}
	
	if (mz_strishex(argv[0])==0) {
		cli_print(cli, "Invalid number.\n");
		return CLI_OK;
	}
	
	ssrc =  xstr2lint(argv[0]);
	if (ssrc>0xffffffff) {
		cli_print(cli, "Range exceeded (0..ffffffff).\n");
		return CLI_OK;
	}
	pd->ssrc = (u_int32_t) ssrc;
	return CLI_OK;
}
Exemplo n.º 2
0
int cmd_rtp_cclist (struct cli_def *cli, char *command, char *argv[], int argc)
{
	struct mops_ext_rtp * pd = clipkt->p_desc;
	unsigned long long int csrc=0;
	char str[80];
	int i=0, n=0;

	
	if ((strcmp(argv[argc-1],"?")==0) || (argc==0)) {
		cli_print(cli, "Specify a CSRC list consisting of 1-15 CSRC values.\r");
		cli_print(cli, "Each CSRC is a 4-byte value and must be specified in hexadecimal notation,\r");
		cli_print(cli, "hence each value must be within 0..ffffffff.\n");
		return CLI_OK;
	}
	
	if ((n=argc)>15) {
		cli_print(cli, "The CSRC list must not exceed 15 items!\n");
		return CLI_OK;
	}
	
	for (i=0; i<n; i++) {
		if (mz_strishex(argv[i])==0) {
			sprintf(str, "Parameter %i: Invalid number!", i);
			cli_print(cli, "%s\n", str);
			return CLI_OK;
		}
		csrc =  xstr2lint(argv[i]);
		if (csrc>0xffffffff) {
			sprintf(str, "Parameter %i: Range exceeded (0..ffffffff)", i);
			cli_print(cli, "%s\n", str);
			return CLI_OK;
		}
		pd->csrc[i] = (u_int32_t) csrc;
	}
	pd->cc = n; // this one can be accessed and modified to "wrong" values by the user
	pd->cc_real = n;
	
	return CLI_OK;
}
Exemplo n.º 3
0
int cmd_rtp_time (struct cli_def *cli, char *command, char *argv[], int argc)
{
	struct mops_ext_rtp * pd = clipkt->p_desc;
	unsigned long long int t = 0;

	if ( (strcmp(argv[argc-1],"?")==0) || (argc!=1)) {
		cli_print(cli, "Configure the RTP initial timestamp (0..ffffffff, default: 0).\n");
		return CLI_OK;
	}
	
	if (mz_strishex(argv[0])==0) {
		cli_print(cli, "Invalid number.\n");
		return CLI_OK;
	}
	t =  xstr2lint(argv[0]);
	if (t>0xffffffff) {
		cli_print(cli, "Range exceeded (0..ffffffff).\n");
		return CLI_OK;
	}
	pd->tst = (u_int32_t) t;
	return CLI_OK;
}
Exemplo n.º 4
0
int cmd_rtp_sqnr (struct cli_def *cli, const char *command, char *argv[], int argc)
{
    struct mops_ext_rtp * pd = clipkt->p_desc;
    unsigned long long int sqnr = 0;

    if ( (strcmp(argv[argc-1],"?")==0) || (argc!=1)) {
        cli_print(cli, "Configure the RTP initial sequence number (0..ffffffff, default: 0).\n");
        return CLI_OK;
    }

    if (mz_strishex(argv[0])==0) {
        cli_print(cli, "Invalid number.\n");
        return CLI_OK;
    }
    sqnr =  xstr2lint(argv[0]);
    if (sqnr>0xffffffff) {
        cli_print(cli, "Range exceeded (0..ffffffff).\n");
        return CLI_OK;
    }
    pd->sqnr = (u_int32_t) sqnr;
    return CLI_OK;
}