*
* $Id$
*
- * Ethereal - Network traffic analyzer
- * By Gerald Combs <gerald@ethereal.com>
+ * Wireshark - Network traffic analyzer
+ * By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* This program is free software; you can redistribute it and/or
#define BUFFER_SIZE 1024
-void start_code(FILE *fd, char *func);
+void start_code(FILE *fd, const char *func);
void write_code(FILE *fd, char *string);
void end_code(FILE *fd);
void ps_clean_string(char *out, const char *in,
int outbuf_size);
-enum ps_state { null, preamble, hex, finale };
+enum ps_state { null, preamble, finale };
int main(int argc, char **argv)
{
while (fgets(buf, BUFFER_SIZE - 1, input)) {
if (state == null) {
- if (strcmp(buf, "% ---- ethereal preamble start ---- %\n") == 0) {
+ if (strcmp(buf, "% ---- wireshark preamble start ---- %\n") == 0) {
state = preamble;
start_code(output, "preamble");
continue;
}
- else if (strcmp(buf, "% ---- ethereal finale start ---- %\n") == 0) {
+ else if (strcmp(buf, "% ---- wireshark finale start ---- %\n") == 0) {
state = finale;
start_code(output, "finale");
continue;
}
}
else if (state == preamble) {
- if (strcmp(buf, "% ---- ethereal preamble end ---- %\n") == 0) {
- state = null;
- end_code(output);
- continue;
- }
- else {
- write_code(output, buf);
- }
- }
- else if (state == hex) {
- if (strcmp(buf, "% ---- ethereal hex end ---- %\n") == 0) {
+ if (strcmp(buf, "% ---- wireshark preamble end ---- %\n") == 0) {
state = null;
end_code(output);
continue;
}
}
else if (state == finale) {
- if (strcmp(buf, "% ---- ethereal finale end ---- %\n") == 0) {
+ if (strcmp(buf, "% ---- wireshark finale end ---- %\n") == 0) {
state = null;
end_code(output);
continue;
exit(0);
}
-void start_code(FILE *fd, char *func)
+void start_code(FILE *fd, const char *func)
{
fprintf(fd, "/* Created by rdps.c. Do not edit! */\n");
fprintf(fd, "void print_ps_%s(FILE *fd) {\n", func);