Hi Everybody!
I’‘ve just finished a first stab at a packet filter plugin. Currently the plugin allows you to create rules by defining a source, destination and packet type (iq,pressence,message). Based on the criteria you assign an action (drop,reject,pass). The first rule that matches gets executed. I’'ve taken some screen shots and uploaded them here :
http://picasaweb.google.com/nate.putnam/PacketFilter
If anybody is interested in trying this plugin out or would like some more info, shoot me a pm and I will help you out.
Cheers,
Nate
I am new to XMPP. I am trying to create a plug-in to OpenFire to gather incoming and outgoing XMPP packets and pass this info to a data processor. How do I go about creating the plug-in ? I will appreciate any help. Do I need to use the OpenFire java classes to gather this info ?
Spain,
There is a very good guide on writing plugins here :
http://www.igniterealtime.org/builds/openfire/docs/latest/documentation/plugin-d ev-guide.html
Basically you register your plugin to receive a copy of every packet, you can then do any processing you wish.
Cheers,
Nate
Hi Nate,
I went through the plugin developer guide but still have some questions. How do I register a plugin as a PacketInterceptor ? Could you show me some example code as to how to register ?
Shyamal Pain
-
implement PacketInterceptor interface.
-
implement interceptPacket() method:
public void interceptPacket(Packet packet, Session session, boolean incoming, boolean processed)
throws PacketRejectedException { /* ...your code here.... */
}
- register your interceptor when your plugin initializes:
InterceptorManager.getInstance().addInterceptor(this);
- unregister your interceptor when your plugin destroys:
InterceptorManager.getInstance().removeInterceptor(this);
Coolcat
Thanks coolcat ! It worked.
Shyamal