source: perl/modules/AIM/lib/Net/OSCAR/Constants.pm @ 7a1c90d

barnowl_perlaim
Last change on this file since 7a1c90d was 7a1c90d, checked in by Geoffrey Thomas <geofft@mit.edu>, 16 years ago
Skeleton AIM module, and Net::OSCAR 1.925
  • Property mode set to 100644
File size: 9.1 KB
Line 
1=pod
2
3Net::OSCAR::Constants -- internal Net::OSCAR constants
4
5=cut
6
7package Net::OSCAR::Constants;
8
9$VERSION = '1.925';
10$REVISION = '$Revision: 1.11 $';
11
12use strict;
13use vars qw(@ISA @EXPORT $VERSION);
14use Scalar::Util qw(dualvar);
15use Net::OSCAR::TLV;
16require Exporter;
17@ISA = qw(Exporter);
18
19@EXPORT = qw(
20        FLAP_CHAN_NEWCONN FLAP_CHAN_SNAC FLAP_CHAN_ERR FLAP_CHAN_CLOSE
21        CONNTYPE_LOGIN CONNTYPE_BOS CONNTYPE_ADMIN CONNTYPE_CHAT CONNTYPE_CHATNAV CONNTYPE_ICON CONNTYPE_DIRECT_IN CONNTYPE_DIRECT_OUT CONNTYPE_SERVER
22        OSCAR_CAPS OSCAR_CAPS_INVERSE OSCAR_CAPS_SHORT_INVERSE OSCAR_TOOLDATA
23        GROUP_PERMIT GROUP_DENY BUDTYPES ERRORS
24
25        ICQ_META_INFO ICQ_META_INFO_INVERSE
26);
27
28
29use constant FLAP_CHAN_NEWCONN => dualvar(0x01, "new connection");
30use constant FLAP_CHAN_SNAC => dualvar(0x02, "SNAC");
31use constant FLAP_CHAN_ERR => dualvar(0x03, "error");
32use constant FLAP_CHAN_CLOSE => dualvar(0x04, "close connection");
33
34use constant CONNTYPE_LOGIN => dualvar(0, "login service");
35use constant CONNTYPE_BOS => dualvar(0x2, "basic OSCAR services");
36use constant CONNTYPE_ADMIN => dualvar(0x7, "administrative service");
37use constant CONNTYPE_CHAT => dualvar(0xE, "chat connection");
38use constant CONNTYPE_CHATNAV => dualvar(0xD, "chat navigator");
39use constant CONNTYPE_ICON => dualvar(0x10, "icon service");
40use constant CONNTYPE_DIRECT_IN => dualvar(0xfe, "direct connect listener");
41use constant CONNTYPE_DIRECT_OUT => dualvar(0xff, "direct connect connection");
42use constant CONNTYPE_SERVER => dualvar(0xfd, "OSCAR server");
43
44use constant GROUP_PERMIT => 0x0002;
45use constant GROUP_DENY   => 0x0003;
46
47use constant OSCAR_CAPS => {
48        chat => {description => "chatrooms", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
49                "0x74 0x8F 0x24 0x20 0x62 0x87 0x11 0xD1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
50        interoperate => {description => "ICQ/AIM interoperation", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
51                "0x09 0x46 0x13 0x4d 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
52        extstatus => {description => "iChat extended status messages", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
53                "0x09 0x46 0x00 0x00 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
54        buddyicon => {description => "buddy icons", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
55                "0x09 0x46 0x13 0x46 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
56        fileshare => {description => "file sharing", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
57                "0x09 0x46 0x13 0x48 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
58        filexfer => {description => "file transfers", value => pack("C*", map{hex($_)} split(/[ \t\n]+/,
59                "0x09 0x46 0x13 0x43 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
60        secureim => {description => "encrypted IM", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
61                "0x09, 0x46, 0x00, 0x01, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
62        hiptop => {description => "hiptop", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
63                "0x09, 0x46, 0x13, 0x23, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
64        voice => {description => "voice chat", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
65                "0x09, 0x46, 0x13, 0x41, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
66        icq => {description => "EveryBuddy ICQ support", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
67                "0x09, 0x46, 0x13, 0x44, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
68        directim => {description => "direct IM", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
69                "0x09, 0x46, 0x13, 0x45, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
70        addins => {description => "add-ins", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
71                "0x09, 0x46, 0x13, 0x47, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
72        icqrelay => {description => "ICQ server relay", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
73                "0x09, 0x46, 0x13, 0x49, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
74        games => {description => "games", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
75                "0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
76        games2 => {description => "games 2", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
77                "0x09, 0x46, 0x13, 0x4a, 0x4c, 0x7f, 0x11, 0xd1, 0x22, 0x82, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
78        sendlist => {description => "buddy list sending", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
79                "0x09, 0x46, 0x13, 0x4b, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
80        icqutf8 => {description => "ICQ UTF-8", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
81                "0x09, 0x46, 0x13, 0x4e, 0x4c, 0x7f, 0x11, 0xd1, 0x82, 0x22, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00"))},
82        icqutf8old => {description => "old ICQ UTF-8", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
83                "0x2e, 0x7a, 0x64, 0x75, 0xfa, 0xdf, 0x4d, 0xc8, 0x88, 0x6f, 0xea, 0x35, 0x95, 0xfd, 0xb6, 0xdf"))},
84        icqrtf => {description => "ICQ RTF", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
85                "0x97, 0xb1, 0x27, 0x51, 0x24, 0x3c, 0x43, 0x34, 0xad, 0x22, 0xd6, 0xab, 0xf7, 0x3f, 0x14, 0x92"))},
86        apinfo => {description => "AP info", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
87                "0xaa, 0x4a, 0x32, 0xb5, 0xf8, 0x84, 0x48, 0xc6, 0xa3, 0xd7, 0x8c, 0x50, 0x97, 0x19, 0xfd, 0x5b"))},
88        trilliancrypt => {description => "Trillian encryption", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
89                "0xf2, 0xe7, 0xc7, 0xf4, 0xfe, 0xad, 0x4d, 0xfb, 0xb2, 0x35, 0x36, 0x79, 0x8b, 0xdf, 0x00, 0x00"))},
90        secureim => {description => "SecureIM encryption", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
91                "0x09 0x46 0x01 0xff 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
92        video => {description => "A/V chat", value => pack("C*", map{hex($_)} split(/[ \t\n,]+/,
93                "0x09 0x46 0x01 0x05 0x4c 0x7f 0x11 0xd1 0x82 0x22 0x44 0x45 0x53 0x54 0x00 0x00"))},
94};
95use constant OSCAR_CAPS_INVERSE => { map { OSCAR_CAPS()->{$_}->{value} => $_ } keys %{OSCAR_CAPS()} };
96use constant OSCAR_CAPS_SHORT_INVERSE => { map { substr(OSCAR_CAPS()->{$_}->{value}, 2, 2) => $_ } keys %{OSCAR_CAPS()} };
97
98use constant OSCAR_TOOLDATA => tlv(
99        0x0001 => {version => 0x0004, toolid => 0x0110, toolversion => 0x08E5},
100        0x0013 => {version => 0x0003, toolid => 0x0110, toolversion => 0x08E5},
101        0x0002 => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
102        0x0003 => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
103        0x0004 => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
104        0x0005 => {version => 0x0001, toolid => 0x0001, toolversion => 0x0001, nobos => 1},
105        0x0006 => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
106        0x0007 => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
107        0x0008 => {version => 0x0001, toolid => 0x0104, toolversion => 0x0001},
108        0x0009 => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
109        0x000A => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
110        0x000B => {version => 0x0001, toolid => 0x0110, toolversion => 0x08E5},
111        0x000C => {version => 0x0001, toolid => 0x0104, toolversion => 0x0001, nobos => 1},
112        0x000D => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
113        0x000E => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
114        0x000F => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
115        0x0010 => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
116        0x0015 => {version => 0x0001, toolid => 0x0110, toolversion => 0x047C, nobos => 1},
117        0x0017 => {version => 0x0000, toolid => 0x0000, toolversion => 0x0000, nobos => 1},
118        0x0018 => {version => 0x0001, toolid => 0x0010, toolversion => 0x08E5, nobos => 1},
119        0xFFFF => {version => 0x0000, toolid => 0x0000, toolversion => 0x0000, nobos => 1},
120);
121
122use constant BUDTYPES => ("buddy", "group", "permit entry", "deny entry", "visibility/misc. data", "presence", undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, undef, "buddy icon data");
123
124use constant ERRORS => split(/\n/, <<EOF);
125Invalid error
126Invalid SNAC
127Sending too fast to host
128Sending too fast to client
129%s is not logged in, so the attempted operation (sending an IM, getting user information) was unsuccessful
130Service unavailable
131Service not defined
132Obsolete SNAC
133Not supported by host
134Not supported by client
135Refused by client
136Reply too big
137Responses lost
138Request denied
139Busted SNAC payload
140Insufficient rights
141%s is in your permit or deny list
142Too evil (sender)
143Too evil (receiver)
144User temporarily unavailable
145No match
146List overflow
147Request ambiguous
148Queue full
149Not while on AOL
150Unknown error 25
151Unknown error 26
152Unknown error 27
153Unknown error 28
154There have been too many recent signons from this address.  Please wait a few minutes and try again.
155EOF
156
157
158use constant ICQ_META_INFO => {
159        basic => 200,
160        office => 210,
161        background => 220,
162        notes => 230,
163        email => 235,
164        interests => 240,
165        affiliations => 250,
166        homepage => 270
167};
168use constant ICQ_META_INFO_INVERSE => { map { ICQ_META_INFO()->{$_} => $_ } keys %{ICQ_META_INFO()} };
169
1701;
Note: See TracBrowser for help on using the repository browser.