Ekahau::License - Internal module used to parse and handle Ekahau license files.


Ekahau documentation Contained in the Ekahau distribution.

Index


Code Index:

NAME

Top

Ekahau::License - Internal module used to parse and handle Ekahau license files.

SYNOPSIS

Top

This module is used internally by the Ekahau::Base class; you shouldn't need to use it directly. It provides an interface to handle Ekahau license files, and perform a few simple operations that are necessary for a licensed authentication to an Ekahau server.

DESCRIPTION

Top

Constructor

new ( %params )

Creates a new object with the given parameters, in a Param = Value> style list. The only parameter recognized is LicenseFile, which gives the path to an Ekahau license file.

Methods

hello_str

Generate a string suitable for an Ekahau YAX HELLO authentication step.

talk_str ( %params )

Generating a string suitable for an Ekahau YAX TALK authentication command. This method accepts three parameters, in a Param = Value> style list:

Password

Password to connect to Ekahau server

HelloStr

String received from the YAX server in a HELLO message.

HelloStr is required; Password defaults to the default Ekahau password.

AUTHOR

Top

Scott Gifford <gifford@umich.edu>, <sgifford@suspectclass.com>

Copyright (C) 2005 The Regents of the University of Michigan.

See the file LICENSE included with the distribution for license information.

SEE ALSO

Top

XML::Simple, Digest::MD5, Ekahau::Base.


Ekahau documentation Contained in the Ekahau distribution.
package Ekahau::License;
use Ekahau::Base; our $VERSION=$Ekahau::Base::VERSION;
use base 'Ekahau::ErrHandler';

# Written by Scott Gifford <gifford@umich.edu>
# Copyright (C) 2004 The Regents of the University of Michigan.
# See the file LICENSE included with the distribution for license
# information.

use strict;
use warnings;

use XML::Simple;
use Digest::MD5 qw(md5_hex);

sub new
{
    my $class = shift;
    my(%p)=@_;

    my $self = {};
    bless $self, $class;
    $self->{_errhandler} = Ekahau::ErrHandler->errhandler_new($class,%p);
    
    $self->{LicenseFile}=$p{LicenseFile}
        or return $self->reterr("No LicenseFile specified");
    $self->{_license} = XMLin($self->{LicenseFile})
	or return $self->reterr("Couldn't parse license file");

    $self->errhandler_constructed();
}

sub ERROBJ
{
    my $self = shift;
    $self->{_errhandler};
}

sub hello_str
{
  my $self = shift;

  join(" ", map { "$_=$self->{_license}{mandate}{claim}{$_}{value}" } keys %{$self->{_license}{mandate}{claim}});
}

sub talk_str
{
  my $self = shift;
  my(%p)=@_;

  
  defined($p{HelloStr})
      or return $self->reterr("talk_str method requires HelloStr argument");
  defined($self->{_license}{mandate}{checksum})
      or return $self->reterr("Couldn't find mandate checksum in Ekahau license");
  defined($p{Password}) or $p{Password} = 'Llama';

  my $str = join("",$p{HelloStr},$p{Password},$self->{_license}{mandate}{checksum});
  my $digest = md5_hex($str);
  $digest;
}

1;