Commit 464cad75 authored by Tanvi's avatar Tanvi

MAC ARP

parents
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/NetworkSecurityGame.iml" filepath="$PROJECT_DIR$/NetworkSecurityGame.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="11f48ef8-4a5d-49ce-81ca-2142c6d2299f" name="Default" comment="" />
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="MACFloodDemo.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/MACFloodDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1">
<caret line="424" selection-start-line="424" selection-end-line="424" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ARPDemo.java" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/ARPDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="61">
<caret line="208" column="6" lean-forward="true" selection-start-line="208" selection-start-column="6" selection-end-line="208" selection-end-column="6" />
<folding>
<element signature="imports" expanded="true" />
<element signature="class#483:4908" />
<element signature="e#555#556#0" expanded="true" />
<element signature="e#598#599#0" expanded="true" />
<element signature="e#747#748#0" expanded="true" />
<element signature="e#790#791#0" expanded="true" />
<element signature="e#1095#1096#0" expanded="true" />
<element signature="e#1138#1139#0" expanded="true" />
<element signature="e#1300#1301#0" expanded="true" />
<element signature="e#1343#1344#0" expanded="true" />
<element signature="e#1413#1414#0" expanded="true" />
<element signature="e#1456#1457#0" expanded="true" />
<element signature="e#1735#1736#0" expanded="true" />
<element signature="e#1778#1779#0" expanded="true" />
<element signature="e#3797#3798#0" expanded="true" />
<element signature="e#3841#3842#0" expanded="true" />
<element signature="e#4145#4146#0" expanded="true" />
<element signature="e#4189#4190#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Game1.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Game1.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4515">
<caret line="327" column="44" selection-start-line="327" selection-start-column="44" selection-end-line="327" selection-end-column="44" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Game2.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Game2.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5490">
<caret line="394" selection-start-line="394" selection-end-line="394" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="StartApp.form" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/StartApp.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
</file>
<file leaf-file-name="StartApp.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/StartApp.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="37" selection-start-line="37" selection-end-line="37" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PopUpDemo.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PopUpDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="8" column="60" selection-start-line="8" selection-start-column="60" selection-end-line="8" selection-end-column="60" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="PopClickListener.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/PopClickListener.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret line="2" column="33" selection-start-line="2" selection-start-column="33" selection-end-line="2" selection-end-column="33" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Bridge.java" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Bridge.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="33" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Class" />
</list>
</option>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>tm</find>
<find>ARP</find>
<find>packets</find>
<find>PopClickListener</find>
<find>network</find>
<find>q.add</find>
<find>==</find>
<find>f</find>
<find>panel.re</find>
<find>panel</find>
<find>intable</find>
<find>getGraphics</find>
</findStrings>
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/src/StartGame.form" />
<option value="$PROJECT_DIR$/src/JPanelWithBackground.java" />
<option value="$PROJECT_DIR$/src/StartApp.form" />
<option value="$PROJECT_DIR$/src/Games.java" />
<option value="$PROJECT_DIR$/src/EasyGames.form" />
<option value="$PROJECT_DIR$/src/EasyGames.java" />
<option value="$PROJECT_DIR$/src/StartApp.java" />
<option value="$PROJECT_DIR$/src/Games.form" />
<option value="$PROJECT_DIR$/src/TutorialMain.form" />
<option value="$PROJECT_DIR$/src/Network.java" />
<option value="$PROJECT_DIR$/src/Packet.java" />
<option value="$PROJECT_DIR$/src/Node.java" />
<option value="$PROJECT_DIR$/src/OSILayers.form" />
<option value="$PROJECT_DIR$/src/OSILayers.java" />
<option value="$PROJECT_DIR$/src/TutorialMain.java" />
<option value="$PROJECT_DIR$/src/DataLinkTut.java" />
<option value="$PROJECT_DIR$/src/DataLinkTut.form" />
<option value="$PROJECT_DIR$/src/TimerBasedAnimation.java" />
<option value="$PROJECT_DIR$/src/Connection.java" />
<option value="$PROJECT_DIR$/src/LearningBridgeTable.java" />
<option value="$PROJECT_DIR$/src/Bridge.java" />
<option value="$PROJECT_DIR$/src/PopClickListener.java" />
<option value="$PROJECT_DIR$/src/PopUpDemo.java" />
<option value="$PROJECT_DIR$/src/Game1.java" />
<option value="$PROJECT_DIR$/src/Game2.java" />
<option value="$PROJECT_DIR$/src/MACFloodDemo.java" />
<option value="$PROJECT_DIR$/src/ARPDemo.java" />
</list>
</option>
</component>
<component name="MavenProjectNavigator">
<treeState>
<expand />
<select />
</treeState>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="65" />
<option name="y" value="24" />
<option name="width" value="1301" />
<option name="height" value="772" />
</component>
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="PackagesPane" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
<path>
<item name="NetworkSecurityGame" type="b2602c69:ProjectViewProjectNode" />
<item name="NetworkSecurityGame" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="NetworkSecurityGame" type="b2602c69:ProjectViewProjectNode" />
<item name="NetworkSecurityGame" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="NetworkSecurityGame" type="b2602c69:ProjectViewProjectNode" />
<item name="NetworkSecurityGame" type="462c0819:PsiDirectoryNode" />
<item name="src" type="462c0819:PsiDirectoryNode" />
<item name="MACFloodDemo.java" type="529ef68f:ClassesTreeStructureProvider$PsiClassOwnerTreeNode" />
</path>
</expand>
<select />
</subPane>
</pane>
<pane id="AndroidView" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.PaletteManager.STATE" value="right" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.SHOW" value="true" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.STATE" value="left" />
<property name="UI_DESIGNER_EDITOR_MODE.UIDesignerToolWindowManager.WIDTH" value="317" />
<property name="project.structure.last.edited" value="Modules" />
<property name="project.structure.proportion" value="0.15" />
<property name="project.structure.side.proportion" value="0.2" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="RunManager" selected="Application.StartApp">
<configuration name="ARPDemo" type="Applet" factoryName="Applet" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="ARPDemo" />
<module name="NetworkSecurityGame" />
</configuration>
<configuration name="Game1" type="Applet" factoryName="Applet" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Game1" />
<module name="NetworkSecurityGame" />
</configuration>
<configuration name="Game2" type="Applet" factoryName="Applet" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="Game2" />
<module name="NetworkSecurityGame" />
</configuration>
<configuration name="MACFloodDemo" type="Applet" factoryName="Applet" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="MACFloodDemo" />
<module name="NetworkSecurityGame" />
</configuration>
<configuration name="StartApp" type="Application" factoryName="Application" temporary="true" nameIsGenerated="true">
<option name="MAIN_CLASS_NAME" value="StartApp" />
<module name="NetworkSecurityGame" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
</configuration>
<configuration default="true" type="Application" factoryName="Application">
<option name="MAIN_CLASS_NAME" value="StartApp" />
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
</configuration>
<configuration default="true" type="JUnit" factoryName="JUnit">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="TEST_OBJECT" value="class" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<patterns />
</configuration>
<configuration name="Unnamed" type="JetRunConfigurationType" factoryName="Kotlin">
<module name="NetworkSecurityGame" />
<option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="WORKING_DIRECTORY" value="" />
</configuration>
<configuration default="true" type="TestNG" factoryName="TestNG">
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="SUITE_NAME" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" />
<option name="METHOD_NAME" />
<option name="GROUP_NAME" />
<option name="TEST_OBJECT" value="CLASS" />
<option name="VM_PARAMETERS" value="-ea" />
<option name="PARAMETERS" />
<option name="WORKING_DIRECTORY" value="%MODULE_WORKING_DIR%" />
<option name="OUTPUT_DIRECTORY" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<option name="USE_DEFAULT_REPORTERS" value="false" />
<option name="PROPERTIES_FILE" />
<properties />
<listeners />
</configuration>
<list>
<item itemvalue="Kotlin.Unnamed" />
<item itemvalue="Applet.MACFloodDemo" />
<item itemvalue="Applet.ARPDemo" />
<item itemvalue="Applet.Game1" />
<item itemvalue="Applet.Game2" />
<item itemvalue="Application.StartApp" />
</list>
<recent_temporary>
<list>
<item itemvalue="Application.StartApp" />
<item itemvalue="Applet.Game2" />
<item itemvalue="Applet.Game1" />
<item itemvalue="Applet.ARPDemo" />
<item itemvalue="Applet.MACFloodDemo" />
</list>
</recent_temporary>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="11f48ef8-4a5d-49ce-81ca-2142c6d2299f" name="Default" comment="" />
<created>1536587726526</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1536587726526</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="64" y="-11" width="1303" height="780" extended-state="7" />
<editor active="true" />
<layout>
<window_info anchor="right" id="Palette" order="0" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Messages" order="7" weight="0.32847896" />
<window_info anchor="right" id="Palette&#9;" order="1" />
<window_info id="Image Layers" order="2" />
<window_info anchor="right" id="Capture Analysis" order="2" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
<window_info anchor="right" id="Maven Projects" order="3" weight="0.32988048" />
<window_info anchor="bottom" id="Version Control" order="7" show_stripe_button="false" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.0" />
<window_info anchor="bottom" id="Terminal" order="7" weight="0.32847896" />
<window_info id="Capture Tool" order="2" />
<window_info id="Designer" order="2" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.4939759" visible="true" weight="0.33227092" />
<window_info id="Structure" order="1" sideWeight="0.5060241" side_tool="true" weight="0.29721117" />
<window_info anchor="right" id="Ant Build" order="7" weight="0.32988048" />
<window_info x="559" y="73" width="313" height="618" id="UI Designer" order="2" sideWeight="0.50161815" type="WINDOWED" weight="0.24940239" />
<window_info anchor="right" id="Theme Preview" order="4" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.39967638" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="6" weight="0.24940239" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="5" type="SLIDING" weight="0.4" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32847896" />
</layout>
<layout-to-restore>
<window_info anchor="right" id="Palette" order="0" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="6" weight="0.25" />
<window_info anchor="right" id="Capture Analysis" order="2" />
<window_info active="true" anchor="bottom" id="Run" order="2" visible="true" weight="0.021035599" />
<window_info anchor="right" id="Theme Preview" order="4" />
<window_info content_ui="combo" id="Project" order="0" sideWeight="0.4939759" visible="true" weight="0.30996016" />
<window_info id="Structure" order="1" sideWeight="0.5060241" side_tool="true" weight="0.29721117" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="5" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="7" weight="0.32988048" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="9" show_stripe_button="false" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
<window_info x="559" y="73" width="313" height="618" id="UI Designer" order="4" sideWeight="0.50161815" type="WINDOWED" weight="0.24940239" />
<window_info anchor="bottom" id="Find" order="1" weight="0.32847896" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="right" id="Palette&#9;" order="1" />
<window_info anchor="bottom" id="Terminal" order="7" />
<window_info anchor="bottom" id="Event Log" order="8" side_tool="true" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info id="Capture Tool" order="5" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Messages" order="10" weight="0.32847896" />
<window_info anchor="right" id="Maven Projects" order="3" weight="0.32988048" />
<window_info id="Favorites" order="6" side_tool="true" />
</layout-to-restore>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<breakpoints>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/MACFloodDemo.java</url>
<line>583</line>
<properties />
</line-breakpoint>
<line-breakpoint enabled="true" type="java-line">
<url>file://$PROJECT_DIR$/src/Game2.java</url>
<line>417</line>
<properties />
<option name="timeStamp" value="1" />
</line-breakpoint>
</breakpoints>
<option name="time" value="2" />
</breakpoint-manager>
</component>
<component name="antWorkspaceConfiguration">
<option name="IS_AUTOSCROLL_TO_SOURCE" value="false" />
<option name="FILTER_TARGETS" value="false" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/Games.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="525">
<caret line="40" column="33" selection-start-line="40" selection-start-column="33" selection-end-line="40" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Game2.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="7245">
<caret line="508" column="29" selection-start-line="508" selection-start-column="29" selection-end-line="508" selection-end-column="29" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Games.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/StartApp.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/TutorialMain.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="39" lean-forward="true" selection-start-line="14" selection-start-column="3" selection-end-line="39" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1160#1161#0" expanded="true" />
<element signature="e#1219#1220#0" expanded="true" />
<element signature="e#1371#1372#0" expanded="true" />
<element signature="e#1449#1450#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ARPDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3375">
<caret line="248" lean-forward="true" selection-start-line="248" selection-end-line="248" />
<folding>
<element signature="imports" expanded="true" />
<element signature="class#483:4908" />
<element signature="e#555#556#0" expanded="true" />
<element signature="e#598#599#0" expanded="true" />
<element signature="e#747#748#0" expanded="true" />
<element signature="e#790#791#0" expanded="true" />
<element signature="e#1095#1096#0" expanded="true" />
<element signature="e#1138#1139#0" expanded="true" />
<element signature="e#1300#1301#0" expanded="true" />
<element signature="e#1343#1344#0" expanded="true" />
<element signature="e#1413#1414#0" expanded="true" />
<element signature="e#1456#1457#0" expanded="true" />
<element signature="e#1735#1736#0" expanded="true" />
<element signature="e#1778#1779#0" expanded="true" />
<element signature="e#3797#3798#0" expanded="true" />
<element signature="e#3841#3842#0" expanded="true" />
<element signature="e#4145#4146#0" expanded="true" />
<element signature="e#4189#4190#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EasyGames.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="33" column="13" lean-forward="true" selection-start-line="33" selection-start-column="13" selection-end-line="33" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TutorialMain.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/EasyGames.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Game1.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="315">
<caret line="203" column="5" lean-forward="true" selection-start-line="21" selection-start-column="2" selection-end-line="203" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Games.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="40" column="33" selection-start-line="40" selection-start-column="33" selection-end-line="40" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Game2.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="7095">
<caret line="508" column="29" lean-forward="true" selection-start-line="508" selection-start-column="29" selection-end-line="508" selection-end-column="29" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartGame.java" />
<entry file="file://$PROJECT_DIR$/src/StartGame.form" />
<entry file="file://$PROJECT_DIR$/src/JPanelWithBackground.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="213">
<caret line="15" column="5" lean-forward="true" selection-start-line="15" selection-start-column="5" selection-end-line="15" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/EasyGames.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/EasyGames.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="266">
<caret line="35" column="58" selection-start-line="35" selection-start-column="58" selection-end-line="35" selection-end-column="58" />
</state>
</provider>
</entry>
<entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/java/net/URLClassLoader.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="380" selection-start-line="380" selection-end-line="380" />
</state>
</provider>
</entry>
<entry file="jar:///usr/lib/jvm/java-8-oracle/src.zip!/javax/swing/plaf/basic/BasicButtonListener.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="251" selection-start-line="251" selection-end-line="251" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TutorialMain.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/IPSpoofDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="24" selection-start-column="24" selection-end-column="24" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DHCPStarveDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="27" selection-start-column="27" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TCPSesHijackDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="29" selection-start-column="29" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TCPSesSpoofDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="28" selection-start-column="28" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DNSOnpathDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="26" selection-start-column="26" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DNSOffpathDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="27" selection-start-column="27" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/SubDNSDomainDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="29" selection-start-column="29" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ARPCache.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="16" selection-start-line="11" selection-start-column="16" selection-end-line="11" selection-end-column="16" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Network.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="206">
<caret line="65" column="14" selection-start-line="65" selection-start-column="14" selection-end-line="65" selection-end-column="14" />
<folding>
<element signature="e#321#322#0" expanded="true" />
<element signature="e#354#355#0" expanded="true" />
<element signature="e#412#413#0" expanded="true" />
<element signature="e#456#457#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Node.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="120">
<caret line="10" lean-forward="true" selection-start-line="10" selection-end-line="10" />
<folding>
<element signature="e#277#278#0" expanded="true" />
<element signature="e#315#316#0" expanded="true" />
<element signature="e#383#384#0" expanded="true" />
<element signature="e#437#438#0" expanded="true" />
<element signature="e#481#482#0" expanded="true" />
<element signature="e#515#516#0" expanded="true" />
<element signature="e#575#576#0" expanded="true" />
<element signature="e#621#622#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Packet.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="135">
<caret line="10" column="32" selection-start-line="10" selection-start-column="32" selection-end-line="10" selection-end-column="32" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/TutorialMain.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2">
<caret line="20" column="71" lean-forward="true" selection-start-line="20" selection-start-column="71" selection-end-line="20" selection-end-column="71" />
<folding>
<element signature="imports" expanded="true" />
<element signature="e#1160#1161#0" expanded="true" />
<element signature="e#1219#1220#0" expanded="true" />
<element signature="e#1371#1372#0" expanded="true" />
<element signature="e#1449#1450#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Games.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="28">
<caret line="13" column="18" selection-start-line="13" selection-start-column="18" selection-end-line="44" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Games.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/OSILayers.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="523">
<caret line="56" lean-forward="true" selection-start-line="56" selection-end-line="56" />
<folding>
<element signature="e#1776#1777#0" expanded="true" />
<element signature="e#1822#1823#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DataLinkTut.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="508">
<caret line="55" column="11" selection-start-line="55" selection-start-column="11" selection-end-line="55" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/DataLinkTut.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/TimerBasedAnimation.java" />
<entry file="file://$PROJECT_DIR$/src/DHCPSpoofDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="26" selection-start-column="26" selection-end-column="26" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/LearningBridgeTable.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="4" selection-start-line="4" selection-start-column="4" selection-end-line="4" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Bridge.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="33" selection-start-line="4" selection-start-column="33" selection-end-line="4" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Connection.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="10" column="23" selection-start-line="10" selection-start-column="23" selection-end-line="10" selection-end-column="23" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/OSILayers.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/PopClickListener.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret line="2" column="33" selection-start-line="2" selection-start-column="33" selection-end-line="2" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/PopUpDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="8" column="60" selection-start-line="8" selection-start-column="60" selection-end-line="8" selection-end-column="60" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Game1.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="4515">
<caret line="327" column="44" selection-start-line="327" selection-start-column="44" selection-end-line="327" selection-end-column="44" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Game2.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="5490">
<caret line="394" selection-start-line="394" selection-end-line="394" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/StartApp.form">
<provider selected="true" editor-type-id="ui-designer" />
</entry>
<entry file="file://$PROJECT_DIR$/src/StartApp.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="465">
<caret line="37" selection-start-line="37" selection-end-line="37" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/MACFloodDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1">
<caret line="424" selection-start-line="424" selection-end-line="424" />
<folding>
<element signature="imports" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/ARPDemo.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="61">
<caret line="208" column="6" lean-forward="true" selection-start-line="208" selection-start-column="6" selection-end-line="208" selection-end-column="6" />
<folding>
<element signature="imports" expanded="true" />
<element signature="class#483:4908" />
<element signature="e#555#556#0" expanded="true" />
<element signature="e#598#599#0" expanded="true" />
<element signature="e#747#748#0" expanded="true" />
<element signature="e#790#791#0" expanded="true" />
<element signature="e#1095#1096#0" expanded="true" />
<element signature="e#1138#1139#0" expanded="true" />
<element signature="e#1300#1301#0" expanded="true" />
<element signature="e#1343#1344#0" expanded="true" />
<element signature="e#1413#1414#0" expanded="true" />
<element signature="e#1456#1457#0" expanded="true" />
<element signature="e#1735#1736#0" expanded="true" />
<element signature="e#1778#1779#0" expanded="true" />
<element signature="e#3797#3798#0" expanded="true" />
<element signature="e#3841#3842#0" expanded="true" />
<element signature="e#4145#4146#0" expanded="true" />
<element signature="e#4189#4190#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ArtifactsStructureConfigurable.UI">
<settings>
<artifact-editor />
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="FacetStructureConfigurable.UI">
<settings>
<last-edited>No facets are configured</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="GlobalLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="JdkListConfigurable.UI">
<settings>
<last-edited>1.8</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ModuleStructureConfigurable.UI">
<settings>
<last-edited>NetworkSecurityGame</last-edited>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
<option value="0.6" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
<state key="ProjectLibrariesConfigurable.UI">
<settings>
<splitter-proportions>
<option name="proportions">
<list>
<option value="0.2" />
</list>
</option>
</splitter-proportions>
</settings>
</state>
</states>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
public class ARPCache {
private String ip_address;
private String hw_type;
private String hw_Address;
private String flags;
private String mask;
private String iFace;
public ARPCache(String ip_address, String hw_type, String hw_Address,
String flags, String mask, String iFace) {
super();
this.ip_address = ip_address;
this.hw_type = hw_type;
this.hw_Address = hw_Address;
this.flags = flags;
this.mask = mask;
this.iFace = iFace;
}
public String getIp_from_Hw(String ip_address)
{
return getHw_Address();
}
public String getHw_from_Ip(String hw_address)
{
return getIp_address();
}
@Override
public String toString() {
return "ARPCache [ip_address=" + ip_address + ", hw_type=" + hw_type
+ ", hw_Address=" + hw_Address + "]";
}
public String getIp_address() {
return ip_address;
}
public void setIp_address(String ip_address) {
this.ip_address = ip_address;
}
public String getHw_type() {
return hw_type;
}
public void setHw_type(String hw_type) {
this.hw_type = hw_type;
}
public String getHw_Address() {
return hw_Address;
}
public void setHw_Address(String hw_Address) {
this.hw_Address = hw_Address;
}
public String getFlags() {
return flags;
}
public void setFlags(String flags) {
this.flags = flags;
}
public String getMask() {
return mask;
}
public void setMask(String mask) {
this.mask = mask;
}
public String getiFace() {
return iFace;
}
public void setiFace(String iFace) {
this.iFace = iFace;
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.ArrayList;
import java.util.List;
public class ARPDemo extends JApplet {
JButton b;
JTextField tf;
List<Packet> packets = new ArrayList<>();
ImageIcon nodeimg = new ImageIcon("/home/tanvi/Pictures/cmp.png");
public ARPDemo(){
paint(new Graphics() {
@Override
public Graphics create() {
return null;
}
@Override
public void translate(int x, int y) {
}
@Override
public Color getColor() {
return null;
}
@Override
public void setColor(Color c) {
}
@Override
public void setPaintMode() {
}
@Override
public void setXORMode(Color c1) {
}
@Override
public Font getFont() {
return null;
}
@Override
public void setFont(Font font) {
}
@Override
public FontMetrics getFontMetrics(Font f) {
return null;
}
@Override
public Rectangle getClipBounds() {
return null;
}
@Override
public void clipRect(int x, int y, int width, int height) {
}
@Override
public void setClip(int x, int y, int width, int height) {
}
@Override
public Shape getClip() {
return null;
}
@Override
public void setClip(Shape clip) {
}
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
}
@Override
public void fillRect(int x, int y, int width, int height) {
}
@Override
public void clearRect(int x, int y, int width, int height) {
}
@Override
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void drawOval(int x, int y, int width, int height) {
}
@Override
public void fillOval(int x, int y, int width, int height) {
}
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawString(String str, int x, int y) {
}
@Override
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
}
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public void dispose() {
}
});
}
public void paint(Graphics g)
{
// Draw head
final Node na = new Node(1);
na.setNode_name("Node A");
InterfaceConfig ica = new InterfaceConfig("10.1.0.1 (IP1)",
"32:52:5e:4b:7a:e4 (MAC1)","10.1.0.255","255.255.255.0","ether");
na.setInterfaceConfig(ica);
na.setHaveAccess(false);
final Node nb = new Node(2);
nb.setNode_name("Node B");
InterfaceConfig icb = new InterfaceConfig("10.1.0.2 (IP2)",
"b8:92:a7:e2:9c:01 (MAC2)","10.1.0.255","255.255.255.0","wlan");
nb.setInterfaceConfig(icb);
nb.setHaveAccess(false);
final Node nc = new Node(3);
nc.setNode_name("Node C");
InterfaceConfig icc = new InterfaceConfig("10.1.0.3 (IP3)",
"95:ae:93:d4:a7:9c (MAC3)","10.1.0.255","255.255.255.0","ether");
nc.setInterfaceConfig(icc);
nc.setHaveAccess(true);
List<ARPCache> ac = new ArrayList<>();
ac.add(new ARPCache("10.1.0.1 (IP1)", "ether", "32:52:5e:4b:7a:e4 (MAC1)","", "",""));
ac.add(new ARPCache("10.1.0.2 (IP2)", "wlan", "b8:92:a7:e2:9c:01 (MAC2)","", "",""));
ac.add(new ARPCache("10.1.0.3 (IP3)", "ether", "95:ae:93:d4:a7:9c (MAC3)","", "",""));
na.setArpCaches(ac);
nb.setArpCaches(ac);
nc.setArpCaches(ac);
Network network = new Network("Network 1");
List<Node> nodes = new ArrayList<>();
nodes.add(na); nodes.add(nb); nodes.add(nc);
network.setNodes(nodes);
network.setNo_of_nodes(nodes.size());
network.setPackets(packets);
JFrame frame= new JFrame("SIMULATOR");
JPanel panel = new JPanel(null){
public void paintComponent(Graphics g){
g.drawLine(320,380,720,380); //a b
g.drawLine(280,320,420,150); //a c
g.drawLine(620,150,720,320); //b c
}
};
JLabel l1,l2,l3,title;
JLabel transmitting;
transmitting = new JLabel("");
final JButton b1,b2,b3;
title = new JLabel("RIGHT CLICK ON THE NODE TO PERFORM ACTIONS. You have access of Node C.");
title.setBounds(10,10,700,30);
l1=new JLabel(na.getNode_name());
l1.setBounds(200,500, 100,30);
l1.addMouseListener(new PopClickListener(na,network,panel));
l2=new JLabel(nb.getNode_name());
l2.setBounds(800,500, 100,30);
l2.addMouseListener(new PopClickListener(nb,network,panel));
l3=new JLabel(nc.getNode_name());
l3.setBounds(500,250, 100,30);
l3.addMouseListener(new PopClickListener(nc,network,panel));
JButton button;
button = new JButton("START TRAMISSION");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// packets.add(new Packet(na.getInterfaceConfig().getIp_address(),nb.getInterfaceConfig().getIp_address(),
// na.getInterfaceConfig().getMac_address(),nb.getInterfaceConfig().getMac_address(),"HELLO", "Data Packet"));
/* packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getInterfaceConfig().getMac_address(),
na.getArpcache()))\*/
for(int i=0;i<na.getArpCaches().size();i++)
{
if(na.getArpCaches().get(i).getIp_address() == nb.getInterfaceConfig().getIp_address())
{
packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getArpCaches().get(i).getIp_address(),
na.getInterfaceConfig().getMac_address(),na.getArpCaches().get(i).getHw_Address(),"HELLO","Data Packet"));
}
}
network.setPackets(packets);
JOptionPane.showMessageDialog(frame, na.getNode_name()+ " Trasmitting to " + nb.getNode_name());
System.out.print(packets);
}
});
button.setBounds(400,650,300,30);
JLabel n1,n2,n3;
n1 = new JLabel("");
n1.setIcon(nodeimg); n1.setBounds(120,300, 200,200);
n1.addMouseListener(new PopClickListener(na,network,panel));
n2 = new JLabel("");
n2.setIcon(nodeimg); n2.setBounds(720,300, 200,200);
n2.addMouseListener(new PopClickListener(nb,network,panel));
n3 = new JLabel("");
n3.setIcon(nodeimg); n3.setBounds(420,70, 200,200);
n3.addMouseListener(new PopClickListener(nc,network,panel));
panel.add(l1); panel.add(l2); panel.add(l3);
panel.add(n1); panel.add(n2); panel.add(n3);
panel.add(title); panel.add(button);
frame.getContentPane().add(panel);
frame.setSize(1000,1000);
frame.setVisible(true);
}
}
import java.util.List;
public class Bridge {
private int bridge_id;
private int max_entry_count=4;
private String bridge_name;
private List<LearningBridgeTable> learningBridgeTables;
private int total_changed=0;
public int increaseCount(){
this.total_changed++;
return this.total_changed;
}
public Bridge(int bridge_id, int max_entry_count, String bridge_name) {
this.bridge_id = bridge_id;
this.max_entry_count = max_entry_count;
this.bridge_name = bridge_name;
}
public Bridge(int bridge_id, int max_entry_count) {
this.bridge_id = bridge_id;
this.max_entry_count = max_entry_count;
}
public Bridge(){}
public Bridge(int bridge_id, int max_entry_count, String bridge_name, List<LearningBridgeTable> learningBridgeTables) {
this.bridge_id = bridge_id;
this.max_entry_count = max_entry_count;
this.bridge_name = bridge_name;
this.learningBridgeTables = learningBridgeTables;
}
public int getBridge_id() {
return bridge_id;
}
public void setBridge_id(int bridge_id) {
this.bridge_id = bridge_id;
}
public int getMax_entry_count() {
return max_entry_count;
}
public void setMax_entry_count(int max_entry_count) {
this.max_entry_count = max_entry_count;
}
public String getBridge_name() {
return bridge_name;
}
public void setBridge_name(String bridge_name) {
this.bridge_name = bridge_name;
}
public List<LearningBridgeTable> getLearningBridgeTables() {
return learningBridgeTables;
}
public void setLearningBridgeTables(List<LearningBridgeTable> learningBridgeTables) {
this.learningBridgeTables = learningBridgeTables;
}
}
import java.util.List;
import java.util.Map;
public class Connection {
private Node node;
// private List<Map.Entry<int,Node> > nodes;
// private List<Map.Entry<int,Bridge> > bridges;
private Bridge bridge;
private int type;
private int port_no;
private Bridge bridge2;
private boolean current=false;
private int x1,x2,y1,y2;
public boolean isCurrent() {
return current;
}
public void setCurrent(boolean current) {
this.current = current;
}
public void setCoordinates(int x1,int y1, int x2,int y2){
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
}
public int getX1() {
return x1;
}
public void setX1(int x1) {
this.x1 = x1;
}
public int getX2() {
return x2;
}
public void setX2(int x2) {
this.x2 = x2;
}
public int getY1() {
return y1;
}
public void setY1(int y1) {
this.y1 = y1;
}
public int getY2() {
return y2;
}
public void setY2(int y2) {
this.y2 = y2;
}
public Connection(Bridge bridge, Node node, int port_no,int x1,int y1, int x2,int y2) {
this.node = node;
this.bridge = bridge;
this.port_no = port_no;
type = 1;
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
}
public Connection(Bridge bridge, Bridge bridge2 ,int port_no,int x1,int y1, int x2,int y2) {
this.bridge = bridge;
this.port_no = port_no;
this.bridge2 = bridge2;
type = 2;
this.x1 = x1;
this.x2 = x2;
this.y1 = y1;
this.y2 = y2;
}
public Node getNodefromPort(int port_no){
return node;
}
public Bridge getBridgefromPort(int port_no){
return bridge2;
}
public Node getNode() {
return node;
}
public void setNode(Node node) {
this.node = node;
}
public Bridge getBridge() {
return bridge;
}
public void setBridge(Bridge bridge) {
this.bridge = bridge;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public int getPort_no() {
return port_no;
}
public void setPort_no(int port_no) {
this.port_no = port_no;
}
public Bridge getBridge2() {
return bridge2;
}
public void setBridge2(Bridge bridge2) {
this.bridge2 = bridge2;
}
}
public class DHCPSpoofDemo {
}
public class DHCPStarveDemo {
}
public class DNSOffpathDemo {
}
public class DNSOnpathDemo {
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="DataLinkTut">
<grid id="27dc6" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<grid id="32571" binding="datalinktut" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="13883" class="javax.swing.JButton" binding="ARPSpoofingButton" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<focusable value="false"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="ARP Spoofing"/>
</properties>
</component>
<component id="d5762" class="javax.swing.JButton" binding="macFloodbutton">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="MAC Flooding"/>
</properties>
</component>
<component id="8b084" class="javax.swing.JButton" binding="exitButton" default-binding="true">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Exit"/>
</properties>
</component>
<component id="ec4ec" class="javax.swing.JButton" binding="backButton">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Back"/>
</properties>
</component>
</children>
</grid>
<vspacer id="b3cdc">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class DataLinkTut {
private JPanel datalinktut;
private JButton ARPSpoofingButton;
private JButton macFloodbutton;
private JButton backButton;
private JButton exitButton;
public DataLinkTut() {
JFrame jFrame = new JFrame("Data Link Layer Tutorial");
try {
jFrame.setContentPane(new JPanelWithBackground("/home/tanvi/Pictures/back1.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
jFrame.getContentPane().add(datalinktut);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.pack();
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
OSILayers osiLayers = new OSILayers();
}
});
macFloodbutton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MACFloodDemo macFloodDemo = new MACFloodDemo();
}
});
ARPSpoofingButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ARPDemo arpDemo = new ARPDemo();
}
});
exitButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="EasyGames">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="FlowLayout" hgap="5" vgap="5" flow-align="1">
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="b0dd3" class="javax.swing.JButton" binding="mitmButton">
<constraints/>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="MITM"/>
</properties>
</component>
<component id="2fb64" class="javax.swing.JButton" binding="dosButton">
<constraints/>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="DOS"/>
</properties>
</component>
<component id="3a677" class="javax.swing.JButton" binding="BACKButton" default-binding="true">
<constraints/>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="BACK"/>
</properties>
</component>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class EasyGames {
private JButton mitmButton;
private JPanel panel1;
private JButton dosButton;
private JButton BACKButton;
public EasyGames() {
JFrame jFrame = new JFrame("Easy Games");
try {
jFrame.setContentPane(new JPanelWithBackground("/home/tanvi/Pictures/back1.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
jFrame.getContentPane().add(panel1);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.pack();
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
mitmButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Game1 game1 = new Game1();
}
});
dosButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Game2 game1 = new Game2();
}
});
BACKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
Games games = new Games();
}
});
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Game1 extends JApplet {
JButton b;
JTextField tf;
List<Packet> packets = new ArrayList<>();
Random rand = new Random();
int random ;
ImageIcon nodeimg = new ImageIcon("/home/tanvi/Pictures/cmp.png");
public Game1(){
paint(new Graphics() {
@Override
public Graphics create() {
return null;
}
@Override
public void translate(int x, int y) {
}
@Override
public Color getColor() {
return null;
}
@Override
public void setColor(Color c) {
}
@Override
public void setPaintMode() {
}
@Override
public void setXORMode(Color c1) {
}
@Override
public Font getFont() {
return null;
}
@Override
public void setFont(Font font) {
}
@Override
public FontMetrics getFontMetrics(Font f) {
return null;
}
@Override
public Rectangle getClipBounds() {
return null;
}
@Override
public void clipRect(int x, int y, int width, int height) {
}
@Override
public void setClip(int x, int y, int width, int height) {
}
@Override
public Shape getClip() {
return null;
}
@Override
public void setClip(Shape clip) {
}
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
}
@Override
public void fillRect(int x, int y, int width, int height) {
}
@Override
public void clearRect(int x, int y, int width, int height) {
}
@Override
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void drawOval(int x, int y, int width, int height) {
}
@Override
public void fillOval(int x, int y, int width, int height) {
}
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawString(String str, int x, int y) {
}
@Override
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
}
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public void dispose() {
}
});
}
public void paint(Graphics g)
{
random= rand.nextInt(9999-1000)+1000;
// Draw head
final Node na = new Node(1);
na.setNode_name("Node A");
InterfaceConfig ica = new InterfaceConfig("10.1.0.1",
"32:52:5e:4b:7a:e4","10.1.0.255","255.255.255.0","ether");
na.setInterfaceConfig(ica);
na.setHaveAccess(false);
final Node nb = new Node(2);
nb.setNode_name("Node B");
InterfaceConfig icb = new InterfaceConfig("10.1.0.2",
"b8:92:a7:e2:9c:01","10.1.0.255","255.255.255.0","wlan");
nb.setInterfaceConfig(icb);
nb.setHaveAccess(false);
final Node nc = new Node(3);
nc.setNode_name("Node C");
InterfaceConfig icc = new InterfaceConfig("10.1.0.3",
"95:ae:93:d4:a7:9c","10.1.0.255","255.255.255.0","ether");
nc.setInterfaceConfig(icc);
nc.setHaveAccess(true);
List<ARPCache> ac = new ArrayList<>();
ac.add(new ARPCache("10.1.0.1", "ether", "32:52:5e:4b:7a:e4","", "",""));
ac.add(new ARPCache("10.1.0.2", "wlan", "b8:92:a7:e2:9c:01","", "",""));
ac.add(new ARPCache("10.1.0.3", "ether", "95:ae:93:d4:a7:9c","", "",""));
na.setArpCaches(ac);
nb.setArpCaches(ac);
nc.setArpCaches(ac);
Network network = new Network("Network 1");
List<Node> nodes = new ArrayList<>();
nodes.add(na); nodes.add(nb); nodes.add(nc);
network.setNodes(nodes);
network.setNo_of_nodes(nodes.size());
network.setPackets(packets);
JFrame frame= new JFrame("SIMULATOR");
JPanel panel = new JPanel(null){
public void paintComponent(Graphics g){
g.drawLine(320,380,720,380); //a b
g.drawLine(280,320,420,150); //a c
g.drawLine(620,150,720,320); //b c
}
};
JLabel l1,l2,l3,title;
JLabel transmitting;
transmitting = new JLabel("");
final JButton b1,b2,b3;
title = new JLabel("ENTER THE MESSAGE SENT FROM A TO B");
title.setBounds(10,10,300,30);
JTextField jt = new JTextField();
jt.setBounds(350,10,200,30);
JButton sub = new JButton("OK");
sub.setBounds(600,10,100,30);
sub.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
if(jt.getText().toString().trim().equals(String.valueOf(random)))
{
JOptionPane.showMessageDialog(frame, "CORRECT!!!");
frame.dispose();
}
else
{
JOptionPane.showMessageDialog(frame, "WRONG!! Try Again");
}
}});
l1=new JLabel(na.getNode_name());
l1.setBounds(200,500, 100,30);
l2=new JLabel(nb.getNode_name());
l2.setBounds(800,500, 100,30);
l3=new JLabel(nc.getNode_name());
l3.setBounds(500,250, 100,30);
l3.addMouseListener(new PopClickListener(nc,network,panel));
JButton button;
button = new JButton("START TRAMISSION");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// packets.add(new Packet(na.getInterfaceConfig().getIp_address(),nb.getInterfaceConfig().getIp_address(),
// na.getInterfaceConfig().getMac_address(),nb.getInterfaceConfig().getMac_address(),"HELLO", "Data Packet"));
/* packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getInterfaceConfig().getMac_address(),
na.getArpcache()))\*/
for(int i=0;i<na.getArpCaches().size();i++)
{
if(na.getArpCaches().get(i).getIp_address() == nb.getInterfaceConfig().getIp_address())
{
packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getArpCaches().get(i).getIp_address(),
na.getInterfaceConfig().getMac_address(),na.getArpCaches().get(i).getHw_Address(),""+random,"Data Packet"));
}
}
network.setPackets(packets);
JOptionPane.showMessageDialog(frame, na.getNode_name()+ " Trasmitting to " + nb.getNode_name());
// System.out.print(packets);
}
});
button.setBounds(400,650,300,30);
JLabel n1,n2,n3;
n1 = new JLabel("");
n1.setIcon(nodeimg); n1.setBounds(120,300, 200,200);
// n1.addMouseListener(new PopClickListener(na,network));
n2 = new JLabel("");
n2.setIcon(nodeimg); n2.setBounds(720,300, 200,200);
// n2.addMouseListener(new PopClickListener(nb,network),panel);
n3 = new JLabel("");
n3.setIcon(nodeimg); n3.setBounds(420,70, 200,200);
n3.addMouseListener(new PopClickListener(nc,network,panel));
panel.add(l1); panel.add(l2); panel.add(l3);
panel.add(n1); panel.add(n2); panel.add(n3);
panel.add(title); panel.add(button);
panel.add(jt); panel.add(sub);
//f.add(b1); f.add(b2); f.add(b3);
// f.add(i1.getImage());
frame.getContentPane().add(panel);
frame.setSize(1000,1000);
frame.setVisible(true);
}
}
import com.sun.xml.internal.messaging.saaj.soap.JpegDataContentHandler;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
public class Game2 extends JApplet {
JButton b;
JTextField tf;
List<Packet> packets = new ArrayList<>();
Random rand = new Random();
int random ;
static JFrame frame;
ImageIcon nodeimg = new ImageIcon("/home/tanvi/Pictures/cmp2.png");
public Game2(){
paint(new Graphics() {
@Override
public Graphics create() {
return null;
}
@Override
public void translate(int x, int y) {
}
@Override
public Color getColor() {
return null;
}
@Override
public void setColor(Color c) {
}
@Override
public void setPaintMode() {
}
@Override
public void setXORMode(Color c1) {
}
@Override
public Font getFont() {
return null;
}
@Override
public void setFont(Font font) {
}
@Override
public FontMetrics getFontMetrics(Font f) {
return null;
}
@Override
public Rectangle getClipBounds() {
return null;
}
@Override
public void clipRect(int x, int y, int width, int height) {
}
@Override
public void setClip(int x, int y, int width, int height) {
}
@Override
public Shape getClip() {
return null;
}
@Override
public void setClip(Shape clip) {
}
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
}
@Override
public void fillRect(int x, int y, int width, int height) {
}
@Override
public void clearRect(int x, int y, int width, int height) {
}
@Override
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void drawOval(int x, int y, int width, int height) {
}
@Override
public void fillOval(int x, int y, int width, int height) {
}
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawString(String str, int x, int y) {
}
@Override
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
}
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public void dispose() {
}
});
}
public void paint(Graphics g)
{
random= rand.nextInt(9999-1000)+1000;
// Draw head
final Node na = new Node(1);
na.setNode_name("Node A");
InterfaceConfig ica = new InterfaceConfig("10.1.0.1",
"32:52:5e:4b:7a:e4","10.1.0.255","255.255.255.0","ether");
na.setInterfaceConfig(ica);
na.setHaveAccess(false);
final Node nb = new Node(2);
nb.setNode_name("Node B");
InterfaceConfig icb = new InterfaceConfig("10.1.0.2",
"b8:92:a7:e2:9c:01","10.1.0.255","255.255.255.0","wlan");
nb.setInterfaceConfig(icb);
nb.setHaveAccess(false);
final Node nc = new Node(3);
nc.setNode_name("Node C");
InterfaceConfig icc = new InterfaceConfig("10.1.0.3",
"95:ae:93:d4:a7:9c","10.1.0.255","255.255.255.0","ether");
nc.setInterfaceConfig(icc);
nc.setHaveAccess(true);
final Node nd = new Node(4);
nd.setNode_name("Node D");
InterfaceConfig icd = new InterfaceConfig("10.1.0.4",
"02:e4:23:9a:13:91","10.1.0.255","255.255.255.0","ether");
nd.setInterfaceConfig(icd);
nd.setHaveAccess(false);
final Node ne = new Node(5);
ne.setNode_name("Node E");
InterfaceConfig ice = new InterfaceConfig("10.1.0.5",
"a9:02:3b:ed:3f:82","10.1.0.255","255.255.255.0","wlan");
ne.setInterfaceConfig(ice);
ne.setHaveAccess(false);
final Node nf = new Node(6);
nf.setNode_name("Node F");
InterfaceConfig icf = new InterfaceConfig("10.1.0.6",
"19:20:ad:b2:c7:f8","10.1.0.255","255.255.255.0","ether");
nf.setInterfaceConfig(icf);
nf.setHaveAccess(true);
List<ARPCache> ac = new ArrayList<>();
ac.add(new ARPCache("10.1.0.1", "ether", "32:52:5e:4b:7a:e4","", "",""));
ac.add(new ARPCache("10.1.0.2", "wlan", "b8:92:a7:e2:9c:01","", "",""));
ac.add(new ARPCache("10.1.0.3", "ether", "95:ae:93:d4:a7:9c","", "",""));
ac.add(new ARPCache(nd.getInterfaceConfig().getIp_address(),nd.getInterfaceConfig().getHw_type(),nd.getInterfaceConfig().getMac_address(),"","",""));
ac.add(new ARPCache(ne.getInterfaceConfig().getIp_address(),ne.getInterfaceConfig().getHw_type(),ne.getInterfaceConfig().getMac_address(),"","",""));
ac.add(new ARPCache(nf.getInterfaceConfig().getIp_address(),nf.getInterfaceConfig().getHw_type(),nf.getInterfaceConfig().getMac_address(),"","",""));
na.setArpCaches(ac);
nb.setArpCaches(ac);
nc.setArpCaches(ac);
nd.setArpCaches(ac);
ne.setArpCaches(ac);
nf.setArpCaches(ac);
Network network = new Network("Network 1");
List<Node> nodes = new ArrayList<>();
nodes.add(na); nodes.add(nb); nodes.add(nc); nodes.add(nd); nodes.add(ne); nodes.add(nf);
network.setNodes(nodes);
network.setNo_of_nodes(nodes.size());
network.setPackets(packets);
frame= new JFrame("SIMULATOR");
JPanel panel = new JPanel(null){
public void paintComponent(Graphics g){
}
};
JLabel l1,l2,l3,l4,l5,l6,title;
JLabel transmitting;
transmitting = new JLabel("");
final JButton b1,b2,b3;
title = new JLabel("Do Denial-of-Service for Node A, (You have access to node C)");
title.setBounds(10,10,600,30);
JButton sub = new JButton("OK");
sub.setBounds(10,40,100,30);
sub.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
}});
l1=new JLabel(na.getNode_name());
l2=new JLabel(nb.getNode_name());
l3=new JLabel(nc.getNode_name());
l3.addMouseListener(new PopClickListener1(nc,network,panel));
l4=new JLabel(nd.getNode_name());
l5=new JLabel(ne.getNode_name());
l6=new JLabel(nf.getNode_name());
JButton button;
button = new JButton("START TRAMISSION");
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
// packets.add(new Packet(na.getInterfaceConfig().getIp_address(),nb.getInterfaceConfig().getIp_address(),
// na.getInterfaceConfig().getMac_address(),nb.getInterfaceConfig().getMac_address(),"HELLO", "Data Packet"));
/* packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getInterfaceConfig().getMac_address(),
na.getArpcache()))\*/
for(int i=0;i<na.getArpCaches().size();i++)
{
if(na.getArpCaches().get(i).getIp_address() == nb.getInterfaceConfig().getIp_address())
{
packets.add(new Packet(na.getInterfaceConfig().getIp_address(),na.getArpCaches().get(i).getIp_address(),
na.getInterfaceConfig().getMac_address(),na.getArpCaches().get(i).getHw_Address(),""+random,"Data Packet"));
}
}
network.setPackets(packets);
JOptionPane.showMessageDialog(frame, na.getNode_name()+ " Trasmitting to " + nb.getNode_name());
System.out.print(packets);
}
});
button.setBounds(400,650,300,30);
JLabel n1,n2,n3,n4,n5,n6;
n1 = new JLabel("");
n1.setIcon(nodeimg); n1.setBounds(120,300, 200,200);
l1.setBounds(140,450, 100,30);
n2 = new JLabel("");
n2.setIcon(nodeimg); n2.setBounds(240,70, 200,200);
l2.setBounds(260,220, 100,30);
n3 = new JLabel("");
n3.setIcon(nodeimg); n3.setBounds(540,70, 200,200);
l3.setBounds(560,220, 100,30);
n3.addMouseListener(new PopClickListener1(nc,network,panel));
n4 = new JLabel("");
n4.setIcon(nodeimg); n4.setBounds(720,300, 200,200);
l4.setBounds(740,450, 100,30);
n5 = new JLabel("");
n5.setIcon(nodeimg); n5.setBounds(540,450, 200,200);
l5.setBounds(560,600,100,30);
n6 = new JLabel("");
n6.setIcon(nodeimg); n6.setBounds(240,450, 200,200);
l6.setBounds(260,600,100,30);
panel.add(l1); panel.add(l2); panel.add(l3); panel.add(l4); panel.add(l5); panel.add(l6);
panel.add(n1); panel.add(n2); panel.add(n3); panel.add(n4); panel.add(n5); panel.add(n6);
panel.add(title); //f.add(button);
panel.add(sub);
frame.getContentPane().add(panel);
frame.setSize(1000,1000);
frame.setVisible(true);
}
}
class PopUpDemo1 extends JPopupMenu {
JMenuItem anItem,anItem2,anItem3;
public PopUpDemo1(Node node, Network network,JPanel panel){
anItem = new JMenuItem("View Node Details");
anItem2 = new JMenuItem("View ARP Cache at Node");
anItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Properties");
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="";
str = str + "<html><p>" + node.getNode_name();
str = str + "</p<br><p>ip_address: " + node.getInterfaceConfig().getIp_address();
str = str + "</p><br><p>mac_address: " + node.getInterfaceConfig().getMac_address();
str = str + "</p><br><p>broadcast: " + node.getInterfaceConfig().getBroadcast();
str = str + "</p><br><p>subnet_mask: " + node.getInterfaceConfig().getSubnet_mask();
str = str + "</html";
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,300, 200);
}
});
add(anItem);
anItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("ARP Cache");
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
List<ARPCache> arp;
arp = node.getArpCaches();
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>ip_address</th>\n" +
" <th>hw_type</th>\n" +
" <th>hw_Address</th>\n" +
" </tr>";
for(int i=0;i<arp.size();i++) {
str = str + "<tr><td>" + arp.get(i).getIp_address() + "</td><td>" + arp.get(i).getHw_type() +
"</td><td>" + arp.get(i).getHw_Address() + "</td></tr>";
}
str = str + "</table></html>";
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,300, 200);
}
});
add(anItem2);
if(node.getHaveAccess()) {
anItem3 = new JMenuItem("Send ARP Packet");
add(anItem3);
anItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jf= new JFrame("");
jf.getContentPane().setLayout(null);
JLabel mac = new JLabel("Choose MAC address");
JComboBox cmac = new JComboBox(network.getNodes().toArray());
mac.setBounds(5,5,200,30);
cmac.setBounds(5,40,500,30);
JLabel ip = new JLabel("Choose IP address");
JComboBox cip = new JComboBox(network.getNodes().toArray());
ip.setBounds(5,75,200,30);
cip.setBounds(5,120,500,30);
JButton jb = new JButton("SEND");
jb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Node nmac = (Node) cmac.getSelectedItem();
Node nip = (Node)cip.getSelectedItem();
Packet packet = new Packet(nip.getInterfaceConfig().getIp_address(),nip.getInterfaceConfig().getBroadcast(),
nmac.getInterfaceConfig().getMac_address(),"","","ARP Packet");
List<Packet> packets = network.getPackets();
packets.add(packet);
network.setPackets(packets);
List<Node> nodes= network.getNodes();
for(int i=0;i<network.getNodes().size();i++)
{
List<ARPCache> arpCaches = nodes.get(i).getArpCaches();
for(int j=0;j<arpCaches.size();j++)
{
if(arpCaches.get(j).getIp_address() == nip.getInterfaceConfig().getIp_address())
{
arpCaches.get(j).setHw_Address(nmac.getInterfaceConfig().getMac_address());
}
}
nodes.get(i).setArpCaches(arpCaches);
}
network.setNodes(nodes);
JOptionPane.showMessageDialog(jf, "ARP Packet Sent");
int count = 0;
List<ARPCache> arpCache = node.getArpCaches();
for(int i=0;i<arpCache.size();i++)
{
if(arpCache.get(i).getHw_Address().equals(network.getNodebyId(1).getInterfaceConfig().getMac_address()))
{
count++;
if(count>=5)
{ JOptionPane.showMessageDialog(jf, "Congestion at A. DOS Successful");
jf.dispose();
}
}
}
jf.dispose();
}
});
jb.setBounds(5,165,100,30);
//jf.setLayout(null);
//choose_mac_address.setHorizontalAlignment(JLabel.CENTER);
jf.add(mac); jf.add(cmac);
jf.add(ip); jf.add(cip);
jf.add(jb);
jf.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,550, 250);
jf.setVisible(true);
}});
}
JMenuItem anItem4;
anItem4 = new JMenuItem("View Packets Received");
anItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Packets Received");
List<Packet> packets = network.getPackets();
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>Sender's IP</th>\n" +
" <th>Sender's MAC</th>\n" +
" <th>Packet Type</th>\n" +
" <th>Data</th>\n" +
" </tr>";
for(int i = 0;i<packets.size();i++)
{
if(packets.get(i).getReceiver_ip() == node.getInterfaceConfig().getIp_address() ||
packets.get(i).getReceiver_ip() == node.getInterfaceConfig().getBroadcast() ||
packets.get(i).getReceiver_mac() == node.getInterfaceConfig().getMac_address())
{str = str +"<tr><td>" + packets.get(i).getSender_ip() +
"</td><td>" + packets.get(i).getSender_mac()+
"</td><td>" + packets.get(i).getType()+
"</td><td>"+ packets.get(i).getData() +"</td></tr>";
}
}
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,500, 200);
}});
add(anItem4);
}
}
class PopClickListener1 extends MouseAdapter {
Node node;
Network network;
JPanel jPanel;
PopClickListener1(Node n, Network net, JPanel panel){
node = n;
network = net;
jPanel = panel;
}
public void mousePressed(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
public void mouseReleased(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
private void doPop(MouseEvent e){
PopUpDemo1 menu = new PopUpDemo1(node,network,jPanel);
menu.show(e.getComponent(), e.getX(), e.getY());
}
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="Games">
<grid id="27dc6" binding="gamesPanel" layout-manager="GridLayoutManager" row-count="5" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="46ba7" class="javax.swing.JButton" binding="easyButton" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<focusable value="false"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="EASY"/>
</properties>
</component>
<component id="51991" class="javax.swing.JButton" binding="mediumButton">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="MEDIUM"/>
</properties>
</component>
<component id="12cd1" class="javax.swing.JButton" binding="hardButton">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="HARD"/>
</properties>
</component>
<component id="65557" class="javax.swing.JButton" binding="backButton">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="BACK"/>
</properties>
</component>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class Games {
private JButton easyButton;
private JButton mediumButton;
private JPanel gamesPanel;
private JButton hardButton;
private JButton backButton;
public Games() {
JFrame jFrame = new JFrame("Games");
try {
jFrame.setContentPane(new JPanelWithBackground("/home/tanvi/Pictures/back1.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
jFrame.getContentPane().add(gamesPanel);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.pack();
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
StartApp.main(null);
}
});
easyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
EasyGames easyGames = new EasyGames();
}
});
}
}
public class IPSpoofDemo {
}
public class InterfaceConfig {
private String ip_address;
private String mac_address;
private String broadcast;
private String subnet_mask;
private String hw_type; //e = ethernet , w = wlan
public InterfaceConfig()
{}
@Override
public String toString() {
return "InterfaceConfig [ip_address=" + ip_address + "\n, mac_address="
+ mac_address + "\n, broadcast=" + broadcast + "\n, subnet_mask="
+ subnet_mask + "\n, hw_type=" + hw_type + "]";
}
public InterfaceConfig(String ip_address, String mac_address,
String broadcast, String subnet_mask, String hw_type) {
super();
this.ip_address = ip_address;
this.mac_address = mac_address;
this.broadcast = broadcast;
this.subnet_mask = subnet_mask;
this.hw_type = hw_type;
}
public String getIp_address() {
return ip_address;
}
public void setIp_address(String ip_address) {
this.ip_address = ip_address;
}
public String getMac_address() {
return mac_address;
}
public void setMac_address(String mac_address) {
this.mac_address = mac_address;
}
public String getBroadcast() {
return broadcast;
}
public void setBroadcast(String broadcast) {
this.broadcast = broadcast;
}
public String getSubnet_mask() {
return subnet_mask;
}
public void setSubnet_mask(String subnet_mask) {
this.subnet_mask = subnet_mask;
}
public String getHw_type() {
return hw_type;
}
public void setHw_type(String hw_type) {
this.hw_type = hw_type;
}
}
import javax.imageio.ImageIO;
import javax.swing.*;
import java.awt.*;
import java.io.File;
import java.io.IOException;
public class JPanelWithBackground extends JPanel {
private Image backgroundImage;
// Some code to initialize the background image.
// Here, we use the constructor to load the image. This
// can vary depending on the use case of the panel.
public JPanelWithBackground(String fileName) throws IOException {
backgroundImage = ImageIO.read(new File(fileName));
}
public void paintComponent(Graphics g) {
super.paintComponent(g);
// Draw the background image.
g.drawImage(backgroundImage, 0, 0, null);
}
}
\ No newline at end of file
public class LearningBridgeTable {
private String mac_address;
private int port_no;
public LearningBridgeTable(String mac_address, int port_no) {
this.mac_address = mac_address;
this.port_no = port_no;
}
public String getMac_address() {
return mac_address;
}
public void setMac_address(String mac_address) {
this.mac_address = mac_address;
}
public int getPort_no() {
return port_no;
}
public void setPort_no(int port_no) {
this.port_no = port_no;
}
}
import javax.swing.*;
import javax.swing.Timer;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.geom.*;
import java.awt.image.ImageObserver;
import java.text.AttributedCharacterIterator;
import java.util.*;
import java.util.List;
public class MACFloodDemo extends JApplet {
JButton b;
JTextField tf;
List<Packet> packets = new ArrayList<>();
ImageIcon nodeimg = new ImageIcon("/home/tanvi/Pictures/cmp.png");
public MACFloodDemo(){
paint(new Graphics() {
@Override
public Graphics create() {
return null;
}
@Override
public void translate(int x, int y) {
}
@Override
public Color getColor() {
return null;
}
@Override
public void setColor(Color c) {
}
@Override
public void setPaintMode() {
}
@Override
public void setXORMode(Color c1) {
}
@Override
public Font getFont() {
return null;
}
@Override
public void setFont(Font font) {
}
@Override
public FontMetrics getFontMetrics(Font f) {
return null;
}
@Override
public Rectangle getClipBounds() {
return null;
}
@Override
public void clipRect(int x, int y, int width, int height) {
}
@Override
public void setClip(int x, int y, int width, int height) {
}
@Override
public Shape getClip() {
return null;
}
@Override
public void setClip(Shape clip) {
}
@Override
public void copyArea(int x, int y, int width, int height, int dx, int dy) {
}
@Override
public void drawLine(int x1, int y1, int x2, int y2) {
}
@Override
public void fillRect(int x, int y, int width, int height) {
}
@Override
public void clearRect(int x, int y, int width, int height) {
}
@Override
public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void fillRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
}
@Override
public void drawOval(int x, int y, int width, int height) {
}
@Override
public void fillOval(int x, int y, int width, int height) {
}
@Override
public void drawArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void fillArc(int x, int y, int width, int height, int startAngle, int arcAngle) {
}
@Override
public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints) {
}
@Override
public void drawString(String str, int x, int y) {
}
@Override
public void drawString(AttributedCharacterIterator iterator, int x, int y) {
}
@Override
public boolean drawImage(Image img, int x, int y, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int x, int y, int width, int height, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, ImageObserver observer) {
return false;
}
@Override
public boolean drawImage(Image img, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2, Color bgcolor, ImageObserver observer) {
return false;
}
@Override
public void dispose() {
}
});
}
public void paint(Graphics g)
{
// g.drawLine(10,10,900,900);
// super.paint(g);
// Draw head
final Node na = new Node(1);
na.setNode_name("Node A");
InterfaceConfig ica = new InterfaceConfig("10.1.0.1",
"32:52:5e:4b:7a:e4 (Node A)","10.1.0.255","255.255.255.0","ether");
na.setInterfaceConfig(ica); na.setHaveAccess(false);
na.setPacketssent(new ArrayList<>()); na.setPacketsreceived(new ArrayList<>());
final Node nb = new Node(2);
nb.setNode_name("Node B");
InterfaceConfig icb = new InterfaceConfig("10.1.0.2",
"b8:92:a7:e2:9c:01 (Node B)","10.1.0.255","255.255.255.0","wlan");
nb.setInterfaceConfig(icb); nb.setHaveAccess(false);
nb.setPacketssent(new ArrayList<>()); nb.setPacketsreceived(new ArrayList<>());
final Node nc = new Node(3);
nc.setNode_name("Node C");
InterfaceConfig icc = new InterfaceConfig("10.1.0.3",
"95:ae:93:d4:a7:9c (Node C)","10.1.0.255","255.255.255.0","ether");
nc.setInterfaceConfig(icc); nc.setHaveAccess(true);
nc.setPacketssent(new ArrayList<>()); nc.setPacketsreceived(new ArrayList<>());
final Node nd = new Node(4);
nd.setNode_name("Node D");
InterfaceConfig icd = new InterfaceConfig("10.1.0.4",
"12:7d:c2:52:9a:d6 (Node D)" ,"10.1.0.255","255.255.255.0","ether");
nd.setInterfaceConfig(icd); nd.setHaveAccess(true);
nd.setPacketssent(new ArrayList<>()); nd.setPacketsreceived(new ArrayList<>());
Network network = new Network("Network 1");
List<Node> nodes = new ArrayList<>();
nodes.add(na); nodes.add(nb); nodes.add(nc); nodes.add(nd);
network.setNodes(nodes);
network.setNo_of_nodes(nodes.size());
List<Bridge> bridges = new ArrayList<>();
Bridge br1 = new Bridge(1,4,"Bridge 1",new ArrayList<>());
Bridge br2 = new Bridge(2,4,"Bridge 2",new ArrayList<>());
bridges.add(br1); bridges.add(br2);
network.setBridges(bridges);
List<Connection> connections = new ArrayList<>();
connections.add(new Connection(br1, na,1,180,260,180,320));
connections.add(new Connection(br1,nb,2,280,380,400,380));
connections.add(new Connection(br1,br2,3,280,320,400,150));
connections.add(new Connection(br2,br1,1,280,320,400,150));
connections.add(new Connection(br2,nc,2,600,120,720,120));
connections.add(new Connection(br2,nd,3,600,150,720,320));
network.setConnections(connections);
network.setPackets(new ArrayList<>());
boolean condition=true;
JFrame frame= new JFrame("SIMULATOR");
JPanel panel = new JPanel(null){
public void paintComponent(Graphics g){
g.drawLine(180,260,180,320); //b1 na
g.drawString("port-1",185,320);
g.drawLine(280,380,400,380); //b1 nb
g.drawString("port-2",285,395);
g.drawLine(280,320,400,150); //b1 b2
g.drawString("port-3",285,325);
g.drawString("port-1",355,155);
g.drawLine(600,120,720,120); //b2 nc
g.drawString("port-2",605,110);
g.drawLine(600,150,720,320); //b2 nd
g.drawString("port-3",610,155);
for(int i=0;i<connections.size();i++){
if(connections.get(i).isCurrent()){
g.setColor(Color.green);
g.drawLine(connections.get(i).getX1(),connections.get(i).getY1(),
connections.get(i).getX2(),connections.get(i).getY2());
}
}
}
};
JLabel l1,l2,l3,l4,l5,l6,title;
JLabel transmitting;
transmitting = new JLabel("");
final JButton b1,b2,b3;
title = new JLabel("MAC Flooding (Sniffing)");
title.setBounds(10,10,700,30);
l1=new JLabel(na.getNode_name());
l1.setBounds(155,230, 100,30);
l1.addMouseListener(new PopClickListener3(na,network,panel));
l2=new JLabel(br2.getBridge_name());
l2.setBounds(475,230, 100,30);
l2.addMouseListener(new PopClickListener3(br2,network,panel)); //bridge2
l3=new JLabel(nc.getNode_name());
l3.setBounds(795,230, 100,30);
l3.addMouseListener(new PopClickListener3(nc,network,panel));
l4=new JLabel(br1.getBridge_name());
l4.setBounds(155,480, 100,30);
l4.addMouseListener(new PopClickListener3(br1,network,panel)); //bridge
l5=new JLabel(nb.getNode_name());
l5.setBounds(475,480, 100,30);
l5.addMouseListener(new PopClickListener3(nb,network,panel));
l6=new JLabel(nd.getNode_name());
l6.setBounds(795,480, 100,30);
l6.addMouseListener(new PopClickListener3(nd,network,panel));
JLabel n1,n2,n3,n4,n5,n6,n7;
n1 = new JLabel("");
n1.setIcon(nodeimg); n1.setBounds(80,50, 200,200);
n1.addMouseListener(new PopClickListener3(na,network,panel));
n2 = new JLabel("");
n2.setIcon(nodeimg); n2.setBounds(400,50, 200,200);
n2.addMouseListener(new PopClickListener3(br2,network,panel)); //bridge2
n3 = new JLabel("");
n3.setIcon(nodeimg); n3.setBounds(720,50, 200,200);
n3.addMouseListener(new PopClickListener3(nc,network,panel));
n4 = new JLabel("");
n4.setIcon(nodeimg); n4.setBounds(80,300, 200,200);
n4.addMouseListener(new PopClickListener3(br1,network,panel)); //bridge1
n5 = new JLabel("");
n5.setIcon(nodeimg); n5.setBounds(400,300, 200,200);
n5.addMouseListener(new PopClickListener3(nb,network,panel));
n6 = new JLabel("");
n6.setIcon(nodeimg); n6.setBounds(720,300, 200,200);
n6.addMouseListener(new PopClickListener3(nd,network,panel));
panel.add(l1); panel.add(l2); panel.add(l3); panel.add(l4); panel.add(l5); panel.add(l6);
panel.add(n1); panel.add(n2); panel.add(n3); panel.add(n4); panel.add(n5); panel.add(n6);
panel.add(title);
frame.getContentPane().add(panel);
frame.setSize(1000,1000);
frame.setVisible(true);
}
}
class PopClickListener3 extends MouseAdapter {
Node node;
Network network;
Bridge bridge;
int type;
JPanel jPanel;
PopClickListener3(Node n, Network net,JPanel panel){
node = n;
network = net;
type=1;
jPanel = panel;
}
PopClickListener3(Bridge b, Network net,JPanel panel){
network = net;
bridge = b;
type = 2;
jPanel = panel;
}
public void mousePressed(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
public void mouseReleased(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
private void doPop(MouseEvent e){
PopUpDemo3 menu = new PopUpDemo3();
if(type==1){
menu = new PopUpDemo3(node,network,jPanel); }
if(type==2){
menu = new PopUpDemo3(bridge,network,jPanel);}
menu.show(e.getComponent(), e.getX(), e.getY());
}
}
class PopUpDemo3 extends JPopupMenu {
JMenuItem anItem,anItem2,anItem3;
public PopUpDemo3(){};
public PopUpDemo3(Bridge bridge, Network network,JPanel panel){
anItem = new JMenuItem("View Learning Bridge Table");
anItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Learning Bridge Table");
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>MAC Address</th>\n" +
" <th>PORT number</th>\n" +
" </tr>";
List<LearningBridgeTable> lbt = network.getBridgebyId(bridge.getBridge_id()).getLearningBridgeTables();
for(int i = 0;i<lbt.size();i++)
{
str = str +"<tr><td>" + lbt.get(i).getMac_address() +
"</td><td>" + lbt.get(i).getPort_no()+
"</td></tr>";
}
title = new JLabel(str);
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,500, 200);
}});
add(anItem);
}
public PopUpDemo3(Node node, Network network,JPanel panel){
anItem = new JMenuItem("View Node Details");
anItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Properties");
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="";
str = str + "<html><p>" + node.getNode_name();
str = str + "</p<br><p>ip_address: " + node.getInterfaceConfig().getIp_address();
str = str + "</p><br><p>mac_address: " + node.getInterfaceConfig().getMac_address();
str = str + "</p><br><p>broadcast: " + node.getInterfaceConfig().getBroadcast();
str = str + "</p><br><p>subnet_mask: " + node.getInterfaceConfig().getSubnet_mask();
str = str + "</html";
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,300, 200);
}
});
add(anItem);
anItem3 = new JMenuItem("Send Data Packet");
add(anItem3);
anItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jf= new JFrame("");
jf.getContentPane().setLayout(null);
JLabel mac = new JLabel("Sender's Mac");
JTextField tmac = new JTextField(node.getInterfaceConfig().getMac_address());
JLabel ip = new JLabel("Sender's IP");
JTextField tip = new JTextField(node.getInterfaceConfig().getIp_address());
mac.setBounds(5,5,200,30);
tmac.setBounds(5,40,500,30);
ip.setBounds(5,75,200,30);
tip.setBounds(5,120,500,30);
JLabel rn = new JLabel("Receiver Node");
JComboBox rnbox = new JComboBox(network.getNodes().toArray());
rn.setBounds(5,155,200,30);
rnbox.setBounds(5,190,500,30);
JLabel msg = new JLabel("Enter your Message");
JTextField tmsg = new JTextField();
msg.setBounds(5,225,200,30);
tmsg.setBounds(5,260,500,30);
JButton jb = new JButton("SEND");
jb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Node node2 = (Node)rnbox.getSelectedItem();
Packet packet = new Packet(tip.getText(),node2.getInterfaceConfig().getIp_address(),tmac.getText(),node2.getInterfaceConfig().getIp_address(),tmsg.getText().toString(),"data");
List<Packet> packets = network.getPackets();
packets.add(packet); network.setPackets(packets);
List<Packet> spackets = node.getPacketssent();
spackets.add(packet); node.setPacketssent(spackets);
List<Connection> connections = network.getConnections();
int type = 1;
Bridge currbridge = new Bridge();
boolean intable ,senderin ,delivered = false;
Queue<Object> q = new LinkedList<>();
q.add(node);
Node currnode = node;
List<String> visited = new ArrayList<>();
visited.add(currnode.getNode_name());
while(!q.isEmpty()) {
intable = false;
senderin = false;
if(q.peek() instanceof Node){
type =1; currnode =(Node) q.peek(); q.remove();
// JOptionPane.showMessageDialog(jf, currnode.toString() +" Current Node");
}
if(q.peek() instanceof Bridge){
type =2; currbridge = (Bridge) q.peek(); q.remove();
// JOptionPane.showMessageDialog(jf, currbridge.getBridge_name() +" Current Bridge");
}
for (int i = 0; i < connections.size() && !delivered; i++) {
if ((type == 1 && connections.get(i).getType() == 1 && connections.get(i).getNode().getNode_name().equals(currnode.getNode_name())) ||
(type == 2 && connections.get(i).getType() == 2 && connections.get(i).getBridge().getBridge_name().equals(currbridge.getBridge_name()))) {
connections.get(i).setCurrent(true);
panel.repaint();
currbridge = connections.get(i).getBridge();
// JOptionPane.showMessageDialog(jf, "Conn at "+ visited.contains(currbridge.getBridge_name())+" "+ currbridge.getBridge_name());
if(!visited.contains(currbridge.getBridge_name())){
List<LearningBridgeTable> learningBridgeTables = currbridge.getLearningBridgeTables();
visited.add(currbridge.getBridge_name());
senderin = false;
for (int j = 0; j < learningBridgeTables.size(); j++) {
//JOptionPane.showMessageDialog(jf, "in table ");
if (learningBridgeTables.get(j).getMac_address().equals(tmac.getText())) {
senderin = true;
}
// JOptionPane.showMessageDialog(jf, "Present in table1 "+ learningBridgeTables.get(j).getMac_address() + learningBridgeTables.get(j).getPort_no());
if (learningBridgeTables.get(j).getMac_address().equals(node2.getInterfaceConfig().getMac_address())) {
// JOptionPane.showMessageDialog(jf, "Present in table "+ learningBridgeTables.get(j).getMac_address() + learningBridgeTables.get(j).getPort_no());
for (int k = 0; k < connections.size(); k++) {
if(connections.get(k).getBridge().getBridge_name().equals(currbridge.getBridge_name())
&& connections.get(k).getPort_no()==learningBridgeTables.get(j).getPort_no()) {
connections.get(k).setCurrent(true);
panel.repaint();
if(connections.get(k).getType()==1 && !visited.contains(connections.get(k).getNode().getNode_name())){
List<Packet> rpackets =connections.get(k).getNode().getPacketsreceived();
rpackets.add(packet); connections.get(k).getNode().setPacketsreceived(rpackets);
if(connections.get(k).getNode().getNode_name().equals(node2.getNode_name())){
connections.get(k).setCurrent(true);
panel.repaint();
JOptionPane.showMessageDialog(jf, "NODE AT PORT NO " +connections.get(k).getPort_no() );
delivered = true;
// JOptionPane.showMessageDialog(jf, "ACTUALLY DATA Packet Sent");
jf.dispose();
intable = true;
break;
}
visited.add(connections.get(k).getNode().getNode_name());
}
else if( !visited.contains(connections.get(k).getBridge2().getBridge_name())){
connections.get(k).setCurrent(true);
panel.repaint();
JOptionPane.showMessageDialog(jf, "NODE AT PORT NO " +connections.get(k).getPort_no() );
intable = true;
q.add((Bridge)connections.get(k).getBridge2());
}
}
}
// JOptionPane.showMessageDialog(jf, "in lbt " + learningBridgeTables.get(j).getMac_address());
}
}
if (!senderin) {
if(learningBridgeTables.size()==currbridge.getMax_entry_count()) {
learningBridgeTables.set((currbridge.increaseCount()-1) % currbridge.getMax_entry_count(), new LearningBridgeTable(tmac.getText(), connections.get(i).getPort_no()));
JOptionPane.showMessageDialog(jf, "Value in Learning Table replaced ");
}
else{
learningBridgeTables.add(new LearningBridgeTable(tmac.getText(), connections.get(i).getPort_no()));
}
connections.get(i).getBridge().setLearningBridgeTables(learningBridgeTables);
}
if(!intable){
JOptionPane.showMessageDialog(jf, "BROADCAST " + currbridge.getBridge_name());
for (int k = 0; k < connections.size(); k++) {
if(connections.get(k).getBridge().getBridge_name().equals(currbridge.getBridge_name())){
// JOptionPane.showMessageDialog(jf, "in broadcast " + connections.get(k).getBridge().getBridge_name() + connections.get(k).getType());
connections.get(k).setCurrent(true);
panel.repaint();
if(connections.get(k).getType()==1 && !visited.contains(connections.get(k).getNode().getNode_name())){
List<Packet> rps =connections.get(k).getNode().getPacketsreceived();
rps.add(packet); connections.get(k).getNode().setPacketsreceived(rps);
visited.add(connections.get(k).getNode().getNode_name());
// JOptionPane.showMessageDialog(jf, "in broadcast node " + connections.get(k).getNode().getNode_name());
}
else if(connections.get(k).getType()==2 && !visited.contains(connections.get(k).getBridge2().getBridge_name())){
// JOptionPane.showMessageDialog(jf, "ADDED in brod " +connections.get(k).getBridge2());
q.add((Bridge)connections.get(k).getBridge2());
// JOptionPane.showMessageDialog(jf, "in broadcast bridge " + connections.get(k).getBridge2().getBridge_name());
}
}
}
}
}
}}
}
JOptionPane.showMessageDialog(jf, "DATA Packet Sent");
jf.dispose();
for(int i=0;i<connections.size();i++){
connections.get(i).setCurrent(false);
}
panel.repaint();
}
});
jb.setBounds(5,295,100,30);
//jf.setLayout(null);
//choose_mac_address.setHorizontalAlignment(JLabel.CENTER);
jf.add(mac); jf.add(tmac); jf.add(ip); jf.add(tip);
jf.add(rn); jf.add(rnbox);
jf.add(msg); jf.add(tmsg);
jf.add(jb);
jf.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,550, 375);
jf.setVisible(true);
}});
JMenuItem anItem4;
anItem4 = new JMenuItem("View Packets Received");
anItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Packets Received");
List<Packet> packets = node.getPacketsreceived();
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>Sender's IP</th>\n" +
" <th>Sender's MAC</th>\n" +
" <th>Packet Type</th>\n" +
" <th>Data</th>\n" +
" </tr>";
for(int i = 0;i<packets.size();i++)
{
str = str +"<tr><td>" + packets.get(i).getSender_ip() +
"</td><td>" + packets.get(i).getSender_mac()+
"</td><td>" + packets.get(i).getType()+
"</td><td>"+ packets.get(i).getData() +"</td></tr>";
}
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,500, 200);
}});
add(anItem4);
}
}
\ No newline at end of file
import java.util.List;
public class Network {
private String name;
private List<Node> nodes;
private int no_of_nodes;
private List<Connection> connections;
private int no_of_connections;
private List<Packet> packets;
private List<Bridge> bridges;
public List<Bridge> getBridges() {
return bridges;
}
public void setBridges(List<Bridge> bridges) {
this.bridges = bridges;
}
public Network(String name) {
this.name = name;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public List<Node> getNodes() {
return nodes;
}
public Node getNodebyId(int id)
{
List<Node> nodes = getNodes();
for(int i=0;i<nodes.size();i++)
{
if(nodes.get(i).getNode_id() == id){
return getNodes().get(i);
}
}
return new Node(id);
}
public Bridge getBridgebyId(int id)
{
List<Bridge> bridges = getBridges();
for(int i=0;i<bridges.size();i++)
{
if(bridges.get(i).getBridge_id() == id){
return getBridges().get(i);
}
}
return new Bridge(id,5);
}
public void setNodes(List<Node> nodes) {
this.nodes = nodes;
}
public int getNo_of_nodes() {
return no_of_nodes;
}
public void setNo_of_nodes(int no_of_nodes) {
this.no_of_nodes = no_of_nodes;
}
public List<Connection> getConnections() {
return connections;
}
public void setConnections(List<Connection> connections) {
this.connections = connections;
}
public int getNo_of_connections() {
return no_of_connections;
}
public void setNo_of_connections(int no_of_connections) {
this.no_of_connections = no_of_connections;
}
public List<Packet> getPackets() {
return packets;
}
public void setPackets(List<Packet> packets) {
this.packets = packets;
}
}
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
public class Node {
private int node_id;
private String node_name;
private List<Packet> packetsreceived;
private List<Packet> packetssent;
public List<Packet> getPacketsreceived() {
return packetsreceived;
}
public void setPacketsreceived(List<Packet> packetsreceived) {
this.packetsreceived = packetsreceived;
}
public List<Packet> getPacketssent() {
return packetssent;
}
public void setPacketssent(List<Packet> packetssent) {
this.packetssent = packetssent;
}
public boolean getHaveAccess() {
return haveAccess;
}
public void setHaveAccess(boolean haveAccess) {
this.haveAccess = haveAccess;
}
private InterfaceConfig interfaceConfig;
public int getNode_id() {
return node_id;
}
public void setNode_id(int node_id) {
this.node_id = node_id;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
Node node = (Node) o;
return node_id == node.node_id &&
haveAccess == node.haveAccess &&
Objects.equals(node_name, node.node_name) &&
Objects.equals(interfaceConfig, node.interfaceConfig) &&
Objects.equals(arpCaches, node.arpCaches);
}
@Override
public int hashCode() {
return Objects.hash(node_id, node_name, interfaceConfig, arpCaches, haveAccess);
}
public String getIp_for_mac(String mac)
{
List<ARPCache> arpCaches = getArpCaches();
for(int i =0 ;i<getArpCaches().size();i++)
{
if(arpCaches.get(i).getHw_Address() == mac)
{
return "";
}
}
return "";
}
private List<ARPCache> arpCaches;
public boolean haveAccess;
@Override
public String toString() {
return "Node{" +
"node_id=" + node_id +
", node_name='" + node_name + '\'' +
", interfaceConfig=" + interfaceConfig +
", arpCaches=" + arpCaches +
", haveAccess=" + haveAccess +
'}';
}
public Node(int node_id) {
super();
this.node_id = node_id;
}
public String getNode_name() {
return node_name;
}
public void setNode_name(String node_name) {
this.node_name = node_name;
}
public InterfaceConfig getInterfaceConfig() {
return interfaceConfig;
}
public void setInterfaceConfig(InterfaceConfig interfaceConfig) {
this.interfaceConfig = interfaceConfig;
}
public List<ARPCache> getArpCaches() {
return arpCaches;
}
public void setArpCaches(List<ARPCache> arpCaches) {
this.arpCaches = arpCaches;
}
public boolean isHaveAccess() {
return haveAccess;
}
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="OSILayers">
<grid id="27dc6" binding="osipanel" layout-manager="GridLayoutManager" row-count="9" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="578" height="400"/>
</constraints>
<properties>
<alignmentY value="0.5"/>
<enabled value="true"/>
<foreground color="-4473925"/>
<inheritsPopupMenu value="false"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="87fd4" class="javax.swing.JButton" binding="transportLayerButton" default-binding="true">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<hideActionText value="true"/>
<inheritsPopupMenu value="false"/>
<text value="Transport Layer"/>
</properties>
</component>
<component id="3672a" class="javax.swing.JButton" binding="dataLinkLayerButton" default-binding="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<hideActionText value="false"/>
<text value="Data Link Layer"/>
</properties>
</component>
<component id="5df82" class="javax.swing.JButton" binding="networkLayerButton" default-binding="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Network Layer"/>
</properties>
</component>
<component id="162cb" class="javax.swing.JButton" binding="applicationLayerButton" default-binding="true">
<constraints>
<grid row="6" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<hideActionText value="false"/>
<text value="Application Layer"/>
</properties>
</component>
<component id="80af1" class="javax.swing.JButton" binding="exitButton" default-binding="true">
<constraints>
<grid row="8" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Exit"/>
</properties>
</component>
<component id="8cc69" class="javax.swing.JButton" binding="backButton" default-binding="true">
<constraints>
<grid row="7" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<focusable value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<hideActionText value="false"/>
<text value="Back"/>
</properties>
</component>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class OSILayers {
private JButton dataLinkLayerButton;
private JButton applicationLayerButton;
private JButton transportLayerButton;
private JButton networkLayerButton;
private JPanel osipanel;
private JButton backButton;
private JButton exitButton;
// private void createUIComponents() {
// // TODO: place custom component creation code here
// }
public OSILayers() {
JFrame jFrame = new JFrame("Layers");
try {
jFrame.setContentPane(new JPanelWithBackground("/home/tanvi/Pictures/back1.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
jFrame.getContentPane().add(osipanel);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.pack();
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
backButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
StartApp.main(null);
}
});
dataLinkLayerButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
DataLinkTut dataLinkTut = new DataLinkTut();
}
});
exitButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}
}
import java.security.Timestamp;
import java.sql.Time;
public class Packet {
private String sender_ip;
private String receiver_ip;
private String sender_mac;
private String receiver_mac;
private String data;
private String type;
private Timestamp timestamp;
public Packet(String sender_ip, String receiver_ip, String sender_mac, String receiver_mac, String data, String type) {
this.sender_ip = sender_ip;
this.receiver_ip = receiver_ip;
this.sender_mac = sender_mac;
this.receiver_mac = receiver_mac;
this.data = data;
this.type = type;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getSender_ip() {
return sender_ip;
}
public void setSender_ip(String sender_ip) {
this.sender_ip = sender_ip;
}
public String getReceiver_ip() {
return receiver_ip;
}
public void setReceiver_ip(String receiver_ip) {
this.receiver_ip = receiver_ip;
}
public String getSender_mac() {
return sender_mac;
}
public void setSender_mac(String sender_mac) {
this.sender_mac = sender_mac;
}
public String getReceiver_mac() {
return receiver_mac;
}
public void setReceiver_mac(String receiver_mac) {
this.receiver_mac = receiver_mac;
}
public String getData() {
return data;
}
public void setData(String data) {
this.data = data;
}
}
import javax.swing.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
class PopClickListener extends MouseAdapter {
Node node;
Network network;
JPanel jPanel;
PopClickListener(Node n, Network net,JPanel panel){
node = n;
network = net;
jPanel = panel;
}
public void mousePressed(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
public void mouseReleased(MouseEvent e){
if (e.isPopupTrigger())
doPop(e);
}
private void doPop(MouseEvent e){
PopUpDemo menu = new PopUpDemo(node,network,jPanel);
menu.show(e.getComponent(), e.getX(), e.getY());
}
}
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.List;
class PopUpDemo extends JPopupMenu {
JMenuItem anItem,anItem2,anItem3;
public PopUpDemo(Node node, Network network,JPanel panel){
anItem = new JMenuItem("View Node Details");
anItem2 = new JMenuItem("View ARP Cache at Node");
anItem.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Properties");
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="";
str = str + "<html><p>" + node.getNode_name();
str = str + "</p<br><p>ip_address: " + node.getInterfaceConfig().getIp_address();
str = str + "</p><br><p>mac_address: " + node.getInterfaceConfig().getMac_address();
str = str + "</p><br><p>broadcast: " + node.getInterfaceConfig().getBroadcast();
str = str + "</p><br><p>subnet_mask: " + node.getInterfaceConfig().getSubnet_mask();
str = str + "</html";
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,300, 200);
}
});
add(anItem);
anItem2.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("ARP Cache");
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
java.util.List<ARPCache> arp;
arp = node.getArpCaches();
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>ip_address</th>\n" +
" <th>hw_type</th>\n" +
" <th>hw_Address</th>\n" +
" </tr>";
for(int i=0;i<arp.size();i++) {
str = str + "<tr><td>" + arp.get(i).getIp_address() + "</td><td>" + arp.get(i).getHw_type() +
"</td><td>" + arp.get(i).getHw_Address() + "</td></tr>";
}
str = str + "</table></html>";
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,300, 200);
}
});
add(anItem2);
if(node.getHaveAccess()) {
anItem3 = new JMenuItem("Send ARP Packet");
add(anItem3);
anItem3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jf= new JFrame("");
jf.getContentPane().setLayout(null);
JLabel mac = new JLabel("Choose MAC address");
JComboBox cmac = new JComboBox(network.getNodes().toArray());
mac.setBounds(5,5,200,30);
cmac.setBounds(5,40,500,30);
JLabel ip = new JLabel("Choose IP address");
JComboBox cip = new JComboBox(network.getNodes().toArray());
ip.setBounds(5,75,200,30);
cip.setBounds(5,120,500,30);
JButton jb = new JButton("SEND");
jb.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Node nmac = (Node) cmac.getSelectedItem();
Node nip = (Node)cip.getSelectedItem();
Packet packet = new Packet(nip.getInterfaceConfig().getIp_address(),nip.getInterfaceConfig().getBroadcast(),
nmac.getInterfaceConfig().getMac_address(),"","","ARP Packet");
java.util.List<Packet> packets = network.getPackets();
packets.add(packet);
network.setPackets(packets);
java.util.List<Node> nodes= network.getNodes();
for(int i=0;i<network.getNodes().size();i++)
{
java.util.List<ARPCache> arpCaches = nodes.get(i).getArpCaches();
for(int j=0;j<arpCaches.size();j++)
{
if(arpCaches.get(j).getIp_address() == nip.getInterfaceConfig().getIp_address())
{
arpCaches.get(j).setHw_Address(nmac.getInterfaceConfig().getMac_address());
}
}
nodes.get(i).setArpCaches(arpCaches);
}
network.setNodes(nodes);
JOptionPane.showMessageDialog(jf, "ARP Packet Sent");
jf.dispose();
}
});
jb.setBounds(5,165,100,30);
//jf.setLayout(null);
//choose_mac_address.setHorizontalAlignment(JLabel.CENTER);
jf.add(mac); jf.add(cmac);
jf.add(ip); jf.add(cip);
jf.add(jb);
jf.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,550, 250);
jf.setVisible(true);
}});
}
JMenuItem anItem4;
anItem4 = new JMenuItem("View Packets Received");
anItem4.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent arg0) {
JFrame jfr = new JFrame("Packets Received");
List<Packet> packets = network.getPackets();
//JDialog digFree = new JDialog(digFree, "Hello", true);
jfr.setLocationRelativeTo(anItem);
JLabel title;
String str ="<html><style>\n" +
"table, th,td{\n" +
" border: 1px solid black;\n" +
" border-collapse: collapse;\n" +
"}\n" +
"</style><table style=\"width:100%\">\n" +
" <tr>\n" +
" <th>Sender's IP</th>\n" +
" <th>Sender's MAC</th>\n" +
" <th>Packet Type</th>\n" +
" <th>Data</th>\n" +
" </tr>";
for(int i = 0;i<packets.size();i++)
{
if(packets.get(i).getReceiver_ip() == node.getInterfaceConfig().getIp_address() ||
packets.get(i).getReceiver_ip() == node.getInterfaceConfig().getBroadcast() ||
packets.get(i).getReceiver_mac() == node.getInterfaceConfig().getMac_address())
{str = str +"<tr><td>" + packets.get(i).getSender_ip() +
"</td><td>" + packets.get(i).getSender_mac()+
"</td><td>" + packets.get(i).getType()+
"</td><td>"+ packets.get(i).getData() +"</td></tr>";
}
}
title = new JLabel(str);
// title.setText(na.toString());
jfr.add(title);
jfr.setFocusable(true);
jfr.setVisible(true);
jfr.setBounds(MouseInfo.getPointerInfo().getLocation().x ,MouseInfo.getPointerInfo().getLocation().y,500, 200);
}});
add(anItem4);
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="StartApp">
<grid id="27dc6" binding="jPanel" layout-manager="GridLayoutManager" row-count="3" column-count="1" same-size-horizontally="true" same-size-vertically="true" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="513" height="400"/>
</constraints>
<properties>
<background color="-16756394"/>
<foreground color="-16755128"/>
<opaque value="false"/>
</properties>
<border type="none"/>
<children>
<component id="33ca" class="javax.swing.JButton" binding="tutorialForAttacksButton" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<focusable value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<hideActionText value="false"/>
<opaque value="true"/>
<text value="Tutorial For Attacks"/>
</properties>
</component>
<component id="936b1" class="javax.swing.JButton" binding="playGameButton" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Play Game"/>
</properties>
</component>
<component id="fe1d2" class="javax.swing.JButton" binding="exitButton" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false">
<preferred-size width="-1" height="50"/>
</grid>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Exit"/>
</properties>
</component>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class StartApp {
private JButton playGameButton;
private JButton tutorialForAttacksButton;
private JButton exitButton;
private JPanel jPanel;
private static JFrame jFrame;
public StartApp() {
tutorialForAttacksButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
OSILayers osiLayers = new OSILayers();
}
});
playGameButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
Games gm = new Games();
}
});
exitButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
System.exit(0);
}
});
}
public static void main(String[] args) {
jFrame= new JFrame("Network Security Game");
// JPanel jPanel1 = new JPanel(new JLabel(new ImageIcon("/home/tanvi/Pictures/back1.jpg")));
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// jFrame.pack();
try {
jFrame.setContentPane(new JPanelWithBackground("/home/tanvi/Pictures/back1.jpg"));
} catch (IOException e) {
e.printStackTrace();
}
jFrame.getContentPane().add(new StartApp().jPanel);
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
}
}
public class SubDNSDomainDemo {
}
public class TCPSesHijackDemo {
}
public class TCPSesSpoofDemo {
}
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TutorialMain">
<grid id="27dc6" binding="tutorialPanel" layout-manager="GridLayoutManager" row-count="6" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="536"/>
</constraints>
<properties>
<autoscrolls value="false"/>
<background color="-16756393"/>
<foreground color="-16756393"/>
<inheritsPopupMenu value="false"/>
<opaque value="true"/>
</properties>
<border type="none"/>
<children>
<component id="211d1" class="javax.swing.JButton" binding="previousButton" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Previous"/>
</properties>
</component>
<vspacer id="34e27">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="d0504" class="javax.swing.JButton" binding="nextButton" default-binding="true">
<constraints>
<grid row="2" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Next"/>
</properties>
</component>
<component id="ed127" class="javax.swing.JButton" binding="tryDemoButton" default-binding="true">
<constraints>
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="Try Demo"/>
</properties>
</component>
<component id="d3a68" class="javax.swing.JButton" binding="BACKButton" default-binding="true">
<constraints>
<grid row="0" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<alignmentY value="1.0"/>
<autoscrolls value="false"/>
<background color="-12828863"/>
<borderPainted value="true"/>
<contentAreaFilled value="true"/>
<font name="URW Gothic L" size="18" style="1"/>
<foreground color="-16711682"/>
<text value="BACK"/>
</properties>
</component>
<grid id="4400d" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="5" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="7ed7f" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="4" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="e4289" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="1762b" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="ec4a3" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="3" column="2" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<opaque value="false"/>
</properties>
<border type="none"/>
<children/>
</grid>
<grid id="752e0" binding="jLabel" layout-manager="GridBagLayout">
<constraints>
<grid row="1" column="1" row-span="1" col-span="3" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
<minimum-size width="-1" height="300"/>
<maximum-size width="-1" height="300"/>
</grid>
</constraints>
<properties>
<autoscrolls value="true"/>
<background color="-12828863"/>
<enabled value="true"/>
<focusTraversalPolicyProvider value="false"/>
<font name="URW Gothic L" size="22" style="0"/>
<foreground color="-1"/>
<opaque value="false"/>
</properties>
<border type="none" title="&lt;html&gt;ARP spoofing is a type of attack in which a malicious actor sends falsified ARP (Address Resolution Protocol) messages over a local area network. This results in the linking of an attacker’s MAC address with the IP address of a legitimate computer or server on the network. Once the attacker’s MAC address is connected to an authentic IP address, the attacker will begin receiving any data that is intended for that IP address. ARP spoofing can enable malicious parties to intercept, modify or even stop data in-transit. ARP spoofing attacks can only occur on local area networks that utilize the Address Resolution Protocol.&#10;&lt;/html&gt;" noi18n="true"/>
<children/>
</grid>
</children>
</grid>
</form>
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;
public class TutorialMain {
private JButton previousButton;
private JButton nextButton;
private JButton tryDemoButton;
private JButton BACKButton;
private JPanel tutorialPanel;
private JPanel jLabel;
public TutorialMain() {
JFrame jFrame = new JFrame("Tutorial");
jFrame.getContentPane().add(tutorialPanel);
jFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
jFrame.pack();
Dimension DimMax = Toolkit.getDefaultToolkit().getScreenSize();
jFrame.setMaximumSize(DimMax);
jFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
jFrame.setVisible(true);
BACKButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
jFrame.dispose();
StartApp.main(null);
}
});
tryDemoButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
ARPDemo arpDemo = new ARPDemo();
}
});
nextButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
MACFloodDemo macFloodDemo = new MACFloodDemo();
}
});
}
private void createUIComponents() {
// TODO: place custom component creation code here
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment