"print_file()" is no longer used; nuke it.
svn path=/trunk/; revision=1430
This commit is contained in:
parent
dccccd9c9d
commit
408e41d6ed
59
print.c
59
print.c
|
@ -1,7 +1,7 @@
|
||||||
/* print.c
|
/* print.c
|
||||||
* Routines for printing packet analysis trees.
|
* Routines for printing packet analysis trees.
|
||||||
*
|
*
|
||||||
* $Id: print.c,v 1.26 2000/01/06 07:33:22 guy Exp $
|
* $Id: print.c,v 1.27 2000/01/07 00:36:25 guy Exp $
|
||||||
*
|
*
|
||||||
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
||||||
*
|
*
|
||||||
|
@ -49,8 +49,6 @@ static void print_hex_data_text(FILE *fh, register const u_char *cp,
|
||||||
register u_int length, char_enc encoding);
|
register u_int length, char_enc encoding);
|
||||||
static void print_hex_data_ps(FILE *fh, register const u_char *cp,
|
static void print_hex_data_ps(FILE *fh, register const u_char *cp,
|
||||||
register u_int length, char_enc encoding);
|
register u_int length, char_enc encoding);
|
||||||
static void print_ps_file(FILE* target_fh, FILE* source_fh);
|
|
||||||
static void print_text_file(FILE* target_fh, FILE* source_fh);
|
|
||||||
|
|
||||||
extern int proto_data; /* in packet-data.c */
|
extern int proto_data; /* in packet-data.c */
|
||||||
|
|
||||||
|
@ -98,20 +96,6 @@ void print_finale(FILE *fh, gint format)
|
||||||
print_ps_finale(fh);
|
print_ps_finale(fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_file(FILE* fh, const char* filename, gint format)
|
|
||||||
{
|
|
||||||
FILE* fh2 = fopen(filename, "r");
|
|
||||||
if (fh2 == NULL) {
|
|
||||||
fprintf(stderr, "Could not open file %s for reading.\n", filename);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (format == PR_FMT_PS)
|
|
||||||
print_ps_file(fh, fh2);
|
|
||||||
else
|
|
||||||
print_text_file(fh, fh2);
|
|
||||||
}
|
|
||||||
|
|
||||||
void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
|
void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
|
||||||
GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh)
|
GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh)
|
||||||
{
|
{
|
||||||
|
@ -211,9 +195,9 @@ void print_hex_data_text(FILE *fh, register const u_char *cp,
|
||||||
register int ad, i, j, k;
|
register int ad, i, j, k;
|
||||||
u_char c;
|
u_char c;
|
||||||
u_char line[60];
|
u_char line[60];
|
||||||
static u_char binhex[16] = {
|
static u_char binhex[16] = {
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
|
|
||||||
memset (line, ' ', sizeof line);
|
memset (line, ' ', sizeof line);
|
||||||
line[sizeof (line)-1] = 0;
|
line[sizeof (line)-1] = 0;
|
||||||
|
@ -320,10 +304,10 @@ void print_hex_data_ps(FILE *fh, register const u_char *cp,
|
||||||
register int ad, i, j, k;
|
register int ad, i, j, k;
|
||||||
u_char c;
|
u_char c;
|
||||||
u_char line[60];
|
u_char line[60];
|
||||||
static u_char binhex[16] = {
|
static u_char binhex[16] = {
|
||||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'};
|
||||||
u_char psline[MAX_LINE_LENGTH];
|
u_char psline[MAX_LINE_LENGTH];
|
||||||
|
|
||||||
print_ps_hex(fh);
|
print_ps_hex(fh);
|
||||||
memset (line, ' ', sizeof line);
|
memset (line, ' ', sizeof line);
|
||||||
|
@ -347,34 +331,13 @@ void print_hex_data_ps(FILE *fh, register const u_char *cp,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line[0] != ' ') {
|
if (line[0] != ' ') {
|
||||||
ps_clean_string(psline, line, MAX_LINE_LENGTH);
|
ps_clean_string(psline, line, MAX_LINE_LENGTH);
|
||||||
fprintf (fh, "(%4x %s) hexdump\n", ad, psline);
|
fprintf (fh, "(%4x %s) hexdump\n", ad, psline);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
|
||||||
void print_text_file(FILE* target_fh, FILE* source_fh)
|
|
||||||
{
|
|
||||||
gchar buffer[MAX_LINE_LENGTH];
|
|
||||||
while (fgets(buffer, sizeof(buffer), source_fh) != NULL) {
|
|
||||||
fputs(buffer, target_fh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static
|
|
||||||
void print_ps_file(FILE* target_fh, FILE* source_fh)
|
|
||||||
{
|
|
||||||
gchar buffer[MAX_LINE_LENGTH];
|
|
||||||
gchar ps_buffer[MAX_LINE_LENGTH];
|
|
||||||
|
|
||||||
while (fgets(buffer, sizeof(buffer), source_fh) != NULL) {
|
|
||||||
ps_clean_string(ps_buffer, buffer, MAX_LINE_LENGTH);
|
|
||||||
fputs(ps_buffer, target_fh);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void print_line(FILE *fh, gint format, char *line)
|
void print_line(FILE *fh, gint format, char *line)
|
||||||
{
|
{
|
||||||
char psbuffer[MAX_LINE_LENGTH]; /* static sized buffer! */
|
char psbuffer[MAX_LINE_LENGTH]; /* static sized buffer! */
|
||||||
|
|
3
print.h
3
print.h
|
@ -1,7 +1,7 @@
|
||||||
/* print.h
|
/* print.h
|
||||||
* Definitions for printing packet analysis trees.
|
* Definitions for printing packet analysis trees.
|
||||||
*
|
*
|
||||||
* $Id: print.h,v 1.16 2000/01/06 07:33:23 guy Exp $
|
* $Id: print.h,v 1.17 2000/01/07 00:36:25 guy Exp $
|
||||||
*
|
*
|
||||||
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
* Gilbert Ramirez <gram@verdict.uthscsa.edu>
|
||||||
*
|
*
|
||||||
|
@ -50,7 +50,6 @@ FILE *open_print_dest(int to_file, const char *dest);
|
||||||
void close_print_dest(int to_file, FILE *fh);
|
void close_print_dest(int to_file, FILE *fh);
|
||||||
void print_preamble(FILE *fh, gint format);
|
void print_preamble(FILE *fh, gint format);
|
||||||
void print_finale(FILE *fh, gint format);
|
void print_finale(FILE *fh, gint format);
|
||||||
void print_file(FILE* fh, const char* filename, gint format);
|
|
||||||
void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
|
void proto_tree_print(gboolean print_one_packet, print_args_t *print_args,
|
||||||
GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh);
|
GNode *protocol_tree, const u_char *pd, frame_data *fd, FILE *fh);
|
||||||
void print_hex_data(FILE *fh, gint format, register const u_char *cp,
|
void print_hex_data(FILE *fh, gint format, register const u_char *cp,
|
||||||
|
|
Loading…
Reference in New Issue