File: XS.pm

package info (click to toggle)
libauthen-sasl-xs-perl 1.00-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 400 kB
  • sloc: perl: 241; makefile: 3
file content (35 lines) | stat: -rwxr-xr-x 696 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package Authen::SASL::XS;
require DynaLoader;
require Authen::SASL::XS::Security;
require Exporter;

@ISA = qw(DynaLoader);

$VERSION = "1.00";

bootstrap Authen::SASL::XS $VERSION;

#
# Take a client filehandle and tie it to the Security subclass to
# perform SASL encryption and decryption on the network traffic
#
sub tiesocket {
  my($sasl, $fh) = @_;

  new Authen::SASL::XS::Security($fh, $sasl);
}



# Create a new client filehandle and tie it to the Security subclass to
# perform SASL encryption and decryption on the network traffic
sub securesocket {
  my ($sasl, $fh) = @_;
  my $glob = \do { local *GLOB; };
  tie(*$glob, "Authen::SASL::XS::Security", $fh, $sasl);
  $glob;
}



1;