ARCv2
view release on metacpan
or search on metacpan
README
view on Meta::CPAN
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | IMPORTANT: Due the automatic generation of the pod-files, first of all
you have to run:
make -C docs
This is a workaround until I'll have a better idea.
Then to install
perl Makefile.PL
make
make test
make install
It is possible to add default value argumenting it to perl Makefile.PL:
e.g.
perl Makefile.PL --ConfigPath=/etc/arcx --DefaultPort=4242 --DefaultHost=arcdserv
Maybe this makes rpm & deb handling easier.
|
lib/Arc.pod
view on Meta::CPAN
231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/Arc/Command.pod
view on Meta::CPAN
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | C<Arc::Command::Test>.
By default , these classes are mapped to B<Command Names> as follows (in the
default arcxd.conf for arcxd):
uptime => Arc::Command::Uptime,
whoami => Arc::Command::Whoami,
copy => Arc::Command::Get,
cp => Arc::Command::Get,
get => Arc::Command::Get,
put => Arc::Command::Put,
test => Arc::Command::Test,
help => Arc::Command::Help,
B<Caution>: Especially take care of the C<Arc::Command::Get> and
C<Arc::Command::Put> in production environment. As ARCv2 will probably
run as root and by default the Get and Put command do NOT have an access
control, everyone can get or put any files from/to your ARCv2 server.
There are some member variables, which contain information about the
client. See 'Class VARIABLES' for a complete list of them. These values
are filled by Arc::Connection::Server, when the client wants to run a command.
|
lib/Arc/Command.pod
view on Meta::CPAN
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/Arc/Connection.pm
view on Meta::CPAN
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 | }
return 1;
}
sub _SendLine
{
my $this = shift ;
return unless @_ ;
my $line = join ( "" , @_ );
$line =~ s/\r//g;
$line =~ s/\n/ /g;
return $this ->_SetError( "SendLine only available when connection and select is set." ) unless $this ->{_connected};
if ( $this ->{_select}->can_write( $this ->{timeout})) {
|
lib/Arc/Connection.pod
view on Meta::CPAN
407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 | B<Description>: send a line. (protocol)
This function sends a command line to the ARCv2 socket .
B<Returns:> true if writing has succeeded, otherwise false.
B<Example:>
$this ->_SendLine( $cmd , "test" );
|
lib/Arc/Connection.pod
view on Meta::CPAN
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/Arc/Connection/Client.pod
view on Meta::CPAN
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | sasl_cb_user => \ &username , sasl_cb_auth => \ &username ,
sasl_cb_pass => \ &password ,
);
if ( my $m = $arc ->IsError()) {
die $m ;
}
if ( $arc ->StartSession) {
$arc ->CommandStart( "test" );
$arc ->CommandWrite( "hallo\n" );
if ( my $t = $arc ->CommandRead()) {
print $t , "\n" ;
}
$arc ->CommandEnd();
}
sub username
{
return $ENV { 'USER' };
|
lib/Arc/Connection/Client.pod
view on Meta::CPAN
709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 | B<Description>: send a line. (protocol)
This function sends a command line to the ARCv2 socket .
B<Returns:> true if writing has succeeded, otherwise false.
B<Example:>
$this ->_SendLine( $cmd , "test" );
|
lib/Arc/Connection/Client.pod
view on Meta::CPAN
778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/Arc/Connection/Server.pod
view on Meta::CPAN
595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 | B<Description>: send a line. (protocol)
This function sends a command line to the ARCv2 socket .
B<Returns:> true if writing has succeeded, otherwise false.
B<Example:>
$this ->_SendLine( $cmd , "test" );
|
lib/Arc/Connection/Server.pod
view on Meta::CPAN
664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/Arc/Server.pod
view on Meta::CPAN
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/arcx.pod
view on Meta::CPAN
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | For authentication use the given <mechanism>. (Default: let the server decide.) |
lib/arcx.pod
view on Meta::CPAN
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
lib/arcxd.pod
view on Meta::CPAN
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | |
lib/arcxd.pod
view on Meta::CPAN
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | PLAIN EOM
[commands]
uptime = Arc::Command::Uptime
whoami = Arc::Command::Whoami
copy = Arc::Command::Get
cp = Arc::Command::Get
get = Arc::Command::Get
put = Arc::Command::Put
test = Arc::Command::Test
help = Arc::Command::Help
h = Arc::Command::Help
hlp = Arc::Command::Help
[logging]
level = 7
destination = syslog
The configuration file is based on .ini format , known from Windows (sorry).
In perl we can parse it, using Config::IniFiles. The configuration file is divided into
|
lib/arcxd.pod
view on Meta::CPAN
198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | Copyright (c) 2003-5 Patrick Boettcher <patrick.boettcher @desy .de> and others.
All rights reserved.
Zeuthen, Germany, (old) Europe
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
Special thanks go to:
DESY Zeuthen, in particular:
- Wolfgang Friebel for bleeding edge testing and heavy bug reporting (and the idea of reimplementing ARC).
- Waltraut Niepraschk and Andreas Haupt for their help and support during the development.
|
scripts/arcx.conf
view on Meta::CPAN
1 2 3 4 5 6 7 8 | [server_command_map]
hekate.ifh.de:4243 = kstart,fs;vos:blah
hekate.ifh.de:4242 = fs;vos:blah
hekate2.ifh.de = whoami,test,
hekate.ifh.de = *
|
scripts/arcxd.conf
view on Meta::CPAN
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
[commands]
uptime = Arc::Command::Uptime
whoami = Arc::Command::Whoami
copy = Arc::Command::Get
cp = Arc::Command::Get
get = Arc::Command::Get
put = Arc::Command::Put
crontab = Arc::Command::Acrontab
acrontab = Arc::Command::Acrontab
test = Arc::Command::Test
help = Arc::Command::Help
h = Arc::Command::Help
hlp = Arc::Command::Help
rpc = Arc::Command::Rpc
fs = Fs
vos = Fs
pv = Pv
|
t/arc1.t
view on Meta::CPAN
1 2 3 4 5 6 7 8 9 10 11 | my $pid = fork ();
my $user = "mannfred" ;
my $pass = "klaus" ;
if ( $pid == 0) {
|
t/arc1.t
view on Meta::CPAN
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | host => "localhost" ,
},
connection_vars => {
loglevel => 0,
logdestination => 'stderr' ,
sasl_mechanisms => [ 'PLAIN' ],
sasl_cb_checkpass => \ &checkpass ,
sasl_cb_getsecret => \ &getsecret ,
service => "arc" ,
commands => {
test => 'Arc::Command::Test' ,
whoami => 'Arc::Command::Whoami' ,
uptime => 'Arc::Command::Uptime' ,
}
}
);
$server ->Start();
exit 0;
} elsif ( $pid ) {
|
t/arc1.t
view on Meta::CPAN
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | sasl_mechanism => "PLAIN" ,
sasl_cb_user => $user ,
sasl_cb_auth => $user ,
sasl_cb_pass => $pass ,
) or ok(0);
ok(1);
my $s ;
if ( $client ->StartSession()) { ok(1); } else { ok(0); }
if ( $client ->CommandStart( "test" )) { ok(1); } else { ok(0); }
if ( $client ->CommandWrite( "hallo\n" )) { ok(1); } else { ok(0); }
if ( $s = $client ->CommandRead()) { ok(1); } else { ok(0); }
if ( $s eq "all\n" ) { ok(1); } else { ok(0); }
if ( $client ->CommandEnd()) { ok(1); } else { ok(0); }
if ( $client ->CommandStart( "whoami" )) { ok(1); } else { ok(0); }
if ( $s = $client ->CommandRead()) { ok(1); } else { ok(0); }
if ( $client ->CommandEnd()) { ok(1); } else { ok(0); }
if ( $client ->CommandStart( "uptime" )) { ok(1); } else { ok(0); }
|