#define WTAP_ENCAP_SCTP 150
#define WTAP_ENCAP_INFINIBAND 151
#define WTAP_ENCAP_JUNIPER_SVCS 152
+#define WTAP_ENCAP_USBPCAP 153
#define WTAP_NUM_ENCAP_TYPES wtap_get_num_encap_types()
typedef struct wtap_reader *FILE_T;
+/*
+ * Types of comments.
+ */
+#define WTAP_COMMENT_PER_SECTION 0x00000001 /* per-file/per-file-section */
+#define WTAP_COMMENT_PER_INTERFACE 0x00000002 /* per-interface */
+#define WTAP_COMMENT_PER_PACKET 0x00000004 /* per-packet */
+
struct file_type_info {
/* the file type name */
/* should be NULL for all "pseudo" types that are only internally used and not read/writeable */
/* should be FALSE is this file type doesn't support name resolution records */
gboolean has_name_resolution;
+ /* what types of comment does this file support? */
+ guint32 supported_comment_types;
+
/* can this type write this encapsulation format? */
/* should be NULL is this file type doesn't have write support */
int (*can_write_encap)(int);
/*** dump packets into a capture file ***/
WS_DLL_PUBLIC
gboolean wtap_dump_can_open(int filetype);
-WS_DLL_PUBLIC
-gboolean wtap_dump_can_write_encap(int filetype, int encap);
/**
* Given a GArray of WTAP_ENCAP_ types, return the per-file encapsulation
int wtap_dump_file_encap_type(const GArray *file_encaps);
/**
- * Return TRUE if a capture with a given GArray of WTAP_ENCAP_ types
- * can be written in a specified format, and FALSE if it can't.
+ * Return TRUE if we can write this capture file format out in
+ * compressed form, FALSE if not.
*/
WS_DLL_PUBLIC
-gboolean wtap_dump_can_write_encaps(int ft, const GArray *file_encaps);
+gboolean wtap_dump_can_compress(int filetype);
+/**
+ * Return TRUE if this capture file format supports storing name
+ * resolution information in it, FALSE if not.
+ */
WS_DLL_PUBLIC
-gboolean wtap_dump_can_compress(int filetype);
gboolean wtap_dump_has_name_resolution(int filetype);
+/**
+ * Return TRUE if this capture file format supports all the comment
+ * types specified, FALSE if not.
+ */
+WS_DLL_PUBLIC
+gboolean wtap_dump_supports_comment_types(int filetype, guint32 comment_types);
+
WS_DLL_PUBLIC
wtap_dumper* wtap_dump_open(const char *filename, int filetype, int encap,
int snaplen, gboolean compressed, int *err);
WS_DLL_PUBLIC
gboolean wtap_dump_close(wtap_dumper *, int *);
+/**
+ * Return TRUE if we can write a file out with the given GArray of file
+ * encapsulations and the given bitmask of comment types.
+ */
+WS_DLL_PUBLIC
+gboolean wtap_dump_can_write(const GArray *file_encaps, guint32 required_comment_types);
+
/**
* Get a GArray of WTAP_FILE_ values for file types that can be used
* to save a file of a given type with a given GArray of WTAP_ENCAP_
- * types.
+ * types and the given bitmask of comment types.
*/
WS_DLL_PUBLIC
-GArray *wtap_get_savable_file_types(int file_type, const GArray *file_encaps);
+GArray *wtap_get_savable_file_types(int file_type, const GArray *file_encaps,
+ guint32 required_comment_types);
/*** various string converter functions ***/
WS_DLL_PUBLIC