예제 #1
0
파일: switch.c 프로젝트: Milstein/trema
static void
option_parser( int argc, char *argv[] ) {
  int c;

  switch_info.secure_channel_fd = 0; // stdin
  switch_info.flow_cleanup = true;
  switch_info.cookie_translation = true;
  switch_info.deny_packet_in_on_startup = false;
  while ( ( c = getopt_long( argc, argv, switch_short_options, switch_long_options, NULL ) ) != -1 ) {
    switch ( c ) {
      case 's':
        switch_info.secure_channel_fd = strtofd( optarg );
        break;

      case NO_FLOW_CLEANUP_LONG_OPTION_VALUE:
        switch_info.flow_cleanup = false;
        break;

      case NO_COOKIE_TRANSLATION_LONG_OPTION_VALUE:
        switch_info.cookie_translation = false;
        break;

      case NO_PACKET_IN_LONG_OPTION_VALUE:
        switch_info.deny_packet_in_on_startup = true;
        break;

      default:
        usage();
        exit( EXIT_SUCCESS );
        return;
    }
  }
}
예제 #2
0
파일: switch.c 프로젝트: s-zenke/trema
static void
option_parser( int argc, char *argv[] ) {
  int c;

  switch_info.secure_channel_fd = 0; // stdin
  while ( ( c = getopt_long( argc, argv, short_options, long_options, NULL ) ) != -1 ) {
    switch ( c ) {
      case 's':
        switch_info.secure_channel_fd = strtofd( optarg );
        break;

      default:
        usage();
        exit( EXIT_SUCCESS );
        return;
    }
  }
}
예제 #3
0
파일: switch.c 프로젝트: miyakz1192/trema
static void
option_parser( int argc, char *argv[] ) {
  int c;

  switch_info.secure_channel_fd = 0; // stdin
  switch_info.flow_cleanup = true;
  while ( ( c = getopt_long( argc, argv, short_options, long_options, NULL ) ) != -1 ) {
    switch ( c ) {
      case 's':
        switch_info.secure_channel_fd = strtofd( optarg );
        break;

      case NO_FLOW_CLEANUP_LONG_OPTION_VALUE:
        switch_info.flow_cleanup = false;
        break;

      default:
        usage();
        exit( EXIT_SUCCESS );
        return;
    }
  }
}