GSList *src_list;
print_dissections_e print_dissections;
gboolean print_hex_for_data;
- char_enc encoding;
+ packet_char_enc encoding;
epan_dissect_t *edt;
} print_data;
};
static const gchar* get_field_hex_value(GSList* src_list, field_info *fi);
-const gchar* get_node_field_value(field_info* fi, epan_dissect_t* edt);
static void proto_tree_print_node(proto_node *node, gpointer data);
static void proto_tree_write_node_pdml(proto_node *node, gpointer data);
static const guint8 *get_field_data(GSList *src_list, field_info *fi);
static void write_pdml_field_hex_value(write_pdml_data *pdata, field_info *fi);
static gboolean print_hex_data_buffer(print_stream_t *stream, const guchar *cp,
- guint length, char_enc encoding);
+ guint length, packet_char_enc encoding);
static void ps_clean_string(unsigned char *out, const unsigned char *in,
int outbuf_size);
static void print_escaped_xml(FILE *fh, const char *unescaped_string);
/* Print geninfo.timestamp */
fprintf(fh,
" <field name=\"timestamp\" pos=\"0\" show=\"%s\" showname=\"Captured Time\" value=\"%d.%09d\" size=\"%u\"/>\n",
- abs_time_to_str(timestamp), (int) timestamp->secs, timestamp->nsecs, frame_finfo->length);
+ abs_time_to_str(timestamp, FALSE), (int) timestamp->secs, timestamp->nsecs, frame_finfo->length);
/* Print geninfo end */
fprintf(fh,
proto_tree_write_psml(epan_dissect_t *edt, FILE *fh)
{
gint i;
+ static gboolean structure_written = FALSE;
/* if this is the first packet, we have to create the PSML structure output */
- if(edt->pi.fd->num == 1) {
+ if(!structure_written) {
fprintf(fh, "<structure>\n");
for(i=0; i < edt->pi.cinfo->num_cols; i++) {
}
fprintf(fh, "</structure>\n\n");
+
+ structure_written = TRUE;
}
fprintf(fh, "<packet>\n");
static gboolean
print_hex_data_buffer(print_stream_t *stream, const guchar *cp,
- guint length, char_enc encoding)
+ guint length, packet_char_enc encoding)
{
register unsigned int ad, i, j, k, l;
guchar c;
* Start of a new line.
*/
j = 0;
- k = 0;
l = use_digits;
do {
l--;
line[j++] = binhex[c>>4];
line[j++] = binhex[c&0xf];
j++;
- if (encoding == CHAR_EBCDIC) {
+ if (encoding == PACKET_CHAR_ENC_CHAR_EBCDIC) {
c = EBCDIC_to_ASCII1(c);
}
line[k++] = c >= ' ' && c < 0x7f ? c : '.';
};
static print_stream_t *
-print_stream_text_allow(int to_file, FILE *fh)
+print_stream_text_alloc(int to_file, FILE *fh)
{
print_stream_t *stream;
output_text *output;
if (fh == NULL)
return NULL;
- return print_stream_text_allow(to_file, fh);
+ return print_stream_text_alloc(to_file, fh);
}
print_stream_t *
print_stream_text_stdio_new(FILE *fh)
{
- return print_stream_text_allow(TRUE, fh);
+ return print_stream_text_alloc(TRUE, fh);
}
typedef struct {