X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FThingy%2FHello.pm;fp=perl%2FThingy%2FHello.pm;h=111abf8b2a46cc48e05ff1b60a025193055b6d28;hb=6f20114b034d329c1e2a4f91f0aba2f6ec4002d4;hp=0000000000000000000000000000000000000000;hpb=72dc0f2eeecaf78902acacb9d183b7f9215dd385;p=spider.git diff --git a/perl/Thingy/Hello.pm b/perl/Thingy/Hello.pm new file mode 100644 index 00000000..111abf8b --- /dev/null +++ b/perl/Thingy/Hello.pm @@ -0,0 +1,47 @@ +# +# Hello Thingy handling +# +# $Id$ +# +# Copyright (c) 2005 Dirk Koopman G1TLH +# + +use strict; + +package Thingy::Hello; + +use vars qw($VERSION $BRANCH); +$VERSION = sprintf( "%d.%03d", q$Revision$ =~ /(\d+)\.(\d+)/ ); +$BRANCH = sprintf( "%d.%03d", q$Revision$ =~ /\d+\.\d+\.(\d+)\.(\d+)/ || (0,0)); +$main::build += $VERSION; +$main::branch += $BRANCH; + +use DXChannel; +use DXDebug; +use Verify; +use Thingy; + +use vars qw(@ISA); +@ISA = qw(Thingy); + +sub gen_Aranea +{ + my $thing = shift; + unless ($thing->{Aranea}) { + my $auth = $thing->{auth} = Verify->new($main::mycall, $main::systime); + $thing->{Aranea} = Aranea::genmsg($thing, 'HELLO', sw=>'DXSpider', + v=>$main::version, + b=>$main::build, + auth=>$auth->challenge($main::me->user->passphrase) + ); + } + return $thing->{Aranea}; +} + +sub from_Aranea +{ + my $line = shift; + my $thing = Aranea::input($line); + return unless $thing; +} +1;