aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:22:32 +0000
committerLuis Ontanon <luis.ontanon@gmail.com>2007-05-25 17:22:32 +0000
commit11f06217ced22efb25ff4157216622ea24da7cab (patch)
tree2ff6203726b046cb044b2ba9f79980fd79fea61d /editcap.c
parentc22f70ec1be27d319953eaa4e37e73fec6810d42 (diff)
Have editcap and capinfos loading the wiretap plugins.
epan/filesystem.c have get_plugin_dir() calling init_plugin_dir() if necessary epan/epan.c and epan/report_err.c move the report_failure family into the new report_err.c file, have epan_init() calling the initializer epan/plugins.h and epan/proto.c do not have init_plugins() calling the proto_reg functions instead do it in init_proto() gtk/main.c and tshark.c init_plugin_dir() has become suprefluous capinfos.c and editcap.c load the wiretap plugins Makefiles do what's needed to build withe the above changes. svn path=/trunk/; revision=21935
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/editcap.c b/editcap.c
index 2a11bf7a10..4a033d351a 100644
--- a/editcap.c
+++ b/editcap.c
@@ -15,6 +15,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <stdarg.h>
/*
* Just make sure we include the prototype for strptime as well
@@ -54,6 +55,9 @@
#endif
#include "epan/crypt/crypt-md5.h"
+#include "epan/plugins.h"
+#include "epan/report_err.h"
+#include "epan/filesystem.h"
#include "svnversion.h"
@@ -346,6 +350,14 @@ static void list_encap_types(void) {
}
}
+static void
+failure_message(const char *msg_format, va_list ap)
+{
+ fprintf(stderr, "editcap: ");
+ vfprintf(stderr, msg_format, ap);
+ fprintf(stderr, "\n");
+}
+
int main(int argc, char *argv[])
{
@@ -368,9 +380,19 @@ int main(int argc, char *argv[])
int split_packet_count = 0;
int written_count = 0;
char *filename;
-
- /* Process the options first */
-
+ char* init_progfile_dir_error;
+
+ /* Register wiretap plugins */
+ if ((init_progfile_dir_error = init_progfile_dir(argv[0]))) {
+ g_warning("capinfos: init_progfile_dir(): %s", init_progfile_dir_error);
+ g_free(init_progfile_dir_error);
+ } else {
+ init_report_err(failure_message,NULL,NULL);
+ init_plugins();
+ register_all_wiretap_modules();
+ }
+
+ /* Process the options */
while ((opt = getopt(argc, argv, "A:B:c:C:dE:F:hrs:t:T:v")) !=-1) {
switch (opt) {