Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/0/BOS_signon.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/0/BOS_signon.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/0/BOS_signon.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,30 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use Net::OSCAR::Common qw(:all);
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+my $cookie = pack("n", $reqid & 0xFFFF) . $data{cookie};
+if($COOKIES{$cookie}) {
+	my $peer = delete $COOKIES{$cookie};
+	my $screenname = $peer->{sn};
+	print "$screenname initiating BOS handshake.\n";
+	$connection->{screenname} = $screenname;
+
+	my $sess = $SESSIONS->{$screenname};
+	push @{$sess->{sessions}}, $connection;
+	$sess->{extstatus} ||= "";
+	$sess->{away} = 0;
+	$sess->{stealth} = 0;
+	
+	$connection->proto_send(protobit => "server_ready", protodata => {
+		families => [grep { !OSCAR_TOOLDATA()->{$_}->{nobos} } keys %{OSCAR_TOOLDATA()}]
+	});
+} else {
+	$connection->log_print(OSCAR_DBG_DEBUG, "No cookie: $cookie");
+	$session->delconn($connection);
+}
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/personal_info_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/personal_info_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/personal_info_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,18 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(reqid => $reqid, protobit => "self_information", protodata => {
+	screenname => $screenname,
+ 			evil => 0,
+	flags => 0x20,
+	onsince => time(),
+	idle => 0,
+	session_length => 0,
+	ip => 0
+});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_acknowledgement.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_acknowledgement.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_acknowledgement.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+# Do nothing
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_info_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_info_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/rate_info_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,13 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(reqid => $reqid, protobit => "rate_info_response", protodata => {
+	classes => [],
+	classmembers => []
+});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_extended_status.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_extended_status.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_extended_status.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,14 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+if($data{status_message}) {
+	$SESSIONS->{$screenname}->{status}->{extstatus} = $data{status_message}->{message};
+} elsif($data{stealth}) {
+	$SESSIONS->{$screenname}->{status}->{stealth} = $data{stealth}->{state} & 0x100;
+}
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_service_versions.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_service_versions.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_service_versions.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+send_versions($connection, 0, 1);
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_tool_versions.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_tool_versions.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/1/set_tool_versions.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,11 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+print "$screenname finished signing on.\n";
+$connection->{signon_done} = 1;
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,22 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+my $blist;
+
+my $visdata = tlv_encode(tlv(
+	0xCA => 0,
+	0xCB => 0xFFFFFFFF,
+));
+$blist = "xxx";
+$blist .= pack("n5a*", 0, 0, 0xCB, 4, length($visdata), $visdata);
+$blist .= pack("na*n4", length("Buddies"), "Buddies", 1, 0, 1, 0);
+my $i = 1;
+$blist .= pack("na*n4", length($_), $_, 1, $i++, 0, 0) foreach @{$SCREENNAMES->{$screenname}->{blist}};
+
+$connection->proto_send(reqid => $reqid, protobit => "buddylist", protodata => {data => $blist});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_rights_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/19/buddylist_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,12 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "buddylist_3_response", reqid => $reqid, protodata => {maximums => [
+	200, 50, 128, 128, 1, 1, 50, 0, 0, 3, 0, 0, 0, 128, 128, 20, 200, 1, 0, 1, 0
+]});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/get_away.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/get_away.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/get_away.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,19 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(reqid => $reqid, protobit => "incoming_profile", protodata => {
+	screenname => $data{screenname},
+	awaymsg => "Got away message at " . scalar(ctime(time())),
+	evil => 0,
+	flags => 0x20,
+	onsince => 0,
+	membersince => 0,
+	idle => 0,
+	capabilities => ""
+});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/locate_rights_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/locate_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/2/locate_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "locate_rights_response", reqid => $reqid);
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/initial_signon_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/initial_signon_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/initial_signon_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,27 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+if(exists($SCREENNAMES->{$data{screenname}})) {
+	$screenname = $data{screenname};
+	my $key = sprintf("%08d", int(rand(99999999)));
+	print "$screenname would like to sign on.  Generated key '$key'\n";
+
+	$SESSIONS->{$screenname} ||= {};
+	$SESSIONS->{$screenname}->{keys} ||= {};
+	$SESSIONS->{$screenname}->{sessions} ||= [];
+	$SESSIONS->{$screenname}->{status} ||= {
+		online => 0,
+	};
+
+	$SESSIONS->{$screenname}->{keys}->{$key} = 1;
+	$connection->proto_send(protobit => "authentication_key", protodata => {key => $key});
+} else {
+	$connection->proto_send(protobit => "authorization_response", protodata => {error => 1});
+	$session->delconn($connection);
+}
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/signon.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/signon.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/23/signon.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,44 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use Net::OSCAR::Constants;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+my $hash;
+($screenname, $hash) = ($data{screenname}, $data{auth_response});
+
+if(!$SCREENNAMES->{$screenname}) {
+	$connection->proto_send(protobit => "authorization_response", protodata => {error => 1});
+}
+
+my @valid_hashes = map {
+	[$_, encode_password($session, exists($data{pass_is_hashed}) ? md5($SCREENNAMES->{$screenname}->{pw}) : $SCREENNAMES->{$screenname}->{pw}, $_)];
+} keys %{$SESSIONS->{$screenname}->{keys}};
+
+my $valid = 0;
+foreach (@valid_hashes) {
+	next unless $_->[1] eq $hash;
+	$valid = 1;
+	delete $SCREENNAMES->{$screenname}->{keys}->{$_->[0]};
+	last;
+}
+
+if($valid) {
+	my $key = randchars(256);
+	$connection->proto_send(protobit => "authorization_response", protodata => {
+		screenname => $SCREENNAMES->{$screenname}->{sn},
+		email => $SCREENNAMES->{$screenname}->{email},
+		auth_cookie => $key,
+		server_ip => "127.0.0.1"
+	});
+	$session->delconn($connection);
+
+	$COOKIES{$key} = {sn => $screenname, conntype => CONNTYPE_BOS};
+} else {
+	$connection->proto_send(protobit => "authorization_response", protodata => {error => 5});
+	$session->delconn($connection);
+}
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/3/buddy_rights_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/3/buddy_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/3/buddy_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "buddy_rights_response", reqid => $reqid);
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/IM_parameter_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/IM_parameter_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/IM_parameter_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "IM_parameter_response", reqid => $reqid, protodata => {channel => $data{channel}});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/add_IM_parameters.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/add_IM_parameters.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/add_IM_parameters.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "IM_parameter_response", reqid => $reqid, protodata => {channel => $data{channel}});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/outgoing_IM.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/outgoing_IM.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/4/outgoing_IM.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,26 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+my $target = $SESSIONS->{$data{screenname}};
+if(!$target or !$target->{sessions}->[0]) {
+	return srv_send_error($connection, $family, 4);
+}
+
+$connection->proto_send(reqid => $reqid, protobit => "IM_acknowledgement", protodata => {
+	cookie => $data{cookie},
+	channel => $data{channel},
+	screenname => $data{screenname}
+});
+
+
+$data{screenname} = $screenname;
+$data{evil} = 0;
+$data{flags} = 0;
+
+$target->{sessions}->[0]->proto_send(protobit => "incoming_IM", protodata => {%data});
+
+};
+
Index: perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/9/BOS_rights_request.pm
===================================================================
--- perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/9/BOS_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
+++ perl/modules/AIM/lib/Net/OSCAR/ServerCallbacks/9/BOS_rights_request.pm	(revision 7a1c90dd56da7730139bf614567192ed49d47108)
@@ -0,0 +1,10 @@
+package Net::OSCAR::ServerCallbacks;
+use strict;
+use warnings;
+use vars qw($SESSIONS $SCREENNAMES %COOKIES $screenname $connection $snac $conntype $family $subtype $data $reqid $reqdata $session $protobit %data);
+sub {
+
+$connection->proto_send(protobit => "BOS_rights_response", reqid => $reqid);
+
+};
+
