aboutsummaryrefslogtreecommitdiffstats
path: root/examples/historical/mbd/make-mbd-nets.pl
diff options
context:
space:
mode:
authorKristian Lyngstol <kly@kly.no>2016-02-26 13:05:31 +0000
committerKristian Lyngstol <kly@kly.no>2016-02-26 13:05:31 +0000
commit885156ee6a26ed047bba3f90541eaab92b65d758 (patch)
treee8a70cd6bca09641efac0c64c4c20d27efab2bda /examples/historical/mbd/make-mbd-nets.pl
parentc6997a4810e09619e9018c91d163f3f38b17212c (diff)
parent3dae75bde90aecc0cef2e3496f3565dcb3eeec0c (diff)
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'examples/historical/mbd/make-mbd-nets.pl')
-rwxr-xr-xexamples/historical/mbd/make-mbd-nets.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/historical/mbd/make-mbd-nets.pl b/examples/historical/mbd/make-mbd-nets.pl
new file mode 100755
index 0000000..7f6ec97
--- /dev/null
+++ b/examples/historical/mbd/make-mbd-nets.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -I /root/tgmanage/
+use strict;
+use warnings;
+
+unless (@ARGV > 0) {
+ print "No arguments. Need netlist.txt.\n";
+ exit 1;
+}
+
+my $n = open(NETLIST, "$ARGV[0]") or die ("Cannot open netlist.txt");
+
+print "# Autogenerated. Do not touch!\n";
+print "package Config;\n";
+print "our \@networks = (\n";
+
+while(<NETLIST>) {
+ next if /^(.*#|\s+$)/; # skip if comment, or blank line
+
+ chomp;
+ my ($v4_net, $v6_net, $net_name) = split;
+
+ print "\t\"$v4_net\",\n";
+}
+
+print ");\n";
+print "1;\n";