~ubuntu-branches/ubuntu/gutsy/wireshark/gutsy-security

« back to all changes in this revision

Viewing changes to epan/column-utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Frederic Peters
  • Date: 2007-04-01 08:58:40 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20070401085840-or3qhrpv8alt1bwg
Tags: 0.99.5-1
* New upstream release.
* debian/patches/09_idl2wrs.dpatch: updated to patch idl2wrs.sh.in.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* column-utils.c
2
2
 * Routines for column utilities.
3
3
 *
4
 
 * $Id: column-utils.c 19539 2006-10-15 06:10:59Z sahlberg $
 
4
 * $Id: column-utils.c 20118 2006-12-11 20:24:51Z sfisher $
5
5
 *
6
6
 * Wireshark - Network traffic analyzer
7
7
 * By Gerald Combs <gerald@wireshark.org>
779
779
  strcpy(cinfo->col_expr_val[col],cinfo->col_buf[col]);
780
780
}
781
781
 
 
782
static void
 
783
col_set_epoch_time(frame_data *fd, column_info *cinfo, int col)
 
784
{
 
785
 
 
786
  COL_CHECK_REF_TIME(fd, cinfo, col);
 
787
 
 
788
  switch(timestamp_get_precision()) {
 
789
          case(TS_PREC_FIXED_SEC):
 
790
          case(TS_PREC_AUTO_SEC):
 
791
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
792
                        fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000000, SECS);
 
793
                  break;
 
794
          case(TS_PREC_FIXED_DSEC):
 
795
          case(TS_PREC_AUTO_DSEC):
 
796
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
797
                        fd->abs_ts.secs, fd->abs_ts.nsecs / 100000000, DSECS);
 
798
                  break;
 
799
          case(TS_PREC_FIXED_CSEC):
 
800
          case(TS_PREC_AUTO_CSEC):
 
801
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
802
                        fd->abs_ts.secs, fd->abs_ts.nsecs / 10000000, CSECS);
 
803
                  break;
 
804
          case(TS_PREC_FIXED_MSEC):
 
805
          case(TS_PREC_AUTO_MSEC):
 
806
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
807
                        fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000, MSECS);
 
808
                  break;
 
809
          case(TS_PREC_FIXED_USEC):
 
810
          case(TS_PREC_AUTO_USEC):
 
811
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
812
                        fd->abs_ts.secs, fd->abs_ts.nsecs / 1000, USECS);
 
813
                  break;
 
814
          case(TS_PREC_FIXED_NSEC):
 
815
          case(TS_PREC_AUTO_NSEC):
 
816
                  display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
 
817
                        fd->abs_ts.secs, fd->abs_ts.nsecs, NSECS);
 
818
                  break;
 
819
          default:
 
820
                  g_assert_not_reached();
 
821
  }
 
822
  cinfo->col_data[col] = cinfo->col_buf[col];
 
823
  strcpy(cinfo->col_expr[col],"frame.time_delta");
 
824
  strcpy(cinfo->col_expr_val[col],cinfo->col_buf[col]);
 
825
}
782
826
/* Set the format of the variable time format.
783
827
   XXX - this is called from "file.c" when the user changes the time
784
828
   format they want for "command-line-specified" time; it's a bit ugly
805
849
    case TS_DELTA:
806
850
      col_set_delta_time(fd, cinfo, col);
807
851
      break;
 
852
    case TS_EPOCH:
 
853
      col_set_epoch_time(fd, cinfo, col);
 
854
      break;
808
855
   case TS_NOT_SET:
809
856
        /* code is missing for this case, but I don't know which [jmayer20051219] */
810
857
        g_assert(FALSE);
1241
1288
 
1242
1289
    case COL_8021Q_VLAN_ID:
1243
1290
        break;
 
1291
    
 
1292
    case COL_DSCP_VALUE:        /* done by packet-ip.c */
 
1293
        break;
 
1294
 
 
1295
    case COL_COS_VALUE:         /* done by packet-vlan.c */
 
1296
        break;
 
1297
 
 
1298
    case COL_FR_DLCI:   /* done by packet-fr.c */
 
1299
    case COL_BSSGP_TLLI: /* done by packet-bssgp.c */
 
1300
        break;
1244
1301
 
1245
1302
    case NUM_COL_FMTS:  /* keep compiler happy - shouldn't get here */
1246
1303
      g_assert_not_reached();