diff options
author | Olivier Abad <oabad@noos.fr> | 1999-12-09 20:43:38 +0000 |
---|---|---|
committer | Olivier Abad <oabad@noos.fr> | 1999-12-09 20:43:38 +0000 |
commit | 564a1c1d6206191861c7f84cca6b3d67cbd4d95b (patch) | |
tree | 49c64c31482630cdc9a7b3f9c95d571e3e1cbcc8 /packet-tcp.c | |
parent | d66ee4b1c45dd252456f06659ac564a9c1818cea (diff) | |
download | wireshark-564a1c1d6206191861c7f84cca6b3d67cbd4d95b.tar.gz wireshark-564a1c1d6206191861c7f84cca6b3d67cbd4d95b.tar.bz2 wireshark-564a1c1d6206191861c7f84cca6b3d67cbd4d95b.zip |
plugins support (i.e. Dynamically loadable dissectors)
depends on dlopen() being available on the target platform
svn path=/trunk/; revision=1263
Diffstat (limited to 'packet-tcp.c')
-rw-r--r-- | packet-tcp.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/packet-tcp.c b/packet-tcp.c index b2f0174e02..7e922e197c 100644 --- a/packet-tcp.c +++ b/packet-tcp.c @@ -1,7 +1,7 @@ /* packet-tcp.c * Routines for TCP packet disassembly * - * $Id: packet-tcp.c,v 1.52 1999/12/09 04:06:53 nneul Exp $ + * $Id: packet-tcp.c,v 1.53 1999/12/09 20:41:25 oabad Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@zing.org> @@ -37,7 +37,7 @@ #include <stdio.h> #include <glib.h> -#include "packet.h" +#include "globals.h" #include "resolv.h" #include "follow.h" #include "util.h" @@ -51,6 +51,10 @@ # include "snprintf.h" #endif +#ifdef HAVE_DLFCN_H +#include "plugins.h" +#endif + #ifndef __PACKET_IP_H__ #include "packet-ip.h" #endif @@ -482,6 +486,22 @@ dissect_tcp(const u_char *pd, int offset, frame_data *fd, proto_tree *tree) { (it could be an ACK-only packet) */ if (packet_max > offset) { + /* try to apply the plugins */ +#ifdef HAVE_DLFCN_H + plugin *pt_plug = plugin_list; + + if (pt_plug) { + while (pt_plug) { + if (pt_plug->enabled && !strcmp(pt_plug->protocol, "tcp") && + tree && dfilter_apply(pt_plug->filter, tree, pd)) { + pt_plug->dissector(pd, offset, fd, tree); + goto reas; + } + pt_plug = pt_plug->next; + } + } +#endif + /* ONC RPC. We can't base this on anything in the TCP header; we have to look at the payload. If "dissect_rpc()" returns TRUE, it was an RPC packet, otherwise it's some other type of packet. */ |