Revision 5e9e29e0 cmdline.c

View differences:

cmdline.c
44 44
  "  -F, --configs-folder=path     Configuration files folder (default=./conf)",
45 45
  "  -c, --cert-pem=filename       HTTPS/DTLS certificate",
46 46
  "  -k, --cert-key=filename       HTTPS/DTLS certificate key",
47
  "  -S, --stun-server=filename    STUN server(:port) to use, if needed (e.g., \n                                  gateway behind NAT, default=none)",
47
  "  -S, --stun-server=ip:port     STUN server(:port) to use, if needed (e.g., \n                                  gateway behind NAT, default=none)",
48
  "  -e, --public-ip=ipaddress     Public address of the machine, to use in SDP",
49
  "  -r, --rtp-port-range=min-max  Port range to use for RTP/RTCP",
48 50
    0
49 51
};
50 52

  
......
83 85
  args_info->cert_pem_given = 0 ;
84 86
  args_info->cert_key_given = 0 ;
85 87
  args_info->stun_server_given = 0 ;
88
  args_info->public_ip_given = 0 ;
89
  args_info->rtp_port_range_given = 0 ;
86 90
}
87 91

  
88 92
static
......
108 112
  args_info->cert_key_orig = NULL;
109 113
  args_info->stun_server_arg = NULL;
110 114
  args_info->stun_server_orig = NULL;
115
  args_info->public_ip_arg = NULL;
116
  args_info->public_ip_orig = NULL;
117
  args_info->rtp_port_range_arg = NULL;
118
  args_info->rtp_port_range_orig = NULL;
111 119
  
112 120
}
113 121

  
......
129 137
  args_info->cert_pem_help = gengetopt_args_info_help[10] ;
130 138
  args_info->cert_key_help = gengetopt_args_info_help[11] ;
131 139
  args_info->stun_server_help = gengetopt_args_info_help[12] ;
140
  args_info->public_ip_help = gengetopt_args_info_help[13] ;
141
  args_info->rtp_port_range_help = gengetopt_args_info_help[14] ;
132 142
  
133 143
}
134 144

  
......
227 237
  free_string_field (&(args_info->cert_key_orig));
228 238
  free_string_field (&(args_info->stun_server_arg));
229 239
  free_string_field (&(args_info->stun_server_orig));
240
  free_string_field (&(args_info->public_ip_arg));
241
  free_string_field (&(args_info->public_ip_orig));
242
  free_string_field (&(args_info->rtp_port_range_arg));
243
  free_string_field (&(args_info->rtp_port_range_orig));
230 244
  
231 245
  
232 246

  
......
283 297
    write_into_file(outfile, "cert-key", args_info->cert_key_orig, 0);
284 298
  if (args_info->stun_server_given)
285 299
    write_into_file(outfile, "stun-server", args_info->stun_server_orig, 0);
300
  if (args_info->public_ip_given)
301
    write_into_file(outfile, "public-ip", args_info->public_ip_orig, 0);
302
  if (args_info->rtp_port_range_given)
303
    write_into_file(outfile, "rtp-port-range", args_info->rtp_port_range_orig, 0);
286 304
  
287 305

  
288 306
  i = EXIT_SUCCESS;
......
550 568
        { "cert-pem",	1, NULL, 'c' },
551 569
        { "cert-key",	1, NULL, 'k' },
552 570
        { "stun-server",	1, NULL, 'S' },
571
        { "public-ip",	1, NULL, 'e' },
572
        { "rtp-port-range",	1, NULL, 'r' },
553 573
        { 0,  0, 0, 0 }
554 574
      };
555 575

  
556
      c = getopt_long (argc, argv, "hVi:p:s:nb:P:C:F:c:k:S:", long_options, &option_index);
576
      c = getopt_long (argc, argv, "hVi:p:s:nb:P:C:F:c:k:S:e:r:", long_options, &option_index);
557 577

  
558 578
      if (c == -1) break;	/* Exit from `while (1)' loop.  */
559 579

  
......
699 719
            goto failure;
700 720
        
701 721
          break;
722
        case 'e':	/* Public address of the machine, to use in SDP.  */
723
        
724
        
725
          if (update_arg( (void *)&(args_info->public_ip_arg), 
726
               &(args_info->public_ip_orig), &(args_info->public_ip_given),
727
              &(local_args_info.public_ip_given), optarg, 0, 0, ARG_STRING,
728
              check_ambiguity, override, 0, 0,
729
              "public-ip", 'e',
730
              additional_error))
731
            goto failure;
732
        
733
          break;
734
        case 'r':	/* Port range to use for RTP/RTCP.  */
735
        
736
        
737
          if (update_arg( (void *)&(args_info->rtp_port_range_arg), 
738
               &(args_info->rtp_port_range_orig), &(args_info->rtp_port_range_given),
739
              &(local_args_info.rtp_port_range_given), optarg, 0, 0, ARG_STRING,
740
              check_ambiguity, override, 0, 0,
741
              "rtp-port-range", 'r',
742
              additional_error))
743
            goto failure;
744
        
745
          break;
702 746

  
703 747
        case 0:	/* Long option with no short option */
704 748
        case '?':	/* Invalid option.  */

Also available in: Unified diff