Re: ARRAY CARP users

  • From: Christian.Schramm@xxxxxxxxxxxxxx
  • To: isalist@xxxxxxxxxxxxx
  • Date: Tue, 15 Jul 2003 15:47:25 +0200

Hi David,

Below is _not_ the original return from ISA server, but the hash function
which is responsible for URL routing is included. I hope this helps you any
further..

Greets,

Christian

-------------------------------------------------------------------

BackupRoute="PROXY 1.1.1.1:8080";

cNodes=2;

function MakeProxies(){
this[0]=new Node("1.1.1.2:8080",529326624,1.000000);
this[1]=new Node("1.1.1.3:8080",1471101161,1.000000);
}

Proxies = new MakeProxies();

function Node(name, hash, load){
 this.name = name;
 this.hash = hash;
 this.load = load;
 this.score = 0;
 return this;
}

function FindProxyForURL(url, host)
{
        if (isPlainHostName(host))
        return "DIRECT";

        var urlhash, ibest, bestscore, list, i, j;
        
        urlhash = HashString(url);
        
        for (i = 0; i < cNodes; i++)
          Proxies[i].score = Proxies[i].load * Scramble(MakeInt(urlhash ^
Proxies[i].hash));
        
        list = "";
        
        for (j = 0; j < cNodes; j++) {
                for (bestscore = -1, i = 0; i < cNodes; i++) {
                        if (Proxies[i].score > bestscore) {
                                bestscore = Proxies[i].score;
                                ibest = i;
                        }
                }

                Proxies[ibest].score = -1;
                list = list + "PROXY " + Proxies[ibest].name + "; ";
        }
 
 list = list + BackupRoute;
 return list;

}

function HashString(url){
 var h = 0;
 var slashes = 0;
 for (var i = 0; i < url.length; i++) {
  var c = url.charAt(i);
  if (c == '/')
   slashes++;
  if (slashes < 3)
   c = c.toLowerCase();
  h += (((h & 0x1fff) << 19) | ((h >> 13) & 0x7ffff)) + CharToAscii(c);
  h = MakeInt(h);
 }
 return h;
}

function Scramble(h){
 h += ((h & 0xffff) * 0x1965) + ((((h >> 16) & 0xffff) * 0x1965) << 16) +
(((h & 0xffff) * 0x6253) << 16);
 h = MakeInt(h);
 h += (((h & 0x7ff) << 21) | ((h >> 11) & 0x1fffff));
 return MakeInt(h);
}

var Chars ="
!\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghi
jklmnopqrstuvwxyz{|}~âÂ???????????ÂÅÂÂ????????????ÂÅ?ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ
ÂÂÂÂÂÂÂÂÂÂÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃÃ
 ";

function CharToAscii(c){
 return Chars.indexOf(c) + 32;
}

function MakeInt(x){
 if (x < 0) {
  return x + 4294967296;
 } else if (x >= 4294967296) {
  return x - 4294967296;
 }
 return x;
}

_-----------------------------------------------------------


