Merge ssh://dirk@server/spider into SIMPLEROUTE server/SIMPLEROUTE
authorDirk Koopman <djk@tobit.co.uk>
Thu, 14 Jun 2007 22:10:51 +0000 (23:10 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Thu, 14 Jun 2007 22:10:51 +0000 (23:10 +0100)
Merge it all back again....

Conflicts:

data/.gitignore
perl/Version.pm

12 files changed:
.gitignore
data/.gitignore
filter/.gitignore
html/.gitignore [new file with mode: 0644]
html/home.html
html/newprot.html
mrtg/.gitignore [new file with mode: 0644]
perl/EphMsg.pm [new file with mode: 0644]
perl/Version.pm
scripts/.gitignore [new file with mode: 0644]
src/.gitignore [new file with mode: 0644]
techdoc/.gitignore [new file with mode: 0644]

index 37eee138edc7708d1f8d6494df91e06a8725a797..1ca43b05150b0d915da95ebafa9aa20714b017c0 100644 (file)
@@ -1,4 +1,16 @@
 local*
 *~
 *.[oa]
+*.tmp
 CVS
+tmp
+*.bak
+.#*
+*#
+*gz
+*zip
+.*
+!.gitignore
+packclus
+tutor*
+db
index 0a6c856e306da773a326e6a0825eac38509dca93..6027afdc080beced87fd5ec9aacecb27fbf58583 100644 (file)
@@ -8,3 +8,6 @@ dupefile
 log
 wwv
 wcy
+motd*
+issue
+logout
index 150f68c80f52952b9c2bf25a4348084aee22b2d1..bbfa3dce4e85abe25980bb228b13c12b7a359ee5 100644 (file)
@@ -1 +1,2 @@
-*/*
+*.pl
+*.pl.o
diff --git a/html/.gitignore b/html/.gitignore
new file mode 100644 (file)
index 0000000..4cb187e
--- /dev/null
@@ -0,0 +1,2 @@
+mrtg
+client
index e77c09cd8a43294c7b59482a201ac96d7236bacc..dd6fcc1f4dea182bccff0f73df09bbb5f38ede54 100644 (file)
@@ -25,7 +25,6 @@ Here are various jumping off points:-
 <!-- Standard Footer!! -->                                                              <p>&nbsp;</p>
         <p>                                                                               <FONT COLOR="#606060"><hr></font>
         <font color="#FF0000" size=-2>                                                    Copyright &copy; 1998 by Dirk Koopman G1TLH. All Rights Reserved<br>
-        </font>                                                                         <font color="#000000" size=-2>$Id: index.html,v 1.19 2001/04/17 20:44:11
- g0vgs Exp $
+        </font>                                                                         <font color="#000000" size=-2>$Id$
 </body>
 </html>
index 1bb84fe237ba78ed4528e3097ba45f77ee01bbff..a0e40c863b01a47bab31825d3cd63ca2f7ad1d1c 100644 (file)
@@ -208,6 +208,5 @@ sufficient!</p>
 <span class="copy">Copyright © 2001 by Dirk Koopman G1TLH. All Rights
 Reserved</span>
  <br>
-<span class="id">$Id: index.html,v 1.19 2001/04/17 20:44:11 g0vgs Exp
-$</span></body>
+<span class="id">$Id$</span></body>
 </html>
diff --git a/mrtg/.gitignore b/mrtg/.gitignore
new file mode 100644 (file)
index 0000000..d6b7ef3
--- /dev/null
@@ -0,0 +1,2 @@
+*
+!.gitignore
diff --git a/perl/EphMsg.pm b/perl/EphMsg.pm
new file mode 100644 (file)
index 0000000..eabba93
--- /dev/null
@@ -0,0 +1,186 @@
+#
+# This class is the internal subclass that deals with 'Ephmeral'
+# communications like: querying http servers and other network
+# connected data services and using Msg.pm
+#
+# An instance of this is setup by a command together with a load
+# of callbacks and then runs with a state machine until completion
+#
+# $Id$
+#
+# Copyright (c) 2001 - Dirk Koopman G1TLH
+#
+
+package EphMsg;
+
+use strict;
+use Msg;
+use DXVars;
+use DXUtil;
+use DXDebug;
+use IO::File;
+use IO::Socket;
+use IPC::Open3;
+
+use vars qw(@ISA $deftimeout);
+
+@ISA = qw(Msg);
+$deftimeout = 60;
+
+
+sub new
+{
+
+}
+
+# we probably won't use the normal format
+sub enqueue
+{
+       my ($conn, $msg) = @_;
+       push (@{$conn->{outqueue}}, $msg . $conn->{lineend});
+}
+
+sub dequeue
+{
+       my $conn = shift;
+       my $msg;
+
+       if ($conn->{csort} eq 'ax25' && exists $conn->{msg}) {
+               $conn->{msg} =~ s/\cM/\cJ/g;
+       }
+
+       if ($conn->{state} eq 'WC') {
+               $conn->to_connected($conn->{call}, 'O', $conn->{csort});
+       }
+
+       if ($conn->{msg} =~ /\cJ/) {
+               my @lines =  $conn->{msg} =~ /([^\cM\cJ]*)\cM?\cJ/g;
+               if ($conn->{msg} =~ /\cJ$/) {
+                       delete $conn->{msg};
+               } else {
+                       $conn->{msg} =~ s/([^\cM\cJ]*)\cM?\cJ//g;
+               }
+
+               while (defined ($msg = shift @lines)) {
+                       dbg("connect $conn->{cnum}: $msg") if $conn->{state} ne 'C' && isdbg('connect');
+
+                       $msg =~ s/\xff\xfa.*\xff\xf0|\xff[\xf0-\xfe].//g; # remove telnet options
+
+                       &{$conn->{rproc}}($conn, $msg);
+               }
+       }
+}
+
+sub to_connected
+{
+       my ($conn, $call, $dir, $sort) = @_;
+       $conn->{state} = 'C';
+       $conn->conns($call);
+       delete $conn->{cmd};
+       $conn->{timeout}->del if $conn->{timeout};
+       delete $conn->{timeout};
+       $conn->nolinger;
+       &{$conn->{rproc}}($conn, "$dir$call|$sort");
+}
+
+
+sub start_connect
+{
+       my $call = shift;
+       my $fn = shift;
+       my $conn = ExtMsg->new(\&main::new_channel);
+       $conn->{outgoing} = 1;
+       $conn->conns($call);
+
+       my $f = new IO::File $fn;
+       push @{$conn->{cmd}}, <$f>;
+       $f->close;
+       $conn->{state} = 'WC';
+       $conn->_dotimeout($deftimeout);
+}
+
+sub _doconnect
+{
+       my ($conn, $sort, $line) = @_;
+       my $r;
+
+       $sort = lc $sort;                       # in this case telnet, ax25 or prog
+       dbg("CONNECT $conn->{cnum} sort: $sort command: $line") if isdbg('connect');
+       if ($sort eq 'telnet') {
+               # this is a straight network connect
+               my ($host, $port) = split /\s+/, $line;
+               $port = 23 if !$port;
+               $r = $conn->connect($host, $port);
+               if ($r) {
+                       dbg("Connected $conn->{cnum} to $host $port") if isdbg('connect');
+               } else {
+                       dbg("***Connect $conn->{cnum} Failed to $host $port $!") if isdbg('connect');
+               }
+       } elsif ($sort eq 'prog') {
+               $r = $conn->start_program($line, $sort);
+       } else {
+               dbg("invalid type of connection ($sort)");
+       }
+       $conn->disconnect unless $r;
+       return $r;
+}
+
+sub _doabort
+{
+       my $conn = shift;
+       my $string = shift;
+       dbg("connect $conn->{cnum}: abort $string") if isdbg('connect');
+       $conn->{abort} = $string;
+}
+
+sub _dotimeout
+{
+       my $conn = shift;
+       my $val = shift;
+       dbg("connect $conn->{cnum}: timeout set to $val") if isdbg('connect');
+       $conn->{timeout}->del if $conn->{timeout};
+       $conn->{timeval} = $val;
+       $conn->{timeout} = Timer->new($val, sub{ &_timedout($conn) });
+}
+
+
+sub _timedout
+{
+       my $conn = shift;
+       dbg("connect $conn->{cnum}: timed out after $conn->{timeval} seconds") if isdbg('connect');
+       $conn->disconnect;
+}
+
+# handle callsign and connection type firtling
+sub _doclient
+{
+       my $conn = shift;
+       my $line = shift;
+       my @f = split /\s+/, $line;
+       my $call = uc $f[0] if $f[0];
+       $conn->conns($call);
+       $conn->{csort} = $f[1] if $f[1];
+       $conn->{state} = 'C';
+       &{$conn->{rproc}}($conn, "O$call|$conn->{csort}");
+       delete $conn->{cmd};
+       $conn->{timeout}->del if $conn->{timeout};
+}
+
+sub _send_file
+{
+       my $conn = shift;
+       my $fn = shift;
+
+       if (-e $fn) {
+               my $f = new IO::File $fn;
+               if ($f) {
+                       while (<$f>) {
+                               chomp;
+                               my $l = $_;
+                               dbg("connect $conn->{cnum}: $l") if isdbg('connll');
+                               $conn->send_raw($l . $conn->{lineend});
+                       }
+                       $f->close;
+               }
+       }
+}
index 230b4a8395da398715f4d4b2bf8dc7f22e41a360..910c8a4300a6ee276eddd4b01eea0089c93a5e45 100644 (file)
@@ -10,6 +10,6 @@ package main;
 use vars qw($version $build);
 
 $version = '1.54';
-$build = '3';
+$build = '32';
 
 1;
diff --git a/scripts/.gitignore b/scripts/.gitignore
new file mode 100644 (file)
index 0000000..4b9ad3b
--- /dev/null
@@ -0,0 +1,3 @@
+*
+!.gitignore
+*.issue
diff --git a/src/.gitignore b/src/.gitignore
new file mode 100644 (file)
index 0000000..c5926d9
--- /dev/null
@@ -0,0 +1,2 @@
+client
+dbg
diff --git a/techdoc/.gitignore b/techdoc/.gitignore
new file mode 100644 (file)
index 0000000..1abc35a
--- /dev/null
@@ -0,0 +1,4 @@
+*
+!Makefile
+!*.pod
+!.gitignore