Index: GridProxy.cs =================================================================== --- GridProxy.cs (revision 2603) +++ GridProxy.cs (working copy) @@ -125,7 +125,8 @@ Console.WriteLine(" --proxy-remote-facing-address= communicate with server via "); Console.WriteLine(" --proxy-remote-login-uri= use SL login server at "); Console.WriteLine(" --log-all log all packets by default in Analyst"); - Console.WriteLine(" --log-whitelist= log packets listed in a file, one name per line"); + Console.WriteLine(" --log-whitelist= log packets listed in file, one name per line"); + Console.WriteLine(" --no-log-blacklist= don't log packets in file, one name per line"); Console.WriteLine(" --output= log Analyst output to a file"); Console.WriteLine(" --verbose display proxy notifications"); Console.WriteLine(" --quiet suppress proxy notifications"); Index: GridProxyLoader.cs =================================================================== --- GridProxyLoader.cs (revision 2603) +++ GridProxyLoader.cs (working copy) @@ -53,10 +53,23 @@ public ProxyFrame(string[] args) { + Init(args, null); + } + + public ProxyFrame(string[] args, ProxyConfig proxyConfig) + { + Init(args, proxyConfig); + } + + private void Init(string[] args, ProxyConfig proxyConfig) + { //bool externalPlugin = false; this.args = args; - ProxyConfig proxyConfig = new ProxyConfig("GridProxy", "Austin Jennings / Andrew Ortman", args); + if (proxyConfig == null) + { + proxyConfig = new ProxyConfig("GridProxy", "Austin Jennings / Andrew Ortman", args); + } proxy = new Proxy(proxyConfig); // add delegates for login Index: Plugins/Analyst.cs =================================================================== --- Plugins/Analyst.cs (revision 2603) +++ Plugins/Analyst.cs (working copy) @@ -79,6 +79,8 @@ LogAll(); else if (arg.Contains("--log-whitelist=")) LogWhitelist(arg.Substring(arg.IndexOf('=') + 1)); + else if (arg.Contains("--no-log-blacklist=")) + NoLogBlacklist(arg.Substring(arg.IndexOf('=') + 1)); else if (arg.Contains("--output=")) SetOutput(arg.Substring(arg.IndexOf('=') + 1)); @@ -743,6 +745,42 @@ } } + private void NoLogBlacklist(string blacklistFile) + { + try + { + string[] lines = File.ReadAllLines(blacklistFile); + int count = 0; + + for (int i = 0; i < lines.Length; i++) + { + string line = lines[i].Trim(); + if (line.Length == 0) + continue; + + PacketType pType; + + try + { + pType = packetTypeFromName(line); + string[] noLogStr = new string[] {"/-log", line}; + CmdNoLog(noLogStr); + ++count; + } + catch (ArgumentException) + { + Console.WriteLine("Bad packet name: " + line); + } + } + + Console.WriteLine(String.Format("Not logging {0} packet types loaded from blacklist", count)); + } + catch (Exception) + { + Console.WriteLine("Failed to load packet blacklist from " + blacklistFile); + } + } + private void SetOutput(string outputFile) { try @@ -793,7 +831,8 @@ if (logGrep == null || (logGrep != null && Regex.IsMatch(packetText, logGrep))) { - string line = String.Format("{0} {1,21} {2,5} {3}{4}{5}" + string line = String.Format("{0}\n{1} {2,21} {3,5} {4}{5}{6}" + , packet.Type , direction == Direction.Incoming ? "<--" : "-->" , endPoint , packet.Header.Sequence