ARCv2

 view release on metacpan or  search on metacpan

lib/Arc.pm  view on Meta::CPAN

my @syslog_arr = ('emerg','alert','crit','err','warning','notice','info','debug');

# package member vars
sub members
{
	return {
		# private:
		# protected:
			_error => undef, # contains the error message
			_syslog => 1,    # log to syslog or to STDERR
		# public:
			loglevel => 7,              # loglevel is combination of bits (1=AUTH,2=USER,4=ERR,8=CMDDEBUG,16=VERBSIDE,32=DEBUG) see _Log method
			logfileprefix => "",        # Prepended to every log entry
			logdestination => 'syslog', # Where should all the log output go to ('stderr','syslog')
	};
}

## Constructor. 
## Initializes the object and returns it blessed.
## For all sub classes, please override C<_Init> to check the 
## parameter which are passed to the C<new> function. This

lib/Arc/Command.pm  view on Meta::CPAN

		# protected:
			_commands => {},    # the "available commands"-hash from the server, 
			_username => "",    # user, who has authenticated against ARCv2 Server by using SASL
			_realm => "",       # the name of the realm, to which the user belongs (SASL)
			_mech => undef,     # user uses this authentication mechanism (e.g. GSSAPI)
			_peeraddr => undef, # users ip address
			_peername => undef, # users host address in sockaddr_in format
			_peerport => undef, # users port
			_cmd => undef,      # user runs this command

		# public: 
			logfileprefix => "command",
	};
}

## execute this command.
## This function is called by the ARCv2 Server when the user wants 
## to execute this command. 
##in> ... (parameter from users request)
##out> true if the command has succeeded, false (and please set _SetError) if not.
sub Execute

lib/Arc/Connection.pm  view on Meta::CPAN

			
			_authenticated => 0,     # Are we authenticated
			#_sasl => undef,         # Authen::SASL::Cyrus Handle
			#_saslmech => "",        # SASL mechnanism used at authentication
			
			_cmdparameter => undef,   # parameter after the command
			_expectedcmds => undef,   # array, which ARCv2 protocol commands are allowed to come next
			_connected => 0,          # are we connected
			_username => "anonymous", # username extracted from SASL

		# public:
			protocol => undef, # Which protocol is used (0 = ARC/2.0, 1 = ARC/2.1)

			timeout => undef,  # timeout for all connections (ARCv2 and command) in seconds
			service => undef,  # name of the server (for SASL)
	};
}

sub _Init
{
	my $this = shift;

lib/Arc/Connection.pm  view on Meta::CPAN

	$this->{_authenticated} = 0;
	$this->{_sasl} = undef;
	$this->{_saslmech} = "";

	$this->{_cmdparameter} = undef;
	$this->{_expectedcmds} = undef;
	$this->{_connected} = 0;
	$this->{_username} = "anonymous";
	$this->{_error} = undef;		

# public:
	$this->{protocol} = undef;
}

1;

lib/Arc/Server.pm  view on Meta::CPAN

@Arc::Server::ISA = qw(Arc Net::Server::PreFork);

sub members
{
	my $this = shift;
	return { %{$this->SUPER::members},
		# private:
			__arc => undef,                # stores the Arc::Connection::Server object for optimal PreFork
		# protected:

		# public:
			connection_type => 'Arc::Connection::Server', # Class to use for connections
			connection_vars => undef,      # variables passed directly to every connection handle See C<Arc::Connection::Server>

			logfileprefix => "mainserver", # Logfileprefix

		# net::server
			server => undef,        # attributes for Net::Server::PreFork
	};
}

scripts/object.pl  view on Meta::CPAN

			}
		}
	}
	close(FH);
}

die "Given class not found, cannot build object structure. ($base)" if (!$members{$base} && !$methods{$base});

podout("head1","Class VARIABLES");
my %ready;
showclass_members($base,0,0,"public");
showclass_members($base,0,0,"protected");
showclass_members($base,0,0,"private");

%ready = ();
podout("head1","Class METHODS");
showclass_methods($base,0,0,"public");
showclass_methods($base,0,0,"protected");
showclass_methods($base,0,0,"private");

print "\n";

sub access_level
{
	$_ = $_[0];
	if (/^__/) {
		return "private";
	} elsif (/^_/) {
		return "protected";
	} else {
		return "public";
	}
}

sub issuperior
{
	my ($type,$cname,$item,$acl) = @_;

	my $text = "";
	while ($cname = $iter{$cname}) {
		if (eval '$'.$type.'{$cname}->{$acl}->{$item}') {



( run in 0.448 second using v1.01-cache-2.11-cpan-64827b87656 )