- case 'S': /* show packets in real time */
- print_packet_info = TRUE;
- break;
- case 't': /* Time stamp type */
- if (strcmp(optarg, "r") == 0)
- timestamp_set_type(TS_RELATIVE);
- else if (strcmp(optarg, "a") == 0)
- timestamp_set_type(TS_ABSOLUTE);
- else if (strcmp(optarg, "ad") == 0)
- timestamp_set_type(TS_ABSOLUTE_WITH_DATE);
- else if (strcmp(optarg, "d") == 0)
- timestamp_set_type(TS_DELTA);
- else if (strcmp(optarg, "dd") == 0)
- timestamp_set_type(TS_DELTA_DIS);
- else if (strcmp(optarg, "e") == 0)
- timestamp_set_type(TS_EPOCH);
- else {
- cmdarg_err("Invalid time stamp type \"%s\"",
- optarg);
- cmdarg_err_cont("It must be \"r\" for relative, \"a\" for absolute,");
- cmdarg_err_cont("\"ad\" for absolute with date, or \"d\" for delta.");
- return 1;
- }
- break;
- case 'T': /* printing Type */
- if (strcmp(optarg, "text") == 0) {
- output_action = WRITE_TEXT;
- print_format = PR_FMT_TEXT;
- } else if (strcmp(optarg, "ps") == 0) {
- output_action = WRITE_TEXT;
- print_format = PR_FMT_PS;
- } else if (strcmp(optarg, "pdml") == 0) {
- output_action = WRITE_XML;
- verbose = TRUE;
- } else if (strcmp(optarg, "psml") == 0) {
- output_action = WRITE_XML;
- verbose = FALSE;
- } else if(strcmp(optarg, "fields") == 0) {
- output_action = WRITE_FIELDS;
- verbose = TRUE; /* Need full tree info */
- } else {
- cmdarg_err("Invalid -T parameter.");
- cmdarg_err_cont("It must be \"ps\", \"text\", \"pdml\", \"psml\" or \"fields\".");
- return 1;
- }
- break;
- case 'u': /* Seconds type */
- if (strcmp(optarg, "s") == 0)
- timestamp_set_seconds_type(TS_SECONDS_DEFAULT);
- else if (strcmp(optarg, "hms") == 0)
- timestamp_set_seconds_type(TS_SECONDS_HOUR_MIN_SEC);
- else {
- cmdarg_err("Invalid seconds type \"%s\"", optarg);
- cmdarg_err_cont("It must be \"s\" for seconds or \"hms\" for hours, minutes and seconds.");
- return 1;
- }