Skip to content

Commit

Permalink
Main.java
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielaTh committed Nov 28, 2015
1 parent f22cb8d commit 63a75ca
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Entities/Equipment/Hub.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/
public class Hub extends NetEquipment {

public Hub(int connectionsNumber) {
public Hub(int connectionsNumber) {
super();
this.connectionsNumber = connectionsNumber;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Entities/Equipment/Terminal.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ public void sendPacket(Packet packet) {
}
}

public Terminal(){}

public Terminal(TerminalOs operatingSystem, IPAddressV4 ed) {
super();
this.operatingSystem = operatingSystem;
this.ed = ed;
}

public void sendPacket(IPAddressV4 destination, PacketType packetType) {
boolean exists = false;
Packet packet;
Expand Down
9 changes: 9 additions & 0 deletions src/Entities/Osystem/TerminalOs.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,13 @@ public String getDataVersion(){
return data;
}

public TerminalOs(){}

public TerminalOs(String name, String version, int ttl) {
super();
this.name = name;
this.version = version;
this.ttl = ttl;
}

}
24 changes: 23 additions & 1 deletion src/Main/Main.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
package Main;
import Entities.Equipment.*;
import Entities.Osystem.*;
import Exceptions.*;;
import Entities.Network.*;

public class Main {

public static void main(String[] args) {
// TODO Auto-generated method stub

Hub hub1 = new Hub(15);

TerminalOs osServerHub1 = new TerminalOs("Windows Server", "2012", 10);
IPAddressV4 ipServerHub1 = new IPAddressV4(190,210,2,1);
Terminal serverHub1 = new Terminal(osServerHub1, ipServerHub1);

TerminalOs osLaptopHub1 = new TerminalOs("Windows", "7", 10);
IPAddressV4 ipLaptopHub1 = new IPAddressV4(190,210, 2, 2);
Terminal LaptopHub1 = new Terminal(osLaptopHub1, ipLaptopHub1);

TerminalOs osDesktopHub1 = new TerminalOs("Windows", "10", 10);
IPAddressV4 ipDesktopHub1 = new IPAddressV4(190,210, 2, 3);
Terminal DesktopHub1 = new Terminal(osDesktopHub1, ipDesktopHub1);


hub1.associateEquipment(serverHub1);
hub1.associateEquipment(LaptopHub1);
hub1.associateEquipment(DesktopHub1);

}

Expand Down

0 comments on commit 63a75ca

Please sign in to comment.