From a007ec855402c54c7829acfc69d2ec03d7920cb8 Mon Sep 17 00:00:00 2001 From: Jim Radford Date: Mon, 20 Apr 2009 06:57:07 +0000 Subject: [PATCH] LIBOMV-477 Finished UpdateNotecardAgentInventoryMessage class for Message system (Still need unit test) LIBOMV-496 Implements new ObservableDictionary class * Switched out KnownCaps dictionary in GridProxy to use new ObservableDictionary. LIBOMV-495 Fixes bug while loading saved settings file in WinGridProxy.AboutBox1.resources LIBOMV-492 Enhancements to WinGridProxy: * All Selection and Filtering menu uptions should work properly now * Made several setting optional in the File and Session menu * Filter preferences can be saved and restored (ie: white/blacklist like in GridProxy) * Work has began on WinGridProxy session searching * Switched out CheckedListBoxes for ListViews since they have more flexibility * Refactored WinGridProxy into multuple classes, major code cleanup * Capabilities discovered and events sent via the EventQueue are automatically added to the Messages Filter listview git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2630 52acb1d6-8a22-11de-b505-999d5b087335 --- OpenMetaverse/Messages/LindenMessages.cs | 3 +- OpenMetaverse/Messages/MessageEventDecoder.cs | 4 +- Programs/GridProxy/GridProxy.cs | 5 +- Programs/WinGridProxy/Form1.Designer.cs | 1181 +++++++++------- Programs/WinGridProxy/Form1.cs | 1253 +++++++++++------ Programs/WinGridProxy/Form1.resx | 53 +- .../FormSessionSearch.Designer.cs | 256 ++++ Programs/WinGridProxy/FormSessionSearch.cs | 99 ++ Programs/WinGridProxy/FormSessionSearch.resx | 123 ++ Programs/WinGridProxy/ListViewNoFlicker.cs | 116 +- .../WinGridProxy/Properties/Resources.resx | 3 - Programs/WinGridProxy/ProxyManager.cs | 211 +++ Programs/WinGridProxy/Resources/Help.png | Bin 892 -> 0 bytes Programs/WinGridProxy/SettingsStore.cs | 98 +- 14 files changed, 2409 insertions(+), 996 deletions(-) create mode 100644 Programs/WinGridProxy/FormSessionSearch.Designer.cs create mode 100644 Programs/WinGridProxy/FormSessionSearch.cs create mode 100644 Programs/WinGridProxy/FormSessionSearch.resx create mode 100644 Programs/WinGridProxy/ProxyManager.cs delete mode 100644 Programs/WinGridProxy/Resources/Help.png diff --git a/OpenMetaverse/Messages/LindenMessages.cs b/OpenMetaverse/Messages/LindenMessages.cs index 4a507240..99a7646e 100644 --- a/OpenMetaverse/Messages/LindenMessages.cs +++ b/OpenMetaverse/Messages/LindenMessages.cs @@ -1084,7 +1084,8 @@ namespace OpenMetaverse.Messages.Linden } } - public class UpdateNotecardAgentInventoryMessage + // TODO: Add Test + public class UpdateNotecardAgentInventoryMessage : IMessage { public UUID ItemID; diff --git a/OpenMetaverse/Messages/MessageEventDecoder.cs b/OpenMetaverse/Messages/MessageEventDecoder.cs index 1887bfa8..9af1d4cb 100644 --- a/OpenMetaverse/Messages/MessageEventDecoder.cs +++ b/OpenMetaverse/Messages/MessageEventDecoder.cs @@ -71,6 +71,8 @@ namespace OpenMetaverse case "UpdateScriptTask": message = new UpdateScriptTaskMessage(); break; case "UpdateScriptAgent": message = new UpdateScriptAgentMessage(); break; case "SendPostcard": message = new SendPostcardMessage(); break; + case "UpdateNotecardAgentInventory": message = new UpdateNotecardAgentInventoryMessage(); break; + // Capabilities TODO: // DispatchRegionInfo @@ -83,13 +85,11 @@ namespace OpenMetaverse // RequestTextureDownload // SearchStatRequest // SearchStatTracking - // SendPostcard // SendUserReport // SendUserReportWithScreenshot // ServerReleaseNotes // StartGroupProposal // UpdateGestureAgentInventory - // UpdateNotecardAgentInventory // UpdateGestureTaskInventory // UpdateNotecardTaskInventory // ViewerStartAuction diff --git a/Programs/GridProxy/GridProxy.cs b/Programs/GridProxy/GridProxy.cs index 3d5bc4f5..f970464e 100644 --- a/Programs/GridProxy/GridProxy.cs +++ b/Programs/GridProxy/GridProxy.cs @@ -592,7 +592,7 @@ namespace GridProxy } - public Dictionary KnownCaps; + public ObservableDictionary KnownCaps = new ObservableDictionary(); //private Dictionary SubHack = new Dictionary(); private void ProxyCaps(NetworkStream netStream, string meth, string uri, Dictionary headers, byte[] content, int reqNo) @@ -997,7 +997,6 @@ namespace GridProxy #endif } } - return false; } @@ -1184,7 +1183,7 @@ namespace GridProxy { foreach (SimProxy simProxy in simProxies.Values) simProxy.Reset(); - KnownCaps = new Dictionary(); + KnownCaps.Clear(); //= new ObservableDictionary(); } private byte[] receiveBuffer = new byte[8192]; diff --git a/Programs/WinGridProxy/Form1.Designer.cs b/Programs/WinGridProxy/Form1.Designer.cs index 3275757e..162cae1a 100644 --- a/Programs/WinGridProxy/Form1.Designer.cs +++ b/Programs/WinGridProxy/Form1.Designer.cs @@ -40,6 +40,42 @@ this.textBoxProxyListenIP = new System.Windows.Forms.TextBox(); this.panel2 = new System.Windows.Forms.Panel(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.listViewSessions = new WinGridProxy.ListViewNoFlicker(); + this.columnHeaderCounter = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderProtocol = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderType = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderSize = new System.Windows.Forms.ColumnHeader(); + this.columnHeaderUrl = new System.Windows.Forms.ColumnHeader(); + this.contextMenuStripSessions = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItemAutoScroll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripRemove = new System.Windows.Forms.ContextMenuStrip(this.components); + this.toolStripMenuItemRemoveAll = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItemRemoveSelected = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItemRemoveUnselected = new System.Windows.Forms.ToolStripMenuItem(); + this.selectToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripSelect = new System.Windows.Forms.ContextMenuStrip(this.components); + this.allToolStripMenuItem4 = new System.Windows.Forms.ToolStripMenuItem(); + this.invertToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.noneToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparatorSelectPacketProto = new System.Windows.Forms.ToolStripSeparator(); + this.toolStripMenuItemSelectPacketName = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripMenuItemSelectProtocol = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparatorFilterPacketByName = new System.Windows.Forms.ToolStripSeparator(); + this.enableDisableFilterByNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); + this.markToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripMark = new System.Windows.Forms.ContextMenuStrip(this.components); + this.redToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.goldToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.greenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.blueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.orangeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); + this.unmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); + this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.imageList1 = new System.Windows.Forms.ImageList(this.components); this.tabControl1 = new System.Windows.Forms.TabControl(); this.tabPageSummary = new System.Windows.Forms.TabPage(); @@ -61,13 +97,15 @@ this.label4 = new System.Windows.Forms.Label(); this.tabPageFilters = new System.Windows.Forms.TabPage(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); + this.checkBoxCheckAllPackets = new System.Windows.Forms.CheckBox(); this.grpUDPFilters = new System.Windows.Forms.GroupBox(); - this.checkedListBoxFiltersPackets = new System.Windows.Forms.CheckedListBox(); - this.checkBox2 = new System.Windows.Forms.CheckBox(); - this.button2 = new System.Windows.Forms.Button(); + this.listViewPacketFilters = new WinGridProxy.ListViewNoFlicker(); + this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); + this.checkBoxCheckAllMessages = new System.Windows.Forms.CheckBox(); + this.buttonRefreshKnownCaps = new System.Windows.Forms.Button(); this.grpCapsFilters = new System.Windows.Forms.GroupBox(); - this.checkedListBoxFiltersMessages = new System.Windows.Forms.CheckedListBox(); + this.listViewMessageFilters = new WinGridProxy.ListViewNoFlicker(); + this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); this.tabPageInspect = new System.Windows.Forms.TabPage(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.tabControlInspectorRequest = new System.Windows.Forms.TabControl(); @@ -89,38 +127,50 @@ this.labelResponseHex = new System.Windows.Forms.ToolStripStatusLabel(); this.hexBoxResponse = new Be.Windows.Forms.HexBox(); this.tabPageInject = new System.Windows.Forms.TabPage(); + this.radioButtonViewer = new System.Windows.Forms.RadioButton(); + this.radioButtonSimulator = new System.Windows.Forms.RadioButton(); this.button3 = new System.Windows.Forms.Button(); this.buttonInjectPacket = new System.Windows.Forms.Button(); this.richTextBoxInject = new System.Windows.Forms.RichTextBox(); + this.removeToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); + this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.markToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripLabelHexEditorRequest = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripFileMenu = new System.Windows.Forms.ToolStripDropDownButton(); this.captureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator7 = new System.Windows.Forms.ToolStripSeparator(); - this.loadSessionArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveSessionArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.loadSessionArchiveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator(); this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.autoScrollSessionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.enableStatisticsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveOptionsOnExitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.startProxyOnStartupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator9 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.EditToolStripButton = new System.Windows.Forms.ToolStripDropDownButton(); this.copyToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.removeToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.selectedToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.unselectedToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.allToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.selectToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.allToolStripMenuItem3 = new System.Windows.Forms.ToolStripMenuItem(); - this.invertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.noneToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); + this.contextMenuStripCopy = new System.Windows.Forms.ContextMenuStrip(this.components); + this.requestDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.responseDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.hostAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.packetMessageTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator10 = new System.Windows.Forms.ToolStripSeparator(); - this.markToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator12 = new System.Windows.Forms.ToolStripSeparator(); this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.toolStripDropDownButton5 = new System.Windows.Forms.ToolStripDropDownButton(); + this.saveFilterSelectionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.loadFilterSelectionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); + this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.autoAddNewDiscoveredMessagesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripDropDownButton4 = new System.Windows.Forms.ToolStripDropDownButton(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.aboutWinGridProxyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.timer1 = new System.Windows.Forms.Timer(this.components); this.toolStripDropDownButton1 = new System.Windows.Forms.ToolStripDropDownButton(); this.captureTrafficToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); @@ -153,48 +203,19 @@ this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.loadToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripButton1 = new System.Windows.Forms.ToolStripDropDownButton(); - this.aboutWinGridProxyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.timer1 = new System.Windows.Forms.Timer(this.components); - this.contextMenuStripSessions = new System.Windows.Forms.ContextMenuStrip(this.components); - this.toolStripMenuItemAutoScroll = new System.Windows.Forms.ToolStripMenuItem(); - this.listViewSessions = new WinGridProxy.ListViewNoFlicker(); - this.columnHeaderCounter = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderProtocol = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderType = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderSize = new System.Windows.Forms.ColumnHeader(); - this.columnHeaderUrl = new System.Windows.Forms.ColumnHeader(); - this.toolStripSeparator13 = new System.Windows.Forms.ToolStripSeparator(); - this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItemRemoveThis = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.removeAllProtocolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.removeAllHostToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator14 = new System.Windows.Forms.ToolStripSeparator(); - this.packetNameToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.protocolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator15 = new System.Windows.Forms.ToolStripSeparator(); - this.findToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.autoScrollSessionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator16 = new System.Windows.Forms.ToolStripSeparator(); - this.markToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuStripMarkDropdown = new System.Windows.Forms.ContextMenuStrip(this.components); - this.redToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.greenToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.blueToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.orangeToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); - this.toolStripSeparator17 = new System.Windows.Forms.ToolStripSeparator(); - this.unmarkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.goldToolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem(); - this.contextMenuStripCopy = new System.Windows.Forms.ContextMenuStrip(this.components); - this.requestDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.responseDataToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.hostAddressToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); - this.packetMessageTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); + this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog(); + this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); + this.saveFileDialog2 = new System.Windows.Forms.SaveFileDialog(); + this.openFileDialog2 = new System.Windows.Forms.OpenFileDialog(); this.panelProxyConfig.SuspendLayout(); this.panel2.SuspendLayout(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); + this.contextMenuStripSessions.SuspendLayout(); + this.contextMenuStripRemove.SuspendLayout(); + this.contextMenuStripSelect.SuspendLayout(); + this.contextMenuStripMark.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPageSummary.SuspendLayout(); this.panel1.SuspendLayout(); @@ -222,8 +243,6 @@ this.statusStrip1.SuspendLayout(); this.tabPageInject.SuspendLayout(); this.toolStrip1.SuspendLayout(); - this.contextMenuStripSessions.SuspendLayout(); - this.contextMenuStripMarkDropdown.SuspendLayout(); this.contextMenuStripCopy.SuspendLayout(); this.SuspendLayout(); // @@ -283,7 +302,7 @@ this.button1.TabIndex = 2; this.button1.Text = "Start Proxy"; this.button1.UseVisualStyleBackColor = true; - this.button1.Click += new System.EventHandler(this.button1_Click); + this.button1.Click += new System.EventHandler(this.buttonStartProxy_Click); // // label1 // @@ -332,6 +351,283 @@ this.splitContainer1.SplitterDistance = 464; this.splitContainer1.TabIndex = 0; // + // listViewSessions + // + this.listViewSessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeaderCounter, + this.columnHeaderProtocol, + this.columnHeaderType, + this.columnHeaderSize, + this.columnHeaderUrl}); + this.listViewSessions.ContextMenuStrip = this.contextMenuStripSessions; + this.listViewSessions.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewSessions.FullRowSelect = true; + this.listViewSessions.GridLines = true; + this.listViewSessions.HideSelection = false; + this.listViewSessions.Location = new System.Drawing.Point(0, 0); + this.listViewSessions.Name = "listViewSessions"; + this.listViewSessions.Size = new System.Drawing.Size(464, 428); + this.listViewSessions.SmallImageList = this.imageList1; + this.listViewSessions.TabIndex = 0; + this.listViewSessions.UseCompatibleStateImageBehavior = false; + this.listViewSessions.View = System.Windows.Forms.View.Details; + this.listViewSessions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listViewSessions_ItemSelectionChanged); + // + // columnHeaderCounter + // + this.columnHeaderCounter.Text = "#"; + this.columnHeaderCounter.Width = 54; + // + // columnHeaderProtocol + // + this.columnHeaderProtocol.Text = "Protocol"; + this.columnHeaderProtocol.Width = 55; + // + // columnHeaderType + // + this.columnHeaderType.Text = "Packet Type"; + this.columnHeaderType.Width = 139; + // + // columnHeaderSize + // + this.columnHeaderSize.Text = "Bytes"; + // + // columnHeaderUrl + // + this.columnHeaderUrl.Text = "Host/Address"; + this.columnHeaderUrl.Width = 312; + // + // contextMenuStripSessions + // + this.contextMenuStripSessions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItemAutoScroll, + this.toolStripSeparator13, + this.toolStripMenuItem1, + this.selectToolStripMenuItem2, + this.toolStripSeparatorFilterPacketByName, + this.enableDisableFilterByNameToolStripMenuItem, + this.toolStripSeparator15, + this.markToolStripMenuItem2, + this.toolStripSeparator16, + this.findToolStripMenuItem1}); + this.contextMenuStripSessions.Name = "contextMenuStripSessions"; + this.contextMenuStripSessions.Size = new System.Drawing.Size(180, 160); + this.contextMenuStripSessions.Opening += new System.ComponentModel.CancelEventHandler(this.contextMenuStripSessions_Opening); + // + // toolStripMenuItemAutoScroll + // + this.toolStripMenuItemAutoScroll.CheckOnClick = true; + this.toolStripMenuItemAutoScroll.Name = "toolStripMenuItemAutoScroll"; + this.toolStripMenuItemAutoScroll.Size = new System.Drawing.Size(179, 22); + this.toolStripMenuItemAutoScroll.Text = "Auto Scroll"; + this.toolStripMenuItemAutoScroll.CheckedChanged += new System.EventHandler(this.sessionEnableAutoScroll_CheckedChanged); + // + // toolStripSeparator13 + // + this.toolStripSeparator13.Name = "toolStripSeparator13"; + this.toolStripSeparator13.Size = new System.Drawing.Size(176, 6); + // + // toolStripMenuItem1 + // + this.toolStripMenuItem1.DropDown = this.contextMenuStripRemove; + this.toolStripMenuItem1.Name = "toolStripMenuItem1"; + this.toolStripMenuItem1.Size = new System.Drawing.Size(179, 22); + this.toolStripMenuItem1.Text = "Remove"; + // + // contextMenuStripRemove + // + this.contextMenuStripRemove.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripMenuItemRemoveAll, + this.toolStripMenuItemRemoveSelected, + this.toolStripMenuItemRemoveUnselected}); + this.contextMenuStripRemove.Name = "contextMenuStripRemove"; + this.contextMenuStripRemove.OwnerItem = this.removeToolStripMenuItem2; + this.contextMenuStripRemove.Size = new System.Drawing.Size(149, 70); + // + // toolStripMenuItemRemoveAll + // + this.toolStripMenuItemRemoveAll.Name = "toolStripMenuItemRemoveAll"; + this.toolStripMenuItemRemoveAll.Size = new System.Drawing.Size(148, 22); + this.toolStripMenuItemRemoveAll.Text = "All"; + this.toolStripMenuItemRemoveAll.Click += new System.EventHandler(this.sessionRemoveAll_Click); + // + // toolStripMenuItemRemoveSelected + // + this.toolStripMenuItemRemoveSelected.Name = "toolStripMenuItemRemoveSelected"; + this.toolStripMenuItemRemoveSelected.ShortcutKeys = System.Windows.Forms.Keys.Delete; + this.toolStripMenuItemRemoveSelected.Size = new System.Drawing.Size(148, 22); + this.toolStripMenuItemRemoveSelected.Text = "Selected"; + this.toolStripMenuItemRemoveSelected.Click += new System.EventHandler(this.sessionRemoveSelected_Click); + // + // toolStripMenuItemRemoveUnselected + // + this.toolStripMenuItemRemoveUnselected.Name = "toolStripMenuItemRemoveUnselected"; + this.toolStripMenuItemRemoveUnselected.Size = new System.Drawing.Size(148, 22); + this.toolStripMenuItemRemoveUnselected.Text = "Unselected"; + this.toolStripMenuItemRemoveUnselected.Click += new System.EventHandler(this.sessionRemoveUnselected_Click); + // + // selectToolStripMenuItem2 + // + this.selectToolStripMenuItem2.DropDown = this.contextMenuStripSelect; + this.selectToolStripMenuItem2.Name = "selectToolStripMenuItem2"; + this.selectToolStripMenuItem2.Size = new System.Drawing.Size(179, 22); + this.selectToolStripMenuItem2.Text = "Select"; + // + // contextMenuStripSelect + // + this.contextMenuStripSelect.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.allToolStripMenuItem4, + this.invertToolStripMenuItem1, + this.noneToolStripMenuItem2, + this.toolStripSeparatorSelectPacketProto, + this.toolStripMenuItemSelectPacketName, + this.toolStripMenuItemSelectProtocol}); + this.contextMenuStripSelect.Name = "contextMenuStripSelect"; + this.contextMenuStripSelect.OwnerItem = this.selectToolStripMenuItem1; + this.contextMenuStripSelect.Size = new System.Drawing.Size(167, 120); + // + // allToolStripMenuItem4 + // + this.allToolStripMenuItem4.Name = "allToolStripMenuItem4"; + this.allToolStripMenuItem4.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); + this.allToolStripMenuItem4.Size = new System.Drawing.Size(166, 22); + this.allToolStripMenuItem4.Text = "All"; + this.allToolStripMenuItem4.Click += new System.EventHandler(this.sessionSelectAll_Click); + // + // invertToolStripMenuItem1 + // + this.invertToolStripMenuItem1.Name = "invertToolStripMenuItem1"; + this.invertToolStripMenuItem1.Size = new System.Drawing.Size(166, 22); + this.invertToolStripMenuItem1.Text = "Invert"; + this.invertToolStripMenuItem1.Click += new System.EventHandler(this.sessionInvertSelection_Click); + // + // noneToolStripMenuItem2 + // + this.noneToolStripMenuItem2.Name = "noneToolStripMenuItem2"; + this.noneToolStripMenuItem2.Size = new System.Drawing.Size(166, 22); + this.noneToolStripMenuItem2.Text = "None"; + this.noneToolStripMenuItem2.Click += new System.EventHandler(this.sessionSelectNone_Click); + // + // toolStripSeparatorSelectPacketProto + // + this.toolStripSeparatorSelectPacketProto.Name = "toolStripSeparatorSelectPacketProto"; + this.toolStripSeparatorSelectPacketProto.Size = new System.Drawing.Size(163, 6); + // + // toolStripMenuItemSelectPacketName + // + this.toolStripMenuItemSelectPacketName.Name = "toolStripMenuItemSelectPacketName"; + this.toolStripMenuItemSelectPacketName.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItemSelectPacketName.Text = "All (Packet Type)"; + this.toolStripMenuItemSelectPacketName.Click += new System.EventHandler(this.sessionSelectAllPacketType_Click); + // + // toolStripMenuItemSelectProtocol + // + this.toolStripMenuItemSelectProtocol.Name = "toolStripMenuItemSelectProtocol"; + this.toolStripMenuItemSelectProtocol.Size = new System.Drawing.Size(166, 22); + this.toolStripMenuItemSelectProtocol.Text = "All (Protocol)"; + this.toolStripMenuItemSelectProtocol.Click += new System.EventHandler(this.sessionSelectAllProtocol_Click); + // + // toolStripSeparatorFilterPacketByName + // + this.toolStripSeparatorFilterPacketByName.Name = "toolStripSeparatorFilterPacketByName"; + this.toolStripSeparatorFilterPacketByName.Size = new System.Drawing.Size(176, 6); + // + // enableDisableFilterByNameToolStripMenuItem + // + this.enableDisableFilterByNameToolStripMenuItem.Checked = true; + this.enableDisableFilterByNameToolStripMenuItem.CheckOnClick = true; + this.enableDisableFilterByNameToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.enableDisableFilterByNameToolStripMenuItem.Name = "enableDisableFilterByNameToolStripMenuItem"; + this.enableDisableFilterByNameToolStripMenuItem.Size = new System.Drawing.Size(179, 22); + this.enableDisableFilterByNameToolStripMenuItem.Text = "Filter (Packet Type)"; + this.enableDisableFilterByNameToolStripMenuItem.CheckedChanged += new System.EventHandler(this.filterDisableByPacketName_CheckedChanged); + // + // toolStripSeparator15 + // + this.toolStripSeparator15.Name = "toolStripSeparator15"; + this.toolStripSeparator15.Size = new System.Drawing.Size(176, 6); + // + // markToolStripMenuItem2 + // + this.markToolStripMenuItem2.DropDown = this.contextMenuStripMark; + this.markToolStripMenuItem2.Name = "markToolStripMenuItem2"; + this.markToolStripMenuItem2.Size = new System.Drawing.Size(179, 22); + this.markToolStripMenuItem2.Text = "Mark"; + // + // contextMenuStripMark + // + this.contextMenuStripMark.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.redToolStripMenuItem2, + this.goldToolStripMenuItem2, + this.greenToolStripMenuItem1, + this.blueToolStripMenuItem1, + this.orangeToolStripMenuItem1, + this.toolStripSeparator17, + this.unmarkToolStripMenuItem}); + this.contextMenuStripMark.Name = "contextMenuStripMarkDropdown"; + this.contextMenuStripMark.OwnerItem = this.markToolStripMenuItem1; + this.contextMenuStripMark.Size = new System.Drawing.Size(122, 142); + // + // redToolStripMenuItem2 + // + this.redToolStripMenuItem2.Name = "redToolStripMenuItem2"; + this.redToolStripMenuItem2.Size = new System.Drawing.Size(121, 22); + this.redToolStripMenuItem2.Text = "Red"; + this.redToolStripMenuItem2.Click += new System.EventHandler(this.sessionMarkSelected_Click); + // + // goldToolStripMenuItem2 + // + this.goldToolStripMenuItem2.Name = "goldToolStripMenuItem2"; + this.goldToolStripMenuItem2.Size = new System.Drawing.Size(121, 22); + this.goldToolStripMenuItem2.Text = "Gold"; + this.goldToolStripMenuItem2.Click += new System.EventHandler(this.sessionMarkSelected_Click); + // + // greenToolStripMenuItem1 + // + this.greenToolStripMenuItem1.Name = "greenToolStripMenuItem1"; + this.greenToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); + this.greenToolStripMenuItem1.Text = "Green"; + this.greenToolStripMenuItem1.Click += new System.EventHandler(this.sessionMarkSelected_Click); + // + // blueToolStripMenuItem1 + // + this.blueToolStripMenuItem1.Name = "blueToolStripMenuItem1"; + this.blueToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); + this.blueToolStripMenuItem1.Text = "Blue"; + this.blueToolStripMenuItem1.Click += new System.EventHandler(this.sessionMarkSelected_Click); + // + // orangeToolStripMenuItem1 + // + this.orangeToolStripMenuItem1.Name = "orangeToolStripMenuItem1"; + this.orangeToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); + this.orangeToolStripMenuItem1.Text = "Orange"; + this.orangeToolStripMenuItem1.Click += new System.EventHandler(this.sessionMarkSelected_Click); + // + // toolStripSeparator17 + // + this.toolStripSeparator17.Name = "toolStripSeparator17"; + this.toolStripSeparator17.Size = new System.Drawing.Size(118, 6); + // + // unmarkToolStripMenuItem + // + this.unmarkToolStripMenuItem.Name = "unmarkToolStripMenuItem"; + this.unmarkToolStripMenuItem.Size = new System.Drawing.Size(121, 22); + this.unmarkToolStripMenuItem.Text = "Unmark"; + this.unmarkToolStripMenuItem.Click += new System.EventHandler(this.sessionUnmarkSelected_Click); + // + // toolStripSeparator16 + // + this.toolStripSeparator16.Name = "toolStripSeparator16"; + this.toolStripSeparator16.Size = new System.Drawing.Size(176, 6); + // + // findToolStripMenuItem1 + // + this.findToolStripMenuItem1.Name = "findToolStripMenuItem1"; + this.findToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); + this.findToolStripMenuItem1.Size = new System.Drawing.Size(179, 22); + this.findToolStripMenuItem1.Text = "Find"; + this.findToolStripMenuItem1.Click += new System.EventHandler(this.findSessions_Click); + // // imageList1 // this.imageList1.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList1.ImageStream"))); @@ -370,9 +666,9 @@ // this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.groupBox1); - this.panel1.Location = new System.Drawing.Point(28, 39); + this.panel1.Location = new System.Drawing.Point(6, 301); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(227, 188); + this.panel1.Size = new System.Drawing.Size(581, 89); this.panel1.TabIndex = 2; // // groupBox2 @@ -383,7 +679,7 @@ this.groupBox2.Controls.Add(this.label10); this.groupBox2.Controls.Add(this.label9); this.groupBox2.Controls.Add(this.label8); - this.groupBox2.Location = new System.Drawing.Point(3, 89); + this.groupBox2.Location = new System.Drawing.Point(6, 3); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(221, 80); this.groupBox2.TabIndex = 3; @@ -452,7 +748,7 @@ this.groupBox1.Controls.Add(this.label6); this.groupBox1.Controls.Add(this.label5); this.groupBox1.Controls.Add(this.label7); - this.groupBox1.Location = new System.Drawing.Point(3, 3); + this.groupBox1.Location = new System.Drawing.Point(357, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(221, 80); this.groupBox1.TabIndex = 2; @@ -542,86 +838,100 @@ // // splitContainer2.Panel1 // - this.splitContainer2.Panel1.Controls.Add(this.checkBox1); + this.splitContainer2.Panel1.Controls.Add(this.checkBoxCheckAllPackets); this.splitContainer2.Panel1.Controls.Add(this.grpUDPFilters); // // splitContainer2.Panel2 // - this.splitContainer2.Panel2.Controls.Add(this.checkBox2); - this.splitContainer2.Panel2.Controls.Add(this.button2); + this.splitContainer2.Panel2.Controls.Add(this.checkBoxCheckAllMessages); + this.splitContainer2.Panel2.Controls.Add(this.buttonRefreshKnownCaps); this.splitContainer2.Panel2.Controls.Add(this.grpCapsFilters); this.splitContainer2.Size = new System.Drawing.Size(587, 390); this.splitContainer2.SplitterDistance = 294; this.splitContainer2.TabIndex = 0; // - // checkBox1 + // checkBoxCheckAllPackets // - this.checkBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBox1.AutoSize = true; - this.checkBox1.Location = new System.Drawing.Point(3, 369); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(120, 17); - this.checkBox1.TabIndex = 1; - this.checkBox1.Text = "Check/Uncheck All"; - this.checkBox1.UseVisualStyleBackColor = true; - this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged); + this.checkBoxCheckAllPackets.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxCheckAllPackets.AutoSize = true; + this.checkBoxCheckAllPackets.Checked = true; + this.checkBoxCheckAllPackets.CheckState = System.Windows.Forms.CheckState.Indeterminate; + this.checkBoxCheckAllPackets.Location = new System.Drawing.Point(3, 369); + this.checkBoxCheckAllPackets.Name = "checkBoxCheckAllPackets"; + this.checkBoxCheckAllPackets.Size = new System.Drawing.Size(120, 17); + this.checkBoxCheckAllPackets.TabIndex = 1; + this.checkBoxCheckAllPackets.Text = "Check/Uncheck All"; + this.checkBoxCheckAllPackets.UseVisualStyleBackColor = true; + this.checkBoxCheckAllPackets.CheckedChanged += new System.EventHandler(this.checkBoxCheckAllPackets_CheckedChanged); // // grpUDPFilters // this.grpUDPFilters.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.grpUDPFilters.Controls.Add(this.checkedListBoxFiltersPackets); + this.grpUDPFilters.Controls.Add(this.listViewPacketFilters); this.grpUDPFilters.Enabled = false; this.grpUDPFilters.Location = new System.Drawing.Point(3, 3); this.grpUDPFilters.Name = "grpUDPFilters"; - this.grpUDPFilters.Size = new System.Drawing.Size(285, 357); + this.grpUDPFilters.Size = new System.Drawing.Size(288, 357); this.grpUDPFilters.TabIndex = 0; this.grpUDPFilters.TabStop = false; this.grpUDPFilters.Text = "UDP Packets"; // - // checkedListBoxFiltersPackets + // listViewPacketFilters // - this.checkedListBoxFiltersPackets.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkedListBoxFiltersPackets.CheckOnClick = true; - this.checkedListBoxFiltersPackets.FormattingEnabled = true; - this.checkedListBoxFiltersPackets.Location = new System.Drawing.Point(6, 19); - this.checkedListBoxFiltersPackets.Name = "checkedListBoxFiltersPackets"; - this.checkedListBoxFiltersPackets.Size = new System.Drawing.Size(273, 334); - this.checkedListBoxFiltersPackets.TabIndex = 0; - this.checkedListBoxFiltersPackets.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBox1_ItemCheck); + this.listViewPacketFilters.CheckBoxes = true; + this.listViewPacketFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader1}); + this.listViewPacketFilters.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewPacketFilters.FullRowSelect = true; + this.listViewPacketFilters.Location = new System.Drawing.Point(3, 16); + this.listViewPacketFilters.MultiSelect = false; + this.listViewPacketFilters.Name = "listViewPacketFilters"; + this.listViewPacketFilters.Size = new System.Drawing.Size(282, 338); + this.listViewPacketFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.listViewPacketFilters.TabIndex = 0; + this.listViewPacketFilters.UseCompatibleStateImageBehavior = false; + this.listViewPacketFilters.View = System.Windows.Forms.View.Details; + this.listViewPacketFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewPacketFilters_ItemChecked); + this.listViewPacketFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); // - // checkBox2 + // columnHeader1 // - this.checkBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.checkBox2.AutoSize = true; - this.checkBox2.Location = new System.Drawing.Point(3, 370); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(120, 17); - this.checkBox2.TabIndex = 2; - this.checkBox2.Text = "Check/Uncheck All"; - this.checkBox2.UseVisualStyleBackColor = true; - this.checkBox2.CheckedChanged += new System.EventHandler(this.checkBoxCheckallCaps_CheckedChanged); + this.columnHeader1.Text = "Packet Name"; + this.columnHeader1.Width = 266; // - // button2 + // checkBoxCheckAllMessages // - this.button2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button2.Location = new System.Drawing.Point(200, 366); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(86, 21); - this.button2.TabIndex = 1; - this.button2.Text = "Refresh"; - this.button2.UseVisualStyleBackColor = true; - this.button2.Click += new System.EventHandler(this.buttonRefreshCapsList_Click); + this.checkBoxCheckAllMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.checkBoxCheckAllMessages.AutoSize = true; + this.checkBoxCheckAllMessages.Checked = true; + this.checkBoxCheckAllMessages.CheckState = System.Windows.Forms.CheckState.Indeterminate; + this.checkBoxCheckAllMessages.Location = new System.Drawing.Point(3, 370); + this.checkBoxCheckAllMessages.Name = "checkBoxCheckAllMessages"; + this.checkBoxCheckAllMessages.Size = new System.Drawing.Size(120, 17); + this.checkBoxCheckAllMessages.TabIndex = 2; + this.checkBoxCheckAllMessages.Text = "Check/Uncheck All"; + this.checkBoxCheckAllMessages.UseVisualStyleBackColor = true; + this.checkBoxCheckAllMessages.CheckedChanged += new System.EventHandler(this.checkBoxCheckallCaps_CheckedChanged); + // + // buttonRefreshKnownCaps + // + this.buttonRefreshKnownCaps.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonRefreshKnownCaps.Location = new System.Drawing.Point(200, 366); + this.buttonRefreshKnownCaps.Name = "buttonRefreshKnownCaps"; + this.buttonRefreshKnownCaps.Size = new System.Drawing.Size(86, 21); + this.buttonRefreshKnownCaps.TabIndex = 1; + this.buttonRefreshKnownCaps.Text = "Refresh"; + this.buttonRefreshKnownCaps.UseVisualStyleBackColor = true; + this.buttonRefreshKnownCaps.Click += new System.EventHandler(this.buttonRefreshCapsList_Click); // // grpCapsFilters // this.grpCapsFilters.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.grpCapsFilters.Controls.Add(this.checkedListBoxFiltersMessages); + this.grpCapsFilters.Controls.Add(this.listViewMessageFilters); this.grpCapsFilters.Enabled = false; this.grpCapsFilters.Location = new System.Drawing.Point(3, 3); this.grpCapsFilters.Name = "grpCapsFilters"; @@ -630,18 +940,28 @@ this.grpCapsFilters.TabStop = false; this.grpCapsFilters.Text = "Capabilities Messages"; // - // checkedListBoxFiltersMessages + // listViewMessageFilters // - this.checkedListBoxFiltersMessages.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) - | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.checkedListBoxFiltersMessages.CheckOnClick = true; - this.checkedListBoxFiltersMessages.FormattingEnabled = true; - this.checkedListBoxFiltersMessages.Location = new System.Drawing.Point(6, 19); - this.checkedListBoxFiltersMessages.Name = "checkedListBoxFiltersMessages"; - this.checkedListBoxFiltersMessages.Size = new System.Drawing.Size(271, 334); - this.checkedListBoxFiltersMessages.TabIndex = 0; - this.checkedListBoxFiltersMessages.ItemCheck += new System.Windows.Forms.ItemCheckEventHandler(this.checkedListBoxCaps_ItemCheck); + this.listViewMessageFilters.CheckBoxes = true; + this.listViewMessageFilters.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.columnHeader2}); + this.listViewMessageFilters.Dock = System.Windows.Forms.DockStyle.Fill; + this.listViewMessageFilters.FullRowSelect = true; + this.listViewMessageFilters.Location = new System.Drawing.Point(3, 16); + this.listViewMessageFilters.MultiSelect = false; + this.listViewMessageFilters.Name = "listViewMessageFilters"; + this.listViewMessageFilters.Size = new System.Drawing.Size(277, 338); + this.listViewMessageFilters.Sorting = System.Windows.Forms.SortOrder.Ascending; + this.listViewMessageFilters.TabIndex = 1; + this.listViewMessageFilters.UseCompatibleStateImageBehavior = false; + this.listViewMessageFilters.View = System.Windows.Forms.View.Details; + this.listViewMessageFilters.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewMessageFilters_ItemChecked); + this.listViewMessageFilters.ColumnClick += new System.Windows.Forms.ColumnClickEventHandler(this.listViewFilterSorter_ColumnClick); + // + // columnHeader2 + // + this.columnHeader2.Text = "Message Name"; + this.columnHeader2.Width = 265; // // tabPageInspect // @@ -879,6 +1199,8 @@ // // tabPageInject // + this.tabPageInject.Controls.Add(this.radioButtonViewer); + this.tabPageInject.Controls.Add(this.radioButtonSimulator); this.tabPageInject.Controls.Add(this.button3); this.tabPageInject.Controls.Add(this.buttonInjectPacket); this.tabPageInject.Controls.Add(this.richTextBoxInject); @@ -890,8 +1212,31 @@ this.tabPageInject.Text = "Inject"; this.tabPageInject.UseVisualStyleBackColor = true; // + // radioButtonViewer + // + this.radioButtonViewer.AutoSize = true; + this.radioButtonViewer.Location = new System.Drawing.Point(397, 370); + this.radioButtonViewer.Name = "radioButtonViewer"; + this.radioButtonViewer.Size = new System.Drawing.Size(97, 17); + this.radioButtonViewer.TabIndex = 4; + this.radioButtonViewer.Text = "Send to Viewer"; + this.radioButtonViewer.UseVisualStyleBackColor = true; + // + // radioButtonSimulator + // + this.radioButtonSimulator.AutoSize = true; + this.radioButtonSimulator.Checked = true; + this.radioButtonSimulator.Location = new System.Drawing.Point(283, 370); + this.radioButtonSimulator.Name = "radioButtonSimulator"; + this.radioButtonSimulator.Size = new System.Drawing.Size(108, 17); + this.radioButtonSimulator.TabIndex = 3; + this.radioButtonSimulator.TabStop = true; + this.radioButtonSimulator.Text = "Send to Simulator"; + this.radioButtonSimulator.UseVisualStyleBackColor = true; + // // button3 // + this.button3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button3.Enabled = false; this.button3.Location = new System.Drawing.Point(6, 367); this.button3.Name = "button3"; @@ -902,21 +1247,48 @@ // // buttonInjectPacket // + this.buttonInjectPacket.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonInjectPacket.Enabled = false; - this.buttonInjectPacket.Location = new System.Drawing.Point(117, 367); + this.buttonInjectPacket.Location = new System.Drawing.Point(512, 367); this.buttonInjectPacket.Name = "buttonInjectPacket"; this.buttonInjectPacket.Size = new System.Drawing.Size(75, 23); this.buttonInjectPacket.TabIndex = 1; this.buttonInjectPacket.Text = "Inject"; this.buttonInjectPacket.UseVisualStyleBackColor = true; + this.buttonInjectPacket.Click += new System.EventHandler(this.buttonInjectPacket_Click); // // richTextBoxInject // + this.richTextBoxInject.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); this.richTextBoxInject.Location = new System.Drawing.Point(6, 6); this.richTextBoxInject.Name = "richTextBoxInject"; - this.richTextBoxInject.Size = new System.Drawing.Size(569, 355); + this.richTextBoxInject.Size = new System.Drawing.Size(581, 355); this.richTextBoxInject.TabIndex = 0; this.richTextBoxInject.Text = ""; + this.richTextBoxInject.TextChanged += new System.EventHandler(this.richTextBoxInject_TextChanged); + // + // removeToolStripMenuItem2 + // + this.removeToolStripMenuItem2.DropDown = this.contextMenuStripRemove; + this.removeToolStripMenuItem2.Name = "removeToolStripMenuItem2"; + this.removeToolStripMenuItem2.Size = new System.Drawing.Size(143, 22); + this.removeToolStripMenuItem2.Text = "Remove"; + // + // selectToolStripMenuItem1 + // + this.selectToolStripMenuItem1.DropDown = this.contextMenuStripSelect; + this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; + this.selectToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); + this.selectToolStripMenuItem1.Text = "Select"; + // + // markToolStripMenuItem1 + // + this.markToolStripMenuItem1.DropDown = this.contextMenuStripMark; + this.markToolStripMenuItem1.Name = "markToolStripMenuItem1"; + this.markToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); + this.markToolStripMenuItem1.Text = "Mark"; // // toolStripLabelHexEditorRequest // @@ -933,7 +1305,7 @@ this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripFileMenu, this.EditToolStripButton, - this.toolStripSeparator6, + this.toolStripDropDownButton5, this.toolStripDropDownButton4}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; @@ -947,8 +1319,8 @@ this.toolStripFileMenu.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.captureToolStripMenuItem, this.toolStripSeparator7, - this.loadSessionArchiveToolStripMenuItem, this.saveSessionArchiveToolStripMenuItem, + this.loadSessionArchiveToolStripMenuItem, this.toolStripSeparator8, this.settingsToolStripMenuItem, this.toolStripSeparator9, @@ -972,17 +1344,19 @@ this.toolStripSeparator7.Name = "toolStripSeparator7"; this.toolStripSeparator7.Size = new System.Drawing.Size(184, 6); // - // loadSessionArchiveToolStripMenuItem - // - this.loadSessionArchiveToolStripMenuItem.Name = "loadSessionArchiveToolStripMenuItem"; - this.loadSessionArchiveToolStripMenuItem.Size = new System.Drawing.Size(187, 22); - this.loadSessionArchiveToolStripMenuItem.Text = "Load Session Archive"; - // // saveSessionArchiveToolStripMenuItem // this.saveSessionArchiveToolStripMenuItem.Name = "saveSessionArchiveToolStripMenuItem"; this.saveSessionArchiveToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.saveSessionArchiveToolStripMenuItem.Text = "Save Session Archive"; + this.saveSessionArchiveToolStripMenuItem.Click += new System.EventHandler(this.saveSessionArchiveToolStripMenuItem_Click); + // + // loadSessionArchiveToolStripMenuItem + // + this.loadSessionArchiveToolStripMenuItem.Name = "loadSessionArchiveToolStripMenuItem"; + this.loadSessionArchiveToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.loadSessionArchiveToolStripMenuItem.Text = "Load Session Archive"; + this.loadSessionArchiveToolStripMenuItem.Click += new System.EventHandler(this.loadSessionArchiveToolStripMenuItem_Click); // // toolStripSeparator8 // @@ -992,11 +1366,50 @@ // settingsToolStripMenuItem // this.settingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.autoScrollSessionsToolStripMenuItem}); + this.autoScrollSessionsToolStripMenuItem, + this.enableStatisticsToolStripMenuItem, + this.saveOptionsOnExitToolStripMenuItem, + this.startProxyOnStartupToolStripMenuItem}); this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; this.settingsToolStripMenuItem.Size = new System.Drawing.Size(187, 22); this.settingsToolStripMenuItem.Text = "Settings"; // + // autoScrollSessionsToolStripMenuItem + // + this.autoScrollSessionsToolStripMenuItem.CheckOnClick = true; + this.autoScrollSessionsToolStripMenuItem.Name = "autoScrollSessionsToolStripMenuItem"; + this.autoScrollSessionsToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.autoScrollSessionsToolStripMenuItem.Text = "Auto Scroll Sessions"; + this.autoScrollSessionsToolStripMenuItem.CheckedChanged += new System.EventHandler(this.sessionEnableAutoScroll_CheckedChanged); + // + // enableStatisticsToolStripMenuItem + // + this.enableStatisticsToolStripMenuItem.Checked = true; + this.enableStatisticsToolStripMenuItem.CheckOnClick = true; + this.enableStatisticsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.enableStatisticsToolStripMenuItem.Name = "enableStatisticsToolStripMenuItem"; + this.enableStatisticsToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.enableStatisticsToolStripMenuItem.Text = "Enable Statistics"; + this.enableStatisticsToolStripMenuItem.CheckedChanged += new System.EventHandler(this.enableStatisticsToolStripMenuItem_CheckedChanged); + // + // saveOptionsOnExitToolStripMenuItem + // + this.saveOptionsOnExitToolStripMenuItem.Checked = true; + this.saveOptionsOnExitToolStripMenuItem.CheckOnClick = true; + this.saveOptionsOnExitToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.saveOptionsOnExitToolStripMenuItem.Name = "saveOptionsOnExitToolStripMenuItem"; + this.saveOptionsOnExitToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.saveOptionsOnExitToolStripMenuItem.Text = "Save Current Profile on Exit"; + // + // startProxyOnStartupToolStripMenuItem + // + this.startProxyOnStartupToolStripMenuItem.Checked = true; + this.startProxyOnStartupToolStripMenuItem.CheckOnClick = true; + this.startProxyOnStartupToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.startProxyOnStartupToolStripMenuItem.Name = "startProxyOnStartupToolStripMenuItem"; + this.startProxyOnStartupToolStripMenuItem.Size = new System.Drawing.Size(218, 22); + this.startProxyOnStartupToolStripMenuItem.Text = "Start Proxy on Startup"; + // // toolStripSeparator9 // this.toolStripSeparator9.Name = "toolStripSeparator9"; @@ -1007,6 +1420,7 @@ this.exitToolStripMenuItem1.Name = "exitToolStripMenuItem1"; this.exitToolStripMenuItem1.Size = new System.Drawing.Size(187, 22); this.exitToolStripMenuItem1.Text = "Exit"; + this.exitToolStripMenuItem1.Click += new System.EventHandler(this.exitToolStripMenuItem1_Click); // // EditToolStripButton // @@ -1027,99 +1441,113 @@ // // copyToolStripMenuItem1 // + this.copyToolStripMenuItem1.DropDown = this.contextMenuStripCopy; this.copyToolStripMenuItem1.Name = "copyToolStripMenuItem1"; - this.copyToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); + this.copyToolStripMenuItem1.Size = new System.Drawing.Size(143, 22); this.copyToolStripMenuItem1.Text = "Copy"; // - // removeToolStripMenuItem2 + // contextMenuStripCopy // - this.removeToolStripMenuItem2.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.selectedToolStripMenuItem1, - this.unselectedToolStripMenuItem, - this.allToolStripMenuItem2}); - this.removeToolStripMenuItem2.Name = "removeToolStripMenuItem2"; - this.removeToolStripMenuItem2.Size = new System.Drawing.Size(152, 22); - this.removeToolStripMenuItem2.Text = "Remove"; + this.contextMenuStripCopy.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.requestDataToolStripMenuItem, + this.responseDataToolStripMenuItem, + this.hostAddressToolStripMenuItem, + this.packetMessageTypeToolStripMenuItem}); + this.contextMenuStripCopy.Name = "contextMenuStripCopy"; + this.contextMenuStripCopy.OwnerItem = this.copyToolStripMenuItem1; + this.contextMenuStripCopy.Size = new System.Drawing.Size(191, 92); // - // selectedToolStripMenuItem1 + // requestDataToolStripMenuItem // - this.selectedToolStripMenuItem1.Name = "selectedToolStripMenuItem1"; - this.selectedToolStripMenuItem1.ShortcutKeys = System.Windows.Forms.Keys.Delete; - this.selectedToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.selectedToolStripMenuItem1.Text = "Selected"; - this.selectedToolStripMenuItem1.Click += new System.EventHandler(this.removeSelectedToolStripMenuItem_Click); + this.requestDataToolStripMenuItem.Name = "requestDataToolStripMenuItem"; + this.requestDataToolStripMenuItem.Size = new System.Drawing.Size(190, 22); + this.requestDataToolStripMenuItem.Text = "Request Data"; // - // unselectedToolStripMenuItem + // responseDataToolStripMenuItem // - this.unselectedToolStripMenuItem.Name = "unselectedToolStripMenuItem"; - this.unselectedToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.unselectedToolStripMenuItem.Text = "Unselected"; - this.unselectedToolStripMenuItem.Click += new System.EventHandler(this.removeUnselectedSessionsToolStripMenuItem_Click); + this.responseDataToolStripMenuItem.Name = "responseDataToolStripMenuItem"; + this.responseDataToolStripMenuItem.Size = new System.Drawing.Size(190, 22); + this.responseDataToolStripMenuItem.Text = "Response Data"; // - // allToolStripMenuItem2 + // hostAddressToolStripMenuItem // - this.allToolStripMenuItem2.Name = "allToolStripMenuItem2"; - this.allToolStripMenuItem2.Size = new System.Drawing.Size(152, 22); - this.allToolStripMenuItem2.Text = "All"; - this.allToolStripMenuItem2.Click += new System.EventHandler(this.removeAllToolStripMenuItem_Click); + this.hostAddressToolStripMenuItem.Name = "hostAddressToolStripMenuItem"; + this.hostAddressToolStripMenuItem.Size = new System.Drawing.Size(190, 22); + this.hostAddressToolStripMenuItem.Text = "Host/Address"; // - // selectToolStripMenuItem1 + // packetMessageTypeToolStripMenuItem // - this.selectToolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.allToolStripMenuItem3, - this.invertToolStripMenuItem, - this.noneToolStripMenuItem1}); - this.selectToolStripMenuItem1.Name = "selectToolStripMenuItem1"; - this.selectToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.selectToolStripMenuItem1.Text = "Select"; - // - // allToolStripMenuItem3 - // - this.allToolStripMenuItem3.Name = "allToolStripMenuItem3"; - this.allToolStripMenuItem3.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); - this.allToolStripMenuItem3.Size = new System.Drawing.Size(152, 22); - this.allToolStripMenuItem3.Text = "All"; - // - // invertToolStripMenuItem - // - this.invertToolStripMenuItem.Name = "invertToolStripMenuItem"; - this.invertToolStripMenuItem.Size = new System.Drawing.Size(152, 22); - this.invertToolStripMenuItem.Text = "Invert"; - // - // noneToolStripMenuItem1 - // - this.noneToolStripMenuItem1.Name = "noneToolStripMenuItem1"; - this.noneToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.noneToolStripMenuItem1.Text = "None"; + this.packetMessageTypeToolStripMenuItem.Name = "packetMessageTypeToolStripMenuItem"; + this.packetMessageTypeToolStripMenuItem.Size = new System.Drawing.Size(190, 22); + this.packetMessageTypeToolStripMenuItem.Text = "Packet/Message Type"; // // toolStripSeparator10 // this.toolStripSeparator10.Name = "toolStripSeparator10"; - this.toolStripSeparator10.Size = new System.Drawing.Size(149, 6); - // - // markToolStripMenuItem1 - // - this.markToolStripMenuItem1.DropDown = this.contextMenuStripMarkDropdown; - this.markToolStripMenuItem1.Name = "markToolStripMenuItem1"; - this.markToolStripMenuItem1.Size = new System.Drawing.Size(152, 22); - this.markToolStripMenuItem1.Text = "Mark"; + this.toolStripSeparator10.Size = new System.Drawing.Size(140, 6); // // toolStripSeparator12 // this.toolStripSeparator12.Name = "toolStripSeparator12"; - this.toolStripSeparator12.Size = new System.Drawing.Size(149, 6); + this.toolStripSeparator12.Size = new System.Drawing.Size(140, 6); // // findToolStripMenuItem // this.findToolStripMenuItem.Name = "findToolStripMenuItem"; this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); - this.findToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.findToolStripMenuItem.Size = new System.Drawing.Size(143, 22); this.findToolStripMenuItem.Text = "Find"; + this.findToolStripMenuItem.Click += new System.EventHandler(this.findSessions_Click); + // + // toolStripDropDownButton5 + // + this.toolStripDropDownButton5.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; + this.toolStripDropDownButton5.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.saveFilterSelectionsToolStripMenuItem, + this.loadFilterSelectionsToolStripMenuItem, + this.toolStripSeparator6, + this.optionsToolStripMenuItem}); + this.toolStripDropDownButton5.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownButton5.Image"))); + this.toolStripDropDownButton5.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripDropDownButton5.Name = "toolStripDropDownButton5"; + this.toolStripDropDownButton5.Size = new System.Drawing.Size(49, 22); + this.toolStripDropDownButton5.Text = "F&ilters"; + // + // saveFilterSelectionsToolStripMenuItem + // + this.saveFilterSelectionsToolStripMenuItem.Name = "saveFilterSelectionsToolStripMenuItem"; + this.saveFilterSelectionsToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.saveFilterSelectionsToolStripMenuItem.Text = "Save Filter Selections"; + this.saveFilterSelectionsToolStripMenuItem.Click += new System.EventHandler(this.saveFilterSelectionsToolStripMenuItem_Click); + // + // loadFilterSelectionsToolStripMenuItem + // + this.loadFilterSelectionsToolStripMenuItem.Name = "loadFilterSelectionsToolStripMenuItem"; + this.loadFilterSelectionsToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.loadFilterSelectionsToolStripMenuItem.Text = "Load Filter Selections"; + this.loadFilterSelectionsToolStripMenuItem.Click += new System.EventHandler(this.loadFilterSelectionsToolStripMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; - this.toolStripSeparator6.Size = new System.Drawing.Size(6, 25); + this.toolStripSeparator6.Size = new System.Drawing.Size(184, 6); + // + // optionsToolStripMenuItem + // + this.optionsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.autoAddNewDiscoveredMessagesToolStripMenuItem}); + this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; + this.optionsToolStripMenuItem.Size = new System.Drawing.Size(187, 22); + this.optionsToolStripMenuItem.Text = "Options"; + // + // autoAddNewDiscoveredMessagesToolStripMenuItem + // + this.autoAddNewDiscoveredMessagesToolStripMenuItem.Checked = true; + this.autoAddNewDiscoveredMessagesToolStripMenuItem.CheckOnClick = true; + this.autoAddNewDiscoveredMessagesToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; + this.autoAddNewDiscoveredMessagesToolStripMenuItem.Name = "autoAddNewDiscoveredMessagesToolStripMenuItem"; + this.autoAddNewDiscoveredMessagesToolStripMenuItem.Size = new System.Drawing.Size(215, 22); + this.autoAddNewDiscoveredMessagesToolStripMenuItem.Text = "Autocheck new Capabilities"; // // toolStripDropDownButton4 // @@ -1132,12 +1560,22 @@ // // aboutToolStripMenuItem // - this.aboutToolStripMenuItem.Image = global::WinGridProxy.Properties.Resources.Help; this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; - this.aboutToolStripMenuItem.Size = new System.Drawing.Size(152, 22); + this.aboutToolStripMenuItem.Size = new System.Drawing.Size(114, 22); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutWinGridProxyToolStripMenuItem_Click); // + // aboutWinGridProxyToolStripMenuItem + // + this.aboutWinGridProxyToolStripMenuItem.Name = "aboutWinGridProxyToolStripMenuItem"; + this.aboutWinGridProxyToolStripMenuItem.Size = new System.Drawing.Size(182, 22); + this.aboutWinGridProxyToolStripMenuItem.Text = "About WinGridProxy"; + this.aboutWinGridProxyToolStripMenuItem.Click += new System.EventHandler(this.aboutWinGridProxyToolStripMenuItem_Click); + // + // timer1 + // + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // // toolStripDropDownButton1 // this.toolStripDropDownButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text; @@ -1259,21 +1697,21 @@ this.allToolStripMenuItem1.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A))); this.allToolStripMenuItem1.Size = new System.Drawing.Size(166, 22); this.allToolStripMenuItem1.Text = "All"; - this.allToolStripMenuItem1.Click += new System.EventHandler(this.allToolStripMenuItem1_Click); + this.allToolStripMenuItem1.Click += new System.EventHandler(this.sessionSelectAll_Click); // // noneToolStripMenuItem // this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; this.noneToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.noneToolStripMenuItem.Text = "None"; - this.noneToolStripMenuItem.Click += new System.EventHandler(this.noneToolStripMenuItem_Click); + this.noneToolStripMenuItem.Click += new System.EventHandler(this.sessionSelectNone_Click); // // invertSelectionsToolStripMenuItem // this.invertSelectionsToolStripMenuItem.Name = "invertSelectionsToolStripMenuItem"; this.invertSelectionsToolStripMenuItem.Size = new System.Drawing.Size(166, 22); this.invertSelectionsToolStripMenuItem.Text = "Invert Selections"; - this.invertSelectionsToolStripMenuItem.Click += new System.EventHandler(this.invertSelectionsToolStripMenuItem_Click); + this.invertSelectionsToolStripMenuItem.Click += new System.EventHandler(this.sessionInvertSelection_Click); // // toolStripSeparator3 // @@ -1299,35 +1737,35 @@ this.redToolStripMenuItem.Name = "redToolStripMenuItem"; this.redToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.redToolStripMenuItem.Text = "Red"; - this.redToolStripMenuItem.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); + this.redToolStripMenuItem.Click += new System.EventHandler(this.sessionMarkSelected_Click); // // goldToolStripMenuItem // this.goldToolStripMenuItem.Name = "goldToolStripMenuItem"; this.goldToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.goldToolStripMenuItem.Text = "Gold"; - this.goldToolStripMenuItem.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); + this.goldToolStripMenuItem.Click += new System.EventHandler(this.sessionMarkSelected_Click); // // orangeToolStripMenuItem // this.orangeToolStripMenuItem.Name = "orangeToolStripMenuItem"; this.orangeToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.orangeToolStripMenuItem.Text = "Orange"; - this.orangeToolStripMenuItem.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); + this.orangeToolStripMenuItem.Click += new System.EventHandler(this.sessionMarkSelected_Click); // // purpleToolStripMenuItem // this.purpleToolStripMenuItem.Name = "purpleToolStripMenuItem"; this.purpleToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.purpleToolStripMenuItem.Text = "Purple"; - this.purpleToolStripMenuItem.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); + this.purpleToolStripMenuItem.Click += new System.EventHandler(this.sessionMarkSelected_Click); // // yellowToolStripMenuItem // this.yellowToolStripMenuItem.Name = "yellowToolStripMenuItem"; this.yellowToolStripMenuItem.Size = new System.Drawing.Size(124, 22); this.yellowToolStripMenuItem.Text = "Yellow"; - this.yellowToolStripMenuItem.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); + this.yellowToolStripMenuItem.Click += new System.EventHandler(this.sessionMarkSelected_Click); // // toolStripSeparator5 // @@ -1379,277 +1817,38 @@ // toolStripButton1 // this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; - this.toolStripButton1.Image = global::WinGridProxy.Properties.Resources.Help; this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton1.Name = "toolStripButton1"; this.toolStripButton1.Size = new System.Drawing.Size(29, 22); this.toolStripButton1.Text = "toolStripButton1"; // - // aboutWinGridProxyToolStripMenuItem + // saveFileDialog1 // - this.aboutWinGridProxyToolStripMenuItem.Name = "aboutWinGridProxyToolStripMenuItem"; - this.aboutWinGridProxyToolStripMenuItem.Size = new System.Drawing.Size(182, 22); - this.aboutWinGridProxyToolStripMenuItem.Text = "About WinGridProxy"; - this.aboutWinGridProxyToolStripMenuItem.Click += new System.EventHandler(this.aboutWinGridProxyToolStripMenuItem_Click); + this.saveFileDialog1.DefaultExt = "osd"; + this.saveFileDialog1.FileName = "sessions"; + this.saveFileDialog1.Filter = "Session Files|*.osd|All Files|*.*"; + this.saveFileDialog1.RestoreDirectory = true; + this.saveFileDialog1.Title = "Save Sessions"; // - // timer1 + // openFileDialog1 // - this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + this.openFileDialog1.DefaultExt = "osd"; + this.openFileDialog1.FileName = "openFileDialog1"; + this.openFileDialog1.Filter = "Session Files|*.osd|All Files|*.*"; + this.openFileDialog1.Title = "Open Session Archive"; // - // contextMenuStripSessions + // saveFileDialog2 // - this.contextMenuStripSessions.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItemAutoScroll, - this.toolStripSeparator13, - this.toolStripMenuItem1, - this.toolStripSeparator14, - this.packetNameToolStripMenuItem, - this.protocolToolStripMenuItem, - this.toolStripSeparator15, - this.findToolStripMenuItem1, - this.toolStripSeparator16, - this.markToolStripMenuItem2}); - this.contextMenuStripSessions.Name = "contextMenuStripSessions"; - this.contextMenuStripSessions.Size = new System.Drawing.Size(180, 160); + this.saveFileDialog2.DefaultExt = "osd"; + this.saveFileDialog2.FileName = "filters"; + this.saveFileDialog2.Title = "Save Filters"; // - // toolStripMenuItemAutoScroll + // openFileDialog2 // - this.toolStripMenuItemAutoScroll.CheckOnClick = true; - this.toolStripMenuItemAutoScroll.Name = "toolStripMenuItemAutoScroll"; - this.toolStripMenuItemAutoScroll.Size = new System.Drawing.Size(179, 22); - this.toolStripMenuItemAutoScroll.Text = "Auto Scroll"; - // - // listViewSessions - // - this.listViewSessions.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { - this.columnHeaderCounter, - this.columnHeaderProtocol, - this.columnHeaderType, - this.columnHeaderSize, - this.columnHeaderUrl}); - this.listViewSessions.ContextMenuStrip = this.contextMenuStripSessions; - this.listViewSessions.Dock = System.Windows.Forms.DockStyle.Fill; - this.listViewSessions.FullRowSelect = true; - this.listViewSessions.GridLines = true; - this.listViewSessions.HideSelection = false; - this.listViewSessions.Location = new System.Drawing.Point(0, 0); - this.listViewSessions.Name = "listViewSessions"; - this.listViewSessions.Size = new System.Drawing.Size(464, 428); - this.listViewSessions.SmallImageList = this.imageList1; - this.listViewSessions.TabIndex = 0; - this.listViewSessions.UseCompatibleStateImageBehavior = false; - this.listViewSessions.View = System.Windows.Forms.View.Details; - this.listViewSessions.ItemSelectionChanged += new System.Windows.Forms.ListViewItemSelectionChangedEventHandler(this.listViewSessions_ItemSelectionChanged); - // - // columnHeaderCounter - // - this.columnHeaderCounter.Text = "#"; - this.columnHeaderCounter.Width = 54; - // - // columnHeaderProtocol - // - this.columnHeaderProtocol.Text = "Protocol"; - this.columnHeaderProtocol.Width = 55; - // - // columnHeaderType - // - this.columnHeaderType.Text = "Packet Type"; - this.columnHeaderType.Width = 139; - // - // columnHeaderSize - // - this.columnHeaderSize.Text = "Bytes"; - // - // columnHeaderUrl - // - this.columnHeaderUrl.Text = "Host/Address"; - this.columnHeaderUrl.Width = 312; - // - // toolStripSeparator13 - // - this.toolStripSeparator13.Name = "toolStripSeparator13"; - this.toolStripSeparator13.Size = new System.Drawing.Size(176, 6); - // - // toolStripMenuItem1 - // - this.toolStripMenuItem1.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.toolStripMenuItemRemoveThis, - this.toolStripMenuItem2, - this.removeAllProtocolToolStripMenuItem, - this.removeAllHostToolStripMenuItem}); - this.toolStripMenuItem1.Name = "toolStripMenuItem1"; - this.toolStripMenuItem1.Size = new System.Drawing.Size(179, 22); - this.toolStripMenuItem1.Text = "Clear"; - // - // toolStripMenuItemRemoveThis - // - this.toolStripMenuItemRemoveThis.Name = "toolStripMenuItemRemoveThis"; - this.toolStripMenuItemRemoveThis.Size = new System.Drawing.Size(182, 22); - this.toolStripMenuItemRemoveThis.Text = "This Item"; - // - // toolStripMenuItem2 - // - this.toolStripMenuItem2.Name = "toolStripMenuItem2"; - this.toolStripMenuItem2.Size = new System.Drawing.Size(182, 22); - this.toolStripMenuItem2.Text = "(Packet Type) Items"; - // - // removeAllProtocolToolStripMenuItem - // - this.removeAllProtocolToolStripMenuItem.Name = "removeAllProtocolToolStripMenuItem"; - this.removeAllProtocolToolStripMenuItem.Size = new System.Drawing.Size(182, 22); - this.removeAllProtocolToolStripMenuItem.Text = "(Protocol) Items"; - // - // removeAllHostToolStripMenuItem - // - this.removeAllHostToolStripMenuItem.Name = "removeAllHostToolStripMenuItem"; - this.removeAllHostToolStripMenuItem.Size = new System.Drawing.Size(182, 22); - this.removeAllHostToolStripMenuItem.Text = "To/From (Host)"; - // - // toolStripSeparator14 - // - this.toolStripSeparator14.Name = "toolStripSeparator14"; - this.toolStripSeparator14.Size = new System.Drawing.Size(176, 6); - // - // packetNameToolStripMenuItem - // - this.packetNameToolStripMenuItem.Checked = true; - this.packetNameToolStripMenuItem.CheckOnClick = true; - this.packetNameToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.packetNameToolStripMenuItem.Name = "packetNameToolStripMenuItem"; - this.packetNameToolStripMenuItem.Size = new System.Drawing.Size(179, 22); - this.packetNameToolStripMenuItem.Text = "Filter (Packet Type)"; - // - // protocolToolStripMenuItem - // - this.protocolToolStripMenuItem.Checked = true; - this.protocolToolStripMenuItem.CheckOnClick = true; - this.protocolToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked; - this.protocolToolStripMenuItem.Name = "protocolToolStripMenuItem"; - this.protocolToolStripMenuItem.Size = new System.Drawing.Size(179, 22); - this.protocolToolStripMenuItem.Text = "Filter (Protocol)"; - // - // toolStripSeparator15 - // - this.toolStripSeparator15.Name = "toolStripSeparator15"; - this.toolStripSeparator15.Size = new System.Drawing.Size(176, 6); - // - // findToolStripMenuItem1 - // - this.findToolStripMenuItem1.Name = "findToolStripMenuItem1"; - this.findToolStripMenuItem1.Size = new System.Drawing.Size(179, 22); - this.findToolStripMenuItem1.Text = "Find"; - // - // autoScrollSessionsToolStripMenuItem - // - this.autoScrollSessionsToolStripMenuItem.CheckOnClick = true; - this.autoScrollSessionsToolStripMenuItem.Name = "autoScrollSessionsToolStripMenuItem"; - this.autoScrollSessionsToolStripMenuItem.Size = new System.Drawing.Size(180, 22); - this.autoScrollSessionsToolStripMenuItem.Text = "Auto Scroll Sessions"; - // - // toolStripSeparator16 - // - this.toolStripSeparator16.Name = "toolStripSeparator16"; - this.toolStripSeparator16.Size = new System.Drawing.Size(176, 6); - // - // markToolStripMenuItem2 - // - this.markToolStripMenuItem2.DropDown = this.contextMenuStripMarkDropdown; - this.markToolStripMenuItem2.Name = "markToolStripMenuItem2"; - this.markToolStripMenuItem2.Size = new System.Drawing.Size(179, 22); - this.markToolStripMenuItem2.Text = "Mark"; - // - // contextMenuStripMarkDropdown - // - this.contextMenuStripMarkDropdown.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.redToolStripMenuItem2, - this.goldToolStripMenuItem2, - this.greenToolStripMenuItem1, - this.blueToolStripMenuItem1, - this.orangeToolStripMenuItem1, - this.toolStripSeparator17, - this.unmarkToolStripMenuItem}); - this.contextMenuStripMarkDropdown.Name = "contextMenuStripMarkDropdown"; - this.contextMenuStripMarkDropdown.Size = new System.Drawing.Size(122, 142); - // - // redToolStripMenuItem2 - // - this.redToolStripMenuItem2.Name = "redToolStripMenuItem2"; - this.redToolStripMenuItem2.Size = new System.Drawing.Size(121, 22); - this.redToolStripMenuItem2.Text = "Red"; - this.redToolStripMenuItem2.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); - // - // greenToolStripMenuItem1 - // - this.greenToolStripMenuItem1.Name = "greenToolStripMenuItem1"; - this.greenToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); - this.greenToolStripMenuItem1.Text = "Green"; - this.greenToolStripMenuItem1.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); - // - // blueToolStripMenuItem1 - // - this.blueToolStripMenuItem1.Name = "blueToolStripMenuItem1"; - this.blueToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); - this.blueToolStripMenuItem1.Text = "Blue"; - this.blueToolStripMenuItem1.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); - // - // orangeToolStripMenuItem1 - // - this.orangeToolStripMenuItem1.Name = "orangeToolStripMenuItem1"; - this.orangeToolStripMenuItem1.Size = new System.Drawing.Size(121, 22); - this.orangeToolStripMenuItem1.Text = "Orange"; - this.orangeToolStripMenuItem1.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); - // - // toolStripSeparator17 - // - this.toolStripSeparator17.Name = "toolStripSeparator17"; - this.toolStripSeparator17.Size = new System.Drawing.Size(118, 6); - // - // unmarkToolStripMenuItem - // - this.unmarkToolStripMenuItem.Name = "unmarkToolStripMenuItem"; - this.unmarkToolStripMenuItem.Size = new System.Drawing.Size(121, 22); - this.unmarkToolStripMenuItem.Text = "Unmark"; - // - // goldToolStripMenuItem2 - // - this.goldToolStripMenuItem2.Name = "goldToolStripMenuItem2"; - this.goldToolStripMenuItem2.Size = new System.Drawing.Size(121, 22); - this.goldToolStripMenuItem2.Text = "Gold"; - this.goldToolStripMenuItem2.Click += new System.EventHandler(this.MarkColorToolStripMenuItem_Click); - // - // contextMenuStripCopy - // - this.contextMenuStripCopy.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { - this.requestDataToolStripMenuItem, - this.responseDataToolStripMenuItem, - this.hostAddressToolStripMenuItem, - this.packetMessageTypeToolStripMenuItem}); - this.contextMenuStripCopy.Name = "contextMenuStripCopy"; - this.contextMenuStripCopy.Size = new System.Drawing.Size(191, 114); - // - // requestDataToolStripMenuItem - // - this.requestDataToolStripMenuItem.Name = "requestDataToolStripMenuItem"; - this.requestDataToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.requestDataToolStripMenuItem.Text = "Request Data"; - // - // responseDataToolStripMenuItem - // - this.responseDataToolStripMenuItem.Name = "responseDataToolStripMenuItem"; - this.responseDataToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.responseDataToolStripMenuItem.Text = "Response Data"; - // - // hostAddressToolStripMenuItem - // - this.hostAddressToolStripMenuItem.Name = "hostAddressToolStripMenuItem"; - this.hostAddressToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.hostAddressToolStripMenuItem.Text = "Host/Address"; - // - // packetMessageTypeToolStripMenuItem - // - this.packetMessageTypeToolStripMenuItem.Name = "packetMessageTypeToolStripMenuItem"; - this.packetMessageTypeToolStripMenuItem.Size = new System.Drawing.Size(190, 22); - this.packetMessageTypeToolStripMenuItem.Text = "Packet/Message Type"; + this.openFileDialog2.DefaultExt = "osd"; + this.openFileDialog2.FileName = "openFileDialog2"; + this.openFileDialog2.Filter = "Filter Files|*.osd|All Files|*.*"; + this.openFileDialog2.Title = "Load Saved Filter Settings"; // // Form1 // @@ -1668,6 +1867,10 @@ this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); + this.contextMenuStripSessions.ResumeLayout(false); + this.contextMenuStripRemove.ResumeLayout(false); + this.contextMenuStripSelect.ResumeLayout(false); + this.contextMenuStripMark.ResumeLayout(false); this.tabControl1.ResumeLayout(false); this.tabPageSummary.ResumeLayout(false); this.tabPageSummary.PerformLayout(); @@ -1703,10 +1906,9 @@ this.statusStrip1.ResumeLayout(false); this.statusStrip1.PerformLayout(); this.tabPageInject.ResumeLayout(false); + this.tabPageInject.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); - this.contextMenuStripSessions.ResumeLayout(false); - this.contextMenuStripMarkDropdown.ResumeLayout(false); this.contextMenuStripCopy.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -1730,12 +1932,11 @@ private System.Windows.Forms.TabPage tabPageSummary; private System.Windows.Forms.TabPage tabPageFilters; private System.Windows.Forms.SplitContainer splitContainer2; - private System.Windows.Forms.CheckedListBox checkedListBoxFiltersPackets; private System.Windows.Forms.GroupBox grpUDPFilters; private System.Windows.Forms.TabPage tabPageInject; private System.Windows.Forms.RichTextBox richTextBoxInject; - private System.Windows.Forms.CheckBox checkBox1; - private System.Windows.Forms.Button button2; + private System.Windows.Forms.CheckBox checkBoxCheckAllPackets; + private System.Windows.Forms.Button buttonRefreshKnownCaps; private System.Windows.Forms.ColumnHeader columnHeaderCounter; private System.Windows.Forms.ColumnHeader columnHeaderProtocol; private System.Windows.Forms.ColumnHeader columnHeaderType; @@ -1815,12 +2016,10 @@ private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem1; private System.Windows.Forms.ToolStripDropDownButton toolStripButton1; private System.Windows.Forms.ToolStripMenuItem aboutWinGridProxyToolStripMenuItem; - private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.CheckBox checkBoxCheckAllMessages; private System.Windows.Forms.GroupBox grpCapsFilters; - private System.Windows.Forms.CheckedListBox checkedListBoxFiltersMessages; private System.Windows.Forms.ToolStripStatusLabel labelRequestHex; private System.Windows.Forms.ToolStripStatusLabel labelResponseHex; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton4; private System.Windows.Forms.ToolStripDropDownButton toolStripFileMenu; private System.Windows.Forms.ToolStripMenuItem captureToolStripMenuItem; @@ -1834,13 +2033,7 @@ private System.Windows.Forms.ToolStripDropDownButton EditToolStripButton; private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem removeToolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem selectedToolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem unselectedToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem allToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem allToolStripMenuItem3; - private System.Windows.Forms.ToolStripMenuItem invertToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator10; private System.Windows.Forms.ToolStripMenuItem markToolStripMenuItem1; private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem; @@ -1850,19 +2043,14 @@ private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemAutoScroll; private System.Windows.Forms.ToolStripSeparator toolStripSeparator13; private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemRemoveThis; - private System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2; - private System.Windows.Forms.ToolStripMenuItem removeAllProtocolToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem removeAllHostToolStripMenuItem; - private System.Windows.Forms.ToolStripSeparator toolStripSeparator14; - private System.Windows.Forms.ToolStripMenuItem packetNameToolStripMenuItem; - private System.Windows.Forms.ToolStripMenuItem protocolToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparatorFilterPacketByName; + private System.Windows.Forms.ToolStripMenuItem enableDisableFilterByNameToolStripMenuItem; private System.Windows.Forms.ToolStripSeparator toolStripSeparator15; private System.Windows.Forms.ToolStripMenuItem findToolStripMenuItem1; private System.Windows.Forms.ToolStripSeparator toolStripSeparator16; private System.Windows.Forms.ToolStripMenuItem markToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem autoScrollSessionsToolStripMenuItem; - private System.Windows.Forms.ContextMenuStrip contextMenuStripMarkDropdown; + private System.Windows.Forms.ContextMenuStrip contextMenuStripMark; private System.Windows.Forms.ToolStripMenuItem redToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem goldToolStripMenuItem2; private System.Windows.Forms.ToolStripMenuItem greenToolStripMenuItem1; @@ -1875,6 +2063,37 @@ private System.Windows.Forms.ToolStripMenuItem responseDataToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem hostAddressToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem packetMessageTypeToolStripMenuItem; + private System.Windows.Forms.ContextMenuStrip contextMenuStripSelect; + private System.Windows.Forms.ContextMenuStrip contextMenuStripRemove; + private System.Windows.Forms.ToolStripMenuItem allToolStripMenuItem4; + private System.Windows.Forms.ToolStripMenuItem invertToolStripMenuItem1; + private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem2; + private System.Windows.Forms.ToolStripMenuItem selectToolStripMenuItem2; + private System.Windows.Forms.ToolStripSeparator toolStripSeparatorSelectPacketProto; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSelectPacketName; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemSelectProtocol; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemRemoveAll; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemRemoveSelected; + private System.Windows.Forms.ToolStripMenuItem toolStripMenuItemRemoveUnselected; + private System.Windows.Forms.ToolStripMenuItem enableStatisticsToolStripMenuItem; + private System.Windows.Forms.RadioButton radioButtonSimulator; + private System.Windows.Forms.RadioButton radioButtonViewer; + private System.Windows.Forms.ToolStripDropDownButton toolStripDropDownButton5; + private System.Windows.Forms.ToolStripMenuItem saveFilterSelectionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem loadFilterSelectionsToolStripMenuItem; + private ListViewNoFlicker listViewPacketFilters; + private System.Windows.Forms.ColumnHeader columnHeader1; + private ListViewNoFlicker listViewMessageFilters; + private System.Windows.Forms.ColumnHeader columnHeader2; + private System.Windows.Forms.ToolStripMenuItem saveOptionsOnExitToolStripMenuItem; + private System.Windows.Forms.SaveFileDialog saveFileDialog1; + private System.Windows.Forms.OpenFileDialog openFileDialog1; + private System.Windows.Forms.SaveFileDialog saveFileDialog2; + private System.Windows.Forms.OpenFileDialog openFileDialog2; + private System.Windows.Forms.ToolStripMenuItem startProxyOnStartupToolStripMenuItem; + private System.Windows.Forms.ToolStripSeparator toolStripSeparator6; + private System.Windows.Forms.ToolStripMenuItem optionsToolStripMenuItem; + private System.Windows.Forms.ToolStripMenuItem autoAddNewDiscoveredMessagesToolStripMenuItem; } } diff --git a/Programs/WinGridProxy/Form1.cs b/Programs/WinGridProxy/Form1.cs index bf9e555f..1f5ec4eb 100644 --- a/Programs/WinGridProxy/Form1.cs +++ b/Programs/WinGridProxy/Form1.cs @@ -1,4 +1,31 @@ -using System; +/* + * Copyright (c) 2009, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; using System.Net; using System.Collections; using System.Collections.Generic; @@ -15,8 +42,8 @@ using OpenMetaverse.Packets; using OpenMetaverse.StructuredData; using OpenMetaverse.Interfaces; using OpenMetaverse.Messages.Linden; -using Nwc.XmlRpc; using System.Xml; +using Nwc.XmlRpc; namespace WinGridProxy { @@ -26,8 +53,10 @@ namespace WinGridProxy private static bool IsProxyRunning = false; + private bool AutoScrollSessions = false; + ProxyManager proxy; - private Assembly openmvAssembly; + private int PacketCounter = 0; @@ -48,73 +77,39 @@ namespace WinGridProxy ProxyManager.OnPacketLog += new ProxyManager.PacketLogHandler(ProxyManager_OnPacketLog); ProxyManager.OnMessageLog += new ProxyManager.MessageLogHandler(ProxyManager_OnMessageLog); ProxyManager.OnLoginResponse += new ProxyManager.LoginLogHandler(ProxyManager_OnLoginResponse); - openmvAssembly = Assembly.Load("OpenMetaverse"); - if (openmvAssembly == null) throw new Exception("Assembly load exception"); - - //Store.DeserializeFromFile("settings.osd"); - - //InitProxyFilters(); - + ProxyManager.OnCapabilityAdded += new ProxyManager.CapsAddedHandler(ProxyManager_OnCapabilityAdded); } - private void InitProxyFilters() + void ProxyManager_OnCapabilityAdded(CapInfo cap) { - Store.DeserializeFromFile("settings.osd"); - - Type packetTypeType = typeof(PacketType); - System.Reflection.MemberInfo[] packetTypes = packetTypeType.GetMembers(); - checkedListBoxFiltersPackets.BeginUpdate(); - for (int i = 0; i < packetTypes.Length; i++) + if (this.InvokeRequired) { - if (packetTypes[i].MemberType == System.Reflection.MemberTypes.Field - && packetTypes[i].DeclaringType == packetTypeType) + this.BeginInvoke(new MethodInvoker(delegate() { - - string name = packetTypes[i].Name; - - PacketType pType; - - try - { - pType = packetTypeFromName(name); - checkedListBoxFiltersPackets.Items.Add(name, false); - } - catch (Exception) - { - continue; - } + ProxyManager_OnCapabilityAdded(cap); + })); + } + else + { + ListViewItem foundCap = listViewMessageFilters.FindItemWithText(cap.CapType); + if (foundCap == null) + { + ListViewItem addedItem = listViewMessageFilters.Items.Add(new ListViewItem(cap.CapType)); + if (autoAddNewDiscoveredMessagesToolStripMenuItem.Checked) + addedItem.Checked = true; } } - checkedListBoxFiltersPackets.Sorted = true; - - - // load from previous stored settings - - - checkedListBoxFiltersPackets.EndUpdate(); - - foreach (KeyValuePair kvp in Store.MessageSessions) - { - checkedListBoxFiltersMessages.Items.Add(kvp.Key, kvp.Value); - } - } - private static PacketType packetTypeFromName(string name) - { - Type packetTypeType = typeof(PacketType); - System.Reflection.FieldInfo f = packetTypeType.GetField(name); - if (f == null) throw new ArgumentException("Bad packet type"); + - return (PacketType)Enum.ToObject(packetTypeType, (int)f.GetValue(packetTypeType)); - } + #region Event Handlers void ProxyManager_OnPacketLog(Packet packet, Direction direction, IPEndPoint endpoint) { PacketAnalyzer_OnPacketLog(packet, direction, endpoint); } - void ProxyManager_OnLoginResponse(object request, Direction direction) { if (this.InvokeRequired) @@ -150,9 +145,8 @@ namespace WinGridProxy { if ((string)ht["login"] == "true") { - - Console.WriteLine("Refresh"); - buttonRefreshCapsList_Click(this, new EventArgs()); + //Console.WriteLine("Refresh"); + //buttonRefreshCapsList_Click(this, new EventArgs()); } } @@ -161,7 +155,6 @@ namespace WinGridProxy } } - void PacketAnalyzer_OnPacketLog(Packet packet, Direction direction, IPEndPoint endpoint) { if (this.InvokeRequired) @@ -194,9 +187,27 @@ namespace WinGridProxy } listViewSessions.Items.Add(session); + + if (AutoScrollSessions) + listViewSessions.EnsureVisible(listViewSessions.Items.Count - 1); } } + //void ProxyManager_OnEventQueueRunning() + //{ + // if (this.InvokeRequired) + // { + // this.BeginInvoke(new MethodInvoker(delegate() + // { + // ProxyManager_OnEventQueueRunning(); + // })); + // } + // else + // { + // buttonRefreshCapsList_Click(null, null); + // } + //} + void ProxyManager_OnMessageLog(CapsRequest req, CapsStage stage) { if (this.InvokeRequired) @@ -208,41 +219,60 @@ namespace WinGridProxy } else { - PacketCounter++; + ListViewItem found = listViewMessageFilters.FindItemWithText(req.Info.CapType); - string size = (stage == CapsStage.Request) ? req.Request.ToString().Length.ToString() : req.Response.ToString().Length.ToString(); - string[] s = { PacketCounter.ToString(), "CAPS", req.Info.CapType, size, req.Info.URI }; - ListViewItem session = new ListViewItem(s); - - session.Tag = req; - - if (stage == CapsStage.Request) + if (found != null && found.Checked) { - CapsOutCounter++; - CapsOutBytes += req.Request.ToString().Length; - session.ImageIndex = 0; + + PacketCounter++; + + // TODO: the sizes should be combined + string size = (stage == CapsStage.Request) ? req.Request.ToString().Length.ToString() : req.Response.ToString().Length.ToString(); + string[] s = { PacketCounter.ToString(), "CAPS", req.Info.CapType, size, req.Info.URI }; + ListViewItem session = new ListViewItem(s); + + session.Tag = req; + + if (stage == CapsStage.Request) + { + CapsOutCounter++; + CapsOutBytes += req.Request.ToString().Length; + session.ImageIndex = 1; + } + else + { + CapsInCounter++; + CapsInBytes += req.Response.ToString().Length; + session.ImageIndex = 0; + } + + listViewSessions.Items.Add(session); } else { - CapsInCounter++; - CapsInBytes += req.Response.ToString().Length; - session.ImageIndex = 1; - } + if (found == null) + { + // must be a new event not in KnownCaps, lets add it to the listview + ListViewItem addedItem = listViewMessageFilters.Items.Add(new ListViewItem(req.Info.CapType)); + addedItem.BackColor = Color.AliceBlue; - listViewSessions.Items.Add(session); + if (autoAddNewDiscoveredMessagesToolStripMenuItem.Checked) + addedItem.Checked = true; + } + } } } - private void button1_Click(object sender, EventArgs e) + #endregion + + #region GUI Event Handlers + + private void buttonStartProxy_Click(object sender, EventArgs e) { - if (button1.Text.StartsWith("Start") && IsProxyRunning.Equals(false)) { - - proxy = new ProxyManager(textBoxProxyPort.Text, textBoxProxyListenIP.Text, textBoxLoginURL.Text); - // start the proxy textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = textBoxLoginURL.Enabled = false; InitProxyFilters(); @@ -251,10 +281,8 @@ namespace WinGridProxy grpUDPFilters.Enabled = grpCapsFilters.Enabled = IsProxyRunning = true; button1.Text = "Stop Proxy"; - if (!timer1.Enabled) + if (enableStatisticsToolStripMenuItem.Checked && !timer1.Enabled) timer1.Enabled = true; - proxy.AddCapsDelegate("ParcelProperties", true); - proxy.AddCapsDelegate("AgentGroupDataUpdate", true); } else if (button1.Text.StartsWith("Stop") && IsProxyRunning.Equals(true)) { @@ -264,24 +292,16 @@ namespace WinGridProxy button1.Text = "Start Proxy"; textBoxProxyListenIP.Enabled = textBoxProxyPort.Enabled = textBoxLoginURL.Enabled = true; - if (timer1.Enabled) + if (!enableStatisticsToolStripMenuItem.Checked && timer1.Enabled) timer1.Enabled = false; } } - private void checkBox1_CheckedChanged(object sender, EventArgs e) + private void checkBoxCheckAllPackets_CheckedChanged(object sender, EventArgs e) { - for (int i = 0; i < checkedListBoxFiltersPackets.Items.Count; i++) + foreach (ListViewItem item in listViewPacketFilters.Items) { - checkedListBoxFiltersPackets.SetItemChecked(i, checkBox1.Checked); - } - } - - private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e) - { - if (e.CurrentValue != e.NewValue) - { - proxy.AddUDPDelegate(packetTypeFromName(checkedListBoxFiltersPackets.Items[e.Index].ToString()), (e.NewValue == CheckState.Checked)); + item.Checked = checkBoxCheckAllPackets.Checked; } } @@ -296,13 +316,15 @@ namespace WinGridProxy cap["capability"] = OSD.FromString(kvp.Value.CapType); cap["Enabled"] = OSD.FromBoolean(true); capsArray.Add(cap); - checkedListBoxFiltersMessages.BeginUpdate(); - if (!checkedListBoxFiltersMessages.Items.Contains(kvp.Value.CapType)) + + listViewMessageFilters.BeginUpdate(); + ListViewItem found = listViewMessageFilters.FindItemWithText(kvp.Value.CapType); + if(found == null) { - checkedListBoxFiltersMessages.Items.Add(kvp.Value.CapType); + listViewMessageFilters.Items.Add(kvp.Value.CapType); } - checkedListBoxFiltersMessages.Sorted = true; - checkedListBoxFiltersMessages.EndUpdate(); + listViewMessageFilters.Sort(); + listViewMessageFilters.EndUpdate(); } map["Capabilities"] = capsArray; @@ -310,22 +332,481 @@ namespace WinGridProxy } - private void checkBoxCheckallCaps_CheckedChanged(object sender, EventArgs e) + private void listViewSessions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) { - for (int i = 0; i < checkedListBoxFiltersMessages.Items.Count; i++) + + if (e.IsSelected && listViewSessions.SelectedItems.Count == 1) { - checkedListBoxFiltersMessages.SetItemChecked(i, checkBox2.Checked); + tabControl1.SelectTab("tabPageInspect"); + object tag = e.Item.Tag; + + if (tag is XmlRpcRequest) + { + XmlRpcRequest requestData = (XmlRpcRequest)tag; + + richTextBoxRawLogRequest.Text = requestData.ToString(); + updateTreeView(requestData.ToString(), treeViewRequestXml); + + Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(requestData.ToString())); + hexBoxRequest.ByteProvider = data; + + hexBoxResponse.ByteProvider = null; + richTextBoxRawLogResponse.Text = String.Empty; + treeViewResponseXml.Nodes.Clear(); + } + else if (tag is XmlRpcResponse) + { + XmlRpcResponse responseData = (XmlRpcResponse)tag; + + richTextBoxRawLogResponse.Text = responseData.ToString(); + updateTreeView(responseData.ToString(), treeViewResponseXml); + + Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(responseData.ToString())); + hexBoxResponse.ByteProvider = data; + + hexBoxRequest.ByteProvider = null; + richTextBoxRawLogRequest.Text = "No Data"; + treeViewRequestXml.Nodes.Clear(); + } + else if (tag is Packet) + { + Packet packet = (Packet)tag; + + Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(packet.ToBytes()); + + // 0 = incoming, 1 = outgoing + if (e.Item.ImageIndex == 1) + { + richTextBoxRawLogRequest.Text = TagToString(tag); + hexBoxRequest.ByteProvider = data; + treeViewRequestXml.Nodes.Clear(); + + richTextBoxRawLogResponse.Text = String.Empty; + hexBoxResponse.ByteProvider = null; + treeViewResponseXml.Nodes.Clear(); + } + else + { + richTextBoxRawLogRequest.Text = String.Empty; + hexBoxRequest.ByteProvider = null; + treeViewRequestXml.Nodes.Clear(); + + richTextBoxRawLogResponse.Text = TagToString(tag); + hexBoxResponse.ByteProvider = data; + treeViewResponseXml.Nodes.Clear(); + } + } + else if (tag is CapsRequest) + { + CapsRequest capsData = (CapsRequest)tag; + + if (capsData.Request != null) + { + richTextBoxRawLogRequest.Text = capsData.Request.ToString(); + updateTreeView(OSDParser.SerializeLLSDXmlString(capsData.Request), treeViewRequestXml); + Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(capsData.Request.ToString())); + hexBoxRequest.ByteProvider = data; + } + else + { + richTextBoxRawLogRequest.Text = "No Data"; + treeViewRequestXml.Nodes.Clear(); + hexBoxRequest.ByteProvider = null; + } + + if (capsData.Response != null) + { + richTextBoxRawLogResponse.Text = capsData.Response.ToString(); + updateTreeView(OSDParser.SerializeLLSDXmlString(capsData.Response), treeViewResponseXml); + Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(capsData.Response.ToString())); + hexBoxResponse.ByteProvider = data; + } + else + { + richTextBoxRawLogResponse.Text = "No Data"; + treeViewResponseXml.Nodes.Clear(); + hexBoxResponse.ByteProvider = null; + } + } } } - private void checkedListBoxCaps_ItemCheck(object sender, ItemCheckEventArgs e) + private void Form1_FormClosing(object sender, FormClosingEventArgs e) { - if (e.CurrentValue != e.NewValue) + if (IsProxyRunning) + proxy.Stop(); + + if(saveOptionsOnExitToolStripMenuItem.Checked) + SaveAllSettings("settings.osd"); + } + + // select all items in session list + private void sessionSelectAll_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) { - proxy.AddCapsDelegate(checkedListBoxFiltersMessages.Items[e.Index].ToString(), (e.NewValue == CheckState.Checked)); + item.Selected = true; } } + // unselect all items in session list + private void sessionSelectNone_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + item.Selected = false; + } + } + + // invert selection + private void sessionInvertSelection_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + item.Selected = !item.Selected; + } + } + + // remove all sessions + private void sessionRemoveAll_Click(object sender, EventArgs e) + { + listViewSessions.Items.Clear(); + } + + // remove sessions that are currently selected + private void sessionRemoveSelected_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.Selected) + listViewSessions.Items.Remove(item); + } + } + + // remove sessions that are not currently selected + private void sessionRemoveUnselected_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + if (!item.Selected) + listViewSessions.Items.Remove(item); + } + } + + // Colorize selected sessions + private void sessionMarkSelected_Click(object sender, EventArgs e) + { + ToolStripMenuItem menu = (ToolStripMenuItem)sender; + + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.Selected) + item.BackColor = Color.FromName(menu.Text); + } + sessionSelectNone_Click(sender, e); + } + + // Unmark selected sessions + private void sessionUnmarkSelected_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.Selected) + item.BackColor = Color.White; + } + sessionSelectNone_Click(sender, e); + } + + private void aboutWinGridProxyToolStripMenuItem_Click(object sender, EventArgs e) + { + AboutBox1 about = new AboutBox1(); + about.ShowDialog(); + } + + // Update Request Hexbox status bar with current cursor location + private void RequestPosition_Changed(object sender, EventArgs e) + { + if (hexBoxRequest.ByteProvider != null) + { + labelRequestHex.Text = string.Format("Ln {0} Col {1} bytes {2}", + hexBoxRequest.CurrentLine, hexBoxRequest.CurrentPositionInLine, hexBoxRequest.ByteProvider.Length); + } + } + + // Update Response Hexbox status bar with current cursor location + void ReplyPosition_Changed(object sender, EventArgs e) + { + if (hexBoxResponse.ByteProvider != null) + { + labelResponseHex.Text = string.Format("Ln {0} Col {1} bytes {2}", + hexBoxResponse.CurrentLine, hexBoxResponse.CurrentPositionInLine, hexBoxResponse.ByteProvider.Length); + } + } + + /// Enable or Disable Autoscrolling of the session list, Updates the Preferences and context menus + /// The ToolStripMenuItem sending the event + /// + private void sessionEnableAutoScroll_CheckedChanged(object sender, EventArgs e) + { + ToolStripMenuItem autoscroll = (ToolStripMenuItem)sender; + AutoScrollSessions = autoScrollSessionsToolStripMenuItem.Checked = toolStripMenuItemAutoScroll.Checked = autoscroll.Checked; + } + + // select all specified sessions by packet name + private void sessionSelectAllPacketType_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.SubItems[2].Text.Equals(toolStripMenuItemSelectPacketName.Tag) && !item.Selected) + item.Selected = true; + } + } + + private void sessionSelectAllProtocol_Click(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.SubItems[1].Text.Equals(toolStripMenuItemSelectProtocol.Tag) && !item.Selected) + item.Selected = true; + } + } + + // stop capturing selected filters + private void filterDisableByPacketName_CheckedChanged(object sender, EventArgs e) + { + if (enableDisableFilterByNameToolStripMenuItem.Tag != null) + { + ListViewItem found = listViewMessageFilters.FindItemWithText(enableDisableFilterByNameToolStripMenuItem.Tag.ToString()); + + if (found != null) + { + listViewMessageFilters.Items[found.Index].Checked = enableDisableFilterByNameToolStripMenuItem.Checked; + } + else + { + found = listViewPacketFilters.FindItemWithText(enableDisableFilterByNameToolStripMenuItem.Tag.ToString()); + + if (found != null) + listViewPacketFilters.Items[found.Index].Checked = enableDisableFilterByNameToolStripMenuItem.Checked; + } + } + } + + private void filterDisableByProtocolName_CheckedChanged(object sender, EventArgs e) + { + + } + + /// + /// Setup the context menu prior to it being displayed with specific entries for filtering packets/messages + /// + /// + /// + private void contextMenuStripSessions_Opening(object sender, CancelEventArgs e) + { + if (listViewSessions.FocusedItem != null) + { + string strPacketOrMessage = (listViewSessions.FocusedItem.SubItems[1].Text.Equals("UDP")) ? "Packets" : "Messages"; + + enableDisableFilterByNameToolStripMenuItem.Text = String.Format("Capture {0} {1}", listViewSessions.FocusedItem.SubItems[2].Text, strPacketOrMessage); + toolStripMenuItemSelectPacketName.Tag = enableDisableFilterByNameToolStripMenuItem.Tag = listViewSessions.FocusedItem.SubItems[2].Text; + + toolStripMenuItemSelectPacketName.Text = String.Format("All {0} {1}", listViewSessions.FocusedItem.SubItems[2].Text, strPacketOrMessage); + + toolStripMenuItemSelectProtocol.Text = String.Format("All {0} {1}", listViewSessions.FocusedItem.SubItems[1].Text, strPacketOrMessage); + + toolStripMenuItemSelectProtocol.Visible = + enableDisableFilterByNameToolStripMenuItem.Visible = + toolStripSeparatorSelectPacketProto.Visible = + toolStripSeparatorFilterPacketByName.Visible = + toolStripMenuItemSelectPacketName.Visible = true; + + // find checkstate of selected menuitem in packets or messages filters checkedListBoxes + bool ctxChecked = false; + + if (strPacketOrMessage.Equals("Packets")) + { + ListViewItem found = listViewPacketFilters.FindItemWithText(toolStripMenuItemSelectPacketName.Tag.ToString()); + if (found != null) + ctxChecked = found.Checked; + } + else if (strPacketOrMessage.Equals("Messages"))// && listViewMessageFilters.Items.ContainsKey(toolStripMenuItemSelectPacketName.Tag.ToString())) + { + ListViewItem found = listViewMessageFilters.FindItemWithText(toolStripMenuItemSelectPacketName.Tag.ToString()); + if (found != null) + ctxChecked = found.Checked; + } + enableDisableFilterByNameToolStripMenuItem.Checked = ctxChecked; + } + else + { + // Hide specific selection options on context menu + toolStripMenuItemSelectProtocol.Visible = + enableDisableFilterByNameToolStripMenuItem.Visible = + toolStripSeparatorSelectPacketProto.Visible = + toolStripSeparatorFilterPacketByName.Visible = + toolStripMenuItemSelectPacketName.Visible = false; + } + } + + private void findSessions_Click(object sender, EventArgs e) + { + FilterOptions opts = new FilterOptions((listViewSessions.SelectedItems.Count > 0)); + FormSessionSearch search = new FormSessionSearch(ref opts); + search.ShowDialog(); + + if (!String.IsNullOrEmpty(opts.SearchWhat)) + SearchSessions(opts); + + } + + // Enable Inject button if box contains text + private void richTextBoxInject_TextChanged(object sender, EventArgs e) + { + buttonInjectPacket.Enabled = (richTextBoxInject.TextLength > 0); + } + + private void buttonInjectPacket_Click(object sender, EventArgs e) + { + proxy.InjectPacket(richTextBoxInject.Text, true); + } + + private void saveFilterSelectionsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (saveFileDialog2.ShowDialog() == DialogResult.OK) + { + SaveAllSettings(saveFileDialog2.FileName); + } + } + + private void loadFilterSelectionsToolStripMenuItem_Click(object sender, EventArgs e) + { + if (openFileDialog2.ShowDialog() == DialogResult.OK) + { + RestoreSavedSettings(openFileDialog2.FileName); + } + } + + private void listViewMessageFilters_ItemChecked(object sender, ItemCheckedEventArgs e) + { + proxy.AddCapsDelegate(e.Item.Text, e.Item.Checked); + } + + private void listViewPacketFilters_ItemChecked(object sender, ItemCheckedEventArgs e) + { + proxy.AddUDPDelegate(packetTypeFromName(e.Item.Text), e.Item.Checked); + } + + + private void checkBoxCheckallCaps_CheckedChanged(object sender, EventArgs e) + { + foreach (ListViewItem item in listViewMessageFilters.Items) + { + item.Checked = checkBoxCheckAllMessages.Checked; + } + } + #endregion + + /// + /// Start/Stop the statistics gathering timer + /// + /// + /// + private void enableStatisticsToolStripMenuItem_CheckedChanged(object sender, EventArgs e) + { + if (timer1.Enabled && !enableStatisticsToolStripMenuItem.Checked) + timer1.Enabled = false; + + if (!timer1.Enabled && enableStatisticsToolStripMenuItem.Checked) + timer1.Enabled = true; + } + + private void saveSessionArchiveToolStripMenuItem_Click(object sender, EventArgs e) + { + Stream myStream; + if (saveFileDialog1.ShowDialog() == DialogResult.OK) + { + if ((myStream = saveFileDialog1.OpenFile()) != null) + { + StreamWriter wText = new StreamWriter(myStream); + OSDMap map = new OSDMap(1); + OSDArray sessionArray = new OSDArray(); + foreach (ListViewItem item in listViewSessions.Items) + { + OSDMap session = new OSDMap(); + session["name"] = OSD.FromString(item.Name); + session["image_index"] = OSD.FromInteger(item.ImageIndex); + session["id"] = OSD.FromString(item.SubItems[0].Text); + session["protocol"] = OSD.FromString(item.SubItems[1].Text); + session["packet"] = OSD.FromString(item.SubItems[2].Text); + session["size"] = OSD.FromString(item.SubItems[3].Text); + session["host"] = OSD.FromString(item.SubItems[4].Text); + session["tag"] = OSD.FromObject(item.Tag); + sessionArray.Add(session); + } + + map["sessions"] = sessionArray; + wText.Write(map.ToString()); + wText.Flush(); + + myStream.Close(); + } + } + } + + private void loadSessionArchiveToolStripMenuItem_Click(object sender, EventArgs e) + { + + if (openFileDialog1.ShowDialog() == DialogResult.OK) + { + OSD osd = OSDParser.DeserializeLLSDNotation(File.ReadAllText(openFileDialog1.FileName)); + OSDMap map = (OSDMap)osd; + OSDArray sessionsArray = (OSDArray)map["sessions"]; + + listViewSessions.Items.Clear(); + listViewSessions.BeginUpdate(); + for (int i = 0; i < sessionsArray.Count; i++) + { + OSDMap session = (OSDMap)sessionsArray[i]; + ListViewItem addedItem = listViewSessions.Items.Add(new ListViewItem(new string[] { + session["id"].AsString(), + session["protocol"].AsString(), + session["packet"].AsString(), + session["size"].AsString(), + session["host"].AsString()})); + + addedItem.ImageIndex = session["image_index"].AsInteger(); + addedItem.Tag = session["tag"].ToString(); + } + + listViewSessions.EndUpdate(); + } + } + + //Generic ListView sort event + private void listViewFilterSorter_ColumnClick(object sender, ColumnClickEventArgs e) + { + ListView lv = (ListView)sender; + //this.listViewPacketFilters.ListViewItemSorter = new ListViewItemComparer(e.Column); + ListViewItemComparer columnSorter = new ListViewItemComparer(); + columnSorter.column = e.Column; + + if ((columnSorter.bAscending = (lv.Sorting == SortOrder.Ascending))) + lv.Sorting = SortOrder.Descending; + else + lv.Sorting = SortOrder.Ascending; + + lv.ListViewItemSorter = columnSorter as IComparer; + } + + private void exitToolStripMenuItem1_Click(object sender, EventArgs e) + { + // warn if connected! + this.Close(); + } + + #region Helpers + // This is from omv Utils, once we get it prettied up put it back there public static string PacketToString(Packet packet) { @@ -354,7 +835,8 @@ namespace WinGridProxy if (packetArrayField.GetValue(nestedArrayRecord).GetType() == typeof(System.Byte[])) { result.AppendFormat("{0,30}: {1}" + System.Environment.NewLine, - packetArrayField.Name, new Color4((byte[])packetArrayField.GetValue(nestedArrayRecord), 0, false).ToString());// c4.ToString()); + packetArrayField.Name, + new Color4((byte[])packetArrayField.GetValue(nestedArrayRecord), 0, false).ToString()); } else { @@ -380,17 +862,30 @@ namespace WinGridProxy // decode bytes into strings else if (packetPropertyField.PropertyType.Equals(typeof(System.Byte[]))) { - result.AppendFormat("{0,30}: {1}" + System.Environment.NewLine, - packetPropertyField.Name, - Utils.BytesToString((byte[])packetPropertyField.GetValue(packetDataObject, null))); + // Handle TextureEntry fields specifically + if (packetPropertyField.Name.Equals("TextureEntry")) + { + byte[] tebytes = (byte[])packetPropertyField.GetValue(packetDataObject, null); + + Primitive.TextureEntry te = new Primitive.TextureEntry(tebytes, 0, tebytes.Length); + result.AppendFormat("{0,30}:\n{1}", packetPropertyField.Name, te.ToString()); + } + else + { + result.AppendFormat("{0,30}: {1} a[{2}]" + System.Environment.NewLine, + packetPropertyField.Name, + Utils.BytesToString((byte[])packetPropertyField.GetValue(packetDataObject, null)), + packetDataObject.GetType()); + } } else { // this seems to be limited to the length property, since all others have been previously handled if (packetPropertyField.Name != "Length") { - result.AppendFormat("{0,30}: {1}" + System.Environment.NewLine, - packetPropertyField.Name, packetPropertyField.GetValue(packetDataObject, null)); + result.AppendFormat("{0,30}: {1} b[{2}]" + System.Environment.NewLine, + packetPropertyField.Name, packetPropertyField.GetValue(packetDataObject, null), + packetPropertyField.GetType()); } } } @@ -399,87 +894,197 @@ namespace WinGridProxy return result.ToString(); } - private void listViewSessions_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e) + private void SaveAllSettings(string fileName) { - if (e.IsSelected) + Store.MessageSessions.Clear(); + Store.PacketSessions.Clear(); + + foreach (ListViewItem item in listViewPacketFilters.Items) { - tabControl1.SelectTab("tabPageInspect"); - object tag = e.Item.Tag; - - if (tag is XmlRpcRequest) + Store.PacketSessions.Add(item.Text, item.Checked); + } + + foreach (ListViewItem item in listViewMessageFilters.Items) + { + Store.MessageSessions.Add(item.Text, item.Checked); + } + + Store.StatisticsEnabled = enableStatisticsToolStripMenuItem.Checked; + Store.AutoScrollEnabled = autoScrollSessionsToolStripMenuItem.Checked; + Store.SaveSessionOnExit = saveOptionsOnExitToolStripMenuItem.Checked; + Store.AutoCheckNewCaps = autoAddNewDiscoveredMessagesToolStripMenuItem.Checked; + + Store.SerializeToFile(fileName); + } + + private void RestoreSavedSettings(string fileName) + { + // load saved settings from OSD Formatted file + + if (Store.DeserializeFromFile(fileName)) + { + autoScrollSessionsToolStripMenuItem.Checked = Store.AutoScrollEnabled; + enableStatisticsToolStripMenuItem.Checked = Store.StatisticsEnabled; + saveOptionsOnExitToolStripMenuItem.Checked = Store.SaveSessionOnExit; + autoAddNewDiscoveredMessagesToolStripMenuItem.Checked = Store.AutoCheckNewCaps; + + // Update message filter listview + listViewMessageFilters.BeginUpdate(); + foreach (KeyValuePair kvp in Store.MessageSessions) { - XmlRpcRequest requestData = (XmlRpcRequest)tag; - - richTextBoxRawLogRequest.Text = requestData.ToString(); - updateTreeView(requestData.ToString(), treeViewRequestXml); - - Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(requestData.ToString())); - hexBoxRequest.ByteProvider = data; - - hexBoxResponse.ByteProvider = null; - richTextBoxRawLogResponse.Text = String.Empty; - treeViewResponseXml.Nodes.Clear(); - } - else if (tag is XmlRpcResponse) - { - XmlRpcResponse responseData = (XmlRpcResponse)tag; - - richTextBoxRawLogResponse.Text = responseData.ToString(); - updateTreeView(responseData.ToString(), treeViewResponseXml); - - Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(responseData.ToString())); - hexBoxResponse.ByteProvider = data; - - hexBoxRequest.ByteProvider = null; - richTextBoxRawLogRequest.Text = "No Data"; - treeViewRequestXml.Nodes.Clear(); - } - else if (tag is Packet) - { - Packet packet = (Packet)tag; - - richTextBoxRawLogResponse.Text = PacketToString(packet); - - Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(packet.ToBytes()); - hexBoxResponse.ByteProvider = data; - - hexBoxRequest.ByteProvider = null; - richTextBoxRawLogRequest.Text = String.Empty; - treeViewRequestXml.Nodes.Clear(); - } - else if (tag is CapsRequest) - { - CapsRequest capsData = (CapsRequest)tag; - - if (capsData.Request != null) + ListViewItem foundMessage = listViewPacketFilters.FindItemWithText(kvp.Key); + if (foundMessage == null) { - richTextBoxRawLogRequest.Text = capsData.Request.ToString(); - updateTreeView(OSDParser.SerializeLLSDXmlString(capsData.Request), treeViewRequestXml); - Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(capsData.Request.ToString())); - hexBoxRequest.ByteProvider = data; + ListViewItem addedItem = listViewMessageFilters.Items.Add(kvp.Key); + addedItem.Checked = kvp.Value; } else { - richTextBoxRawLogRequest.Text = "No Data"; - treeViewRequestXml.Nodes.Clear(); - hexBoxRequest.ByteProvider = null; - } - - if (capsData.Response != null) - { - richTextBoxRawLogResponse.Text = capsData.Response.ToString(); - updateTreeView(OSDParser.SerializeLLSDXmlString(capsData.Response), treeViewResponseXml); - Be.Windows.Forms.DynamicByteProvider data = new Be.Windows.Forms.DynamicByteProvider(Utils.StringToBytes(capsData.Response.ToString())); - hexBoxResponse.ByteProvider = data; - } else { - richTextBoxRawLogResponse.Text = "No Data"; - treeViewResponseXml.Nodes.Clear(); - hexBoxResponse.ByteProvider = null; + foundMessage.Checked = kvp.Value; } } + listViewMessageFilters.EndUpdate(); + + // updateTreeView packet filter listview + listViewPacketFilters.BeginUpdate(); + foreach (KeyValuePair kvp in Store.PacketSessions) + { + ListViewItem foundPacket = listViewPacketFilters.FindItemWithText(kvp.Key); + if (foundPacket == null) + { + ListViewItem addedItem = listViewPacketFilters.Items.Add(new ListViewItem(kvp.Key)); + addedItem.Checked = kvp.Value; + } + else + { + foundPacket.Checked = kvp.Value; + } + } + listViewPacketFilters.EndUpdate(); } } + private void InitProxyFilters() + { + RestoreSavedSettings("settings.osd"); + + Type packetTypeType = typeof(PacketType); + System.Reflection.MemberInfo[] packetTypes = packetTypeType.GetMembers(); + + listViewPacketFilters.BeginUpdate(); + for (int i = 0; i < packetTypes.Length; i++) + { + if (packetTypes[i].MemberType == System.Reflection.MemberTypes.Field + && packetTypes[i].DeclaringType == packetTypeType) + { + + string name = packetTypes[i].Name; + + PacketType pType; + + try + { + pType = packetTypeFromName(name); + ListViewItem found = listViewPacketFilters.FindItemWithText(name); + if (!String.IsNullOrEmpty(name) && found == null) + { + ListViewItem addedItem = listViewPacketFilters.Items.Add(new ListViewItem(name)); + } + } + catch (Exception) + { + continue; + } + } + } + + listViewPacketFilters.Sort(); + + // load from previous stored settings + listViewPacketFilters.EndUpdate(); + } + + private static PacketType packetTypeFromName(string name) + { + Type packetTypeType = typeof(PacketType); + System.Reflection.FieldInfo f = packetTypeType.GetField(name); + if (f == null) throw new ArgumentException("Bad packet type"); + + return (PacketType)Enum.ToObject(packetTypeType, (int)f.GetValue(packetTypeType)); + } + + private void SearchSessions(FilterOptions opts) + { + Console.WriteLine("{1}: {0}", opts.HasSelection, "HasSelection"); + Console.WriteLine("{1}: {0}", opts.HighlightMatches, "HighlightMatches"); + Console.WriteLine("{1}: {0}", opts.MatchCase, "MatchCase"); + Console.WriteLine("{1}: {0}", opts.SearchSelected, "SearchSelected"); + Console.WriteLine("{1}: {0}", opts.SearchText, "SearchText"); + Console.WriteLine("{1}: {0}", opts.SearchWhat, "SearchWhat"); + Console.WriteLine("{1}: {0}", opts.SelectResults, "SelectResults"); + Console.WriteLine("{1}: {0}", opts.UnMarkPrevious, "UnmarkPrevious"); + + foreach (ListViewItem item in listViewSessions.Items) + { + if (item.Text.Contains(opts.SearchText) || TagToString(item.Tag).Contains(opts.SearchText)) + { + if (opts.UnMarkPrevious) + item.BackColor = Color.White; + + item.BackColor = opts.HighlightMatches; + + if (opts.SelectResults) + item.Selected = true; + else + item.Selected = false; + } + + + } + if (opts.SearchWhat.Equals("Both") || opts.SearchWhat.Equals("Messages")) + { + + } + } + + private string TagToString(object tag) + { + if (tag is XmlRpcRequest) + { + XmlRpcRequest requestData = (XmlRpcRequest)tag; + return requestData.ToString(); + } + else if (tag is XmlRpcResponse) + { + XmlRpcResponse responseData = (XmlRpcResponse)tag; + + return responseData.ToString(); + } + else if (tag is Packet) + { + Packet packet = (Packet)tag; + + return PacketToString(packet); + } + else if (tag is CapsRequest) + { + CapsRequest capsData = (CapsRequest)tag; + + if (capsData.Request != null) + { + return capsData.Request.ToString(); + } + + if (capsData.Response != null) + { + return capsData.Response.ToString(); + } + } + return string.Empty; + } + + #endregion + #region XML Tree private void updateTreeView(string xml, TreeView treeView) @@ -547,48 +1152,7 @@ namespace WinGridProxy #endregion - private void Form1_FormClosing(object sender, FormClosingEventArgs e) - { - if (IsProxyRunning) - proxy.Stop(); - - SaveAllSettings("settings.osd"); - } - - private void SaveAllSettings(string fileName) - { - Store.MessageSessions.Clear(); - Store.PacketSessions.Clear(); - - for (int i = 0; i < checkedListBoxFiltersMessages.Items.Count; i++) - { - bool cbchecked = false; - if (checkedListBoxFiltersMessages.CheckedItems.Contains(checkedListBoxFiltersMessages.Items[i])) - cbchecked = true; - - Store.MessageSessions.Add(checkedListBoxFiltersMessages.Items[i].ToString(), cbchecked); - } - - for (int i = 0; i < checkedListBoxFiltersPackets.Items.Count; i++) - { - bool cbchecked = false; - if (checkedListBoxFiltersPackets.CheckedItems.Contains(checkedListBoxFiltersPackets.Items[i])) - cbchecked = true; - - Store.PacketSessions.Add(checkedListBoxFiltersPackets.Items[i].ToString(), cbchecked); - } - - Store.SerializeToFile(fileName); - } - - void ReplyPosition_Changed(object sender, EventArgs e) - { - if (hexBoxResponse.ByteProvider != null) - { - labelResponseHex.Text = string.Format("Ln {0} Col {1} bytes {2}", - hexBoxResponse.CurrentLine, hexBoxResponse.CurrentPositionInLine, hexBoxResponse.ByteProvider.Length); - } - } + #region Timers private void timer1_Tick(object sender, EventArgs e) { @@ -611,250 +1175,7 @@ namespace WinGridProxy } } - // select all items - private void allToolStripMenuItem1_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - item.Selected = true; - } - } - - // unselect all items - private void noneToolStripMenuItem_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - item.Selected = false; - } - } - - // invert selection - private void invertSelectionsToolStripMenuItem_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - item.Selected = !item.Selected; - } - } - - // remove all sessions - private void removeAllToolStripMenuItem_Click(object sender, EventArgs e) - { - listViewSessions.Items.Clear(); - } - - // remove sessions that are currently selected - private void removeSelectedToolStripMenuItem_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - if (item.Selected) - listViewSessions.Items.Remove(item); - } - } - - // remove sessions that are not currently selected - private void removeUnselectedSessionsToolStripMenuItem_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - if (!item.Selected) - listViewSessions.Items.Remove(item); - } - } - - private void MarkColorToolStripMenuItem_Click(object sender, EventArgs e) - { - ToolStripMenuItem menu = (ToolStripMenuItem)sender; + #endregion - foreach (ListViewItem item in listViewSessions.Items) - { - if (item.Selected) - item.BackColor = Color.FromName(menu.Text); - } - noneToolStripMenuItem_Click(sender, e); - } - - // Unmark selected sessions - private void removeMarkToolStripMenuItem1_Click(object sender, EventArgs e) - { - foreach (ListViewItem item in listViewSessions.Items) - { - if (item.Selected) - item.BackColor = Color.White; - } - noneToolStripMenuItem_Click(sender, e); - } - - private void aboutWinGridProxyToolStripMenuItem_Click(object sender, EventArgs e) - { - AboutBox1 about = new AboutBox1(); - about.ShowDialog(); - } - - private void RequestPosition_Changed(object sender, EventArgs e) - { - if (hexBoxRequest.ByteProvider != null) - { - labelRequestHex.Text = string.Format("Ln {0} Col {1} bytes {2}", - hexBoxRequest.CurrentLine, hexBoxRequest.CurrentPositionInLine, hexBoxRequest.ByteProvider.Length); - } - } - } - - public class ProxyManager - { - public delegate void PacketLogHandler(Packet packet, Direction direction, IPEndPoint endpoint); - public static event PacketLogHandler OnPacketLog; - - public delegate void MessageLogHandler(CapsRequest req, CapsStage stage); - public static event MessageLogHandler OnMessageLog; - - public delegate void LoginLogHandler(object request, Direction direction); - public static event LoginLogHandler OnLoginResponse; - - private string _Port; - private string _ListenIP; - private string _LoginURI; - - ProxyFrame Proxy; - ProxyPlugin analyst; - - public ProxyManager(string port, string listenIP, string loginUri) - { - - _Port = string.Format("--proxy-login-port={0}", port); - - IPAddress remoteIP; // not used - if (IPAddress.TryParse(listenIP, out remoteIP)) - _ListenIP = String.Format("--proxy-client-facing-address={0}", listenIP); - else - _ListenIP = "--proxy-client-facing-address=127.0.0.1"; - - if (String.IsNullOrEmpty(loginUri)) - _LoginURI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; - else - _LoginURI = loginUri; - - - string[] args = { _Port, _ListenIP, _LoginURI }; - /* - help - proxy-help - proxy-login-port - proxy-client-facing-address - proxy-remote-facing-address - proxy-remote-login-uri - verbose - quiet - */ - - Proxy = new ProxyFrame(args); - - analyst = new PacketAnalyzer(Proxy); - analyst.Init(); - - Proxy.proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest)); - Proxy.proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse)); - - AddCapsDelegate("SeedCapability", true); - } - - public void Start() - { - - Proxy.proxy.Start(); - } - - public void Stop() - { - Proxy.proxy.Stop(); - } - - private void LoginRequest(XmlRpcRequest request) - { - if (OnLoginResponse != null) - OnLoginResponse(request, Direction.Outgoing); - } - - private void LoginResponse(XmlRpcResponse response) - { - if (OnLoginResponse != null) - OnLoginResponse(response, Direction.Incoming); - } - - - internal Dictionary GetCapabilities() - { - return Proxy.proxy.KnownCaps; - } - - internal void AddCapsDelegate(string capsKey, bool add) - { - if (add) - Proxy.proxy.AddCapsDelegate(capsKey, new CapsDelegate(CapsHandler)); - else - Proxy.proxy.RemoveCapRequestDelegate(capsKey, new CapsDelegate(CapsHandler)); - - } - - private bool CapsHandler(CapsRequest req, CapsStage stage) - { - if (OnMessageLog != null) - OnMessageLog(req, stage); - //Console.WriteLine(req); - return false; - } - - internal void AddUDPDelegate(PacketType packetType, bool add) - { - if (add) - { - Proxy.proxy.AddDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler)); - Proxy.proxy.AddDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler)); - } - else - { - Proxy.proxy.RemoveDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler)); - Proxy.proxy.RemoveDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler)); - } - } - - private Packet PacketInHandler(Packet packet, IPEndPoint endPoint) - { - if (OnPacketLog != null) - OnPacketLog(packet, Direction.Incoming, endPoint); - - return packet; - } - - private Packet PacketOutHandler(Packet packet, IPEndPoint endPoint) - { - if (OnPacketLog != null) - OnPacketLog(packet, Direction.Outgoing, endPoint); - - return packet; - } - - - } - - public class PacketAnalyzer : ProxyPlugin - { - private ProxyFrame frame; - private Proxy proxy; - - public PacketAnalyzer(ProxyFrame frame) - { - this.frame = frame; - this.proxy = frame.proxy; - } - - public override void Init() - { - - } - } } diff --git a/Programs/WinGridProxy/Form1.resx b/Programs/WinGridProxy/Form1.resx index 27ce35af..61ec2a85 100644 --- a/Programs/WinGridProxy/Form1.resx +++ b/Programs/WinGridProxy/Form1.resx @@ -120,9 +120,6 @@ 524, 17 - - 705, 17 - 309, 17 @@ -175,6 +172,21 @@ BQAD/wUACw== + + 185, 54 + + + 17, 54 + + + 705, 17 + + + 414, 17 + + + 116, 17 + 414, 17 @@ -217,6 +229,27 @@ AAAAAElFTkSuQmCC + + + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAgxJREFUOE+lkvtL + U2EYx+0PEbtpFwnBKPGKiJImGP0gYhIYs1E5GF5gIxkpA00JRSmMEF0ohMh+GaRWYlqabMVcNdS2QpaI + VqiDIYhk397vA6fXhCjyhYdzeM/5fp7vczkAdeL2cwho7v/wWzT1zcN+Pwhr51uY2/y41PQaF+wzKKiZ + QvaN58g0jyLd5KEUcQbg+84P/Cm2tncQjW3j68YWIqubCC3FcOJc478BAuGoZM6zvoRnakXEruEIjhc4 + /g5gZop9c+voGAyLbQIfeBZxLL9BA1jzXvuGbWamuKh+GmmVbswE19A59FEBbmoAG7YbsLtm2mZmiml9 + cvabNDwpz6YB7LYBoMXCumkJr7LOmnnHzBQ/9X2Bo2cOibm1GsBREbAQiYmw/8lnuCeWkVzcgnZlnw1j + 3HV/wuNXK6i/9x5Hc6wawDlTXHbLJ+LZUBQPRyKwdQdxutwl1h+NLXHh5Ht1ewBHsiwawCW57HyDAfWR + dvl0uhZQ1eqX8aVc7EKLqrum651ATLf9OJx5XQM4KmY0xPzZ0hFAiQJnXB0WwME0E3IsL5B17ZlADqWb + NYDrOepdlcysmTWWOrxqbceRWtaLk0VO1XW72D5Vckd2gMBfq8zdpmUG62NJvKM4+XyziDk24xmfWoGE + s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC + + + + 919, 17 + + + 226, 17 + iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 @@ -262,10 +295,16 @@ s1c0gHPmbrPTpHNJKOCo2G1mZs20zcwUJ5yp1AB5+8/zEwgF5GMVDxh4AAAAAElFTkSuQmCC - - 226, 17 + + 364, 54 - - 919, 17 + + 492, 54 + + + 622, 54 + + + 750, 54 \ No newline at end of file diff --git a/Programs/WinGridProxy/FormSessionSearch.Designer.cs b/Programs/WinGridProxy/FormSessionSearch.Designer.cs new file mode 100644 index 00000000..81803f3a --- /dev/null +++ b/Programs/WinGridProxy/FormSessionSearch.Designer.cs @@ -0,0 +1,256 @@ +namespace WinGridProxy +{ + partial class FormSessionSearch + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.label1 = new System.Windows.Forms.Label(); + this.textBoxFind = new System.Windows.Forms.TextBox(); + this.labelMarkColor = new System.Windows.Forms.Label(); + this.checkBoxMatchCase = new System.Windows.Forms.CheckBox(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.panelColor = new System.Windows.Forms.Panel(); + this.buttonPickColor = new System.Windows.Forms.Button(); + this.checkBoxUnmark = new System.Windows.Forms.CheckBox(); + this.checkBoxSelectMatches = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.comboBoxPacketsOrMessages = new System.Windows.Forms.ComboBox(); + this.checkBoxSearchSelected = new System.Windows.Forms.CheckBox(); + this.buttonClose = new System.Windows.Forms.Button(); + this.buttonFind = new System.Windows.Forms.Button(); + this.colorDialog1 = new System.Windows.Forms.ColorDialog(); + this.groupBox1.SuspendLayout(); + this.panelColor.SuspendLayout(); + this.SuspendLayout(); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 15); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(30, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Find:"; + // + // textBoxFind + // + this.textBoxFind.Location = new System.Drawing.Point(48, 12); + this.textBoxFind.Name = "textBoxFind"; + this.textBoxFind.Size = new System.Drawing.Size(231, 20); + this.textBoxFind.TabIndex = 1; + this.textBoxFind.TextChanged += new System.EventHandler(this.textBoxFind_TextChanged); + // + // labelMarkColor + // + this.labelMarkColor.AutoSize = true; + this.labelMarkColor.BackColor = System.Drawing.Color.Transparent; + this.labelMarkColor.Location = new System.Drawing.Point(27, 7); + this.labelMarkColor.Name = "labelMarkColor"; + this.labelMarkColor.Size = new System.Drawing.Size(72, 13); + this.labelMarkColor.TabIndex = 3; + this.labelMarkColor.Text = "Mark Results:"; + // + // checkBoxMatchCase + // + this.checkBoxMatchCase.AutoSize = true; + this.checkBoxMatchCase.Location = new System.Drawing.Point(9, 46); + this.checkBoxMatchCase.Name = "checkBoxMatchCase"; + this.checkBoxMatchCase.Size = new System.Drawing.Size(83, 17); + this.checkBoxMatchCase.TabIndex = 4; + this.checkBoxMatchCase.Text = "Match Case"; + this.checkBoxMatchCase.UseVisualStyleBackColor = true; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.panelColor); + this.groupBox1.Controls.Add(this.checkBoxUnmark); + this.groupBox1.Controls.Add(this.checkBoxSelectMatches); + this.groupBox1.Controls.Add(this.label3); + this.groupBox1.Controls.Add(this.comboBoxPacketsOrMessages); + this.groupBox1.Controls.Add(this.checkBoxSearchSelected); + this.groupBox1.Controls.Add(this.checkBoxMatchCase); + this.groupBox1.Location = new System.Drawing.Point(15, 38); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(271, 145); + this.groupBox1.TabIndex = 5; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Options"; + // + // panelColor + // + this.panelColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); + this.panelColor.Controls.Add(this.buttonPickColor); + this.panelColor.Controls.Add(this.labelMarkColor); + this.panelColor.Location = new System.Drawing.Point(10, 111); + this.panelColor.Name = "panelColor"; + this.panelColor.Size = new System.Drawing.Size(255, 28); + this.panelColor.TabIndex = 11; + // + // buttonPickColor + // + this.buttonPickColor.BackColor = System.Drawing.SystemColors.ButtonFace; + this.buttonPickColor.FlatStyle = System.Windows.Forms.FlatStyle.Popup; + this.buttonPickColor.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.buttonPickColor.Location = new System.Drawing.Point(134, 3); + this.buttonPickColor.Name = "buttonPickColor"; + this.buttonPickColor.Size = new System.Drawing.Size(66, 21); + this.buttonPickColor.TabIndex = 10; + this.buttonPickColor.Text = "Pick Color"; + this.buttonPickColor.UseVisualStyleBackColor = false; + this.buttonPickColor.Click += new System.EventHandler(this.button1_Click); + // + // checkBoxUnmark + // + this.checkBoxUnmark.AutoSize = true; + this.checkBoxUnmark.Checked = true; + this.checkBoxUnmark.CheckState = System.Windows.Forms.CheckState.Checked; + this.checkBoxUnmark.Location = new System.Drawing.Point(144, 92); + this.checkBoxUnmark.Name = "checkBoxUnmark"; + this.checkBoxUnmark.Size = new System.Drawing.Size(120, 17); + this.checkBoxUnmark.TabIndex = 9; + this.checkBoxUnmark.Text = "Unmark Old Results"; + this.checkBoxUnmark.UseVisualStyleBackColor = true; + // + // checkBoxSelectMatches + // + this.checkBoxSelectMatches.AutoSize = true; + this.checkBoxSelectMatches.Location = new System.Drawing.Point(9, 92); + this.checkBoxSelectMatches.Name = "checkBoxSelectMatches"; + this.checkBoxSelectMatches.Size = new System.Drawing.Size(100, 17); + this.checkBoxSelectMatches.TabIndex = 8; + this.checkBoxSelectMatches.Text = "Select Matches"; + this.checkBoxSelectMatches.UseVisualStyleBackColor = true; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(6, 22); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(44, 13); + this.label3.TabIndex = 7; + this.label3.Text = "Search:"; + // + // comboBoxPacketsOrMessages + // + this.comboBoxPacketsOrMessages.FormattingEnabled = true; + this.comboBoxPacketsOrMessages.Items.AddRange(new object[] { + "Both", + "Messages", + "Packets"}); + this.comboBoxPacketsOrMessages.Location = new System.Drawing.Point(84, 19); + this.comboBoxPacketsOrMessages.Name = "comboBoxPacketsOrMessages"; + this.comboBoxPacketsOrMessages.Size = new System.Drawing.Size(180, 21); + this.comboBoxPacketsOrMessages.TabIndex = 6; + this.comboBoxPacketsOrMessages.Text = "Both"; + // + // checkBoxSearchSelected + // + this.checkBoxSearchSelected.AutoSize = true; + this.checkBoxSearchSelected.Enabled = false; + this.checkBoxSearchSelected.Location = new System.Drawing.Point(9, 69); + this.checkBoxSearchSelected.Name = "checkBoxSearchSelected"; + this.checkBoxSearchSelected.Size = new System.Drawing.Size(168, 17); + this.checkBoxSearchSelected.TabIndex = 5; + this.checkBoxSearchSelected.Text = "Search only selected sessions"; + this.checkBoxSearchSelected.UseVisualStyleBackColor = true; + // + // buttonClose + // + this.buttonClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.buttonClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonClose.Location = new System.Drawing.Point(15, 195); + this.buttonClose.Name = "buttonClose"; + this.buttonClose.Size = new System.Drawing.Size(75, 23); + this.buttonClose.TabIndex = 6; + this.buttonClose.Text = "Close"; + this.buttonClose.UseVisualStyleBackColor = true; + this.buttonClose.Click += new System.EventHandler(this.buttonClose_Click); + // + // buttonFind + // + this.buttonFind.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonFind.Enabled = false; + this.buttonFind.Location = new System.Drawing.Point(166, 195); + this.buttonFind.Name = "buttonFind"; + this.buttonFind.Size = new System.Drawing.Size(120, 23); + this.buttonFind.TabIndex = 7; + this.buttonFind.Text = "Find Sessions"; + this.buttonFind.UseVisualStyleBackColor = true; + this.buttonFind.Click += new System.EventHandler(this.buttonFind_Click); + // + // colorDialog1 + // + this.colorDialog1.Color = System.Drawing.Color.Yellow; + this.colorDialog1.FullOpen = true; + // + // FormSessionSearch + // + this.AcceptButton = this.buttonFind; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonClose; + this.ClientSize = new System.Drawing.Size(298, 230); + this.Controls.Add(this.buttonFind); + this.Controls.Add(this.buttonClose); + this.Controls.Add(this.groupBox1); + this.Controls.Add(this.textBoxFind); + this.Controls.Add(this.label1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSessionSearch"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Find Sessions"; + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.panelColor.ResumeLayout(false); + this.panelColor.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox textBoxFind; + private System.Windows.Forms.Label labelMarkColor; + private System.Windows.Forms.CheckBox checkBoxMatchCase; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button buttonClose; + private System.Windows.Forms.Button buttonFind; + private System.Windows.Forms.CheckBox checkBoxUnmark; + private System.Windows.Forms.CheckBox checkBoxSelectMatches; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.ComboBox comboBoxPacketsOrMessages; + private System.Windows.Forms.CheckBox checkBoxSearchSelected; + private System.Windows.Forms.Button buttonPickColor; + private System.Windows.Forms.ColorDialog colorDialog1; + private System.Windows.Forms.Panel panelColor; + } +} \ No newline at end of file diff --git a/Programs/WinGridProxy/FormSessionSearch.cs b/Programs/WinGridProxy/FormSessionSearch.cs new file mode 100644 index 00000000..b3f78ad3 --- /dev/null +++ b/Programs/WinGridProxy/FormSessionSearch.cs @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2009, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace WinGridProxy +{ + + public partial class FormSessionSearch : Form + { + private FilterOptions FilterOpts; + public FormSessionSearch(ref FilterOptions filterOptions) + { + + InitializeComponent(); + filterOptions.SearchText = "Foo Bar"; + FilterOpts = filterOptions; + this.checkBoxSearchSelected.Enabled = filterOptions.HasSelection; + } + + private void textBoxFind_TextChanged(object sender, EventArgs e) + { + buttonFind.Enabled = (textBoxFind.TextLength > 0); + } + + private void buttonClose_Click(object sender, EventArgs e) + { + FilterOpts.SearchText = String.Empty; + } + + private void buttonFind_Click(object sender, EventArgs e) + { + FilterOpts.HighlightMatches = panelColor.BackColor; + FilterOpts.MatchCase = checkBoxMatchCase.Checked; + FilterOpts.SearchSelected = checkBoxSearchSelected.Checked; + FilterOpts.SearchText = textBoxFind.Text; + FilterOpts.SearchWhat = comboBoxPacketsOrMessages.SelectedItem.ToString(); + FilterOpts.SelectResults = checkBoxSelectMatches.Checked; + FilterOpts.UnMarkPrevious = checkBoxUnmark.Checked; + this.Close(); + + } + + private void button1_Click(object sender, EventArgs e) + { + if (colorDialog1.ShowDialog() == DialogResult.OK) + { + panelColor.BackColor = colorDialog1.Color; + } + } + } + + public class FilterOptions + { + public bool HasSelection; // set to true if SessionList has sessions selected already; + + public string SearchText; + public string SearchWhat; // Both, Messages, Packets + public bool MatchCase; + public bool SearchSelected; + public bool SelectResults; + public bool UnMarkPrevious; + public Color HighlightMatches; + + public FilterOptions(bool hasSelection) + { + this.HasSelection = hasSelection; + } + } +} diff --git a/Programs/WinGridProxy/FormSessionSearch.resx b/Programs/WinGridProxy/FormSessionSearch.resx new file mode 100644 index 00000000..cd492d3b --- /dev/null +++ b/Programs/WinGridProxy/FormSessionSearch.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/Programs/WinGridProxy/ListViewNoFlicker.cs b/Programs/WinGridProxy/ListViewNoFlicker.cs index a86bb6d9..41265095 100644 --- a/Programs/WinGridProxy/ListViewNoFlicker.cs +++ b/Programs/WinGridProxy/ListViewNoFlicker.cs @@ -1,4 +1,30 @@ -using System; +/* + * Copyright (c) 2009, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; using System.Collections.Generic; using System.Text; using System.Windows.Forms; @@ -10,22 +36,90 @@ namespace WinGridProxy public ListViewNoFlicker() { - //Activate double buffering - this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + //Activate double buffering + this.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint, true); + + //Enable the OnNotifyMessage event so we get a chance to filter out + // Windows messages before they get to the form's WndProc + this.SetStyle(ControlStyles.EnableNotifyMessage, true); + } + + protected override void OnNotifyMessage(Message m) + { + //Filter out the WM_ERASEBKGND message + if (m.Msg != 0x14) + { + base.OnNotifyMessage(m); + } + } - //Enable the OnNotifyMessage event so we get a chance to filter out - // Windows messages before they get to the form's WndProc - this.SetStyle(ControlStyles.EnableNotifyMessage, true); } - protected override void OnNotifyMessage(Message m) + public class ListViewItemComparer : IComparer { - //Filter out the WM_ERASEBKGND message - if(m.Msg != 0x14) + // Initialize the variables to default + public int column = 0; + public bool bAscending = true; + + // Using the Compare function of IComparer + public int Compare(object x, object y) { - base.OnNotifyMessage(m); + // Cast the objects to ListViewItems + ListViewItem lvi1 = (ListViewItem)x; + ListViewItem lvi2 = (ListViewItem)y; + + // If the column is the string columns + if (column != 2) + { + string lvi1String = lvi1.SubItems[column].ToString(); + string lvi2String = lvi2.SubItems[column].ToString(); + + // Return the normal Compare + if (bAscending) + return String.Compare(lvi1String, lvi2String); + + // Return the negated Compare + return -String.Compare(lvi1String, lvi2String); + } + + // The column is the Age column + int lvi1Int = ParseListItemString(lvi1.SubItems[column].ToString()); + int lvi2Int = ParseListItemString(lvi2.SubItems[column].ToString()); + + // Return the normal compare.. if x < y then return -1 + if (bAscending) + { + if (lvi1Int < lvi2Int) + return -1; + else if (lvi1Int == lvi2Int) + return 0; + + return 1; + } + + // Return the opposites for descending + if (lvi1Int > lvi2Int) + return -1; + else if (lvi1Int == lvi2Int) + return 0; + + return 1; + } + + private int ParseListItemString(string x) + { + //ListViewItems are returned like this: "ListViewSubItem: {19}" + int counter = 0; + for (int i = x.Length - 1; i >= 0; i--, counter++) + { + if (x[i] == '{') + break; + } + + return Int32.Parse(x.Substring(x.Length - counter, counter - 1)); } } - } + + } diff --git a/Programs/WinGridProxy/Properties/Resources.resx b/Programs/WinGridProxy/Properties/Resources.resx index 4957d2a4..97283aa1 100644 --- a/Programs/WinGridProxy/Properties/Resources.resx +++ b/Programs/WinGridProxy/Properties/Resources.resx @@ -118,9 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - ..\Resources\Help.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a - ..\Resources\InstallWelcome.bmp;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a diff --git a/Programs/WinGridProxy/ProxyManager.cs b/Programs/WinGridProxy/ProxyManager.cs new file mode 100644 index 00000000..8696198b --- /dev/null +++ b/Programs/WinGridProxy/ProxyManager.cs @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2009, openmetaverse.org + * All rights reserved. + * + * - Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * - Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * - Neither the name of the openmetaverse.org nor the names + * of its contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Net; +using System.Collections.Generic; +using System.Text; +using GridProxy; +using Nwc.XmlRpc; +using OpenMetaverse.Packets; +using OpenMetaverse.StructuredData; + +namespace WinGridProxy +{ + public class ProxyManager + { + public delegate void PacketLogHandler(Packet packet, Direction direction, IPEndPoint endpoint); + public static event PacketLogHandler OnPacketLog; + + public delegate void MessageLogHandler(CapsRequest req, CapsStage stage); + public static event MessageLogHandler OnMessageLog; + + public delegate void LoginLogHandler(object request, Direction direction); + public static event LoginLogHandler OnLoginResponse; + + public delegate void CapsAddedHandler(CapInfo cap); + public static event CapsAddedHandler OnCapabilityAdded; + + private string _Port; + private string _ListenIP; + private string _LoginURI; + + ProxyFrame Proxy; + + public ProxyManager(string port, string listenIP, string loginUri) + { + + _Port = string.Format("--proxy-login-port={0}", port); + + IPAddress remoteIP; // not used + if (IPAddress.TryParse(listenIP, out remoteIP)) + _ListenIP = String.Format("--proxy-client-facing-address={0}", listenIP); + else + _ListenIP = "--proxy-client-facing-address=127.0.0.1"; + + if (String.IsNullOrEmpty(loginUri)) + _LoginURI = "https://login.agni.lindenlab.com/cgi-bin/login.cgi"; + else + _LoginURI = loginUri; + + + string[] args = { _Port, _ListenIP, _LoginURI }; + /* + help + proxy-help + proxy-login-port + proxy-client-facing-address + proxy-remote-facing-address + proxy-remote-login-uri + verbose + quiet + */ + + ProxyConfig pc = new ProxyConfig("WinGridProxy", "Jim Radford", args); + + Proxy = new ProxyFrame(args, pc); + + + Proxy.proxy.SetLoginRequestDelegate(new XmlRpcRequestDelegate(LoginRequest)); + Proxy.proxy.SetLoginResponseDelegate(new XmlRpcResponseDelegate(LoginResponse)); + + Proxy.proxy.AddCapsDelegate("EventQueueGet", new CapsDelegate(EventQueueGetHandler)); + + Proxy.proxy.KnownCaps.AddDelegate(OpenMetaverse.DictionaryEventAction.Add, new OpenMetaverse.DictionaryChangeCallback(KnownCapsAddedHandler)); + } + + public void Start() + { + Proxy.proxy.Start(); + } + + public void Stop() + { + Proxy.proxy.Stop(); + } + + public void KnownCapsAddedHandler(OpenMetaverse.DictionaryEventAction action, System.Collections.DictionaryEntry de) + { + if (OnCapabilityAdded != null) + OnCapabilityAdded((CapInfo)de.Value); + } + + private void LoginRequest(XmlRpcRequest request) + { + if (OnLoginResponse != null) + OnLoginResponse(request, Direction.Outgoing); + } + + private void LoginResponse(XmlRpcResponse response) + { + if (OnLoginResponse != null) + OnLoginResponse(response, Direction.Incoming); + } + + + internal OpenMetaverse.ObservableDictionary GetCapabilities() + { + return Proxy.proxy.KnownCaps; + } + + internal void AddCapsDelegate(string capsKey, bool add) + { + if (add) + Proxy.proxy.AddCapsDelegate(capsKey, new CapsDelegate(CapsHandler)); + else + Proxy.proxy.RemoveCapRequestDelegate(capsKey, new CapsDelegate(CapsHandler)); + + } + + private bool CapsHandler(CapsRequest req, CapsStage stage) + { + if (OnMessageLog != null) + OnMessageLog(req, stage); + return false; + } + + private bool EventQueueGetHandler(CapsRequest req, CapsStage stage) + { + if (stage == CapsStage.Response) + { + OSDMap map = (OSDMap)req.Response; + OSDArray eventsArray = (OSDArray)map["events"]; + + for (int i = 0; i < eventsArray.Count; i++) + { + OSDMap bodyMap = (OSDMap)eventsArray[i]; + if (OnMessageLog != null) + { + CapInfo capInfo = new CapInfo(req.Info.URI, req.Info.Sim, bodyMap["message"].AsString()); + CapsRequest capReq = new CapsRequest(capInfo); + capReq.Request = req.Request; + capReq.Response = bodyMap; + + OnMessageLog(capReq, CapsStage.Response); + } + + //Console.WriteLine("[" + i + "] " + bodyMap["message"].AsString()); + } + } + return false; + } + + internal void AddUDPDelegate(PacketType packetType, bool add) + { + if (add) + { + Proxy.proxy.AddDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler)); + Proxy.proxy.AddDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler)); + } + else + { + Proxy.proxy.RemoveDelegate(packetType, Direction.Incoming, new PacketDelegate(PacketInHandler)); + Proxy.proxy.RemoveDelegate(packetType, Direction.Outgoing, new PacketDelegate(PacketOutHandler)); + } + } + + private Packet PacketInHandler(Packet packet, IPEndPoint endPoint) + { + if (OnPacketLog != null) + OnPacketLog(packet, Direction.Incoming, endPoint); + + return packet; + } + + private Packet PacketOutHandler(Packet packet, IPEndPoint endPoint) + { + if (OnPacketLog != null) + OnPacketLog(packet, Direction.Outgoing, endPoint); + + return packet; + } + + internal void InjectPacket(string packetData, bool toSimulator) + { + + } + } +} diff --git a/Programs/WinGridProxy/Resources/Help.png b/Programs/WinGridProxy/Resources/Help.png deleted file mode 100644 index f37ea408b22072845f8ba0e861efe964e4a78cc9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 892 zcmV-?1B3jDP)}-cAxV!6e3XQ8!m??L=AIl`(IMUe*gi>eWE+wm)GPV^_Nx3|UzR z6Nb>cx?R}8aCCDpSX*5|oLFOK*QnLJoaCImp5*L8I_y4I4?JI+3(rv$L}!q38!+b!+cA+D$<&2cx4EIux69+N9aE z@cCT$dI6Wu3$HHyK<#3Ccak^iNu207?L8Ims}3=dANVS#nY!=%0@Se(&V#G zPl!aEsA`4p_Okdr3c*H7N<^aziWcmds1`ag4A6Bb6ku;Jimrp%wrLI+SaywaxyE0I zCVxmSsJ4)fB|dq(XF@S*BH10#s8^s~he`#CRh!e4$;E3q<}cR}9gx@Se7WsG4Y>iZ zC7V)3O)3DgBmvNr+q@iTaNJwxlBVmx+7f6;xMir-&JO%o)X;rFg69M>k8AkdwTx2CXV)}MA2efOv@I-JpN)Z9G*Yz>T~$JRD>!aREaUw;G@wl#uI*?l^d8I z?|(a6uX5?=QTs*a@w~jXwRLoTEETtl!BN-6C|<9EP$k}Xne@19N=BJ-qt2-oLZ}i7 zZ9KpJiPv~|cX4s?YZ*WY@zZdueZ$;$^?4E@B9RWNEerMNA96*5XI*hbK*h>cupVsC z+xYpH&5b9wcXxNsR8FVUmeZ-+ONETE>$!QQoW)@@o#Z>iWJM>(nF^Ih2Y5DrZwvk5 z-Hj)YZ?CSdR$pu5D`sY9Mv}?oLLd~KFlr(R;8m*`y>Pg8aBy&Ed3pJ@I{ynl*I5iS SW8W440000 MessageSessions; - public Dictionary PacketSessions; + public bool AutoScrollEnabled; + public bool StatisticsEnabled; + public bool SaveSessionOnExit; + public bool AutoCheckNewCaps; public SettingsStore() { @@ -20,26 +49,37 @@ namespace WinGridProxy public OSDMap Serialize() { - OSDMap map = new OSDMap(2); - OSDArray messageArray = new OSDArray(MessageSessions.Count); - foreach (KeyValuePair kvp in MessageSessions) + OSDMap map = new OSDMap(); + if (MessageSessions.Count > 0) { - OSDMap sessionMap = new OSDMap(2); - sessionMap["Capability"] = OSD.FromString(kvp.Key); - sessionMap["Capture"] = OSD.FromBoolean(kvp.Value); - messageArray.Add(sessionMap); + OSDArray messageArray = new OSDArray(MessageSessions.Count); + foreach (KeyValuePair kvp in MessageSessions) + { + OSDMap sessionMap = new OSDMap(2); + sessionMap["Capability"] = OSD.FromString(kvp.Key); + sessionMap["Capture"] = OSD.FromBoolean(kvp.Value); + messageArray.Add(sessionMap); + } + map.Add("message_sessions", messageArray); } - map["message_sessions"] = messageArray; - OSDArray packetArray = new OSDArray(PacketSessions.Count); - foreach (KeyValuePair kvp in PacketSessions) + if (PacketSessions.Count > 0) { - OSDMap sessionMap = new OSDMap(2); - sessionMap["PacketName"] = OSD.FromString(kvp.Key); - sessionMap["Capture"] = OSD.FromBoolean(kvp.Value); - packetArray.Add(sessionMap); + OSDArray packetArray = new OSDArray(PacketSessions.Count); + foreach (KeyValuePair kvp in PacketSessions) + { + OSDMap sessionMap = new OSDMap(2); + sessionMap["PacketName"] = OSD.FromString(kvp.Key); + sessionMap["Capture"] = OSD.FromBoolean(kvp.Value); + packetArray.Add(sessionMap); + } + map.Add("packet_sessions", packetArray); } - map["packet_sessions"] = packetArray; + + map.Add("AutoScrollSessions", OSD.FromBoolean(AutoScrollEnabled)); + map.Add("CaptureStatistics", OSD.FromBoolean(StatisticsEnabled)); + map.Add("SaveProfileOnExit", OSD.FromBoolean(SaveSessionOnExit)); + map.Add("AutoCheckNewCaps", OSD.FromBoolean(AutoCheckNewCaps)); return map; } @@ -49,6 +89,12 @@ namespace WinGridProxy if (map.ContainsKey("message_sessions")) { + + AutoScrollEnabled = map["AutoScrollSessions"].AsBoolean(); + StatisticsEnabled = map["CaptureStatistics"].AsBoolean(); + SaveSessionOnExit = map["SaveProfileOnExit"].AsBoolean(); + AutoCheckNewCaps = map["AutoCheckNewCaps"].AsBoolean(); + OSDArray messageArray = (OSDArray)map["message_sessions"]; MessageSessions = new Dictionary(messageArray.Count); @@ -86,14 +132,22 @@ namespace WinGridProxy } - public void DeserializeFromFile(string fileName) + public bool DeserializeFromFile(string fileName) { - - if(File.Exists(fileName)) + if (File.Exists(fileName)) { - OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(File.ReadAllText(fileName)); - this.Deserialize(map); + try + { + OSDMap map = (OSDMap)OSDParser.DeserializeLLSDNotation(File.ReadAllText(fileName)); + this.Deserialize(map); + return true; + } + catch (Exception e) + { + Console.WriteLine("Exception Deserializing From File: {0} {1}", e.Message, e.StackTrace); + } } + return false; } public void SerializeToFile(string fileName)