<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7233.28">
<TITLE>differentiated karma in jabber1.x</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<P><FONT SIZE=2 FACE="Arial">What do people think about extending jabber configuration to allow you to specify karma settings, but also define a set of netmask IPs that would have unlimited access? Basically, you would allow additional tags that look like something this</FONT></P>
<P><FONT SIZE=2 FACE="Arial"><karmaExemptions></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><exempt netmask="192.168.255.255"/></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><exempt netmask="10.255.255.255"/></FONT>
<BR> <FONT SIZE=2 FACE="Arial"><exempt netmask="166.77.255.255"/></FONT>
<BR><FONT SIZE=2 FACE="Arial"></karmaExemptions></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm looking at jabberd/mio.c and it seems like this could be added with just a few lines of code, maybe along the lines of the following:</FONT></P>
<P><FONT SIZE=2 FACE="Arial">1. In mio_init() read any exemptions into an array</FONT>
<BR><FONT SIZE=2 FACE="Arial">2. In mio_listen (and mio_accept) after creating a new mio with mio_new(), compare the mio's ip with any exempt netmasks. If the new mio's ip is exempt, set mio->k.dec = 0.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Then again, I'm just scanning through the code and there could be dependencies that I don't understand. If I'm missing something, please let me know.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">CONTEXT FOR THIS:</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">I'm using jabber as the socket layer in a game engine. Flash game clients (I'm fairly invested in jabber1.x for it's Flash support), connect to jabber and join a game (MUC) room to recieve game events. Game state is primarily managed on an application server, which broadcasts game events to the same MUC rooms that the game clients are listening on. </FONT></P>
<P><FONT SIZE=2 FACE="Arial">The reason karma is a problem in this architecture is that the game application server is sending lots and lots of messages to jabber, spread out across the various game/MUC rooms. For this reason, I need karma *NOT* to be applied to the application server. On the other hand, I do want karma applied to game clients connecting over the Internet to help prevent malicious or misbehaving clients from taking jabber down. It seems like a good way to achieve this would be to distinquish the game servers by their private, in-network IPs and specifically exempt them from the karma system.</FONT></P>
<P><FONT SIZE=2 FACE="Arial">If there's a better way to handle this problem than what I described above, please chime in and let me know. If there isn't, I'll probably need to implement the extension described above (or convince real jabber developers to do it). If it does come to that, is this a change that the jabber community would be interested in having in the public release?</FONT></P>
<P><FONT SIZE=2 FACE="Arial">Thanks for your advice and help,</FONT>
<BR><FONT SIZE=2 FACE="Arial">--Larry Kirschner</FONT>
</P>
</BODY>
</HTML>