> -----UrsprÃngliche Nachricht-----
> Von: David Farinic [mailto:davidf@xxxxxxx] 
> Gesendet: Dienstag, 15. Juli 2003 15:37
> An: [ISAserver.org Discussion List]
> Betreff: [isalist] Re: ARRAY CARP users
> 
> 
> http://www.ISAserver.org
> 
> 
> I just want to see form and extend of data information 
> returned within ISA arrays with CARP switched on. As one of 
> data returned is used for hashing in CARP... and I am solving 
> some small problem to reassure same URL routing with CARP ON.
> 
> David FArinic
> -----Original Message-----
> From: Jim Harrison [mailto:jim@xxxxxxxxxxxx] 
> Sent: Tuesday, July 15, 2003 3:29 PM
> To: [ISAserver.org Discussion List]
> Subject: [isalist] Re: ARRAY CARP users
> 
> http://www.ISAserver.org
> 
> 
> What are you looking for?
> 
>   Jim Harrison
>   MCP(NT4, W2K), A+, Network+, PCG
>   http://isaserver.org/Jim_Harrison/
>   http://isatools.org
>   Read the help / books / articles!
> 
> 
> 
> http://www.ISAserver.org
> 
> 
>  
> Hi ISA ppl,
>  
> Can anybody, who has ISA array, request url: 
> http://ip_of_one_of_your_isa_servers:8080/array.dll?Get.Info.v1
> via browser and paste me result page? (u can hide any ips or private
> informations)
>  
> Thank You David Farinic
>  
>  
> 
> This mail was content-checked for malicious code and viruses
> by GFI MailSecurity. GFI MailSecurity provides email content 
> checking, exploit detection and anti-virus for Exchange & 
> SMTP servers. Spam, viruses, dangerous attachments and 
> offensive content are removed automatically. Key features 
> include: Multiple virus engines; Email content & attachment 
> checking; Exploit shield - email intrusion detection & defence; 
> Email threats engine - analyses & defuses HTML scripts, 
> .exe files & more. 
> 
> 
> 
> In addition to GFI MailSecurity, GFI also produces the GFI 
> FAXmaker fax server & GFI LANguard network security product 
> ranges. For more information on our products, please visit 
> http://www.gfi.com. This disclaimer was sent by GFI MailEssentials 
> for Exchange/SMTP.
> 
> 
> 
> 
> ------------------------------------------------------
> List Archives: http://www.webelists.com/cgi/lyris.pl?enter=isalist
> ISA Server Newsletter: http://www.isaserver.org/pages/newsletter.asp
> ISA Server FAQ: http://www.isaserver.org/pages/larticle.asp?type=FAQ
> ------------------------------------------------------
> Other Internet Software Marketing Sites:
> Leading Network Software Directory: 
> http://www.serverfiles.com No.1 Exchange Server Resource 
> Site: http://www.msexchange.org Windows Security Resource 
> Site: http://www.windowsecurity.com/ Network Security 
> Library: http://www.secinf.net/ Windows 2000/NT Fax 
> Solutions: http://www.ntfaxfaq.com
> ------------------------------------------------------
> You are currently subscribed to this ISAserver.org Discussion 
> List as: jim@xxxxxxxxxxxx To unsubscribe send a blank email 
> to $subst('Email.Unsub')
> 
> ------------------------------------------------------
> List Archives: http://www.webelists.com/cgi/lyris.pl?enter=isalist
> ISA Server Newsletter: http://www.isaserver.org/pages/newsletter.asp
> ISA Server FAQ: http://www.isaserver.org/pages/larticle.asp?type=FAQ
> ------------------------------------------------------
> Other Internet Software Marketing Sites:
> Leading Network Software Directory: 
> http://www.serverfiles.com No.1 Exchange > Server Resource 
> Site: http://www.msexchange.org Windows Security Resource 
> Site: http://www.windowsecurity.com/ Network Security 
> Library: http://www.secinf.net/ Windows 2000/NT Fax 
> Solutions: http://www.ntfaxfaq.com
> ------------------------------------------------------
> You are currently subscribed to this ISAserver.org Discussion 
> List as: davidf@xxxxxxx To unsubscribe send a blank email to 
> $subst('Email.Unsub')
> 
> ------------------------------------------------------
> List Archives: http://www.webelists.com/cgi/lyris.pl?enter=isalist
> ISA Server Newsletter: http://www.isaserver.org/pages/newsletter.asp
> ISA Server FAQ: http://www.isaserver.org/pages/larticle.asp?type=FAQ
> ------------------------------------------------------
> Other Internet Software Marketing Sites:
> Leading Network Software Directory: 
> http://www.serverfiles.com No.1 Exchange > Server Resource 
> Site: http://www.msexchange.org Windows Security Resource 
> Site: http://www.windowsecurity.com/ Network Security 
> Library: http://www.secinf.net/ Windows 2000/NT Fax 
> Solutions: http://www.ntfaxfaq.com
> ------------------------------------------------------
> You are currently subscribed to this ISAserver.org Discussion 
> List as: christian.schramm@xxxxxxxxxxxxxx To unsubscribe send 
> a blank email to $subst('Email.Unsub')
> 


Other related posts: