eex Wiki Rss Feedhttp://eex.codeplex.com/eex Wiki Rss DescriptionUpdated Wiki: Documentationhttps://eex.codeplex.com/documentation?version=18<div class="wikidoc"><h1>Documentation</h1>
This page provides documentation about the core functions of the network library and an entrance to application development. If you didn&#39;t find the information you have been searching for, you are <b>strongly encouraged</b> to ask for it in the discussion-tab.
<h2>Key Principles</h2>
In the network library, there are three main concepts, which provide the basics of the network library architecture:<br />
<ul><li>The first one is the <a href="https://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Documentation">Traffic Handler</a> class. It provides methods to modify network frames and to be linked up with other traffic handlers. </li>
<li>The second one is the <a href="https://eex.codeplex.com/wikipage?title=Frame&referringTitle=Documentation">Frame</a> class. A frame represents any network packet, but frames can be parsed or casted to IP frames, Ethernet frames, TCP frames and so on. A frame provides also methods to parse itself from raw data or to convert the frame object back to raw data.</li>
<li>The third one is the <a href="https://eex.codeplex.com/wikipage?title=Relations&referringTitle=Documentation">Layer Architecture</a>, which provides support for larger, more dynamic applications which can also support plug-ins, like the <a href="https://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Documentation">eEx NetLab</a></li></ul>
<br />It is very important to understand these principles, but if you once understand them, working with the network library will become very easy.
<h2>Start over with developing</h2>
It is useful to get familiar with the concept of the <a href="https://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Documentation">Traffic Handler</a>, the <a href="https://eex.codeplex.com/wikipage?title=Frame&referringTitle=Documentation">Frame</a>, and the <a href="https://eex.codeplex.com/wikipage?title=Relations&referringTitle=Documentation">Layer Architecture</a>, which are already described above before starting development. Also, it is good practice to get used to the way Traffic Handlers are linked and interact together by playing around with the <a href="https://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Documentation">NetLab</a> a bit and to test out scenarios you want to program. <br /><br /><b><a href="https://eex.codeplex.com/wikipage?title=Application%20Development&referringTitle=Documentation">Writing your own applications</a></b> based on the network library<br /><b><a href="https://eex.codeplex.com/wikipage?title=Plug-in%20Development&referringTitle=Documentation">Writing plug-ins</a></b> for the Network Library Management Layer or the NetLab<br /></div><div class="ClearBoth"></div>emisweltFri, 16 Aug 2013 13:26:42 GMTUpdated Wiki: Documentation 20130816012642PUpdated Wiki: Homehttps://eex.codeplex.com/wikipage?version=31<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="https://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="https://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><img src="http://download-codeplex.sec.s-msft.com/Download?ProjectName=eex&DownloadId=307390" alt="NetLab&#32;AINAC.png" title="NetLab&#32;AINAC.png" /><br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li>
<li><b>Extensibility</b> - Implement your own <a href="https://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
<b>Head over to <a href="https://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a></b> <br /><br /></div><div class="ClearBoth"></div>emisweltFri, 16 Aug 2013 13:25:44 GMTUpdated Wiki: Home 20130816012544PUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=30<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><img src="http://i3.codeplex.com/Download?ProjectName=eex&DownloadId=307390" alt="NetLab&#32;AINAC.png" title="NetLab&#32;AINAC.png" /><br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li>
<li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltSat, 26 Nov 2011 22:00:25 GMTUpdated Wiki: Home 20111126100025PUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=29<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><img src="http://i3.codeplex.com/Download?ProjectName=eex&DownloadId=307389" alt="NetLab&#32;AINAC.png" title="NetLab&#32;AINAC.png" /><br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li>
<li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltSat, 26 Nov 2011 21:59:23 GMTUpdated Wiki: Home 20111126095923PUpdated Wiki: HandlerControllerhttp://eex.codeplex.com/wikipage?title=HandlerController&version=13<div class="wikidoc"><h1>The eExNLML.Extensibility.HandlerController class</h1>
Handler controllers implement the Interface eExNLML.Extensibility.IHandlerController and are responsible for managing <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Hanlder&referringTitle=HandlerController">Traffic Handlers</a> on <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=HandlerController">NLML</a> layer. The handler controller wraps the Traffic Handler&#39;s linking capabilities into <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">TrafficHandlerPorts</a>. Furthermore, this class manages saving and loading of the TrafficHandlers properties and configuration. <br /><br />Handler controllers are in general created by the given <a href="http://eex.codeplex.com/wikipage?title=HandlerDefinition&referringTitle=HandlerController">HandlerDefinition</a>.<br />
<h1>General Operation</h1>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231735" alt="HandlerController.png" title="HandlerController.png" /><br />Handler controllers provide various methods for managing handlers, and methods to provide default settings and ports. There are also some methods which must be implemented by a deriving class, which are responsible for creating configuration loaders and writers, custom port information or the handler itself. <br /><br />All methods which create something are called once, when the controller is created. A controller is created every time the user gives the command to instantiate a new handler. <br /><br />Handler controllers also provide information about the <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">ports</a> of a <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=HandlerController">Traffic Handler</a>, since on NLML layer, traffic handlers are linked via ports. When a port signals an attach or detach event from another port, the controller checks if the call is valid and applies the action. <br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Defining%20a%20NLML%20Plug-In&referringTitle=HandlerController">Defining a NLML Plug-In</a></li></ul></div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:56:12 GMTUpdated Wiki: HandlerController 20110501115612AUpdated Wiki: HandlerControllerhttp://eex.codeplex.com/wikipage?title=HandlerController&version=12<div class="wikidoc"><h1>The eExNLML.Extensibility.HandlerController class</h1>
Handler controllers implement the Interface eExNLML.Extensibility.IHandlerController and are responsible for managing <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Hanlder&referringTitle=HandlerController">Traffic Handlers</a> on <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=HandlerController">NLML</a> layer. The handler controller wraps the Traffic Handler&#39;s linking capabilities into <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">TrafficHandlerPorts</a>. Furthermore, this class manages saving and loading of the TrafficHandlers properties and configuration. <br /><br />Handler controllers are in general created by the given <a href="http://eex.codeplex.com/wikipage?title=HandlerDefinition&referringTitle=HandlerController">HandlerDefinition</a>.<br />
<h1>General Operation</h1>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231735" alt="HandlerController.png" title="HandlerController.png" /><br />Handler controllers provide various methods for managing handlers, and methods to provide default settings and ports. There are also some methods which must be implemented by a deriving class, which are responsible for creating configuration loaders and writers, custom port information or the handler itself. <br /><br />All methods which create something are called once, when the controller is created. A controller is created every time the user gives the command to instantiate a new handler. <br /><br />Handler controllers also provide information about the <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">ports</a> of a <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=HandlerController">Traffic Handler</a>, since on NLML layer, traffic handlers are linked via ports. When a port signals an attach or detach event from another port, the controller checks if the call is valid and applies the action. <br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Defining%20a%20NLML%20Plug-In&referringTitle=HandlerController">Defining a NLML Plug-In</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationLoader&referringTitle=HandlerController">Implementing a ConfigurationLoader</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationWriter&referringTitle=HandlerController">Implementing a ConfigurationWriter</a></li></ul></div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:55:44 GMTUpdated Wiki: HandlerController 20110501115544AUpdated Wiki: HandlerControllerhttp://eex.codeplex.com/wikipage?title=HandlerController&version=11<div class="wikidoc"><h1>The eExNLML.Extensibility.HandlerController class</h1>
Handler controllers implement the Interface eExNLML.Extensibility.IHandlerController and are responsible for managing <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Hanlder&referringTitle=HandlerController">Traffic Handlers</a> on <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=HandlerController">NLML</a> layer. The handler controller wraps the Traffic Handler&#39;s linking capabilities into <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">TrafficHandlerPorts</a>. Furthermore, this class manages saving and loading of the TrafficHandlers properties and configuration. <br /><br />Handler controllers are in general created by the given <a href="http://eex.codeplex.com/wikipage?title=HandlerDefinition&referringTitle=HandlerController">HandlerDefinition</a>.<br />
<h1>General Operation</h1>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231735" alt="HandlerController.png" title="HandlerController.png" /><br />Handler controllers provide various methods for managing handlers, and methods to provide default settings and ports. There are also some methods which must be implemented by a deriving class, which are responsible for creating configuration loaders and writers, custom port information or the handler itself. <br /><br />All methods which create something are called once, when the controller is created. A controller is created every time the user gives the command to instantiate a new handler. <br /><br />Handler controllers also provide information about the <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">ports</a> of a <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=HandlerController">Traffic Handler</a>, since on NLML layer, traffic handlers are linked via ports. When a port signals an attach or detach event from another port, the controller checks if the call is valid and applies the action. <br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Defining%20a%20NLML%20Plug-In&referringTitle=HandlerController">Defining a NLML Plug-In</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationLoader&referringTitle=HandlerController">Implementing a ConfigurationLoader</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationWriter&referringTitle=HandlerController">Implementing a ConfigurationWriter</a></li></ul></div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:54:27 GMTUpdated Wiki: HandlerController 20110501115427AUpdated Wiki: HandlerControllerhttp://eex.codeplex.com/wikipage?title=HandlerController&version=10<div class="wikidoc"><h1>The eExNLML.Extensibility.HandlerController class</h1>
Handler controllers implement the Interface eExNLML.Extensibility.IHandlerController and are responsible for managing <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Hanlder&referringTitle=HandlerController">Traffic Handlers</a> on <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=HandlerController">NLML</a> layer. The handler controller wraps the Traffic Handler&#39;s linking capabilities into <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">TrafficHandlerPorts</a>. Furthermore, this class manages saving and loading of the TrafficHandlers properties and configuration. <br /><br />Handler controllers are in general created by the given <a href="http://eex.codeplex.com/wikipage?title=HandlerDefinition&referringTitle=HandlerController">HandlerDefinition</a>.<br />
<h1>General Operation</h1>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231735" alt="HandlerController.png" title="HandlerController.png" /><br />Handler controllers provide various methods for managing handlers, and methods to provide default settings and ports. There are also some methods which must be implemented by a deriving class, which are responsible for creating configuration loaders and writers, custom port information or the handler itself. <br /><br />All methods which create something are called once, when the controller is created. A controller is created every time the user gives the command to instantiate a new handler. <br /><br />Handler controllers also provide information about the <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=HandlerController">ports</a> of a <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=HandlerController">Traffic Handler</a>, since on NLML layer, traffic handlers are linked via ports. When a port signals an attach or detach event from another port, the controller checks if the call is valid and applies the action. <br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Defining%20a%20NLML%20Plug-In&referringTitle=HandlerController">Defining a NLML Plug-In</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationLoader&referringTitle=HandlerController">Implementing a ConfigurationLoader</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20a%20ConfigurationWriter&referringTitle=HandlerController">Implementing a ConfigurationWriter</a></li></ul></div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:53:25 GMTUpdated Wiki: HandlerController 20110501115325AUpdated Wiki: Implementing a ConfigurationWriterhttp://eex.codeplex.com/wikipage?title=Implementing a ConfigurationWriter&version=1<div class="wikidoc"><h1>Implementing a Configuration Writer</h1>
The configuration IO mechanism of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=Implementing%20%20a%20ConfigurationWriter">NLML</a> depends on a tree of configuration items, where each has a name and a value and any number of sub items. Configuration Writers are responsible for converting the configuration of a certain handler to such a tree.<br /><br />To create a configuration writer, simply create a new class and derive from eExNLML.IO.HandlerConfigurationWriter.<br /><br />Start with implementing a constructor, which calls the base constructor and also stores a reference to the <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20%20a%20ConfigurationWriter">Traffic Handler</a> for which this configuration writer is responsible:<br /> <br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">private</span> YourHandler thHandler;
<span style="color:Blue;">public</span> YourConfigurationWriter(TrafficHandler thHandler)
: <span style="color:Blue;">base</span>(thHandler)
{
<span style="color:Blue;">this</span>.thHandler = (YourHandler)thHandler;
}
</pre></div><br />The constructor of this class is called once when a new instance of the according <a href="http://eex.codeplex.com/wikipage?title=HandlerController&referringTitle=Implementing%20%20a%20ConfigurationWriter">HandlerController</a> is created. <br />Then, implement the AddConfiguration method. This method has two parameters. First, a list to add your configuration too, second, the environment. <br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Green;"> This method must be overriden by all derived classes. It has to add it&#39;s own configuration items to the given list.</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;/summary&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;lNameValueItems&quot;&gt;</span><span style="color:Green;">The list to add all configuration items to&lt;/param&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;eEnviornment&quot;&gt;</span><span style="color:Green;">The environment&lt;/param&gt;</span>
<span style="color:Blue;">protected</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> AddConfiguration(List&lt;NameValueItem&gt; lNameValueItems, IEnvironment eEnviornment);
</pre></div><br />When creating the configuration, don&#39;t forget that you can add any number of sub items to each of your configuration items. For converting common data types and even arrays of common data types, use the eExNLML.IO.ConfigurationParser class. You can create many items with the same name. Don&#39;t worry about the name of your configuration items to be unique among the configurations of other handlers, since the NLML engine stores the configuration isolated from other handlers.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">protected</span> <span style="color:Blue;">override</span> <span style="color:Blue;">void</span> AddConfiguration(List&lt;NameValueItem&gt; lNameValueItems, IEnvironment eEnviornment)
{
<span style="color:Green;">//Creation of root items</span>
lNameValueItems.AddRange(ConvertToNameValueItems(<span style="color:#A31515;">&quot;PropertyA&quot;</span>, thHandler.PropertyA));
lNameValueItems.AddRange(ConvertToNameValueItems(<span style="color:#A31515;">&quot;PropertyB&quot;</span>, thHandler.PropertyB));
<span style="color:Green;">//Creation of multiple, nested items</span>
IPAddress[] ipa = thHandler.IpAddresses;
Subnetmask[] smMasks = thHandler.Subnetmasks;
<span style="color:Blue;">for</span> (<span style="color:Blue;">int</span> iC1 = 0; iC1 &lt; ipa.Length; iC1++)
{
NameValueItem nviNestedItem = <span style="color:Blue;">new</span> NameValueItem(<span style="color:#A31515;">&quot;MultipleNestedProperty&quot;</span>, <span style="color:#A31515;">&quot;&quot;</span>);
<span style="color:Green;">//Adding child items to a nested item</span>
nviNestedItem.AddChildRange(ConvertToNameValueItems(<span style="color:#A31515;">&quot;Address&quot;</span>, ipa[iC1]));
nviNestedItem.AddChildRange(ConvertToNameValueItems(<span style="color:#A31515;">&quot;Mask&quot;</span>, smMasks[iC1]));
lNameValueItems.Add(nviNestedItem);
}
}
</pre></div><br />The AddConfiguration method is called by the engine whenever the the command to save the compilation is received.</div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:52:34 GMTUpdated Wiki: Implementing a ConfigurationWriter 20110501115234AUpdated Wiki: Implementing a ConfigurationLoaderhttp://eex.codeplex.com/wikipage?title=Implementing a ConfigurationLoader&version=2<div class="wikidoc"><h1>Implementing a Configuration Loader</h1>
The configuration IO mechanism of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=Implementing%20%20a%20ConfigurationLoader">NLML</a> depends on a tree of configuration items, where each has a name and a value and any number of sub items. Configuration Loaders are responsible for loading the configuration of a certain handler from those tree.<br /><br />To create a configuration loader, simply create a new class and derive from eExNLML.IO.HandlerConfigurationLoader.<br /><br />Start with implementing a constructor, which calls the base constructor and also stores a reference to the <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20%20a%20ConfigurationLoader">Traffic Handler</a> for which this configuration loader is responsible:<br /> <br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">private</span> YourHandler thHandler;
<span style="color:Blue;">public</span> YourConfigurationLoader(TrafficHandler thHandler)
: <span style="color:Blue;">base</span>(thHandler)
{
<span style="color:Blue;">this</span>.thHandler = (YourHandler)thHandler;
}
</pre></div><br />Then, override the ParseConfiguration method, to parse the configuration. This method has two parameters. First, a dictionary which contains all configuration items at root level, and second, the environment.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Green;"> This method must be overriden by any derived class. It must configure the given traffic handler according to the given name value configuration items.</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;/summary&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;strNameValues&quot;&gt;</span><span style="color:Green;">A dictionary filled with name value items which store the configuration to apply to your traffic handler&lt;/param&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;eEnviornment&quot;&gt;</span><span style="color:Green;">The environment to associate with the traffic handler&lt;/param&gt;</span>
<span style="color:Blue;">protected</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> ParseConfiguration(Dictionary&lt;<span style="color:Blue;">string</span>, NameValueItem[]&gt; strNameValues, IEnvironment eEnviornment);
</pre></div><br />When parsing, don&#39;t forget that each configuration item (NameValueItem) can have any number of sub-items. For parsing common data types, simply use the methods which are provided by the eExNLML.IO.ConfigurationParser class. Since the configuration can also contain many items with the same name, the parsing methods are written to work with arrays. If a property is not supposed to be contained more than once in the configuration, simply use the first value in the array.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">protected</span> <span style="color:Blue;">override</span> <span style="color:Blue;">void</span> ParseConfiguration(Dictionary&lt;<span style="color:Blue;">string</span>, NameValueItem[]&gt; strNameValues, IEnvironment eEnviornment)
{
<span style="color:Green;">//Parsing root configuration</span>
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;PropertyA&quot;</span>))
thHandler.PropertyA = ConfigurationParser.ConvertToBools(strNameValues[<span style="color:#A31515;">&quot;PropertyA&quot;</span>])[0];
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;PropertyB&quot;</span>))
thHandler.PropertyB = ConfigurationParser.ConvertToInt(strNameValues[<span style="color:#A31515;">&quot;PropertyB&quot;</span>])[0];
<span style="color:Green;">//Parsing nested configuration</span>
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;MultipleNestedProperty&quot;</span>))
{
<span style="color:Green;">//For each configuration item with the name &quot;MultipleNestedProperty&quot; </span>
<span style="color:Blue;">foreach</span> (NameValueItem nvi <span style="color:Blue;">in</span> strNameValues[<span style="color:#A31515;">&quot;MultipleNestedProperty&quot;</span>])
{
<span style="color:Green;">//Access sub items of the configuration item with the name &quot;MultipleNestedProperty&quot;</span>
IPAddress ipAddress= ConvertToIPAddress(nvi[<span style="color:#A31515;">&quot;Address&quot;</span>])[0];
Subnetmask smMask = ConvertToSubnetmask(nvi[<span style="color:#A31515;">&quot;Mask&quot;</span>])[0];
thHandler.Add(ipaAddress, smMask);
}
}
}
</pre></div><br />The ParseConfiguration method is called by the NLML engine once when loading is done, after the initialization of the <a href="http://eex.codeplex.com/wikipage?title=HandlerController&referringTitle=Implementing%20%20a%20ConfigurationLoader">HandlerController</a>.</div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:50:18 GMTUpdated Wiki: Implementing a ConfigurationLoader 20110501115018AUpdated Wiki: Implementing a ConfigurationLoaderhttp://eex.codeplex.com/wikipage?title=Implementing a ConfigurationLoader&version=1<div class="wikidoc"><h1>Implementing a Configuration Loader</h1>
The configuration IO mechanism of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=Implementing%20%20a%20ConfigurationLoader">NLML</a> depends on a tree of configuration items, where each has a name and a value and any number of sub items. Configuration Loaders are responsible for loading the configuration of a certain handler from those tree.<br /><br />To create a configuration loader, simply create a new class and derive from eExNLML.IO.HandlerConfigurationLoader.<br /><br />Start with implementing a constructor, which calls the base constructor and also stores a reference to the <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20%20a%20ConfigurationLoader">Traffic Handler</a> for which this configuration loader is responsible:<br /> <br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">private</span> YourHandler thHandler;
<span style="color:Blue;">public</span> YourConfigurationLoader(TrafficHandler thHandler)
: <span style="color:Blue;">base</span>(thHandler)
{
<span style="color:Blue;">this</span>.thHandler = (YourHandler)thHandler;
}
</pre></div><br />Then, override the ParseConfiguration method, to parse the configuration. This method has two parameters. First, a dictionary which contains all configuration items at root level, and second, the environment.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Green;"> This method must be overriden by any derived class. It must configure the given traffic handler according to the given name value configuration items.</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;/summary&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;strNameValues&quot;&gt;</span><span style="color:Green;">A dictionary filled with name value items which store the configuration to apply to your traffic handler&lt;/param&gt;</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;param name=&quot;eEnviornment&quot;&gt;</span><span style="color:Green;">The environment to associate with the traffic handler&lt;/param&gt;</span>
<span style="color:Blue;">protected</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> ParseConfiguration(Dictionary&lt;<span style="color:Blue;">string</span>, NameValueItem[]&gt; strNameValues, IEnvironment eEnviornment);
</pre></div><br />When parsing, don&#39;t forget that each configuration item (NameValueItem) can have any number of sub-items. For parsing common data types, simply use the methods which are provided by the eExNLML.IO.ConfigurationParser class. Since the configuration can also contain many items with the same name, the parsing methods are written to work with arrays. If a property is not supposed to be contained more than once in the configuration, simply use the first value in the array.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">protected</span> <span style="color:Blue;">override</span> <span style="color:Blue;">void</span> ParseConfiguration(Dictionary&lt;<span style="color:Blue;">string</span>, NameValueItem[]&gt; strNameValues, IEnvironment eEnviornment)
{
<span style="color:Green;">//Parsing root configuration</span>
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;PropertyA&quot;</span>))
thHandler.PropertyA = ConfigurationParser.ConvertToBools(strNameValues[<span style="color:#A31515;">&quot;PropertyA&quot;</span>])[0];
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;PropertyB&quot;</span>))
thHandler.PropertyB = ConfigurationParser.ConvertToInt(strNameValues[<span style="color:#A31515;">&quot;PropertyB&quot;</span>])[0];
<span style="color:Green;">//Parsing nested configuration</span>
<span style="color:Blue;">if</span> (strNameValues.ContainsKey(<span style="color:#A31515;">&quot;MultipleNestedProperty&quot;</span>))
{
<span style="color:Green;">//For each configuration item with the name &quot;MultipleNestedProperty&quot; </span>
<span style="color:Blue;">foreach</span> (NameValueItem nvi <span style="color:Blue;">in</span> strNameValues[<span style="color:#A31515;">&quot;MultipleNestedProperty&quot;</span>])
{
<span style="color:Green;">//Access sub items of the configuration item with the name &quot;MultipleNestedProperty&quot;</span>
IPAddress ipAddress= ConvertToIPAddress(nvi[<span style="color:#A31515;">&quot;Address&quot;</span>])[0];
Subnetmask smMask = ConvertToSubnetmask(nvi[<span style="color:#A31515;">&quot;Mask&quot;</span>])[0];
thHandler.Add(ipaAddress, smMask);
}
}
}
</pre></div><br />The ParseConfiguration method is called by the NLML engine once when loading is done, after the initialization of the <a href="http://eex.codeplex.com/wikipage?title=Handler%20Controller&referringTitle=Implementing%20%20a%20ConfigurationLoader">Handler Controller</a>.</div><div class="ClearBoth"></div>emisweltSun, 01 May 2011 11:49:48 GMTUpdated Wiki: Implementing a ConfigurationLoader 20110501114948AUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=28<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li>
<li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 15:02:41 GMTUpdated Wiki: Home 20110425030241PUpdated Wiki: Framehttp://eex.codeplex.com/wikipage?title=Frame&version=11<div class="wikidoc"><h1>The Frame class </h1>
The Frame classes are a main component of the network library. All implemented network protocols derive from the Frame super class which includes several methods which must be implemented. <br /><br />The frame parsing is done by the <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">Protocol Engine</a>. If you want to implement your own protocl add-on, you will have to provide a Frame class and a valid implementation of <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">IProtocolProvider</a>.<br />
<h2>General Operation</h2>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231671" alt="FrameStructure.png" title="FrameStructure.png" /><br />All Frame classes in the Network Library derive from the superclass Frame. Only abstract frame objects are pushed from <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Frame">Traffic Handler</a> to Traffic Handler, but you can get the desired frame, for example IPv4, with ease since the traffic handler provides methods to access the protocol engine. <br /><br />The frame is a recursive data structure. Each frame contains an encapsulated frame, which represents the frame payload. For example, an Ethernet Frame may contain an encapsulated IP frame and the IP frame may contain and encapsulated TCP frame, which finally contains some payload data. If you change the EncapsulatedFrame property of a frame, you can change it&#39;s payload. If you set it to null, the payload is deleted.<br /><br />When sending a frame, for example, the FrameBytes property is called, which converts the actual frames to bytes and calls the FrameBytes method for the encapsulated frame which again calls the FrameBytes method for the next encapsulated frame and so on. All frame types already contained in the Network Library have got a constructor which accepts a byte array, which will be parsed. <br /><br />Each frame also has an identifier, named the FrameType. This property returns a string which uniquely identifies the frame type. This is also used when searching for a <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">protocol provider</a> for a given frame. <br />If you want to implement frames, it is good practice to use the constants pre-defined for many protocols in the eExNetworkLibrary.FrameTypes object, and to define a static property in your frame class, which also returns the type of the frame. <br /><br />Each frame which was captured by an interface, should contain a TrafficDescriptionFrame as the first frame, which holds a reference to the capture interface.<br />
<h2>Overview of Frame Types</h2>
The network library implements the following classes which derive from frame:<br />
<ul><li>EthernetFrame</li>
<li>IPFrame
<ul><li>IPv4Frame</li>
<li>IPv6Frame</li></ul></li>
<li>ARPFrame</li>
<li>ICMPFrame
<ul><li>ICMPv4Frame</li>
<li>ICMPv6Frame</li></ul></li>
<li>RawDataFrame (For raw payload data)</li>
<li>UDPFrame</li>
<li>TCPFrame</li>
<li>DNSFrame</li>
<li>DHCPFrame
<ul><li>TLVItem</li>
<li>DHCPTLVItem</li></ul></li>
<li>NeighborSolicitation &amp; NeighborAdvertisement
<ul><li>NeighborDiscoveryOption (For IVMPv6)</li></ul></li>
<li>OSPFCommonHeader
<ul><li>Various OSPF Messages</li>
<li>Various LSA Types</li></ul></li>
<li>TrafficDescriptionFrame</li>
<li>RIPFrame</li>
<li>ExtensionHeader (For IPv6)
<ul><li>FragmentationExtension</li>
<li>RoutingExtension</li></ul></li></ul>
<br />All these classes are supported by default by the <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">Protocol Engine</a>, and can be created from and converted to an array of bytes. <br />
<h2>Creating own frames</h2>
Needless to say, it is possible to create new frames and set various parameters. For example, here is an example taken from the DHCPServer class:<br /><br /><div style="color:Black;background-color:White;"><pre>
UDP.UDPFrame newUDPFrame = <span style="color:Blue;">new</span> eExNetworkLibrary.UDP.UDPFrame();
newUDPFrame.DestinationPort = iDHCPInPort;
newUDPFrame.SourcePort = iDHCPOutPort;
newUDPFrame.EncapsulatedFrame = newDHCPFrame;
IP.IPv4Frame newIPv4Frame = <span style="color:Blue;">new</span> eExNetworkLibrary.IP.IPv4Frame();
newIPv4Frame.Version = 4;
newIPv4Frame.DestinationAddress = IPAddress.Broadcast;
newIPv4Frame.SourceAddress = ipaServer;
newIPv4Frame.Protocol = eExNetworkLibrary.IP.IPProtocol.UDP;
newIPv4Frame.EncapsulatedFrame = newUDPFrame;
newIPv4Frame.Identification = (<span style="color:Blue;">uint</span>)IncrementIPIDCounter();
newIPv4Frame.TimeToLive = 128;
</pre></div><br />In this example, a new UDP frame and a new IP frame is created. Then, the UDP frame is set as the encapsulated frame of the IP frame, which means that now the UDP frame is the payload of the IP frame. <br />As you can see, the encapsulate frame of the UDP frame ist set to a DHCP frame. The DHCP frame creation is a little bit large, so if you want to see it, head over into the DHCPServer class and see the method HandleDHCPFrame.<br /><br />If you create own frames, it is not necessary to create Ethernet frames or other layer 2 protocols, as long as you use a router, since the router will tell the interface about the next hop of the frame, and the interface will automatically add layer 2 data when sending. <br /><br />You can push your frames any time by calling the NotifyNext() method of your <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Frame">Traffic Handler</a>. </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 11:01:20 GMTUpdated Wiki: Frame 20110425110120AUpdated Wiki: Framehttp://eex.codeplex.com/wikipage?title=Frame&version=10<div class="wikidoc"><h1>The Frame class </h1>
The Frame classes are a main component of the network library. All implemented network protocols derive from the Frame super class which includes several methods which must be implemented. <br /><br />The frame parsing is done by the <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">Protocol Engine</a>. If you want to implement your own protocl add-on, you will have to provide a Frame class and a valid implementation of <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">IProtocolProvider</a>.<br />
<h2>General Operation</h2>
<div style="clear:both;height:0;">&nbsp;</div><img style="float:right;padding-left:.5em;" src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231671" alt="FrameStructure.png" title="FrameStructure.png" /><br />All Frame classes in the Network Library derive from the superclass Frame. Only abstract frame objects are pushed from <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Frame">Traffic Handler</a> to Traffic Handler, but you can get the desired frame, for example IPv4, with ease since the traffic handler provides methods to access the protocol engine. <br /><br />The frame is a recursive data structure. Each frame contains an encapsulated frame, which represents the frame payload. For example, an Ethernet Frame may contain an encapsulated IP frame and the IP frame may contain and encapsulated TCP frame, which finally contains some payload data. If you change the EncapsulatedFrame property of a frame, you can change it&#39;s payload. If you set it to null, the payload is deleted.<br /><br />When sending a frame, for example, the FrameBytes property is called, which converts the actual frames to bytes and calls the FrameBytes method for the encapsulated frame which again calls the FrameBytes method for the next encapsulated frame and so on. All frame types already contained in the Network Library have got a constructor which accepts a byte array, which will be parsed. <br /><br />Each frame also has an identifier, named the FrameType. This property returns a string which uniquely identifies the frame type. This is also used when searching for a <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">protocol provider</a> for a given frame. <br />If you want to implement frames, it is good practice to use the constants pre-defined for many protocols in the eExNetworkLibrary.FrameTypes object, and to define a static property in your frame class, which also returns the type of the frame. <br /><br />Each frame which was captured by an interface, should contain a TrafficDescriptionFrame as the first frame, which holds a reference to the capture interface.<br />
<h2>Overview of Frame Types</h2>
The network library implements the following classes which derive from frame:<br />
<ul><li>EthernetFrame</li>
<li>IPFrame
<ul><li>IPv4Frame</li>
<li>IPv6Frame</li></ul></li>
<li>ARPFrame</li>
<li>ICMPFrame
<ul><li>ICMPv4Frame</li>
<li>ICMPv6Frame</li></ul></li>
<li>RawDataFrame (For raw payload data)</li>
<li>UDPFrame</li>
<li>TCPFrame</li>
<li>DNSFrame</li>
<li>DHCPFrame
<ul><li>TLVItem</li>
<li>DHCPTLVItem</li></ul></li>
<li>NeighborSolicitation &amp; NeighborAdvertisement
<ul><li>NeighborDiscoveryOption (For IVMPv6)</li></ul></li>
<li>OSPFCommonHeader
<ul><li>Various OSPF Messages</li>
<li>Various LSA Types</li></ul></li>
<li>TrafficDescriptionFrame</li>
<li>RIPFrame</li>
<li>ExtensionHeader (For IPv6)
<ul><li>FragmentationExtension</li>
<li>RoutingExtension</li></ul></li></ul>
<br />All these classes are supported by default by the <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Frame">Protocol Engine</a>, and can be created from and converted to an array of bytes. <br />
<h2>Creating own frames</h2>
Needless to say, it is possible to create new frames and set various parameters. For example, here is an example taken from the DHCPServer class:<br /><br /><div style="color:Black;background-color:White;"><pre>
UDP.UDPFrame newUDPFrame = <span style="color:Blue;">new</span> eExNetworkLibrary.UDP.UDPFrame();
newUDPFrame.DestinationPort = iDHCPInPort;
newUDPFrame.SourcePort = iDHCPOutPort;
newUDPFrame.EncapsulatedFrame = newDHCPFrame;
IP.IPv4Frame newIPv4Frame = <span style="color:Blue;">new</span> eExNetworkLibrary.IP.IPv4Frame();
newIPv4Frame.Version = 4;
newIPv4Frame.DestinationAddress = IPAddress.Broadcast;
newIPv4Frame.SourceAddress = ipaServer;
newIPv4Frame.Protocol = eExNetworkLibrary.IP.IPProtocol.UDP;
newIPv4Frame.EncapsulatedFrame = newUDPFrame;
newIPv4Frame.Identification = (<span style="color:Blue;">uint</span>)IncrementIPIDCounter();
newIPv4Frame.TimeToLive = 128;
</pre></div><br />In this example, a new UDP frame and a new IP frame is created. Then, the UDP frame is set as the encapsulated frame of the IP frame, which means that now the UDP frame is the payload of the IP frame. <br />As you can see, the encapsulate frame of the UDP frame ist set to a DHCP frame. The DHCP frame creation is a little bit large, so if you want to see it, head over into the DHCPServer class and see the method HandleDHCPFrame.<br /><br />If you create own frames, it is not necessary to create Ethernet frames or other layer 2 protocols, as long as you use a router, since the router will tell the interface about the next hop of the frame, and the interface will automatically add layer 2 data when sending. </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 11:00:45 GMTUpdated Wiki: Frame 20110425110045AUpdated Wiki: Implementing own Traffic Handlershttp://eex.codeplex.com/wikipage?title=Implementing own Traffic Handlers&version=9<div class="wikidoc"><h1>Implementing your own Traffic Handler</h1>
The <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20own%20Traffic%20Handlers">Traffic Handler</a> class is one of the base classes in the Network Library. If you want to implement your own networking tasks, you will have to derive from eExNetworkLibrary.TrafficHandler or one of it&#39;s subclasses.<br /><br />When you derive from Traffic Handler, two methods have to be implemented by you:<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Green;"> This method starts the handlers cleanup process which will release network resources or</span>
<span style="color:Gray;">///</span><span style="color:Green;"> remote allocated resources. It should be called before stopping the handler to ensure </span>
<span style="color:Gray;">///</span><span style="color:Green;"> a clean shutdown.</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;/summary&gt;</span>
<span style="color:Blue;">public</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> Cleanup();
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Green;"> This method is called for every frame in the input queue per default. </span>
<span style="color:Green;">// It should be used to process received traffic.</span>
<span style="color:Gray;">///</span> <span style="color:Gray;">&lt;/summary&gt;</span>
<span style="color:Gray;">///</span><span style="color:Gray;">&lt;param name=&quot;fInputFrame&quot;&gt;</span><span style="color:Green;">The frame to process&lt;/param&gt;</span>
<span style="color:Blue;">protected</span> <span style="color:Blue;">abstract</span> <span style="color:Blue;">void</span> HandleTraffic(Frame fInputFrame);
</pre></div>The cleanup method provides you with the opportunity to perform cleanup tasks before the handler is shut down. If you, for example, wrote a handler which leases addresses from a DHCP server, the cleanup method would be the right place to release the addresses again before shutdown. <br /><br />The HandleTraffic method is responsible for performing the handler&#39;s operation, regardless of analysis or modification. The <a href="http://eex.codeplex.com/wikipage?title=Frame&referringTitle=Implementing%20own%20Traffic%20Handlers">Frame</a> fInputFrame is the frame which was received from the previous handler. It is the core method where all the work should be done. <br /><br />Furthermore, you can override the Start() and Stop() methods, but do not forget to call base.Start() and base.Stop() to start and stop the handlers worker thread.<br /><br /><a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20own%20Traffic%20Handlers">Traffic Handler</a> provides you with some methods to make working with traffic easier. This includes especially methods for <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Implementing%20own%20Traffic%20Handlers">protocol parsing</a>: <br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">// Gets the IP component of the input frame, or null, if no IP component is present.</span>
eExNetworkLibrary.IP.IPFrame ipFrame = GetIPFrame(fInputFrame);
eExNetworkLibrary.IP.IPv4Frame ipv4Frame = GetIPv4Frame(fInputFrame);
eExNetworkLibrary.IP.V6.IPv6Frame ipv6Frame = GetIPv6Frame(fInputFrame);
<span style="color:Green;">//This is also possible for TCP-Frames and so on</span>
eExNetworkLibrary.TCP.TCPFrame tcpFrame = GetTCPFrame(fInputFrame);
</pre></div><br />If a frame, for example the TCP frame is present, you can edit the frame.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Blue;">if</span> (tcpFrame != <span style="color:Blue;">null</span>)
{
<span style="color:Green;">//Now, do something with the frame.</span>
tcpFrame.DestinationPort = 8080;
<span style="color:Green;">//But don&#39;t forget to adjust checksums if you modify traffic.</span>
<span style="color:Green;">//Also you have to use the pseudo-header of the right frame </span>
tcpFrame.Checksum = tcpFrame.CalculateChecksum(ipFrame.GetPseudoHeader());
}
</pre></div>As already written in the code, don&#39;t forget to update the checksum of the frame. Each frame which uses checksums provides you with a method to do that. <br />Needless to say, you can edit the payload of each frame. The payload of a <a href="http://eex.codeplex.com/wikipage?title=Frame&referringTitle=Implementing%20own%20Traffic%20Handlers">Frame</a> is accessed via the Frame.EncapsulatedFrame property, but if you want to edit TCP stream data, it may be more easy to derive from the <a href="http://eex.codeplex.com/wikipage?title=TCPStreamModifier&referringTitle=Implementing%20own%20Traffic%20Handlers">TCPStreamModifier</a> class. <br /><br />Finally, you can push your frame to the <a href="http://eex.codeplex.com/wikipage?title=TrafficHandler&referringTitle=Implementing%20own%20Traffic%20Handlers">OutputHandler</a>.<br /><br /><div style="color:Black;background-color:White;"><pre>
<span style="color:Green;">//Push the frame to the next handler. </span>
<span style="color:Green;">//Omit this call, if you want to discard the frame. </span>
NotifyNext(fInputFrame);
</pre></div>If you omit this call, the frame is discarded. You can also call the NotifyNext method, for example, each five seconds by using a timer or by user interaction to send self-crafted <a href="http://eex.codeplex.com/wikipage?title=Frame&referringTitle=Implementing%20own%20Traffic%20Handlers">frames</a>. <br /><br />Have a look at trunk/Examples/HandlerPlugInTemplate/HandlerTempate.cs at the repository for a template for implementing own Traffic Handlers.<br /><br />Don&#39;t forget that you can derive from special <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Implementing%20own%20Traffic%20Handlers">Traffic Handler</a> classes, if you need certain features. </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 10:50:45 GMTUpdated Wiki: Implementing own Traffic Handlers 20110425105045AUpdated Wiki: Traffic Handlerhttp://eex.codeplex.com/wikipage?title=Traffic Handler&version=15<div class="wikidoc"><h1>The TrafficHandler class</h1>
The TrafficHandler class is the main class in the network library. All networking functions from the interface to the HTTP monitor rely on this class. Traffic handlers are like modules in a network application.<br />
<h2>General Operation</h2>
The TrafficHandler class provides you with a lot of important capabilities: <br />
<ul><li>It has it&#39;s own working thread and implements ISynchronizeInvoke, so it ensures <b>Thread Safety</b>.</li>
<li>It provides methods for <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Traffic%20Handler">protocol parsing</a>, which means, you don&#39;t have to worry about parsing IP frames, TCP frames and so on at your own, if you want to implement you own traffic handler. </li>
<li>Each traffic handler can have a OutputHandler by default. All traffic which is handled by a traffic handler is pushed forward to the output handler. </li>
<li>Frames which are received by a handler are pushed into a queue and handled one after one, so that only one traffic handler at a time is able to modify a frame. Also, a traffic handler can only have one output handler by default. This is necessary to eliminate concurrency issues. </li></ul>
<br />This means that all classes in the network library can be linked together to a graph which performs networking operations. This linking operation is abstracted by the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=Traffic%20Handler">NLML</a>, which uses <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=Traffic%20Handler">ports</a> to link together handlers. <br /><br /><img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231668" alt="HandlerGraph.png" title="HandlerGraph.png" /><br /><br />This is a lot easier to understand if you tried it by using the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Traffic%20Handler">NetLab</a> first, because with the net lab you can see your graph and edit it in real time. <br />
<h2>Special Handlers</h2>
In the network library, there are also some base classes which derive from TrafficHandler and provide additional functionality, like capability for simultaneous analysis, or the interfaces, which support any number of output handlers.<br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=IPInterface&referringTitle=Traffic%20Handler">IPInterface</a></b><br /><br />The IPInterface class provides an abstract base for interface implementations like the Ethernet interface. Interfaces are not supposed to use the OutputHandler, instead they provide a PacketCaptured event. When this event is invoked, each event handler receives a separate copy of the captured frame. This means, multiple handlers of the type DirectInterfaceIO can be attached to an IPInterface. <br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=DirectInterfaceIO&referringTitle=Traffic%20Handler">DirectInterfaceIO</a></b><br /><br />The DirectInterfaceIO class is supposed to directly connect to interfaces. By default, this class has methods to add any number of interfaces and one output handler. Traffic is received from all interfaces and pushed to the output handler, and incoming traffic is pushed to all connected interfaces. This class is the base for handlers like routers or attacks which need direct access to network interfaces. <br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=TrafficAnalyzer&referringTitle=Traffic%20Handler">TrafficAnalyzer</a></b><br /><br />This class provides the capability of simultaneously analyzing traffic. TrafficAnalyzers must not edit frames and they do not support output handlers. If you implement a class which does sole analysis (examples are the LibPcap Dumper or the Network Map), you can use this class for a performance boost.<br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=TrafficSplitter&referringTitle=Traffic%20Handler">TrafficSplitter</a></b><br /><br />The traffic splitter is a support class for traffic analyzers. If you insert a traffic splitter into your network compilation, you can add analyzers to the splitter. All analyzers will receive the same copy of the frame simultaneously, which will have a positive impact on performance. <br /><br /><b>Notice</b>: For information about all handlers provided by the NLML or the NetLab, check the NetLab Wiki on <a href="http://network.eex-dev.net/index.php?id=64&amp;L=1" class="externalLink">eex-dev.net<span class="externalLinkIcon"></span></a>.<br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Application%20Development&referringTitle=Traffic%20Handler">Application Development</a></li>
<li><a href="http://eex.codeplex.com/wikipage?title=Implementing%20own%20Traffic%20Handlers&referringTitle=Traffic%20Handler">Implementing own Traffic Handlers</a></li></ul></div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 10:49:27 GMTUpdated Wiki: Traffic Handler 20110425104927AUpdated Wiki: Traffic Handlerhttp://eex.codeplex.com/wikipage?title=Traffic Handler&version=14<div class="wikidoc"><h1>The TrafficHandler class</h1>
The TrafficHandler class is the main class in the network library. All networking functions from the interface to the HTTP monitor rely on this class. Traffic handlers are like modules in a network application.<br />
<h2>General Operation</h2>
The TrafficHandler class provides you with a lot of important capabilities: <br />
<ul><li>It has it&#39;s own working thread and implements ISynchronizeInvoke, so it ensures <b>Thread Safety</b>.</li>
<li>It provides methods for <a href="http://eex.codeplex.com/wikipage?title=Protocol%20Engine&referringTitle=Traffic%20Handler">protocol parsing</a>, which means, you don&#39;t have to worry about parsing IP frames, TCP frames and so on at your own, if you want to implement you own traffic handler. </li>
<li>Each traffic handler can have a OutputHandler by default. All traffic which is handled by a traffic handler is pushed forward to the output handler. </li>
<li>Frames which are received by a handler are pushed into a queue and handled one after one, so that only one traffic handler at a time is able to modify a frame. Also, a traffic handler can only have one output handler by default. This is necessary to eliminate concurrency issues. </li></ul>
<br />This means that all classes in the network library can be linked together to a graph which performs networking operations. This linking operation is abstracted by the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NLML&referringTitle=Traffic%20Handler">NLML</a>, which uses <a href="http://eex.codeplex.com/wikipage?title=Ports&referringTitle=Traffic%20Handler">ports</a> to link together handlers. <br /><br /><img src="http://i3.codeplex.com/Project/Download/FileDownload.aspx?ProjectName=eex&DownloadId=231668" alt="HandlerGraph.png" title="HandlerGraph.png" /><br /><br />This is a lot easier to understand if you tried it by using the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Traffic%20Handler">NetLab</a> first, because with the net lab you can see your graph and edit it in real time. <br />
<h2>Special Handlers</h2>
In the network library, there are also some base classes which derive from TrafficHandler and provide additional functionality, like capability for simultaneous analysis, or the interfaces, which support any number of output handlers.<br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=IPInterface&referringTitle=Traffic%20Handler">IPInterface</a></b><br /><br />The IPInterface class provides an abstract base for interface implementations like the Ethernet interface. Interfaces are not supposed to use the OutputHandler, instead they provide a PacketCaptured event. When this event is invoked, each event handler receives a separate copy of the captured frame. This means, multiple handlers of the type DirectInterfaceIO can be attached to an IPInterface. <br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=DirectInterfaceIO&referringTitle=Traffic%20Handler">DirectInterfaceIO</a></b><br /><br />The DirectInterfaceIO class is supposed to directly connect to interfaces. By default, this class has methods to add any number of interfaces and one output handler. Traffic is received from all interfaces and pushed to the output handler, and incoming traffic is pushed to all connected interfaces. This class is the base for handlers like routers or attacks which need direct access to network interfaces. <br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=TrafficAnalyzer&referringTitle=Traffic%20Handler">TrafficAnalyzer</a></b><br /><br />This class provides the capability of simultaneously analyzing traffic. TrafficAnalyzers must not edit frames and they do not support output handlers. If you implement a class which does sole analysis (examples are the LibPcap Dumper or the Network Map), you can use this class for a performance boost.<br /><br /><b><a href="http://eex.codeplex.com/wikipage?title=TrafficSplitter&referringTitle=Traffic%20Handler">TrafficSplitter</a></b><br /><br />The traffic splitter is a support class for traffic analyzers. If you insert a traffic splitter into your network compilation, you can add analyzers to the splitter. All analyzers will receive the same copy of the frame simultaneously, which will have a positive impact on performance. <br /><br /><b>Notice</b>: For information about all handlers provided by the NLML or the NetLab, check the NetLab Wiki on <a href="http://network.eex-dev.net/index.php?id=64&amp;L=1" class="externalLink">eex-dev.net<span class="externalLinkIcon"></span></a>.<br />
<h2>Further reading</h2>
<ul><li><a href="http://eex.codeplex.com/wikipage?title=Application%20Development&referringTitle=Traffic%20Handler">Application Development</a></li></ul></div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 10:48:58 GMTUpdated Wiki: Traffic Handler 20110425104858AUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=27<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.<br /><br /><b>Download</b>: At the moment, no complete development package is available. Please check out the source code. <br />
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li>
<li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 09:20:51 GMTUpdated Wiki: Home 20110425092051AUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=26<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.<br /><br /><b>Download</b>: At the moment, no complete development package is available. Please check out the source code. <br />
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with a wrapper for WinPcap or LibPcap, including packet filters</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li></ul>
<ul><li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltMon, 25 Apr 2011 09:17:48 GMTUpdated Wiki: Home 20110425091748AUpdated Wiki: Homehttp://eex.codeplex.com/wikipage?version=25<div class="wikidoc"><h1>Welcome!</h1>
To the <a href="http://eex.codeplex.com/wikipage?title=eEx%20Network%20Library&referringTitle=Home">eEx Network Library</a> project page on CodePlex. The Network Library enables Programmers to access lower network layers very easily and to analyze, create and change network traffic by writing their own C# programs which use the Network Library. <br />Furthermore, the Network Library is the core of the <a href="http://eex.codeplex.com/wikipage?title=eEx%20NetLab&referringTitle=Home">eEx NetLab</a>.<br /><br /><b>Notice</b>: This project is in beta state - testers, volunteers, feature requests and feedback are welcome!<br />Documentation and source comments are currently under construction, but we are working hard on it.<br /><br /><b>Download</b>: At the moment, no complete development package is available. Please check out the source code. <br />
<h2>Features</h2>
<ul><li><b>Protocol Parsing</b> - Ethernet, IPv4, IPv6, TCP, UDP, DHCP, OSPF, RIP, DNS, HTTP, ICMPv4, ICMPv6</li>
<li><b>Sockets</b> - Which bind on foreign addresses and can hijack TCP/IP connections</li>
<li><b>Networking Tasks</b> - DHCP Server, Loggers, Routing, NAT and much more</li>
<li><b>WAN Emulation</b> - WAN simulation with packet loss, duplicate, bit errors and so on between to interfaces</li>
<li><b>Injection and Sniffing</b> - At layer 2, with WinPcap or LibPcap</li>
<li><b>Attacks</b> - Proof-of-Concept - ARP poisoning, DHCP spoofing, DNS on-the-fly spoofing</li>
<li><b>Scanning</b> - Passive scanning, ARP scanning</li></ul>
<ul><li><b>Extensibility</b> - Implement your own <a href="http://eex.codeplex.com/wikipage?title=Traffic%20Handler&referringTitle=Home">Traffic Handlers</a> with ease</li>
<li><b>HTTP</b> - Monitoring and payload on the fly modification</li></ul>
<h2>Getting started</h2>
Head over to <a href="http://eex.codeplex.com/documentation?referringTitle=Home">Documentation</a> </div><div class="ClearBoth"></div>emisweltSun, 24 Apr 2011 15:45:13 GMTUpdated Wiki: Home 20110424034513P