diff options
author | Guy Harris <guy@alum.mit.edu> | 2013-04-01 20:36:42 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2013-04-01 20:36:42 +0000 |
commit | 82a602d697b03314a11b3fd914dc7173fe18b293 (patch) | |
tree | 85adc187849d0ebcbcc2997db1edfab1ab15fd2f /file.c | |
parent | 2deedfb1e1288e79341bf05704f0662c251897e7 (diff) | |
download | wireshark-82a602d697b03314a11b3fd914dc7173fe18b293.tar.gz wireshark-82a602d697b03314a11b3fd914dc7173fe18b293.tar.bz2 wireshark-82a602d697b03314a11b3fd914dc7173fe18b293.zip |
Define a collection of bits for different types of capture file comments.
For each capture file type, have a bitset of comment types supported by
that capture file type.
Add a Wiretap routine that, for a given file type, returns the bitset of
comment types it supports.
Have wtap_get_savable_file_types() take a bitset of comment types that
need to be supported by the file types it returns.
Replace cf_has_comments() with a routine that returns a bitset of
capture file comment types in the capture file.
Use those routines in the capture file dialogs; don't wire in the notion
that pcap-NG supports all comment types and no other file formats
support any comment types. (That's currently true, but we don't want to
wire that in as being forever true.)
svn path=/trunk/; revision=48689
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -3858,12 +3858,18 @@ cf_update_packet_comment(capture_file *cf, frame_data *fdata, gchar *comment) } /* - * Does this capture file have any comments? + * What types of comments does this capture file have? */ -gboolean -cf_has_comments(capture_file *cf) +guint32 +cf_comment_types(capture_file *cf) { - return (cf_read_shb_comment(cf) != NULL || cf->packet_comment_count != 0); + guint32 comment_types = 0; + + if (cf_read_shb_comment(cf) != NULL) + comment_types |= WTAP_COMMENT_PER_SECTION; + if (cf->packet_comment_count != 0) + comment_types |= WTAP_COMMENT_PER_PACKET; + return comment_types; } typedef struct { |