Index: nodes/ip2node.pl
===================================================================
--- nodes/ip2node.pl	(revision 5334)
+++ nodes/ip2node.pl	(revision 5334)
@@ -0,0 +1,62 @@
+#!/usr/bin/env perl
+
+#maak een mooi systeem met hash aanroepen om snel gegevens te verwerken
+sub parse_config {
+  foreach my $id (sort keys %config) {
+    my $rawData = $config{$id};
+    $rawData =~ s/#.*\n/\n/g;                  #wegslopen comments
+    $rawData =~ s/\s*[\r,\n]+\s*/:::/g;        #spaties+enter+spaties vervangen door :::
+    $rawData =~ s/^::://;                      #::: aan het begin weghalen
+    $rawData =~ s/:::$//;                      #::: aan het eind weghalen
+    my @configArray = split( /:::/, $rawData); #array er van maken
+    foreach $line (@configArray) {
+      (my $name, my $value) = split( /\=/, $line);
+      $$name{$id} = $value;
+    };
+  };
+}; #end parse_config
+
+sub clean_ip {
+    local($ip,$name) = @_;
+    split('/',$ip);
+    print "@_[0]|$name\n";
+
+};
+
+  #ga alle config files doorwerken
+  foreach my $file (`ls -1`) {
+    chomp($file);
+    $file .= "/wleiden.conf";
+    if (not ($file =~ /^CNode/ or $file =~ /^proxy/)) {
+    }
+    else {
+        print STDERR  "Working on $file...\n";
+        #clean up all old variablen
+          @$_ = [] foreach qw(static_dhcp);
+          $$_ = "" foreach qw(location master_ip gw_open nodetype nodename
+                              OS status X Y N E OS DISK AGGREGATE);
+          %$_ = () foreach qw(config TYPE IP DESC SDESC SPEED DHCP DHCP_STATIC
+                              OSPF_BROADCAST OSPF_NEIGHBORS MODE ESSID CHANNEL
+                              POLAR ANTENNA GAIN DIRECTION BEAMWIDTH CABLE
+                              HEIGHT ROUTE);
+        #end cleanup
+        
+        #load config file
+        do($file) || die("Cann't open file");
+        
+        #parse de config om hem snel en makkelijk te kunnen gebruiken  
+        print STDERR "\t Parsing config...";
+          parse_config;
+        print STDERR "DONE\n";
+        clean_ip($master_ip,$nodename);
+        foreach $key (keys %IP) {
+           clean_ip($IP{$key},$nodename);
+        }
+    }
+    
+}; #end main
+
+main;
+exit 0;
+
+
Index: nodes/ip2node.py
===================================================================
--- nodes/ip2node.py	(revision 5334)
+++ nodes/ip2node.py	(revision 5334)
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+import os
+import re
+
+def xor(a,b):
+    return (not b and a) or (not a and b) or False
+
+ipre = re.compile('^IP')
+masterre = re.compile('master_ip')
+ipnumber = re.compile('([0-9]{1,3}(\.[0-9]{1,3}){3})')
+
+for file in os.listdir('.'):
+    if file[0:5] == "proxy" or file[0:5] == "CNode":
+        conf = open( file + '/wleiden.conf', 'r')
+        for line in conf.readlines():
+            a =  ipre.search(line)
+            b =  masterre.search(line)
+            if (xor(a,b)):
+                result = ipnumber.search(line).groups()[0]
+                print '%s|%s' % ( result,file)
+        conf.close()
+
Index: nodes/ip2node.sh
===================================================================
--- nodes/ip2node.sh	(revision 5334)
+++ nodes/ip2node.sh	(revision 5334)
@@ -0,0 +1,8 @@
+#!/bin/sh
+for file in `echo  CNode* proxy*`
+do
+    cat $file/wleiden.conf  | grep ^IP | grep -v master |\
+    sed "s#IP=\(.*\)/.*#\1|$file#"
+    cat $file/wleiden.conf  | grep '^$master' |\
+    sed "s#\$master_ip='\(.*\)';#\1|$file#"
+done
