2 * Routines for column utilities.
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
32 #include "column-utils.h"
33 #include "timestamp.h"
34 #include "sna-utils.h"
35 #include "atalk-utils.h"
37 #include "packet_info.h"
39 #include "addr_resolv.h"
40 #include "ipv6-utils.h"
41 #include "osi-utils.h"
42 #include "value_string.h"
43 #include "column_info.h"
45 #include <epan/strutil.h>
46 #include <epan/epan.h>
48 static column_info *ci;
50 /* Allocate all the data structures for constructing column data, given
51 the number of columns. */
53 col_setup(column_info *cinfo, gint num_cols)
57 cinfo->num_cols = num_cols;
58 cinfo->col_fmt = g_new(gint, num_cols);
59 cinfo->fmt_matx = g_new(gboolean*, num_cols);
60 cinfo->col_first = g_new(int, NUM_COL_FMTS);
61 cinfo->col_last = g_new(int, NUM_COL_FMTS);
62 cinfo->col_title = g_new(gchar*, num_cols);
63 cinfo->col_custom_field = g_new(gchar*, num_cols);
64 cinfo->col_custom_dfilter = g_new(dfilter_t*, num_cols);
65 cinfo->col_data = (const gchar **)g_new(gchar*, num_cols);
66 cinfo->col_buf = g_new(gchar*, num_cols);
67 cinfo->col_fence = g_new(int, num_cols);
68 cinfo->col_expr.col_expr = g_new(gchar*, num_cols + 1);
69 cinfo->col_expr.col_expr_val = g_new(gchar*, num_cols + 1);
71 for (i = 0; i < NUM_COL_FMTS; i++) {
72 cinfo->col_first[i] = -1;
73 cinfo->col_last[i] = -1;
77 /* Initialize the data structures for constructing column data. */
79 col_init(column_info *cinfo)
83 for (i = 0; i < cinfo->num_cols; i++) {
84 cinfo->col_buf[i][0] = '\0';
85 cinfo->col_data[i] = cinfo->col_buf[i];
86 cinfo->col_fence[i] = 0;
87 cinfo->col_expr.col_expr[i][0] = '\0';
88 cinfo->col_expr.col_expr_val[i][0] = '\0';
90 cinfo->writable = TRUE;
94 col_get_writable(column_info *cinfo)
96 return (cinfo ? cinfo->writable : FALSE);
100 col_set_writable(column_info *cinfo, gboolean writable)
103 cinfo->writable = writable;
106 /* Checks to see if a particular packet information element is needed for
109 check_col(column_info *cinfo, gint el) {
111 if (col_get_writable(cinfo)) {
112 /* We are constructing columns, and they're writable */
113 if (cinfo->col_first[el] >= 0) {
114 /* There is at least one column in that format */
121 /* Sets the fence for a column to be at the end of the column. */
123 col_set_fence(column_info *cinfo, gint el)
127 if (!check_col(cinfo, el))
130 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
131 if (cinfo->fmt_matx[i][el]) {
132 cinfo->col_fence[i] = (int)strlen(cinfo->col_data[i]);
137 /* Use this to clear out a column, especially if you're going to be
138 appending to it later; at least on some platforms, it's more
139 efficient than using "col_add_str()" with a null string, and
140 more efficient than "col_set_str()" with a null string if you
141 later append to it, as the later append will cause a string
144 col_clear(column_info *cinfo, gint el)
149 if (!check_col(cinfo, el))
152 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
153 if (cinfo->fmt_matx[i][el]) {
155 * At this point, either
157 * 1) col_data[i] is equal to col_buf[i], in which case we
158 * don't have to worry about copying col_data[i] to
161 * 2) col_data[i] isn't equal to col_buf[i], in which case
162 * the only thing that's been done to the column is
163 * "col_set_str()" calls and possibly "col_set_fence()"
164 * calls, in which case the fence is either unset and
165 * at the beginning of the string or set and at the end
166 * of the string - if it's at the beginning, we're just
167 * going to clear the column, and if it's at the end,
168 * we don't do anything.
170 fence = cinfo->col_fence[i];
171 if (fence == 0 || cinfo->col_buf[i] == cinfo->col_data[i]) {
173 * The fence isn't at the end of the column, or the column wasn't
174 * last set with "col_set_str()", so clear the column out.
176 cinfo->col_buf[i][fence] = '\0';
177 cinfo->col_data[i] = cinfo->col_buf[i];
179 cinfo->col_expr.col_expr[i][0] = '\0';
180 cinfo->col_expr.col_expr_val[i][0] = '\0';
185 #define COL_CHECK_APPEND(cinfo, i, max_len) \
186 if (cinfo->col_data[i] != cinfo->col_buf[i]) { \
187 /* This was set with "col_set_str()"; copy the string they \
188 set it to into the buffer, so we can append to it. */ \
189 g_strlcpy(cinfo->col_buf[i], cinfo->col_data[i], max_len); \
190 cinfo->col_data[i] = cinfo->col_buf[i]; \
193 #define COL_CHECK_REF_TIME(fd, cinfo, col) \
194 if(fd->flags.ref_time){ \
195 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN, "*REF*"); \
196 cinfo->col_data[col] = cinfo->col_buf[col]; \
200 /* Use this if "str" points to something that will stay around (and thus
201 needn't be copied). */
203 col_set_str(column_info *cinfo, gint el, const gchar* str)
209 if (!check_col(cinfo, el))
213 max_len = COL_MAX_INFO_LEN;
215 max_len = COL_MAX_LEN;
217 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
218 if (cinfo->fmt_matx[i][el]) {
219 fence = cinfo->col_fence[i];
222 * We will append the string after the fence.
223 * First arrange that we can append, if necessary.
225 COL_CHECK_APPEND(cinfo, i, max_len);
227 g_strlcpy(&cinfo->col_buf[i][fence], str, max_len - fence);
230 * There's no fence, so we can just set the column to point
233 cinfo->col_data[i] = str;
239 /* Adds a vararg list to a packet info string. */
241 col_add_fstr(column_info *cinfo, gint el, const gchar *format, ...) {
247 if (!check_col(cinfo, el))
251 max_len = COL_MAX_INFO_LEN;
253 max_len = COL_MAX_LEN;
255 va_start(ap, format);
256 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
257 if (cinfo->fmt_matx[i][el]) {
258 fence = cinfo->col_fence[i];
261 * We will append the string after the fence.
262 * First arrange that we can append, if necessary.
264 COL_CHECK_APPEND(cinfo, i, max_len);
267 * There's no fence, so we can just write to the string.
269 cinfo->col_data[i] = cinfo->col_buf[i];
271 g_vsnprintf(&cinfo->col_buf[i][fence], max_len - fence, format, ap);
272 cinfo->col_buf[i][max_len - 1] = '\0';
279 col_custom_set_fstr(header_field_info *hfinfo, const gchar *format, ...)
284 if (!have_custom_cols(ci))
287 va_start(ap, format);
288 for (i = ci->col_first[COL_CUSTOM];
289 i <= ci->col_last[COL_CUSTOM]; i++) {
290 if (ci->fmt_matx[i][COL_CUSTOM] &&
291 ci->col_custom_field[i] &&
292 strcmp(ci->col_custom_field[i], hfinfo->abbrev) == 0) {
293 ci->col_data[i] = ci->col_buf[i];
294 g_vsnprintf(ci->col_buf[i], COL_MAX_LEN, format, ap);
296 g_strlcpy(ci->col_expr.col_expr[i], hfinfo->abbrev, COL_MAX_LEN);
298 switch(hfinfo->type) {
301 g_snprintf(ci->col_expr.col_expr_val[i], COL_MAX_LEN, "\"%s\"",
306 g_strlcpy(ci->col_expr.col_expr_val[i], ci->col_buf[i], COL_MAX_LEN);
315 col_custom_prime_edt(epan_dissect_t *edt, column_info *cinfo)
319 ci = cinfo; /* Save this into the static variable ci for use by
320 * col_custom_set_fstr() later. */
322 if(!have_custom_cols(cinfo))
325 for (i = cinfo->col_first[COL_CUSTOM];
326 i <= cinfo->col_last[COL_CUSTOM]; i++) {
327 if (cinfo->fmt_matx[i][COL_CUSTOM] &&
328 cinfo->col_custom_dfilter[i])
329 epan_dissect_prime_dfilter(edt, cinfo->col_custom_dfilter[i]);
334 have_custom_cols(column_info *cinfo)
336 /* The same as check_col(), but without the check to see if the column
338 if (cinfo && cinfo->col_first[COL_CUSTOM] >= 0)
345 col_has_time_fmt(column_info *cinfo, gint col)
347 return ((cinfo->fmt_matx[col][COL_CLS_TIME]) ||
348 (cinfo->fmt_matx[col][COL_ABS_TIME]) ||
349 (cinfo->fmt_matx[col][COL_ABS_DATE_TIME]) ||
350 (cinfo->fmt_matx[col][COL_REL_TIME]) ||
351 (cinfo->fmt_matx[col][COL_DELTA_TIME]) ||
352 (cinfo->fmt_matx[col][COL_DELTA_TIME_DIS]));
356 col_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
357 const gchar *format, va_list ap)
360 int len, max_len, sep_len;
363 max_len = COL_MAX_INFO_LEN;
365 max_len = COL_MAX_LEN;
367 if (separator == NULL)
370 sep_len = (int) strlen(separator);
371 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
372 if (cinfo->fmt_matx[i][el]) {
374 * First arrange that we can append, if necessary.
376 COL_CHECK_APPEND(cinfo, i, max_len);
378 len = (int) strlen(cinfo->col_buf[i]);
381 * If we have a separator, append it if the column isn't empty.
383 if (separator != NULL) {
385 g_strlcat(cinfo->col_buf[i], separator, max_len);
389 g_vsnprintf(&cinfo->col_buf[i][len], max_len - len, format, ap);
390 cinfo->col_buf[i][max_len-1] = 0;
395 /* Appends a vararg list to a packet info string. */
397 col_append_fstr(column_info *cinfo, gint el, const gchar *format, ...)
401 if (!check_col(cinfo, el))
404 va_start(ap, format);
405 col_do_append_sep_va_fstr(cinfo, el, NULL, format, ap);
409 /* Appends a vararg list to a packet info string.
410 * Prefixes it with the given separator if the column is not empty. */
412 col_append_sep_fstr(column_info *cinfo, gint el, const gchar *separator,
413 const gchar *format, ...)
417 if (!check_col(cinfo, el))
420 if (separator == NULL)
421 separator = ", "; /* default */
422 va_start(ap, format);
423 col_do_append_sep_va_fstr(cinfo, el, separator, format, ap);
429 /* Prepends a vararg list to a packet info string. */
430 #define COL_BUF_MAX_LEN (((COL_MAX_INFO_LEN) > (COL_MAX_LEN)) ? \
431 (COL_MAX_INFO_LEN) : (COL_MAX_LEN))
433 col_prepend_fstr(column_info *cinfo, gint el, const gchar *format, ...)
437 char orig_buf[COL_BUF_MAX_LEN];
441 if (!check_col(cinfo, el))
445 max_len = COL_MAX_INFO_LEN;
447 max_len = COL_MAX_LEN;
449 va_start(ap, format);
450 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
451 if (cinfo->fmt_matx[i][el]) {
452 if (cinfo->col_data[i] != cinfo->col_buf[i]) {
453 /* This was set with "col_set_str()"; which is effectively const */
454 orig = cinfo->col_data[i];
456 g_strlcpy(orig_buf, cinfo->col_buf[i], max_len);
459 g_vsnprintf(cinfo->col_buf[i], max_len, format, ap);
460 cinfo->col_buf[i][max_len - 1] = '\0';
463 * Move the fence, unless it's at the beginning of the string.
465 if (cinfo->col_fence[i] > 0)
466 cinfo->col_fence[i] += (int) strlen(cinfo->col_buf[i]);
468 g_strlcat(cinfo->col_buf[i], orig, max_len);
469 cinfo->col_data[i] = cinfo->col_buf[i];
475 col_prepend_fence_fstr(column_info *cinfo, gint el, const gchar *format, ...)
479 char orig_buf[COL_BUF_MAX_LEN];
483 if (!check_col(cinfo, el))
487 max_len = COL_MAX_INFO_LEN;
489 max_len = COL_MAX_LEN;
491 va_start(ap, format);
492 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
493 if (cinfo->fmt_matx[i][el]) {
494 if (cinfo->col_data[i] != cinfo->col_buf[i]) {
495 /* This was set with "col_set_str()"; which is effectively const */
496 orig = cinfo->col_data[i];
498 g_strlcpy(orig_buf, cinfo->col_buf[i], max_len);
501 g_vsnprintf(cinfo->col_buf[i], max_len, format, ap);
502 cinfo->col_buf[i][max_len - 1] = '\0';
505 * Move the fence if it exists, else create a new fence at the
506 * end of the prepended data.
508 if (cinfo->col_fence[i] > 0) {
509 cinfo->col_fence[i] += (int) strlen(cinfo->col_buf[i]);
511 cinfo->col_fence[i] = (int) strlen(cinfo->col_buf[i]);
513 g_strlcat(cinfo->col_buf[i], orig, max_len);
514 cinfo->col_data[i] = cinfo->col_buf[i];
520 /* Use this if "str" points to something that won't stay around (and
521 must thus be copied). */
523 col_add_str(column_info *cinfo, gint el, const gchar* str)
529 if (!check_col(cinfo, el))
533 max_len = COL_MAX_INFO_LEN;
535 max_len = COL_MAX_LEN;
537 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
538 if (cinfo->fmt_matx[i][el]) {
539 fence = cinfo->col_fence[i];
542 * We will append the string after the fence.
543 * First arrange that we can append, if necessary.
545 COL_CHECK_APPEND(cinfo, i, max_len);
548 * There's no fence, so we can just write to the string.
550 cinfo->col_data[i] = cinfo->col_buf[i];
552 g_strlcpy(&cinfo->col_buf[i][fence], str, max_len - fence);
558 col_do_append_str(column_info *cinfo, gint el, const gchar* separator,
562 size_t len, max_len, sep_len;
564 if (!check_col(cinfo, el))
568 max_len = COL_MAX_INFO_LEN;
570 max_len = COL_MAX_LEN;
572 if (separator == NULL)
575 sep_len = strlen(separator);
577 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
578 if (cinfo->fmt_matx[i][el]) {
580 * First arrange that we can append, if necessary.
582 COL_CHECK_APPEND(cinfo, i, max_len);
584 len = cinfo->col_buf[i][0];
587 * If we have a separator, append it if the column isn't empty.
589 if (separator != NULL) {
591 g_strlcat(cinfo->col_buf[i], separator, max_len);
594 g_strlcat(cinfo->col_buf[i], str, max_len);
600 col_append_str(column_info *cinfo, gint el, const gchar* str)
602 col_do_append_str(cinfo, el, NULL, str);
606 col_append_sep_str(column_info *cinfo, gint el, const gchar* separator,
609 if (separator == NULL)
610 separator = ", "; /* default */
611 col_do_append_str(cinfo, el, separator, str);
615 col_set_abs_date_time(frame_data *fd, column_info *cinfo, int col)
620 COL_CHECK_REF_TIME(fd, cinfo, col);
622 then = fd->abs_ts.secs;
623 tmp = localtime(&then);
625 switch(timestamp_get_precision()) {
626 case(TS_PREC_FIXED_SEC):
627 case(TS_PREC_AUTO_SEC):
628 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
629 "%04d-%02d-%02d %02d:%02d:%02d",
637 case(TS_PREC_FIXED_DSEC):
638 case(TS_PREC_AUTO_DSEC):
639 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
640 "%04d-%02d-%02d %02d:%02d:%02d.%01ld",
647 (long)fd->abs_ts.nsecs / 100000000);
649 case(TS_PREC_FIXED_CSEC):
650 case(TS_PREC_AUTO_CSEC):
651 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
652 "%04d-%02d-%02d %02d:%02d:%02d.%02ld",
659 (long)fd->abs_ts.nsecs / 10000000);
661 case(TS_PREC_FIXED_MSEC):
662 case(TS_PREC_AUTO_MSEC):
663 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
664 "%04d-%02d-%02d %02d:%02d:%02d.%03ld",
671 (long)fd->abs_ts.nsecs / 1000000);
673 case(TS_PREC_FIXED_USEC):
674 case(TS_PREC_AUTO_USEC):
675 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
676 "%04d-%02d-%02d %02d:%02d:%02d.%06ld",
683 (long)fd->abs_ts.nsecs / 1000);
685 case(TS_PREC_FIXED_NSEC):
686 case(TS_PREC_AUTO_NSEC):
687 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
688 "%04d-%02d-%02d %02d:%02d:%02d.%09ld",
695 (long)fd->abs_ts.nsecs);
698 g_assert_not_reached();
701 cinfo->col_buf[col][0] = '\0';
703 cinfo->col_data[col] = cinfo->col_buf[col];
704 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time",COL_MAX_LEN);
705 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
709 col_set_rel_time(frame_data *fd, column_info *cinfo, int col)
711 COL_CHECK_REF_TIME(fd, cinfo, col);
713 switch(timestamp_get_precision()) {
714 case(TS_PREC_FIXED_SEC):
715 case(TS_PREC_AUTO_SEC):
716 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
717 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000000000, SECS);
719 case(TS_PREC_FIXED_DSEC):
720 case(TS_PREC_AUTO_DSEC):
721 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
722 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 100000000, DSECS);
724 case(TS_PREC_FIXED_CSEC):
725 case(TS_PREC_AUTO_CSEC):
726 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
727 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 10000000, CSECS);
729 case(TS_PREC_FIXED_MSEC):
730 case(TS_PREC_AUTO_MSEC):
731 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
732 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000000, MSECS);
734 case(TS_PREC_FIXED_USEC):
735 case(TS_PREC_AUTO_USEC):
736 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
737 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000, USECS);
739 case(TS_PREC_FIXED_NSEC):
740 case(TS_PREC_AUTO_NSEC):
741 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
742 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs, NSECS);
745 g_assert_not_reached();
747 cinfo->col_data[col] = cinfo->col_buf[col];
748 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_relative", COL_MAX_LEN);
749 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
753 col_set_delta_time(frame_data *fd, column_info *cinfo, int col)
755 COL_CHECK_REF_TIME(fd, cinfo, col);
757 switch(timestamp_get_precision()) {
758 case(TS_PREC_FIXED_SEC):
759 case(TS_PREC_AUTO_SEC):
760 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
761 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000000000, SECS);
763 case(TS_PREC_FIXED_DSEC):
764 case(TS_PREC_AUTO_DSEC):
765 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
766 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 100000000, DSECS);
768 case(TS_PREC_FIXED_CSEC):
769 case(TS_PREC_AUTO_CSEC):
770 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
771 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 10000000, CSECS);
773 case(TS_PREC_FIXED_MSEC):
774 case(TS_PREC_AUTO_MSEC):
775 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
776 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000000, MSECS);
778 case(TS_PREC_FIXED_USEC):
779 case(TS_PREC_AUTO_USEC):
780 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
781 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000, USECS);
783 case(TS_PREC_FIXED_NSEC):
784 case(TS_PREC_AUTO_NSEC):
785 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
786 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs, NSECS);
789 g_assert_not_reached();
791 cinfo->col_data[col] = cinfo->col_buf[col];
792 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta",COL_MAX_LEN);
793 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
797 col_set_delta_time_dis(frame_data *fd, column_info *cinfo, int col)
799 COL_CHECK_REF_TIME(fd, cinfo, col);
801 switch(timestamp_get_precision()) {
802 case(TS_PREC_FIXED_SEC):
803 case(TS_PREC_AUTO_SEC):
804 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
805 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000000000, SECS);
807 case(TS_PREC_FIXED_DSEC):
808 case(TS_PREC_AUTO_DSEC):
809 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
810 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 100000000, DSECS);
812 case(TS_PREC_FIXED_CSEC):
813 case(TS_PREC_AUTO_CSEC):
814 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
815 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 10000000, CSECS);
817 case(TS_PREC_FIXED_MSEC):
818 case(TS_PREC_AUTO_MSEC):
819 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
820 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000000, MSECS);
822 case(TS_PREC_FIXED_USEC):
823 case(TS_PREC_AUTO_USEC):
824 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
825 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000, USECS);
827 case(TS_PREC_FIXED_NSEC):
828 case(TS_PREC_AUTO_NSEC):
829 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
830 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs, NSECS);
833 g_assert_not_reached();
835 cinfo->col_data[col] = cinfo->col_buf[col];
836 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta_displayed",
838 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
841 /* To do: Add check_col checks to the col_add* routines */
844 col_set_abs_time(frame_data *fd, column_info *cinfo, int col)
849 COL_CHECK_REF_TIME(fd, cinfo, col);
851 then = fd->abs_ts.secs;
852 tmp = localtime(&then);
854 switch(timestamp_get_precision()) {
855 case(TS_PREC_FIXED_SEC):
856 case(TS_PREC_AUTO_SEC):
857 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
863 case(TS_PREC_FIXED_DSEC):
864 case(TS_PREC_AUTO_DSEC):
865 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
866 "%02d:%02d:%02d.%01ld",
870 (long)fd->abs_ts.nsecs / 100000000);
872 case(TS_PREC_FIXED_CSEC):
873 case(TS_PREC_AUTO_CSEC):
874 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
875 "%02d:%02d:%02d.%02ld",
879 (long)fd->abs_ts.nsecs / 10000000);
881 case(TS_PREC_FIXED_MSEC):
882 case(TS_PREC_AUTO_MSEC):
883 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
884 "%02d:%02d:%02d.%03ld",
888 (long)fd->abs_ts.nsecs / 1000000);
890 case(TS_PREC_FIXED_USEC):
891 case(TS_PREC_AUTO_USEC):
892 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
893 "%02d:%02d:%02d.%06ld",
897 (long)fd->abs_ts.nsecs / 1000);
899 case(TS_PREC_FIXED_NSEC):
900 case(TS_PREC_AUTO_NSEC):
901 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
902 "%02d:%02d:%02d.%09ld",
906 (long)fd->abs_ts.nsecs);
909 g_assert_not_reached();
912 cinfo->col_buf[col][0] = '\0';
914 cinfo->col_data[col] = cinfo->col_buf[col];
915 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time",COL_MAX_LEN);
916 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
920 col_set_epoch_time(frame_data *fd, column_info *cinfo, int col)
923 COL_CHECK_REF_TIME(fd, cinfo, col);
925 switch(timestamp_get_precision()) {
926 case(TS_PREC_FIXED_SEC):
927 case(TS_PREC_AUTO_SEC):
928 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
929 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000000, SECS);
931 case(TS_PREC_FIXED_DSEC):
932 case(TS_PREC_AUTO_DSEC):
933 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
934 fd->abs_ts.secs, fd->abs_ts.nsecs / 100000000, DSECS);
936 case(TS_PREC_FIXED_CSEC):
937 case(TS_PREC_AUTO_CSEC):
938 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
939 fd->abs_ts.secs, fd->abs_ts.nsecs / 10000000, CSECS);
941 case(TS_PREC_FIXED_MSEC):
942 case(TS_PREC_AUTO_MSEC):
943 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
944 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000, MSECS);
946 case(TS_PREC_FIXED_USEC):
947 case(TS_PREC_AUTO_USEC):
948 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
949 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000, USECS);
951 case(TS_PREC_FIXED_NSEC):
952 case(TS_PREC_AUTO_NSEC):
953 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
954 fd->abs_ts.secs, fd->abs_ts.nsecs, NSECS);
957 g_assert_not_reached();
959 cinfo->col_data[col] = cinfo->col_buf[col];
960 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta",COL_MAX_LEN);
961 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
965 col_set_cls_time(frame_data *fd, column_info *cinfo, gint col)
967 switch (timestamp_get_type()) {
969 col_set_abs_time(fd, cinfo, col);
972 case TS_ABSOLUTE_WITH_DATE:
973 col_set_abs_date_time(fd, cinfo, col);
977 col_set_rel_time(fd, cinfo, col);
981 col_set_delta_time(fd, cinfo, col);
985 col_set_delta_time_dis(fd, cinfo, col);
989 col_set_epoch_time(fd, cinfo, col);
993 /* code is missing for this case, but I don't know which [jmayer20051219] */
999 /* Set the format of the variable time format.
1000 XXX - this is called from "file.c" when the user changes the time
1001 format they want for "command-line-specified" time; it's a bit ugly
1002 that we have to export it, but if we go to a CList-like widget that
1003 invokes callbacks to get the text for the columns rather than
1004 requiring us to stuff the text into the widget from outside, we
1005 might be able to clean this up. */
1007 col_set_fmt_time(frame_data *fd, column_info *cinfo, gint fmt, gint col)
1011 col_set_cls_time(fd, cinfo, col);
1015 col_set_abs_time(fd, cinfo, col);
1018 case COL_ABS_DATE_TIME:
1019 col_set_abs_date_time(fd, cinfo, col);
1023 col_set_rel_time(fd, cinfo, col);
1026 case COL_DELTA_TIME:
1027 col_set_delta_time(fd, cinfo, col);
1030 case COL_DELTA_TIME_DIS:
1031 col_set_delta_time_dis(fd, cinfo, col);
1034 case COL_REL_CONV_TIME:
1035 case COL_DELTA_CONV_TIME:
1036 /* Will be set by various dissectors */
1040 g_assert_not_reached();
1046 col_set_time(column_info *cinfo, gint el, nstime_t *ts, char *fieldname)
1050 if (!check_col(cinfo, el))
1053 for (col = cinfo->col_first[el]; col <= cinfo->col_last[el]; col++) {
1054 if (cinfo->fmt_matx[col][el]) {
1055 switch(timestamp_get_precision()) {
1056 case(TS_PREC_FIXED_SEC):
1057 case(TS_PREC_AUTO_SEC):
1058 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1059 (gint32) ts->secs, ts->nsecs / 1000000000, SECS);
1061 case(TS_PREC_FIXED_DSEC):
1062 case(TS_PREC_AUTO_DSEC):
1063 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1064 (gint32) ts->secs, ts->nsecs / 100000000, DSECS);
1066 case(TS_PREC_FIXED_CSEC):
1067 case(TS_PREC_AUTO_CSEC):
1068 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1069 (gint32) ts->secs, ts->nsecs / 10000000, CSECS);
1071 case(TS_PREC_FIXED_MSEC):
1072 case(TS_PREC_AUTO_MSEC):
1073 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1074 (gint32) ts->secs, ts->nsecs / 1000000, MSECS);
1076 case(TS_PREC_FIXED_USEC):
1077 case(TS_PREC_AUTO_USEC):
1078 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1079 (gint32) ts->secs, ts->nsecs / 1000, USECS);
1081 case(TS_PREC_FIXED_NSEC):
1082 case(TS_PREC_AUTO_NSEC):
1083 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1084 (gint32) ts->secs, ts->nsecs, NSECS);
1087 g_assert_not_reached();
1089 cinfo->col_data[col] = cinfo->col_buf[col];
1090 g_strlcpy(cinfo->col_expr.col_expr[col],fieldname,COL_MAX_LEN);
1091 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],
1098 col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res,
1101 struct e_in6_addr ipv6_addr;
1103 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1104 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1106 if (addr->type == AT_NONE)
1107 return; /* no address, nothing to do */
1110 get_addr_name_buf(addr, pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1112 address_to_str_buf(addr, pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1114 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1116 switch (addr->type) {
1120 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "eth.src",COL_MAX_LEN);
1122 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "eth.dst",COL_MAX_LEN);
1123 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ether_to_str(addr->data), COL_MAX_LEN);
1128 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ip.src", COL_MAX_LEN);
1130 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ip.dst",COL_MAX_LEN);
1131 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ip_to_str(addr->data), COL_MAX_LEN);
1136 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipv6.src", COL_MAX_LEN);
1138 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipv6.dst", COL_MAX_LEN);
1139 memcpy(&ipv6_addr.bytes, addr->data, sizeof ipv6_addr.bytes);
1140 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ip6_to_str(&ipv6_addr), COL_MAX_LEN);
1145 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.src", COL_MAX_LEN);
1147 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.dst", COL_MAX_LEN);
1148 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1153 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "arcnet.src",
1156 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "arcnet.dst",
1158 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1163 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "uri.src", COL_MAX_LEN);
1165 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "uri.dst", COL_MAX_LEN);
1166 address_to_str_buf(addr, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
1175 col_set_port(packet_info *pinfo, int col, gboolean is_res, gboolean is_src)
1180 port = pinfo->srcport;
1182 port = pinfo->destport;
1183 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1184 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1185 switch (pinfo->ptype) {
1189 g_strlcpy(pinfo->cinfo->col_buf[col], get_sctp_port(port), COL_MAX_LEN);
1191 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1196 g_strlcpy(pinfo->cinfo->col_buf[col], get_tcp_port(port), COL_MAX_LEN);
1198 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1200 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "tcp.srcport",
1203 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "tcp.dstport",
1205 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1210 g_strlcpy(pinfo->cinfo->col_buf[col], get_udp_port(port), COL_MAX_LEN);
1212 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1214 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "udp.srcport",
1217 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "udp.dstport",
1219 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1224 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.src_socket",
1227 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.dst_socket",
1229 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1230 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1234 /* XXX - resolve IPX socket numbers */
1235 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%04x", port);
1237 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipx.src.socket",
1240 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipx.dst.socket",
1242 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%04x", port);
1246 /* XXX - resolve IDP socket numbers */
1247 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%04x", port);
1249 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "idp.src.socket",
1252 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "idp.dst.socket",
1254 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%04x", port);
1258 /* XXX - resolve USB endpoint numbers */
1259 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%08x", port);
1261 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "usb.src.endpoint",
1264 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "usb.dst.endpoint",
1266 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%08x", port);
1272 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1276 * XXX - this should be in some common code in the epan directory, shared
1277 * by this code and packet-isdn.c.
1279 static const value_string channel_vals[] = {
1315 col_set_circuit_id(packet_info *pinfo, int col)
1317 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1318 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1319 switch (pinfo->ctype) {
1322 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1323 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "fr.dlci", COL_MAX_LEN);
1324 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1328 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%s",
1329 val_to_str(pinfo->circuit_id, channel_vals, "Unknown (%u)"));
1330 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "isdn.channel",
1332 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1336 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1340 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1341 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "isup.cic", COL_MAX_LEN);
1342 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1348 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1352 col_fill_in(packet_info *pinfo)
1356 for (i = 0; i < pinfo->cinfo->num_cols; i++) {
1357 switch (pinfo->cinfo->col_fmt[i]) {
1360 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->num);
1361 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1362 g_strlcpy(pinfo->cinfo->col_expr.col_expr[i], "frame.number",
1364 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[i], pinfo->cinfo->col_buf[i], COL_MAX_LEN);
1368 col_set_cls_time(pinfo->fd, pinfo->cinfo, i);
1372 col_set_abs_time(pinfo->fd, pinfo->cinfo, i);
1375 case COL_ABS_DATE_TIME:
1376 col_set_abs_date_time(pinfo->fd, pinfo->cinfo, i);
1380 col_set_rel_time(pinfo->fd, pinfo->cinfo, i);
1383 case COL_DELTA_TIME:
1384 col_set_delta_time(pinfo->fd, pinfo->cinfo, i);
1387 case COL_DELTA_TIME_DIS:
1388 col_set_delta_time_dis(pinfo->fd, pinfo->cinfo, i);
1391 case COL_REL_CONV_TIME:
1392 case COL_DELTA_CONV_TIME:
1393 break; /* Will be set by various dissectors */
1396 case COL_RES_SRC: /* COL_DEF_SRC is currently just like COL_RES_SRC */
1397 col_set_addr(pinfo, i, &pinfo->src, TRUE, TRUE);
1401 col_set_addr(pinfo, i, &pinfo->src, FALSE, TRUE);
1404 case COL_DEF_DL_SRC:
1405 case COL_RES_DL_SRC:
1406 col_set_addr(pinfo, i, &pinfo->dl_src, TRUE, TRUE);
1409 case COL_UNRES_DL_SRC:
1410 col_set_addr(pinfo, i, &pinfo->dl_src, FALSE, TRUE);
1413 case COL_DEF_NET_SRC:
1414 case COL_RES_NET_SRC:
1415 col_set_addr(pinfo, i, &pinfo->net_src, TRUE, TRUE);
1418 case COL_UNRES_NET_SRC:
1419 col_set_addr(pinfo, i, &pinfo->net_src, FALSE, TRUE);
1423 case COL_RES_DST: /* COL_DEF_DST is currently just like COL_RES_DST */
1424 col_set_addr(pinfo, i, &pinfo->dst, TRUE, FALSE);
1428 col_set_addr(pinfo, i, &pinfo->dst, FALSE, FALSE);
1431 case COL_DEF_DL_DST:
1432 case COL_RES_DL_DST:
1433 col_set_addr(pinfo, i, &pinfo->dl_dst, TRUE, FALSE);
1436 case COL_UNRES_DL_DST:
1437 col_set_addr(pinfo, i, &pinfo->dl_dst, FALSE, FALSE);
1440 case COL_DEF_NET_DST:
1441 case COL_RES_NET_DST:
1442 col_set_addr(pinfo, i, &pinfo->net_dst, TRUE, FALSE);
1445 case COL_UNRES_NET_DST:
1446 col_set_addr(pinfo, i, &pinfo->net_dst, FALSE, FALSE);
1449 case COL_DEF_SRC_PORT:
1450 case COL_RES_SRC_PORT: /* COL_DEF_SRC_PORT is currently just like COL_RES_SRC_PORT */
1451 col_set_port(pinfo, i, TRUE, TRUE);
1454 case COL_UNRES_SRC_PORT:
1455 col_set_port(pinfo, i, FALSE, TRUE);
1458 case COL_DEF_DST_PORT:
1459 case COL_RES_DST_PORT: /* COL_DEF_DST_PORT is currently just like COL_RES_DST_PORT */
1460 col_set_port(pinfo, i, TRUE, FALSE);
1463 case COL_UNRES_DST_PORT:
1464 col_set_port(pinfo, i, FALSE, FALSE);
1467 case COL_PROTOCOL: /* currently done by dissectors */
1468 case COL_INFO: /* currently done by dissectors */
1471 case COL_PACKET_LENGTH:
1472 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->pkt_len);
1473 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1474 g_strlcpy(pinfo->cinfo->col_expr.col_expr[i], "frame.len",
1476 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[i], pinfo->cinfo->col_buf[i], COL_MAX_LEN);
1479 case COL_CUMULATIVE_BYTES:
1480 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->cum_bytes);
1481 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1485 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->oxid);
1486 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1490 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->rxid);
1491 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1494 case COL_IF_DIR: /* currently done by dissectors */
1497 case COL_CIRCUIT_ID:
1498 col_set_circuit_id(pinfo, i);
1502 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->src_idx);
1503 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1507 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->dst_idx);
1508 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1512 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->vsan);
1513 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1516 case COL_HPUX_SUBSYS: /* done by nettl disector */
1517 case COL_HPUX_DEVID: /* done by nettl disector */
1520 case COL_DCE_CALL: /* done by dcerpc */
1523 case COL_DCE_CTX: /* done by dcerpc */
1526 case COL_8021Q_VLAN_ID:
1529 case COL_DSCP_VALUE: /* done by packet-ip.c */
1532 case COL_COS_VALUE: /* done by packet-vlan.c */
1535 case COL_FR_DLCI: /* done by packet-fr.c */
1536 case COL_BSSGP_TLLI: /* done by packet-bssgp.c */
1539 case COL_EXPERT: /* done by expert.c */
1542 case COL_FREQ_CHAN: /* done by radio dissectors */
1545 case COL_CUSTOM: /* done by col_custom_set_fstr() called from proto.c */
1548 case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
1549 g_assert_not_reached();