#
# $Id: xnm.pm,v 1.6 2003/07/09 19:36:05 trostler Exp $
#
# COPYRIGHT AND LICENSE
# Copyright (c) 2001-2003, Juniper Networks, Inc.
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# 1. Redistributions of source code must retain the above
# copyright notice, this list of conditions and the following
# disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# 3. The name of the copyright owner may not be used to
# endorse or promote products derived from this software without specific
# prior written permission.
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
# INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
#==========================================================================
#
# xnm Access Method: An abstract class for the TCP and SSL Access Methods
#
# Here are the mandatory input parameter(s) that are needed to
# create a connection with the server and optional input parameters
# that can change the default behavior of the TCP connection.
#
# $self->{hostname} = Mandatory. Name of the router to connect to.
#
# $self->{login} = Conditional on noninteractive. The username to login the server.
# If this parameter is not provided by the client application,
# this module will prompt for the username unless noninteractive
# is specified.
#
# $self->{password} = Conditional on noninteractive. The password for the username.
# If this parameter is not provided by the client
# application and it's requested by the server, this
# module will prompt for the password unless noninteractive
# is specified.
#
# $self->{noninteractive} = Optional. If this parameter is specified, this module
# will not prompt for any information it needs. Instead,
# it will fail if any required information is not already
# provided by the client application. For example, if
# the login value is not provided and noninteractive is
# specified, then the TCP connection will fail.
#
# Jade states maintained by this access method for each TCP/SSL connection, they
# can also be read by the client application:
#
# $self->{xnm_result} = contains the authenticated user if the TCP
# connection was successful. Otherwise, it contains the error message.
#
# $self->{xnm_state} = the current state of the connection
#
# $self->{xnm_challenge} = the challenge prompt provided by the server
#
# $self->{xnm_response_element} = a very temporary variable to keep the name
# of the element live just long enough so the xnm_auth_char can use
# it. It is set everytime, xnm_auth_start is called and unset by
# xnm_auth_char after it knows which element the data is meant for.
#
#==========================================================================
package JUNOS::Access::xnm;
use strict;
use IO::Socket;
use XML::Parser;
use Term::ReadKey;
use JUNOS::Trace;
use JUNOS::Access;
use vars qw(@ISA);
@ISA = qw(JUNOS::Access);
#
# JUNOS::Access::xnm::start
#
use constant JUNOSCRIPT_XNM_NOECHO => 'no';
sub start
{
# implemented by subclass
return;
}
#
# private: xnm_authenticate
#
=1= |