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 = (gint *) g_malloc(sizeof(gint) * num_cols);
59 cinfo->fmt_matx = (gboolean **) g_malloc(sizeof(gboolean *) * num_cols);
60 cinfo->col_first = (int *) g_malloc(sizeof(int) * (NUM_COL_FMTS));
61 cinfo->col_last = (int *) g_malloc(sizeof(int) * (NUM_COL_FMTS));
62 cinfo->col_title = (gchar **) g_malloc(sizeof(gchar *) * num_cols);
63 cinfo->col_custom_field = (gchar **) g_malloc(sizeof(gchar *) * num_cols);
64 cinfo->col_data = (const gchar **) g_malloc(sizeof(gchar *) * num_cols);
65 cinfo->col_buf = (gchar **) g_malloc(sizeof(gchar *) * num_cols);
66 cinfo->col_fence = (int *) g_malloc(sizeof(int) * num_cols);
67 cinfo->col_expr.col_expr = (gchar **) g_malloc(sizeof(gchar *) * num_cols);
68 cinfo->col_expr.col_expr_val = (gchar **) g_malloc(sizeof(gchar *) * num_cols);
70 for (i = 0; i < NUM_COL_FMTS; i++) {
71 cinfo->col_first[i] = -1;
72 cinfo->col_last[i] = -1;
76 /* Initialize the data structures for constructing column data. */
78 col_init(column_info *cinfo)
82 for (i = 0; i < cinfo->num_cols; i++) {
83 cinfo->col_buf[i][0] = '\0';
84 cinfo->col_data[i] = cinfo->col_buf[i];
85 cinfo->col_fence[i] = 0;
86 cinfo->col_expr.col_expr[i][0] = '\0';
87 cinfo->col_expr.col_expr_val[i][0] = '\0';
89 cinfo->writable = TRUE;
93 col_get_writable(column_info *cinfo)
95 return (cinfo ? cinfo->writable : FALSE);
99 col_set_writable(column_info *cinfo, gboolean writable)
102 cinfo->writable = writable;
105 /* Checks to see if a particular packet information element is needed for
108 check_col(column_info *cinfo, gint el) {
110 if (cinfo && cinfo->writable) {
111 /* We are constructing columns, and they're writable */
112 if (cinfo->col_first[el] >= 0) {
113 /* There is at least one column in that format */
120 /* Sets the fence for a column to be at the end of the column. */
122 col_set_fence(column_info *cinfo, gint el)
126 if (cinfo && cinfo->writable) {
127 /* We are constructing columns, and they're writable */
128 if (cinfo->col_first[el] >= 0) {
129 /* There is at least one column in that format */
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] = strlen(cinfo->col_data[i]);
139 /* Use this to clear out a column, especially if you're going to be
140 appending to it later; at least on some platforms, it's more
141 efficient than using "col_add_str()" with a null string, and
142 more efficient than "col_set_str()" with a null string if you
143 later append to it, as the later append will cause a string
146 col_clear(column_info *cinfo, gint el)
151 g_assert(cinfo->col_first[el] >= 0);
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)
210 max_len = COL_MAX_INFO_LEN;
212 max_len = COL_MAX_LEN;
214 g_assert(cinfo->col_first[el] >= 0);
215 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
216 if (cinfo->fmt_matx[i][el]) {
217 fence = cinfo->col_fence[i];
220 * We will append the string after the fence.
221 * First arrange that we can append, if necessary.
223 COL_CHECK_APPEND(cinfo, i, max_len);
225 g_strlcpy(&cinfo->col_buf[i][fence], str, max_len - fence);
228 * There's no fence, so we can just set the column to point
231 cinfo->col_data[i] = str;
237 /* Adds a vararg list to a packet info string. */
239 col_add_fstr(column_info *cinfo, gint el, const gchar *format, ...) {
245 g_assert(cinfo->col_first[el] >= 0);
247 max_len = COL_MAX_INFO_LEN;
249 max_len = COL_MAX_LEN;
251 va_start(ap, format);
252 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
253 if (cinfo->fmt_matx[i][el]) {
254 fence = cinfo->col_fence[i];
257 * We will append the string after the fence.
258 * First arrange that we can append, if necessary.
260 COL_CHECK_APPEND(cinfo, i, max_len);
263 * There's no fence, so we can just write to the string.
265 cinfo->col_data[i] = cinfo->col_buf[i];
267 g_vsnprintf(&cinfo->col_buf[i][fence], max_len - fence, format, ap);
268 cinfo->col_buf[i][max_len - 1] = '\0';
275 col_custom_set_fstr(header_field_info *hfinfo, const gchar *format, ...)
280 if (!have_custom_cols(ci))
283 va_start(ap, format);
284 for (i = ci->col_first[COL_CUSTOM];
285 i <= ci->col_last[COL_CUSTOM]; i++) {
286 if (ci->fmt_matx[i][COL_CUSTOM] &&
287 strcmp(ci->col_custom_field[i], hfinfo->abbrev) == 0) {
288 ci->col_data[i] = ci->col_buf[i];
289 g_vsnprintf(ci->col_buf[i], COL_MAX_LEN, format, ap);
291 g_strlcpy(ci->col_expr.col_expr[i], hfinfo->abbrev, COL_MAX_LEN);
293 switch(hfinfo->type) {
296 g_snprintf(ci->col_expr.col_expr_val[i], COL_MAX_LEN, "\"%s\"",
301 g_strlcpy(ci->col_expr.col_expr_val[i], ci->col_buf[i], COL_MAX_LEN);
310 col_custom_prime_edt(epan_dissect_t *edt, column_info *cinfo)
313 dfilter_t *dfilter_code;
315 ci = cinfo; /* Save this into the static variable ci for use by
316 * col_custom_set_fstr() later. */
318 if(!have_custom_cols(cinfo))
321 for (i = cinfo->col_first[COL_CUSTOM];
322 i <= cinfo->col_last[COL_CUSTOM]; i++) {
323 if (cinfo->fmt_matx[i][COL_CUSTOM] &&
324 strlen(cinfo->col_custom_field[i]) > 0) {
325 if(dfilter_compile(cinfo->col_custom_field[i], &dfilter_code)) {
326 epan_dissect_prime_dfilter(edt, dfilter_code);
327 dfilter_free(dfilter_code);
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_do_append_sep_va_fstr(column_info *cinfo, gint el, const gchar *separator,
346 const gchar *format, va_list ap)
349 size_t len, max_len, sep_len;
351 g_assert(cinfo->col_first[el] >= 0);
353 max_len = COL_MAX_INFO_LEN;
355 max_len = COL_MAX_LEN;
357 if (separator == NULL)
360 sep_len = strlen(separator);
361 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
362 if (cinfo->fmt_matx[i][el]) {
364 * First arrange that we can append, if necessary.
366 COL_CHECK_APPEND(cinfo, i, max_len);
368 len = strlen(cinfo->col_buf[i]);
371 * If we have a separator, append it if the column isn't empty.
373 if (separator != NULL) {
375 g_strlcat(cinfo->col_buf[i], separator, max_len);
379 g_vsnprintf(&cinfo->col_buf[i][len], max_len - len, format, ap);
380 cinfo->col_buf[i][max_len-1] = 0;
385 /* Appends a vararg list to a packet info string. */
387 col_append_fstr(column_info *cinfo, gint el, const gchar *format, ...)
391 va_start(ap, format);
392 col_do_append_sep_va_fstr(cinfo, el, NULL, format, ap);
396 /* Appends a vararg list to a packet info string.
397 * Prefixes it with the given separator if the column is not empty. */
399 col_append_sep_fstr(column_info *cinfo, gint el, const gchar *separator,
400 const gchar *format, ...)
404 if (separator == NULL)
405 separator = ", "; /* default */
406 va_start(ap, format);
407 col_do_append_sep_va_fstr(cinfo, el, separator, format, ap);
413 /* Prepends a vararg list to a packet info string. */
414 #define COL_BUF_MAX_LEN (((COL_MAX_INFO_LEN) > (COL_MAX_LEN)) ? \
415 (COL_MAX_INFO_LEN) : (COL_MAX_LEN))
417 col_prepend_fstr(column_info *cinfo, gint el, const gchar *format, ...)
421 char orig_buf[COL_BUF_MAX_LEN];
425 g_assert(cinfo->col_first[el] >= 0);
427 max_len = COL_MAX_INFO_LEN;
429 max_len = COL_MAX_LEN;
431 va_start(ap, format);
432 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
433 if (cinfo->fmt_matx[i][el]) {
434 if (cinfo->col_data[i] != cinfo->col_buf[i]) {
435 /* This was set with "col_set_str()"; which is effectively const */
436 orig = cinfo->col_data[i];
438 g_strlcpy(orig_buf, cinfo->col_buf[i], max_len);
441 g_vsnprintf(cinfo->col_buf[i], max_len, format, ap);
442 cinfo->col_buf[i][max_len - 1] = '\0';
445 * Move the fence, unless it's at the beginning of the string.
447 if (cinfo->col_fence[i] > 0)
448 cinfo->col_fence[i] += strlen(cinfo->col_buf[i]);
450 g_strlcat(cinfo->col_buf[i], orig, max_len);
451 cinfo->col_data[i] = cinfo->col_buf[i];
457 col_prepend_fence_fstr(column_info *cinfo, gint el, const gchar *format, ...)
461 char orig_buf[COL_BUF_MAX_LEN];
465 g_assert(cinfo->col_first[el] >= 0);
467 max_len = COL_MAX_INFO_LEN;
469 max_len = COL_MAX_LEN;
471 va_start(ap, format);
472 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
473 if (cinfo->fmt_matx[i][el]) {
474 if (cinfo->col_data[i] != cinfo->col_buf[i]) {
475 /* This was set with "col_set_str()"; which is effectively const */
476 orig = cinfo->col_data[i];
478 g_strlcpy(orig_buf, cinfo->col_buf[i], max_len);
481 g_vsnprintf(cinfo->col_buf[i], max_len, format, ap);
482 cinfo->col_buf[i][max_len - 1] = '\0';
485 * Move the fence if it exists, else create a new fence at the
486 * end of the prepended data.
488 if (cinfo->col_fence[i] > 0) {
489 cinfo->col_fence[i] += strlen(cinfo->col_buf[i]);
491 cinfo->col_fence[i] = strlen(cinfo->col_buf[i]);
493 g_strlcat(cinfo->col_buf[i], orig, max_len);
494 cinfo->col_data[i] = cinfo->col_buf[i];
500 /* Use this if "str" points to something that won't stay around (and
501 must thus be copied). */
503 col_add_str(column_info *cinfo, gint el, const gchar* str)
509 g_assert(cinfo->col_first[el] >= 0);
511 max_len = COL_MAX_INFO_LEN;
513 max_len = COL_MAX_LEN;
515 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
516 if (cinfo->fmt_matx[i][el]) {
517 fence = cinfo->col_fence[i];
520 * We will append the string after the fence.
521 * First arrange that we can append, if necessary.
523 COL_CHECK_APPEND(cinfo, i, max_len);
526 * There's no fence, so we can just write to the string.
528 cinfo->col_data[i] = cinfo->col_buf[i];
530 g_strlcpy(&cinfo->col_buf[i][fence], str, max_len - fence);
536 col_do_append_str(column_info *cinfo, gint el, const gchar* separator,
540 size_t len, max_len, sep_len;
542 g_assert(cinfo->col_first[el] >= 0);
544 max_len = COL_MAX_INFO_LEN;
546 max_len = COL_MAX_LEN;
548 if (separator == NULL)
551 sep_len = strlen(separator);
553 for (i = cinfo->col_first[el]; i <= cinfo->col_last[el]; i++) {
554 if (cinfo->fmt_matx[i][el]) {
556 * First arrange that we can append, if necessary.
558 COL_CHECK_APPEND(cinfo, i, max_len);
560 len = cinfo->col_buf[i][0];
563 * If we have a separator, append it if the column isn't empty.
565 if (separator != NULL) {
567 g_strlcat(cinfo->col_buf[i], separator, max_len);
570 g_strlcat(cinfo->col_buf[i], str, max_len);
576 col_append_str(column_info *cinfo, gint el, const gchar* str)
578 col_do_append_str(cinfo, el, NULL, str);
582 col_append_sep_str(column_info *cinfo, gint el, const gchar* separator,
585 if (separator == NULL)
586 separator = ", "; /* default */
587 col_do_append_str(cinfo, el, separator, str);
591 col_set_abs_date_time(frame_data *fd, column_info *cinfo, int col)
596 COL_CHECK_REF_TIME(fd, cinfo, col);
598 then = fd->abs_ts.secs;
599 tmp = localtime(&then);
601 switch(timestamp_get_precision()) {
602 case(TS_PREC_FIXED_SEC):
603 case(TS_PREC_AUTO_SEC):
604 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
605 "%04d-%02d-%02d %02d:%02d:%02d",
613 case(TS_PREC_FIXED_DSEC):
614 case(TS_PREC_AUTO_DSEC):
615 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
616 "%04d-%02d-%02d %02d:%02d:%02d.%01ld",
623 (long)fd->abs_ts.nsecs / 100000000);
625 case(TS_PREC_FIXED_CSEC):
626 case(TS_PREC_AUTO_CSEC):
627 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
628 "%04d-%02d-%02d %02d:%02d:%02d.%02ld",
635 (long)fd->abs_ts.nsecs / 10000000);
637 case(TS_PREC_FIXED_MSEC):
638 case(TS_PREC_AUTO_MSEC):
639 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
640 "%04d-%02d-%02d %02d:%02d:%02d.%03ld",
647 (long)fd->abs_ts.nsecs / 1000000);
649 case(TS_PREC_FIXED_USEC):
650 case(TS_PREC_AUTO_USEC):
651 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
652 "%04d-%02d-%02d %02d:%02d:%02d.%06ld",
659 (long)fd->abs_ts.nsecs / 1000);
661 case(TS_PREC_FIXED_NSEC):
662 case(TS_PREC_AUTO_NSEC):
663 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
664 "%04d-%02d-%02d %02d:%02d:%02d.%09ld",
671 (long)fd->abs_ts.nsecs);
674 g_assert_not_reached();
677 cinfo->col_buf[col][0] = '\0';
679 cinfo->col_data[col] = cinfo->col_buf[col];
680 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time",COL_MAX_LEN);
681 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
685 col_set_rel_time(frame_data *fd, column_info *cinfo, int col)
687 COL_CHECK_REF_TIME(fd, cinfo, col);
689 switch(timestamp_get_precision()) {
690 case(TS_PREC_FIXED_SEC):
691 case(TS_PREC_AUTO_SEC):
692 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
693 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000000000, SECS);
695 case(TS_PREC_FIXED_DSEC):
696 case(TS_PREC_AUTO_DSEC):
697 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
698 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 100000000, DSECS);
700 case(TS_PREC_FIXED_CSEC):
701 case(TS_PREC_AUTO_CSEC):
702 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
703 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 10000000, CSECS);
705 case(TS_PREC_FIXED_MSEC):
706 case(TS_PREC_AUTO_MSEC):
707 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
708 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000000, MSECS);
710 case(TS_PREC_FIXED_USEC):
711 case(TS_PREC_AUTO_USEC):
712 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
713 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs / 1000, USECS);
715 case(TS_PREC_FIXED_NSEC):
716 case(TS_PREC_AUTO_NSEC):
717 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
718 (gint32) fd->rel_ts.secs, fd->rel_ts.nsecs, NSECS);
721 g_assert_not_reached();
723 cinfo->col_data[col] = cinfo->col_buf[col];
724 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_relative", COL_MAX_LEN);
725 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
729 col_set_delta_time(frame_data *fd, column_info *cinfo, int col)
731 COL_CHECK_REF_TIME(fd, cinfo, col);
733 switch(timestamp_get_precision()) {
734 case(TS_PREC_FIXED_SEC):
735 case(TS_PREC_AUTO_SEC):
736 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
737 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000000000, SECS);
739 case(TS_PREC_FIXED_DSEC):
740 case(TS_PREC_AUTO_DSEC):
741 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
742 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 100000000, DSECS);
744 case(TS_PREC_FIXED_CSEC):
745 case(TS_PREC_AUTO_CSEC):
746 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
747 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 10000000, CSECS);
749 case(TS_PREC_FIXED_MSEC):
750 case(TS_PREC_AUTO_MSEC):
751 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
752 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000000, MSECS);
754 case(TS_PREC_FIXED_USEC):
755 case(TS_PREC_AUTO_USEC):
756 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
757 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs / 1000, USECS);
759 case(TS_PREC_FIXED_NSEC):
760 case(TS_PREC_AUTO_NSEC):
761 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
762 (gint32) fd->del_cap_ts.secs, fd->del_cap_ts.nsecs, NSECS);
765 g_assert_not_reached();
767 cinfo->col_data[col] = cinfo->col_buf[col];
768 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta",COL_MAX_LEN);
769 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
773 col_set_delta_time_dis(frame_data *fd, column_info *cinfo, int col)
775 COL_CHECK_REF_TIME(fd, cinfo, col);
777 switch(timestamp_get_precision()) {
778 case(TS_PREC_FIXED_SEC):
779 case(TS_PREC_AUTO_SEC):
780 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
781 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000000000, SECS);
783 case(TS_PREC_FIXED_DSEC):
784 case(TS_PREC_AUTO_DSEC):
785 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
786 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 100000000, DSECS);
788 case(TS_PREC_FIXED_CSEC):
789 case(TS_PREC_AUTO_CSEC):
790 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
791 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 10000000, CSECS);
793 case(TS_PREC_FIXED_MSEC):
794 case(TS_PREC_AUTO_MSEC):
795 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
796 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000000, MSECS);
798 case(TS_PREC_FIXED_USEC):
799 case(TS_PREC_AUTO_USEC):
800 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
801 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs / 1000, USECS);
803 case(TS_PREC_FIXED_NSEC):
804 case(TS_PREC_AUTO_NSEC):
805 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
806 (gint32) fd->del_dis_ts.secs, fd->del_dis_ts.nsecs, NSECS);
809 g_assert_not_reached();
811 cinfo->col_data[col] = cinfo->col_buf[col];
812 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta_displayed",
814 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
817 /* To do: Add check_col checks to the col_add* routines */
820 col_set_abs_time(frame_data *fd, column_info *cinfo, int col)
825 COL_CHECK_REF_TIME(fd, cinfo, col);
827 then = fd->abs_ts.secs;
828 tmp = localtime(&then);
830 switch(timestamp_get_precision()) {
831 case(TS_PREC_FIXED_SEC):
832 case(TS_PREC_AUTO_SEC):
833 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
839 case(TS_PREC_FIXED_DSEC):
840 case(TS_PREC_AUTO_DSEC):
841 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
842 "%02d:%02d:%02d.%01ld",
846 (long)fd->abs_ts.nsecs / 100000000);
848 case(TS_PREC_FIXED_CSEC):
849 case(TS_PREC_AUTO_CSEC):
850 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
851 "%02d:%02d:%02d.%02ld",
855 (long)fd->abs_ts.nsecs / 10000000);
857 case(TS_PREC_FIXED_MSEC):
858 case(TS_PREC_AUTO_MSEC):
859 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
860 "%02d:%02d:%02d.%03ld",
864 (long)fd->abs_ts.nsecs / 1000000);
866 case(TS_PREC_FIXED_USEC):
867 case(TS_PREC_AUTO_USEC):
868 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
869 "%02d:%02d:%02d.%06ld",
873 (long)fd->abs_ts.nsecs / 1000);
875 case(TS_PREC_FIXED_NSEC):
876 case(TS_PREC_AUTO_NSEC):
877 g_snprintf(cinfo->col_buf[col], COL_MAX_LEN,
878 "%02d:%02d:%02d.%09ld",
882 (long)fd->abs_ts.nsecs);
885 g_assert_not_reached();
888 cinfo->col_buf[col][0] = '\0';
890 cinfo->col_data[col] = cinfo->col_buf[col];
891 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time",COL_MAX_LEN);
892 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
896 col_set_epoch_time(frame_data *fd, column_info *cinfo, int col)
899 COL_CHECK_REF_TIME(fd, cinfo, col);
901 switch(timestamp_get_precision()) {
902 case(TS_PREC_FIXED_SEC):
903 case(TS_PREC_AUTO_SEC):
904 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
905 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000000, SECS);
907 case(TS_PREC_FIXED_DSEC):
908 case(TS_PREC_AUTO_DSEC):
909 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
910 fd->abs_ts.secs, fd->abs_ts.nsecs / 100000000, DSECS);
912 case(TS_PREC_FIXED_CSEC):
913 case(TS_PREC_AUTO_CSEC):
914 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
915 fd->abs_ts.secs, fd->abs_ts.nsecs / 10000000, CSECS);
917 case(TS_PREC_FIXED_MSEC):
918 case(TS_PREC_AUTO_MSEC):
919 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
920 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000000, MSECS);
922 case(TS_PREC_FIXED_USEC):
923 case(TS_PREC_AUTO_USEC):
924 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
925 fd->abs_ts.secs, fd->abs_ts.nsecs / 1000, USECS);
927 case(TS_PREC_FIXED_NSEC):
928 case(TS_PREC_AUTO_NSEC):
929 display_epoch_time(cinfo->col_buf[col], COL_MAX_LEN,
930 fd->abs_ts.secs, fd->abs_ts.nsecs, NSECS);
933 g_assert_not_reached();
935 cinfo->col_data[col] = cinfo->col_buf[col];
936 g_strlcpy(cinfo->col_expr.col_expr[col],"frame.time_delta",COL_MAX_LEN);
937 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],COL_MAX_LEN);
939 /* Set the format of the variable time format.
940 XXX - this is called from "file.c" when the user changes the time
941 format they want for "command-line-specified" time; it's a bit ugly
942 that we have to export it, but if we go to a CList-like widget that
943 invokes callbacks to get the text for the columns rather than
944 requiring us to stuff the text into the widget from outside, we
945 might be able to clean this up. */
947 col_set_cls_time(frame_data *fd, column_info *cinfo, gint col)
949 switch (timestamp_get_type()) {
951 col_set_abs_time(fd, cinfo, col);
954 case TS_ABSOLUTE_WITH_DATE:
955 col_set_abs_date_time(fd, cinfo, col);
959 col_set_rel_time(fd, cinfo, col);
963 col_set_delta_time(fd, cinfo, col);
967 col_set_delta_time_dis(fd, cinfo, col);
971 col_set_epoch_time(fd, cinfo, col);
975 /* code is missing for this case, but I don't know which [jmayer20051219] */
982 col_set_time(column_info *cinfo, gint el, nstime_t *ts, char *fieldname)
986 g_assert(cinfo->col_first[el] >= 0);
988 for (col = cinfo->col_first[el]; col <= cinfo->col_last[el]; col++) {
989 if (cinfo->fmt_matx[col][el]) {
990 switch(timestamp_get_precision()) {
991 case(TS_PREC_FIXED_SEC):
992 case(TS_PREC_AUTO_SEC):
993 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
994 (gint32) ts->secs, ts->nsecs / 1000000000, SECS);
996 case(TS_PREC_FIXED_DSEC):
997 case(TS_PREC_AUTO_DSEC):
998 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
999 (gint32) ts->secs, ts->nsecs / 100000000, DSECS);
1001 case(TS_PREC_FIXED_CSEC):
1002 case(TS_PREC_AUTO_CSEC):
1003 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1004 (gint32) ts->secs, ts->nsecs / 10000000, CSECS);
1006 case(TS_PREC_FIXED_MSEC):
1007 case(TS_PREC_AUTO_MSEC):
1008 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1009 (gint32) ts->secs, ts->nsecs / 1000000, MSECS);
1011 case(TS_PREC_FIXED_USEC):
1012 case(TS_PREC_AUTO_USEC):
1013 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1014 (gint32) ts->secs, ts->nsecs / 1000, USECS);
1016 case(TS_PREC_FIXED_NSEC):
1017 case(TS_PREC_AUTO_NSEC):
1018 display_signed_time(cinfo->col_buf[col], COL_MAX_LEN,
1019 (gint32) ts->secs, ts->nsecs, NSECS);
1022 g_assert_not_reached();
1024 cinfo->col_data[col] = cinfo->col_buf[col];
1025 g_strlcpy(cinfo->col_expr.col_expr[col],fieldname,COL_MAX_LEN);
1026 g_strlcpy(cinfo->col_expr.col_expr_val[col],cinfo->col_buf[col],
1033 col_set_addr(packet_info *pinfo, int col, address *addr, gboolean is_res,
1036 struct e_in6_addr ipv6_addr;
1038 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1039 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1041 if (addr->type == AT_NONE)
1042 return; /* no address, nothing to do */
1045 get_addr_name_buf(addr, pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1047 address_to_str_buf(addr, pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1049 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1051 switch (addr->type) {
1055 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "eth.src",COL_MAX_LEN);
1057 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "eth.dst",COL_MAX_LEN);
1058 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ether_to_str(addr->data), COL_MAX_LEN);
1063 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ip.src", COL_MAX_LEN);
1065 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ip.dst",COL_MAX_LEN);
1066 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ip_to_str(addr->data), COL_MAX_LEN);
1071 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipv6.src", COL_MAX_LEN);
1073 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipv6.dst", COL_MAX_LEN);
1074 memcpy(&ipv6_addr.bytes, addr->data, sizeof ipv6_addr.bytes);
1075 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], ip6_to_str(&ipv6_addr), COL_MAX_LEN);
1080 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.src", COL_MAX_LEN);
1082 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.dst", COL_MAX_LEN);
1083 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1088 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "arcnet.src",
1091 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "arcnet.dst",
1093 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[col], pinfo->cinfo->col_buf[col], COL_MAX_LEN);
1098 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "uri.src", COL_MAX_LEN);
1100 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "uri.dst", COL_MAX_LEN);
1101 address_to_str_buf(addr, pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN);
1110 col_set_port(packet_info *pinfo, int col, gboolean is_res, gboolean is_src)
1115 port = pinfo->srcport;
1117 port = pinfo->destport;
1118 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1119 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1120 switch (pinfo->ptype) {
1124 g_strlcpy(pinfo->cinfo->col_buf[col], get_sctp_port(port), COL_MAX_LEN);
1126 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1131 g_strlcpy(pinfo->cinfo->col_buf[col], get_tcp_port(port), COL_MAX_LEN);
1133 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1135 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "tcp.srcport",
1138 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "tcp.dstport",
1140 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1141 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1146 g_strlcpy(pinfo->cinfo->col_buf[col], get_udp_port(port), COL_MAX_LEN);
1148 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1150 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "udp.srcport",
1153 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "udp.dstport",
1155 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1156 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1161 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.src_socket",
1164 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ddp.dst_socket",
1166 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", port);
1167 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", port);
1168 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1172 /* XXX - resolve IPX socket numbers */
1173 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%04x", port);
1175 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipx.src.socket",
1178 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "ipx.dst.socket",
1180 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%04x", port);
1181 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1185 /* XXX - resolve IDP socket numbers */
1186 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%04x", port);
1188 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "idp.src.socket",
1191 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "idp.dst.socket",
1193 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%04x", port);
1194 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1198 /* XXX - resolve USB endpoint numbers */
1199 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "0x%08x", port);
1201 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "usb.src.endpoint",
1204 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "usb.dst.endpoint",
1206 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "0x%08x", port);
1207 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1213 pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
1214 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1218 * XXX - this should be in some common code in the epan directory, shared
1219 * by this code and packet-isdn.c.
1221 static const value_string channel_vals[] = {
1257 col_set_circuit_id(packet_info *pinfo, int col)
1259 pinfo->cinfo->col_expr.col_expr[col][0] = '\0';
1260 pinfo->cinfo->col_expr.col_expr_val[col][0] = '\0';
1261 switch (pinfo->ctype) {
1264 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1265 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "fr.dlci", COL_MAX_LEN);
1266 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1267 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1271 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%s",
1272 val_to_str(pinfo->circuit_id, channel_vals, "Unknown (%u)"));
1273 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "isdn.channel",
1275 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1276 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1280 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1284 g_snprintf(pinfo->cinfo->col_buf[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1285 g_strlcpy(pinfo->cinfo->col_expr.col_expr[col], "isup.cic", COL_MAX_LEN);
1286 g_snprintf(pinfo->cinfo->col_expr.col_expr_val[col], COL_MAX_LEN, "%u", pinfo->circuit_id);
1287 pinfo->cinfo->col_expr.col_expr_val[col][COL_MAX_LEN - 1] = '\0';
1293 pinfo->cinfo->col_buf[col][COL_MAX_LEN - 1] = '\0';
1294 pinfo->cinfo->col_data[col] = pinfo->cinfo->col_buf[col];
1298 col_fill_in(packet_info *pinfo)
1302 for (i = 0; i < pinfo->cinfo->num_cols; i++) {
1303 switch (pinfo->cinfo->col_fmt[i]) {
1306 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->num);
1307 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1308 g_strlcpy(pinfo->cinfo->col_expr.col_expr[i], "frame.number",
1310 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[i], pinfo->cinfo->col_buf[i], COL_MAX_LEN);
1314 col_set_cls_time(pinfo->fd, pinfo->cinfo, i);
1318 col_set_abs_time(pinfo->fd, pinfo->cinfo, i);
1321 case COL_ABS_DATE_TIME:
1322 col_set_abs_date_time(pinfo->fd, pinfo->cinfo, i);
1326 col_set_rel_time(pinfo->fd, pinfo->cinfo, i);
1329 case COL_DELTA_TIME:
1330 col_set_delta_time(pinfo->fd, pinfo->cinfo, i);
1333 case COL_DELTA_TIME_DIS:
1334 col_set_delta_time_dis(pinfo->fd, pinfo->cinfo, i);
1337 case COL_REL_CONV_TIME:
1338 case COL_DELTA_CONV_TIME:
1339 break; /* Will be set by various dissectors */
1342 case COL_RES_SRC: /* COL_DEF_SRC is currently just like COL_RES_SRC */
1343 col_set_addr(pinfo, i, &pinfo->src, TRUE, TRUE);
1347 col_set_addr(pinfo, i, &pinfo->src, FALSE, TRUE);
1350 case COL_DEF_DL_SRC:
1351 case COL_RES_DL_SRC:
1352 col_set_addr(pinfo, i, &pinfo->dl_src, TRUE, TRUE);
1355 case COL_UNRES_DL_SRC:
1356 col_set_addr(pinfo, i, &pinfo->dl_src, FALSE, TRUE);
1359 case COL_DEF_NET_SRC:
1360 case COL_RES_NET_SRC:
1361 col_set_addr(pinfo, i, &pinfo->net_src, TRUE, TRUE);
1364 case COL_UNRES_NET_SRC:
1365 col_set_addr(pinfo, i, &pinfo->net_src, FALSE, TRUE);
1369 case COL_RES_DST: /* COL_DEF_DST is currently just like COL_RES_DST */
1370 col_set_addr(pinfo, i, &pinfo->dst, TRUE, FALSE);
1374 col_set_addr(pinfo, i, &pinfo->dst, FALSE, FALSE);
1377 case COL_DEF_DL_DST:
1378 case COL_RES_DL_DST:
1379 col_set_addr(pinfo, i, &pinfo->dl_dst, TRUE, FALSE);
1382 case COL_UNRES_DL_DST:
1383 col_set_addr(pinfo, i, &pinfo->dl_dst, FALSE, FALSE);
1386 case COL_DEF_NET_DST:
1387 case COL_RES_NET_DST:
1388 col_set_addr(pinfo, i, &pinfo->net_dst, TRUE, FALSE);
1391 case COL_UNRES_NET_DST:
1392 col_set_addr(pinfo, i, &pinfo->net_dst, FALSE, FALSE);
1395 case COL_DEF_SRC_PORT:
1396 case COL_RES_SRC_PORT: /* COL_DEF_SRC_PORT is currently just like COL_RES_SRC_PORT */
1397 col_set_port(pinfo, i, TRUE, TRUE);
1400 case COL_UNRES_SRC_PORT:
1401 col_set_port(pinfo, i, FALSE, TRUE);
1404 case COL_DEF_DST_PORT:
1405 case COL_RES_DST_PORT: /* COL_DEF_DST_PORT is currently just like COL_RES_DST_PORT */
1406 col_set_port(pinfo, i, TRUE, FALSE);
1409 case COL_UNRES_DST_PORT:
1410 col_set_port(pinfo, i, FALSE, FALSE);
1413 case COL_PROTOCOL: /* currently done by dissectors */
1414 case COL_INFO: /* currently done by dissectors */
1417 case COL_PACKET_LENGTH:
1418 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->pkt_len);
1419 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1420 g_strlcpy(pinfo->cinfo->col_expr.col_expr[i], "frame.pkt_len",
1422 g_strlcpy(pinfo->cinfo->col_expr.col_expr_val[i], pinfo->cinfo->col_buf[i], COL_MAX_LEN);
1425 case COL_CUMULATIVE_BYTES:
1426 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->fd->cum_bytes);
1427 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1431 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->oxid);
1432 pinfo->cinfo->col_buf[i][COL_MAX_LEN - 1] = '\0';
1433 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1437 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->rxid);
1438 pinfo->cinfo->col_buf[i][COL_MAX_LEN - 1] = '\0';
1439 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1442 case COL_IF_DIR: /* currently done by dissectors */
1445 case COL_CIRCUIT_ID:
1446 col_set_circuit_id(pinfo, i);
1450 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->src_idx);
1451 pinfo->cinfo->col_buf[i][COL_MAX_LEN - 1] = '\0';
1452 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1456 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "0x%x", pinfo->dst_idx);
1457 pinfo->cinfo->col_buf[i][COL_MAX_LEN - 1] = '\0';
1458 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1462 g_snprintf(pinfo->cinfo->col_buf[i], COL_MAX_LEN, "%u", pinfo->vsan);
1463 pinfo->cinfo->col_buf[i][COL_MAX_LEN - 1] = '\0';
1464 pinfo->cinfo->col_data[i] = pinfo->cinfo->col_buf[i];
1467 case COL_HPUX_SUBSYS: /* done by nettl disector */
1468 case COL_HPUX_DEVID: /* done by nettl disector */
1471 case COL_DCE_CALL: /* done by dcerpc */
1474 case COL_DCE_CTX: /* done by dcerpc */
1477 case COL_8021Q_VLAN_ID:
1480 case COL_DSCP_VALUE: /* done by packet-ip.c */
1483 case COL_COS_VALUE: /* done by packet-vlan.c */
1486 case COL_FR_DLCI: /* done by packet-fr.c */
1487 case COL_BSSGP_TLLI: /* done by packet-bssgp.c */
1490 case COL_EXPERT: /* done by expert.c */
1493 case COL_FREQ_CHAN: /* done by radio dissectors */
1496 case COL_CUSTOM: /* done by col_custom_set_fstr() called from proto.c */
1499 case NUM_COL_FMTS: /* keep compiler happy - shouldn't get here */
1500 g_assert_not_reached();