diff --git a/BD/Lekpa/.##connectDB# b/BD/Lekpa/.##connectDB# new file mode 120000 index 0000000..c6d7f28 --- /dev/null +++ b/BD/Lekpa/.##connectDB# @@ -0,0 +1 @@ +lekpa@morinl.3345:1669890146 \ No newline at end of file diff --git a/BD/Lekpa/PLSQL_cours.pdf b/BD/Lekpa/PLSQL_cours.pdf new file mode 100644 index 0000000..c56054b Binary files /dev/null and b/BD/Lekpa/PLSQL_cours.pdf differ diff --git a/BD/Lekpa/tp02_2.txt b/BD/Lekpa/tp02_2.txt index e13f92e..ccaa0db 100644 --- a/BD/Lekpa/tp02_2.txt +++ b/BD/Lekpa/tp02_2.txt @@ -82,6 +82,7 @@ la contrainte de suppression en cascade exercice 6 +// faire manuellement (car la suppression ne marche pas) drop table Client cascade constraints; drop table Commande cascade constraints; drop table ligne_commande cascade constraints; @@ -116,3 +117,34 @@ CREATE TABLE ligne_commande ( Exercice 7 +create table CommandeAuditLog( + Utilisateur VARCHAR(255), + ActionSQL VARCHAR(3) CONSTRAINT type_enumere_requette CHECK (ActionSQL IN ('INS', 'DEL', 'UDP')), + DateMAJ DATE, + ActCol VARCHAR(255) +); + +CREATE OR REPLACE TRIGGER insertionCommandeAuditLog +AFTER INSERT OR DELETE OR UPDATE +ON Commande +FOR EACH ROW +DECLARE + CURSOR c_attribut IS SELECT column_name FROM user_tab_columns WHERE table_name = 'COMMANDE'; + nom_colonne VARCHAR(255); +BEGIN + IF INSERTING THEN + INSERT INTO CommandeAuditLog VALUES (USER, 'INS', SYSDATE, null); + ELSIF DELETING THEN + INSERT INTO CommandeAuditLog VALUES (USER, 'DEL', SYSDATE, null); + ELSIF UPDATING THEN + OPEN c_attribut; + LOOP + FETCH c_attribut INTO nom_colonne ; + IF UPDATING(nom_colonne) THEN + INSERT INTO CommandeAuditLog VALUES (USER, 'UDP', SYSDATE, nom_colonne); + END IF; + EXIT WHEN c_attribut%NOTFOUND; + END LOOP; + CLOSE c_attribut; + END IF; +END combinedTrigger; \ No newline at end of file diff --git a/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Coche.java b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Coche.java new file mode 100644 index 0000000..e12b59e --- /dev/null +++ b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Coche.java @@ -0,0 +1,15 @@ +import javax.swing.JCheckBox; + +public class Coche extends JCheckBox{ + + private Ingredient valeur; + + public Coche(Ingredient valeur){ + super(valeur.name()); + this.valeur = valeur; + } + + public Ingredient getValeur(){ + return this.valeur; + } +} \ No newline at end of file diff --git a/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementIngredient.java b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementIngredient.java new file mode 100644 index 0000000..a879a93 --- /dev/null +++ b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementIngredient.java @@ -0,0 +1,21 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class EvenementIngredient implements ItemListener{ + + private PileIngredient historiqueChoix; + private JButton boutonRetour; + + public EvenementIngredient(PileIngredient historiqueChoix, JButton boutonRetour){ + this.historiqueChoix = historiqueChoix; + this.boutonRetour = boutonRetour; + } + + @Override + public void itemStateChanged(ItemEvent e){ + Coche coche = (Coche) e.getSource(); + this.historiqueChoix.push(coche.getValeur()); + this.boutonRetour.setEnabled(true); + } +} diff --git a/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementRetour.java b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementRetour.java new file mode 100644 index 0000000..6470b98 --- /dev/null +++ b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/EvenementRetour.java @@ -0,0 +1,33 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class EvenementRetour implements ActionListener{ + + private PileIngredient historique; + private Coche[] listeCoche; + private EvenementIngredient evenementIngredient; + + + public EvenementRetour(PileIngredient historique, Coche[] listeCoche, EvenementIngredient evenementIngredient){ + this.historique = historique; + this.listeCoche = listeCoche; + this.evenementIngredient = evenementIngredient; + } + + @Override + public void actionPerformed(ActionEvent e){ + Ingredient dernierChoisis = this.historique.pop(); + JButton boutonRetour = (JButton) e.getSource(); + for (Coche coche : this.listeCoche){ + if (coche.getValeur() == dernierChoisis){ + coche.removeItemListener(evenementIngredient); + coche.setSelected(!coche.isSelected()); + coche.addItemListener(evenementIngredient); + if (historique.isEmpty()){ + boutonRetour.setEnabled(false); + } + } + } + } +} diff --git a/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Fenetre.java b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Fenetre.java new file mode 100644 index 0000000..6a40ab7 --- /dev/null +++ b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Fenetre.java @@ -0,0 +1,38 @@ +import javax.swing.*; +import java.awt.*; + +public class Fenetre extends JFrame{ + + private PileIngredient historique; + + public Fenetre(){ + super(); + this.setTitle("Question1"); + this.setSize(500, 300); + this.setLocation(0, 0); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + this.historique = new PileIngredient(); + this.addIngredient(); + } + + private void addIngredient(){ + JButton retour = new JButton("RETOUR"); + EvenementIngredient evenementIngredient = new EvenementIngredient(this.historique, retour); + Ingredient[] listeIngredient = Ingredient.values(); + int nbIngredient = listeIngredient.length; + Coche[] listeCoche = new Coche[nbIngredient]; + int i; + this.setLayout(new GridLayout(1,nbIngredient+1)); + + for (i=0; i pile; + + public PileIngredient(){ + this.pile = new ArrayDeque<>(); + } + + public void push(Ingredient valeur){ + this.pile.push(valeur); + } + + public Ingredient pop(){ + return this.pile.pop(); + + } + + public boolean isEmpty(){ + return this.pile.isEmpty(); + } +} \ No newline at end of file diff --git a/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Q4Main.java b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Q4Main.java new file mode 100644 index 0000000..9e4e7bf --- /dev/null +++ b/DEV/DEV3.2/Controle_Machine_Blanc/Q1_Annulation/Q4Main.java @@ -0,0 +1,11 @@ +import javax.swing.*; +import java.awt.*; +import java.awt.event.*; + +public class Q4Main{ + public static void main(String[] args) { + + Fenetre fenetre = new Fenetre(); + fenetre.setVisible(true); + } +} diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Donjon.class b/DEV/DEV_Madelaine/Shadock_couliior/Donjon.class new file mode 100644 index 0000000..d68973d Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/Donjon.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Donjon.java b/DEV/DEV_Madelaine/Shadock_couliior/Donjon.java new file mode 100644 index 0000000..e07f27a --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/Donjon.java @@ -0,0 +1,5 @@ +public interface Donjon { + public Piece apres(); + public Piece avant(); + public Piece ici(); +} \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Shadock_couliior/DonjonBD.java b/DEV/DEV_Madelaine/Shadock_couliior/DonjonBD.java new file mode 100644 index 0000000..a72b127 --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/DonjonBD.java @@ -0,0 +1,98 @@ +import org.mariadb.jdbc.*; +import java.sql.*; +import java.util.ArrayList; +import java.util.List; + +public class DonjonBD implements Donjon { + + private int idPiece; + private int contenu; + private Connection connexion; + + public DonjonBD(){ + try{ + this.ouvrirConnexion(); + PreparedStatement requete = this.connexion.prepareStatement( + "SELECT idPiece,contenu FROM Piece"); + ResultSet resultat = requete.executeQuery(); + requete.close(); + if (resultat.next()){ + this.idPiece = resultat.getInt("idPiece"); + this.contenu = resultat.getInt("contenu"); + } + resultat.close(); + } + catch(SQLException e){ + System.out.println(e); + this.fermerConnexion(); + } + } + + @Override + public Piece apres(){ + try{ + PreparedStatement requete = this.connexion.prepareStatement( + "SELECT idPiece,contenu FROM Piece WHERE idPiece=(Select apres FROM Piece WHERE idPiece=?)"); + requete.setInt(1, this.idPiece); + ResultSet resultat = requete.executeQuery(); + requete.close(); + if (resultat.next()){ + this.idPiece = resultat.getInt("idPiece"); + this.contenu = resultat.getInt("contenu"); + } + resultat.close(); + return new PieceConcrete(this.contenu); + } + catch(SQLException e){ + return null; + } + } + + @Override + public Piece avant(){ + try{ + PreparedStatement requete = this.connexion.prepareStatement( + "SELECT idPiece,contenu FROM Piece WHERE apres=?"); + requete.setInt(1, this.idPiece); + ResultSet resultat = requete.executeQuery(); + requete.close(); + if (resultat.next()){ + this.idPiece = resultat.getInt("idPiece"); + this.contenu = resultat.getInt("contenu"); + } + resultat.close(); + return new PieceConcrete(this.contenu); + } + catch(SQLException e){ + return null; + } + } + + @Override + public Piece ici() { + return new PieceConcrete(this.contenu); + } + + public void fermerConnexion(){ + try { + this.connexion.close(); + } catch (SQLException e) { + } + } + + public void ouvrirConnexion() throws SQLException { + try { + try { + Class.forName("org.mariadb.jdbc.Driver"); + } catch (ClassNotFoundException e) { + throw new RuntimeException("ClassNotFoundException", e); + } + this.connexion = DriverManager.getConnection( + "jdbc:mariadb://dwarves.iut-fbleau.fr/williatt", + "williatt", "OscarSQL92"); + } catch (SQLException e) { + throw new SQLException("Connexion au serveur impossible ! Verifiez votre connexion internet puis reessayez", + e); + } + } +} \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.class b/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.class new file mode 100644 index 0000000..c6a4546 Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.java b/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.java new file mode 100644 index 0000000..3a0ba14 --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/DonjonLocal.java @@ -0,0 +1,38 @@ +import java.util.*; + +public class DonjonLocal implements Donjon { + + private List couloir; + private int position; + + public DonjonLocal() { + this.couloir = new ArrayList<>(); + this.position = 0; + this.remplirCouloir(50); + } + + @Override + public Piece apres() { + this.position = (this.position+1)%this.couloir.size(); + return this.couloir.get(this.position); + } + + @Override + public Piece avant() { + this.position = (this.position+(this.couloir.size()-1))%this.couloir.size(); + return this.couloir.get(this.position); + } + + @Override + public Piece ici() { + return this.couloir.get(this.position); + } + + private void remplirCouloir(int nbPiece) { + int i; + for (i = 0; i < nbPiece; i++) { + Piece piece = new PieceConcrete(); + this.couloir.add(piece); + } + } +} \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Main.class b/DEV/DEV_Madelaine/Shadock_couliior/Main.class new file mode 100644 index 0000000..3457ae4 Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/Main.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Main.java b/DEV/DEV_Madelaine/Shadock_couliior/Main.java new file mode 100644 index 0000000..0f4734e --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/Main.java @@ -0,0 +1,28 @@ +public class Main{ + public static void main (String[] args){ + Donjon sametlenoob = new DonjonLocal(); + VueShadock oscarDansLeDonjonDeSamet = new VueShadock(sametlenoob, 3); + System.out.println(oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.avance(); + System.out.println(" ===> "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.avance(); + System.out.println(" ===> "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.recule(); + System.out.println(" <=== "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.recule(); + System.out.println(" <=== "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.recule(); + System.out.println(" <=== "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.avance(); + System.out.println(" ===> "+ oscarDansLeDonjonDeSamet); + + oscarDansLeDonjonDeSamet.avance(); + System.out.println(" ===> "+ oscarDansLeDonjonDeSamet); + } +} \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Piece.class b/DEV/DEV_Madelaine/Shadock_couliior/Piece.class new file mode 100644 index 0000000..474a1b0 Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/Piece.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/Piece.java b/DEV/DEV_Madelaine/Shadock_couliior/Piece.java new file mode 100644 index 0000000..903dc82 --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/Piece.java @@ -0,0 +1,15 @@ +public abstract class Piece { + protected int contenu; + + public Piece(int contenu) { + this.contenu = contenu; + } + + public int getContenu() { + return contenu; + } + + public String toString(){ + return ""+this.contenu; + } +} diff --git a/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.class b/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.class new file mode 100644 index 0000000..9efa976 Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.java b/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.java new file mode 100644 index 0000000..0750fad --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/PieceConcrete.java @@ -0,0 +1,19 @@ +import java.util.Random; + +public class PieceConcrete extends Piece { + + public PieceConcrete(int n){ + super(n); + } + + public PieceConcrete(){ + super(0); + Random r = new Random(); + int n = r.nextInt(10); + this.contenu = n; + } + + public int getContenu(){ + return super.getContenu(); + } +} diff --git a/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.class b/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.class new file mode 100644 index 0000000..18f8974 Binary files /dev/null and b/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.class differ diff --git a/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.java b/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.java new file mode 100644 index 0000000..7362977 --- /dev/null +++ b/DEV/DEV_Madelaine/Shadock_couliior/VueShadock.java @@ -0,0 +1,57 @@ +public class VueShadock { + + private Piece[] listePiece; + private Donjon donjon; + private boolean isAvance; // true si la derniere direction est avance() / false si derniere direction est recule() + + public VueShadock(Donjon donjon, int porteeVision) { + this.donjon = donjon; + this.listePiece = new PieceConcrete[porteeVision]; + int i, taille=this.listePiece.length; + for (i=0; i0; i--){ + this.listePiece[i] = this.listePiece[i-1]; + } + this.listePiece[0] = this.donjon.avant(); + } + else{ + for (i=taille; i>=0; i--){ + this.listePiece[i] = this.donjon.avant(); + } + } + this.isAvance = false; + } + + @Override + public String toString() { + String resultat = new String(); + for (Piece piece : this.listePiece){ + resultat += piece+" "; + } + return resultat; + } +} \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.class b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.class new file mode 100644 index 0000000..446fae0 Binary files /dev/null and b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.class differ diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.java b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.java index 55af6f8..2a4dcd8 100644 --- a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.java +++ b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Billet.java @@ -1,10 +1,24 @@ +/** +* cette classe represente un billet de banque +*/ public class Billet{ + /** + * Valeur du billet + */ private Denomination valeur; + /** + * Creer un billet + * @param valeur valeur du billet + */ public Billet(Denomination valeur){ this.valeur = valeur; } + /** + * donne la valeur du billet + * @return montant du billet + */ public int getValeur(){ if (valeur == Denomination.UN){ return 1; @@ -35,4 +49,16 @@ public class Billet{ } return 0; } + + /** + * compare 2 billets en fonction de leurs valeurs + * @param billet billet a comparer + * @return true si les 2 billets ont les memes valeurs / false sinon + */ + public boolean equals(Billet billet){ + if (this.getValeur() == billet.getValeur()){ + return true; + } + return false; + } } \ No newline at end of file diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Denomination.class b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Denomination.class new file mode 100644 index 0000000..c1cab97 Binary files /dev/null and b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Denomination.class differ diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.class b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.class new file mode 100644 index 0000000..d739424 Binary files /dev/null and b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.class differ diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.java b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.java index 7b99337..fee3635 100644 --- a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.java +++ b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Individu.java @@ -1,17 +1,41 @@ import java.util.*; - +/** +* Cette classe represente un individu (un nom et sa fortune) +*/ public class Individu{ private String nom; private List fortune; +/** +* Creer un individus et lui donne un nom et une fortune vide +* @param nom nom de l'individus +*/ public Individu(String nom){ this.nom = nom; this.fortune = new ArrayList<>(); } - +/** +* Ajoute un billet a la fortune d'un individus +* @param billet billet a ajouter +* @return true si l'ajout est reussi / false sinon +*/ public boolean add(Billet billet){ return this.fortune.add(billet); } +/** +* Supprime un billet a la fortune d'un individus +* @param billet billet a supprimer (le billet supprimer est un billet de la meme valeur que celui passer en argument) +* @return true si la suppression est reussi / false sinon +*/ + public boolean remove(Billet billet){ + for (Billet b : this.fortune){ + if (billet.equals(b)){ + return this.fortune.remove(b); + } + } + return false; + } + public void payer(int valeur, Individu vendeur){ // to do (il faut pouvoir trier la liste du plus grand au plus petit) @@ -20,14 +44,22 @@ public class Individu{ // cette methode doit etre recursive pour que chaque individus se rembourse plusieurs fois jusqu'a ce qu'il ne puisse plus } +/** +* Donne le montant de la fortune de l'individus +* @return montant de la fortune +*/ public int getFortune(){ int total = 0; - for (Billet billet : fortune){ + for (Billet billet : this.fortune){ total += billet.getValeur(); } return total; } +/** +* Donne le nom de l'individus +* @return nom +*/ public String getNom(){ return this.nom; } diff --git a/DEV/DEV_Madelaine/Wamster_stub/exercice1/Main.class b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Main.class new file mode 100644 index 0000000..142075f Binary files /dev/null and b/DEV/DEV_Madelaine/Wamster_stub/exercice1/Main.class differ diff --git a/SCR/IMUNES/SCR.3.2/TP01/one-gateway.imn b/SCR/IMUNES/SCR.3.2/TP01/one-gateway.imn new file mode 100644 index 0000000..e69de29 diff --git a/SCR/IMUNES/SCR.3.2/TP01/two-gateway.imn b/SCR/IMUNES/SCR.3.2/TP01/two-gateway.imn new file mode 100644 index 0000000..e69de29 diff --git a/SCR/IMUNES/SCR.3.2/TP03/tp03_debut.imn b/SCR/IMUNES/SCR.3.2/TP03/tp03_debut.imn new file mode 100644 index 0000000..56d87a8 --- /dev/null +++ b/SCR/IMUNES/SCR.3.2/TP03/tp03_debut.imn @@ -0,0 +1,534 @@ +node n0 { + type host + network-config { + hostname GW1 + ! + interface eth1 + mac address 42:00:aa:00:00:02 + ip address 172.16.2.253/24 + ! + interface eth0 + mac address 42:00:aa:00:00:01 + ip address 172.16.1.253/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + } + canvas c0 + iconcoords {240 264} + labelcoords {240 300} + interface-peer {eth0 n4} + interface-peer {eth1 n5} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.1.253/24 dev eth0 + ip addr add 172.16.2.253/24 dev eth1 + ip -6 addr add ::1/128 dev lo0 + + iproute add 0.0.0.0/0 via 172.16.2.254 + + iptables -t filter -A FORWARD -d 172.16.3.0/24 -j DROP + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.2.253 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n1 { + type host + network-config { + hostname GW2 + ! + interface eth2 + mac address 42:00:aa:00:00:07 + ip address 45.45.45.254/21 + ! + interface eth1 + mac address 42:00:aa:00:00:05 + ip address 172.16.3.254/24 + ! + interface eth0 + mac address 42:00:aa:00:00:04 + ip address 172.16.2.254/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + ! + } + canvas c0 + iconcoords {576 264} + labelcoords {576 300} + interface-peer {eth0 n5} + interface-peer {eth1 n6} + interface-peer {eth2 n7} + custom-configs { + custom-config-id default { + custom-command /bin/sh + config { + ip addr add 127.0.0.1/8 dev lo0 + ip addr add 172.16.2.254/24 dev eth0 + ip addr add 172.16.3.254/24 dev eth1 + ip addr add 45.45.45.254/21 dev eth2 + ip -6 addr add ::1/128 dev lo0 + + iproute add default via 45.45.45.254 + ip route add 172.16.1.253/24 via 172.16.2.253 + + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 172.16.3.254 + + rpcbind + inetd + + } + } + } + custom-enabled true + custom-selected default +} + +node n2 { + type host + network-config { + hostname host1 + ! + interface eth0 + mac address 42:00:aa:00:00:08 + ip address 45.45.45.1/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {744 288} + labelcoords {744 324} + interface-peer {eth0 n7} +} + +node n3 { + type host + network-config { + hostname host2 + ! + interface eth0 + mac address 42:00:aa:00:00:09 + ip address 45.45.45.2/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + ! + } + canvas c0 + iconcoords {840 360} + labelcoords {840 396} + interface-peer {eth0 n7} +} + +node n4 { + type lanswitch + network-config { + hostname switch1 + ! + } + canvas c0 + iconcoords {120 120} + labelcoords {120 143} + interface-peer {e0 n10} + interface-peer {e1 n0} +} + +node n5 { + type lanswitch + network-config { + hostname switch2 + ! + } + canvas c0 + iconcoords {408 168} + labelcoords {408 191} + interface-peer {e0 n0} + interface-peer {e1 n11} + interface-peer {e2 n1} +} + +node n6 { + type lanswitch + network-config { + hostname switch3 + ! + } + canvas c0 + iconcoords {744 48} + labelcoords {744 71} + interface-peer {e0 n1} + interface-peer {e1 n12} +} + +node n7 { + type lanswitch + network-config { + hostname switch4 + ! + } + canvas c0 + iconcoords {672 528} + labelcoords {672 551} + interface-peer {e0 n1} + interface-peer {e1 n2} + interface-peer {e2 n3} + interface-peer {e3 n8} +} + +node n8 { + type router + model quagga + network-config { + hostname router1 + ! + interface eth0 + mac address 42:00:aa:00:00:0a + ip address 62.62.62.253/19 + ! + interface eth1 + mac address 42:00:aa:00:00:0c + ip address 45.45.45.253/21 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + canvas c0 + iconcoords {504 552} + labelcoords {504 577} + interface-peer {eth0 n9} + interface-peer {eth1 n7} + custom-configs { + custom-config-id default { + custom-command /usr/local/bin/quaggaboot.sh + config { + interface lo0 + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + interface eth0 + ip address 62.62.62.253/19 + ! + interface eth1 + ip address 45.45.45.253/21 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + ip route add default via 62.62.62.254 + ip route add 172.16.2.253/24 via 45.45.45.254 + ip route add 172.16.1.253/24 via 45.45.45.254 + + + } + } + } + custom-enabled true + custom-selected default +} + +node n9 { + type router + model quagga + network-config { + hostname router2 + ! + interface eth1 + mac address 42:00:aa:00:00:0d + ip address 37.37.37.254/22 + ! + interface eth0 + mac address 42:00:aa:00:00:0b + ip address 62.62.62.254/19 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + } + canvas c0 + iconcoords {240 408} + labelcoords {240 433} + interface-peer {eth0 n8} + interface-peer {eth1 n13} + custom-configs { + custom-config-id default { + custom-command /usr/local/bin/quaggaboot.sh + config { + interface lo0 + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + interface eth0 + ip address 62.62.62.254/19 + ! + interface eth1 + ip address 37.37.37.254/22 + ! + router rip + redistribute static + redistribute connected + redistribute ospf + network 0.0.0.0/0 + ! + router ripng + redistribute static + redistribute connected + redistribute ospf6 + network ::/0 + ! + ip route add default via 62.62.62.253 + iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source 37.37.37.254 + + + } + } + } + custom-enabled true + custom-selected default +} + +node n10 { + type pc + network-config { + hostname pc1 + ! + interface eth0 + mac address 42:00:aa:00:00:00 + ip address 172.16.1.1/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.1.253 + ip route 172.16.2.0/24 172.16.1.253 + ! + } + canvas c0 + iconcoords {48 336} + labelcoords {48 367} + interface-peer {eth0 n4} +} + +node n11 { + type pc + network-config { + hostname pc2 + ! + interface eth0 + mac address 42:00:aa:00:00:03 + ip address 172.16.2.2/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 172.16.2.254 + ip route 172.16.3.0/24 172.16.2.254 + ! + } + canvas c0 + iconcoords {408 336} + labelcoords {408 367} + interface-peer {eth0 n5} +} + +node n12 { + type pc + network-config { + hostname pc3 + ! + interface eth0 + mac address 42:00:aa:00:00:06 + ip address 172.16.3.3/24 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ! + } + canvas c0 + iconcoords {840 144} + labelcoords {840 175} + interface-peer {eth0 n6} +} + +node n13 { + type pc + network-config { + hostname pc + ! + interface eth0 + mac address 42:00:aa:00:00:0e + ip address 37.37.37.1/22 + ! + interface lo0 + type lo + ip address 127.0.0.1/8 + ipv6 address ::1/128 + ! + ip route 0.0.0.0/0 10.0.5.1 + ! + ipv6 route ::/0 fc00:5::1 + ! + } + canvas c0 + iconcoords {96 552} + labelcoords {96 583} + interface-peer {eth0 n9} +} + +link l0 { + nodes {n4 n10} + bandwidth 0 +} + +link l1 { + nodes {n0 n4} + bandwidth 0 +} + +link l2 { + nodes {n5 n0} + bandwidth 0 +} + +link l3 { + nodes {n11 n5} + bandwidth 0 +} + +link l4 { + nodes {n1 n5} + bandwidth 0 +} + +link l5 { + nodes {n6 n1} + bandwidth 0 +} + +link l6 { + nodes {n12 n6} + bandwidth 0 +} + +link l7 { + nodes {n7 n1} + bandwidth 0 +} + +link l8 { + nodes {n2 n7} + bandwidth 0 +} + +link l9 { + nodes {n3 n7} + bandwidth 0 +} + +link l10 { + nodes {n8 n9} + bandwidth 0 +} + +link l11 { + nodes {n7 n8} + bandwidth 0 +} + +link l12 { + nodes {n9 n13} + bandwidth 0 +} + +canvas c0 { + name {Canvas0} +} + +option show { + interface_names yes + ip_addresses yes + ipv6_addresses yes + node_labels yes + link_labels yes + background_images no + annotations yes + hostsAutoAssign no + grid yes + iconSize normal + zoom 1.0 +} +