MODULE OSCARDEF IDENT "OSCARDEF-1-X"; /*++ /* Facility: /* OSCAR API for OpenVMS /* /* Abstract: /* An interface module defined OSCAR primitives, constants. This story is based on /* http://iserverd1.khstu.ru/oscar/ /* /* /* Author: /* Ruslan R. Laishev /* /* Creation Date: 21-DEC-2007 /* /* Modification History: /* /* /*-- CONSTANT PORT EQUALS 5190 PREFIX ICQ__$; CONSTANT VER EQUALS 9 PREFIX ICQ__$; CONSTANT MAXFLAP EQUALS 8192 PREFIX ICQ__$; /* FLAP is a low-level communications protocol that facilitates the development /* of higher-level, datagram-oriented, communications /* layers. It is used on the TCP connection between all clients /* and servers. Here is format of FLAP datagram: CONSTANT id EQUALS %x02A PREFIX FLAP$; CONSTANT maxseq EQUALS %x08000 PREFIX FLAP$; AGGREGATE flap STRUCTURE PREFIX flap$ TAG "oscar"; id BYTE UNSIGNED; /* FLAP id byte is always 0x2A. It is frame-start sign. chan BYTE UNSIGNED; /* FLAP channel, see FLAPCHN$* constants seq WORD UNSIGNED; /* FLAP datagram seq number from 0 ... %x08000 len WORD UNSIGNED; /* FLAP data size #hdrsz = .; data BYTE UNSIGNED DIMENSION 1; /* FLAP data END flap; CONSTANT hdrsz EQUALS #hdrsz PREFIX flap$ TAG "oscar"; CONSTANT ( NCN, /* New Connection Negotiation SNAC, /* SNAC data ERR, /* FLAP-level Error CCN, /* Close Connection Negotiation KPALV /* Keep alive ) EQUALS 1 INCREMENT 1 PREFIX FLAPCHN$; /* A SNAC is the basic communication unit that is exchanged between /* clients and servers. The SNAC communication layers sits on top of /* the FLAP layer. SNAC is the normal contents of the FLAP Data Field for /* channel 0x02. SNACs are only sent over channel 0x02. Data /* sent across other channels are not considered complete SNACs. /* There can be only one SNAC per FLAP frame. Here is the format of SNAC: CONSTANT ( gsc, /* Generic service controls locs, /* Location services blms, /* Buddy List management service icbm, /* ICBM (messages) service ads, /* Advertisements service inv, /* Invitation service adm, /* Administrative service popup, /* Popup notices service pvcs, /* Privacy management service ulookup, /* User lookup service (not used any more) usage, /* Usage stats service trn, /* Translation service nav, /* Chat navigation service chat, /* Chat service search, /* Directory user search ssbi, /* Server-stored buddy icons (SSBI) service h11, h12, ssi, /* Server Side Information (SSI) service h14, icq, /* ICQ specific extensions service h16, auths, /* Authorization/registration service ) EQUALS 1 INCREMENT 1 PREFIX SNACF$; /* Broadcast service - IServerd extension CONSTANT broad EQUALS %x85 PREFIX SNACF$; /* /* /* CONSTANT more EQUALS %x0001 PREFIX SNACF$_M; CONSTANT undef EQUALS %x7FFE PREFIX SNACF$_M; CONSTANT add EQUALS %x8000 PREFIX SNACF$_M; AGGREGATE snac STRUCTURE PREFIX snac$ TAG "oscar"; service WORD UNSIGNED; /* Family (service) id number, see SNACF$ constants subtype WORD UNSIGNED; flags WORD UNSIGNED; /* SNAC flags req LONGWORD UNSIGNED; /* SNAC request id #hdrsz = .; data UNION; data BYTE UNSIGNED DIMENSION 1; /* SNAC data data WORD UNSIGNED DIMENSION 1; /* SNAC data data LONGWORD UNSIGNED DIMENSION 1; /* SNAC data END data; END snac; CONSTANT hdrsz EQUALS #hdrsz PREFIX snac$ TAG "oscar"; /* TLVs are a very convenient and efficient method of putting data into an /* organized format, especially variable length strings, etc. /* TLV literally stands for "Type, Length, Value". And that's exactly what it /* is: a 16bit Type code, a 16bit value for the length of /* the Value field, and then the actual data in the Value field (variable /* length). Here is TLV format: AGGREGATE tlv STRUCTURE PREFIX tlv$ TAG ""; tag WORD UNSIGNED; /* TLV type number len WORD UNSIGNED; /* TLV length value #hdrsz = .; val UNION; val CHARACTER LENGTH 2; val BYTE UNSIGNED; val WORD UNSIGNED; val LONGWORD UNSIGNED; END val; END tlv; CONSTANT hdrsz EQUALS #hdrsz PREFIX tlv$ TAG "oscar"; CONSTANT ( b, w, l, s, a ) EQUALS 1 INCREMENT %x1 PREFIX TLV_VALSZ$; AGGREGATE ascic STRUCTURE PREFIX ascic$ TAG ""; len WORD UNSIGNED; /* TLV length value val UNION; val CHARACTER LENGTH 2; val BYTE UNSIGNED; val WORD UNSIGNED; val LONGWORD UNSIGNED; END val; END ascic; /* /* /* OSCAR API Context structure /* /* AGGREGATE ctx STRUCTURE PREFIX oscar$ TAG "oscar"; uin LONGWORD UNSIGNED; /* UIN in a binary from chan LONGWORD UNSIGNED; /* VMS Network I/O channel iseq WORD UNSIGNED; /* datagram seq number for sent FLAP oseq WORD UNSIGNED; /* datagram seq number for sent FLAP oreqid LONGWORD UNSIGNED; /* Sent SNAC request id ireqid LONGWORD UNSIGNED; /* received SNAC request id s UNION; status LONGWORD UNSIGNED; c STRUCTURE; sts WORD UNSIGNED; /* Error code from SNAC (x,1); stv WORD UNSIGNED; /* Error subcode from TLV.Type(0x08); END c; END s; END ctx; /* /* SNACs /* /* Family 0x0001 Generic service controls CONSTANT ( err, /* Client / server error ok, /* Client is now online and ready for normal function flist, /* Server supported snac families list news, /* Request for new service redir, /* Redirect (for 0x0004 subtype) reqlim, /* Request rate limits information anslim, /* Rate limits information response addlim, /* Add rate limits group dellim, /* Delete rate limits group chnglim, /* Rate information changed / rate limit warning pause, /* Server pause command pauseack, /* Client pause ack resume, /* Server resume command rqown, /* Request own online information rqonln, /* Requested online info response evile, /* Evil notification idle, /* Set idle time migrate, /* Migration notice and info motd, /* Message of the day (MOTD) pvcfl, /* Set privacy flags wkns, /* Well known urls nop, /* No operation (NOP) rqver, /* Request server services versions srvver, /* Server services versions setloc, /* Set status (set location info) rqcliver, /* Client verification request anscliver, /* Client verification reply clists /* Client's extended status from server ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_GSC$; /* Family 0x0002 Location services CONSTANT ( err, /* Client / server error reqpar, /* Request limitations/params anspar, /* Limitations/params response setui, /* Set user information requi, /* Request user info ansui, /* User information response rqwatch, /* Watcher sub request ntwatch, /* Watcher notification requpd, /* Update directory info request ansupd, /* Update directory info reply qry, /* Query for SNAC(02,0C) rpl, /* Reply to SNAC(02,0B) updudi, /* Update user directory interests ansudi, /* Update user directory interests reply qryui /* User info query ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_LOCS$; /* Family 0x0003 Buddy List management service CONSTANT ( err, /* Client / server error reqpar, /* Request limitations/params anspar, /* Limitations/params response add, /* Add buddy(s) to contact list del, /* Remove buddy(ies) from contact qry, /* Query for list of watchers reqwl, /* Requested watchers list subrqw, /* Watcher sub request notfyw, /* Watcher notification rejntfy, /* Notification rejected online, /* User online notification offline, /* User offline notification ) EQUALS 1 INCREMENT %x30000 PREFIX SNACTP_BLMS$; /* Family 0x0004 ICBM service CONSTANT ( err, /* Client / server error set, /* Set ICBM parameters get, /* Reset ICBM parameters reqpar, /* Request parameters info anspar, /* Requested parameters info response send, /* Send message thru server msg, /* Message for client from server reqevl, /* Evil request ansevl, /* Server evil ack miss, /* Missed call (msg not delivered) data, /* Client/server message error or data ack, /* Server message ack mtn /* Mini typing notifications (MTN) ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_ICBM$; /* /* Message channels /* CONSTANT ( text, /* Channel 1 message format (plain-text messages) rtf, /* Channel 2 message format (rtf messages, rendezvous) chat, /* Channel 3 is used for chat messages (not in the same family as these channels) old /* Channel 4 message format (typed old-style messages) ) EQUALS 1 INCREMENT 1 PREFIX OSCAR$CHN; /* /* Message types and flags /* CONSTANT ( plain, /* Plain text (simple) message chat, /* Chat request message filereq, /* File request / file ok message url, /* URL message (0xFE formatted) authreq, /* Authorization request message (0xFE formatted) authdeny, /* Authorization denied message (0xFE formatted) authok, /* Authorization given message (empty) server, /* Message from OSCAR server (0xFE formatted) /* Unknown or unused _a,_b, added, /* "You-were-added" message (0xFE formatted) wwp, /* Web pager message (0xFE formatted) eexpress, /* Email express message (0xFE formatted) /* Unknown or unused _f,_10,_11,_12, contacts, /* Contact list message /* Unknown or unused _14,_15,_16,_17,_18,_19, plugin /* Plugin message described by text string ) EQUALS 1 INCREMENT 1 PREFIX OSCAR$MTP; CONSTANT ( autoaway, /* Auto away message autobusy, /* Auto occupied message autona, /* Auto not available message autodnd, /* Auto do not disturb message autoffc /* Auto free for chat message ) EQUALS %x0E8 INCREMENT 1 PREFIX OSCAR$MTP; /* CONSTANT normal EQUALS 1 PREFIX OSCAR$MFL; CONSTANT auto EQUALS 3 PREFIX OSCAR$MFL; CONSTANT multi EQUALS %x80 PREFIX OSCAR$MFL; /* Family 0x0005 (depricated) Advertisements service CONSTANT ( err, /* Client / server error req, /* Client request ads ans /* Server returned ads (GIFs) ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_ADS$; /* Family 0x0006 Invitation service CONSTANT ( err, /* Client server error invite, /* Invite a friend to join AIM ack /* Invitation server ack ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_INV$; /* Family 0x0007 Administrative service CONSTANT ( err, /* Client / server error req, /* Request account info ans, /* Requested account info reqmod, /* Change account info (screenname, password) request ackmod, /* Change account info ack reqconf, /* Account confirm request ansconf, /* Account confirm ack reqdel, /* Account delete request ackdel /* Account delete ack ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_ADM$; /* Family 0x0008 Popup notices service CONSTANT ( err, /* Client server error cmd /* Display popup message server command ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_POPUP$; /* Family 0x0009 Privacy management service CONSTANT ( err, /* Client server error reqpar, /* Request service parameters anspar, /* Requested service parameters setperm, /* Set group permissions mask addvis, /* Add to visible list delvis, /* Delete from visible list addinvis, /* Add to invisible list delinvis, /* Delete from invisible list svcerr, /* Service error addvis2, /* Add to visible list (?) delvis2 /* Delete from visible list (?) ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_PVCS$; /* Family 0x000A User lookup service CONSTANT ( err, /* Client / server error email, /* Search user by email resp /* Search response ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_ULOOKUP$; /* Family 0x000B Usage stats service CONSTANT ( err, /* Client / server error intvl, /* Set minimum report interval usage, /* Usage stats report ackusage /* Usage stats report ack ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_USAGE$; /* Family 0x000c (depricated) Translation service CONSTANT ( err, /* Client / server error reqtrn, /* Client translate request anstrn /* Server translate reply ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_TRN$; /* Family 0x000D Chat navigation service CONSTANT ( err, /* Client / server error reqlim, /* Request limits exchange, /* Request exchange information room, /* Request room information extroom, /* Request extended room information members, /* Request member list search, /* Search for room create, /* Create room ans /* Requested information response ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_NAV$; /* Family 0x000E Chat service CONSTANT ( err, /* Client / server error update, /* Room information update joined, /* Users joined notification left, /* Users left notification from, /* Channel message from client to, /* Channel message to client reqevil, /* Evil request ansevil, /* Evil reply data /* Chat error or data ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_CHAT$; /* Family 0x000f Directory search (aim new search) CONSTANT ( err, /* Client / server error req, /* Client search user request ans, /* Server reply for search request (found users) reqintrst, /* Request interests list from server rspintrst /* Server response to interests list request ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_SEARCH$; /* Family 0x0010 Server-stored buddy icons CONSTANT ( err, /* Client / server error put, /* Upload your icon to server ackput, /* Server ack for icon upload aimreqico, /* Request buddy icon from server (AIM only) aimrspico, /* Server response to a buddy icon request (AIM only) reqico, /* Request buddy icon from server (ICQ) rspico /* Server response to a buddy icon request (ICQ) ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_SSBI$; /* Family 0x0013 Server side information service CONSTANT ( err, /* Client / server error reqsvc, /* Request service parameters anssvc, /* Service parameters reply reqlst, /* Request contact list (first time) chklst, /* Contact list checkout anslst, /* Server contact list reply loadlst, /* Load server contact list (after login) add, /* SSI edit: add item(s) upd, /* SSI edit: update group header del, /* SSI edit: remove item acc, /* SSI edit server ack utodate, /* client local SSI is up-to-date lstbeg, /* Contacts edit start (begin transaction) lstend, /* Contacts edit end (finish transaction) grant, /* Grant future authorization to client granted, /* Future authorization granted remove, /* Delete yourself from another client server contact sendauth, /* Send authorization request reqauth, /* Authorization request auth, /* Send authorization reply ansauth, /* Authorization reply added /* "You were added" message ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_SSI$; /* Family 0x0015 ICQ specific extensions service CONSTANT ( err, /* Client / server error reqmeta, /* Meta information request ansmeta /* Meta information response ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_ICQ$; /* Family 0x0017 Authorization/registration service CONSTANT SNACTP_AREG$ EQUALS %x17; CONSTANT ( err, /* Server error (registration refused) login, /* Client login request (md5 login sequence) reply, /* Server login reply / error reply requin, /* Request new uin ansuin, /* New uin response reqkey, /* Request md5 authkey anskey, /* Server md5 authkey response reqsid, /* Server SecureID request anssid, /* Client SecureID reply ) EQUALS 1 INCREMENT 1 PREFIX SNACTP_AREG$; /* Family 0x0085 - IServerd extension Broadcast service CONSTANT ( err, /* Server error send, /* Send broadcast message to server reply /* Server broadcast reply ) EQUALS 1 INCREMENT %x850000 PREFIX SNACTP_BROAD$; AGGREGATE usts STRUCTURE PREFIX usts$ TAG "oscar"; webaware BITFIELD LENGTH 1 MASK; /* Status webaware flag showip BITFIELD LENGTH 1 MASK; /* Status show ip flag fill0 BITFIELD LENGTH 1; birthday BITFIELD LENGTH 1 MASK; /* User birthday flag fill1 BITFIELD LENGTH 1; webfront BITFIELD LENGTH 1 MASK; /* User active webfront flag fill2 BITFIELD LENGTH 2; dcdisa BITFIELD LENGTH 1 MASK; /* Direct connection not supported fill3 BITFIELD LENGTH 3; dcauth BITFIELD LENGTH 1 MASK; /* Direct connection upon authorization dccont BITFIELD LENGTH 1 MASK; /* DC only with contact users fill4 BITFIELD LENGTH 1; online BITFIELD LENGTH 1 MASK; /* Status is online away BITFIELD LENGTH 1 MASK; /* Status is away dnd BITFIELD LENGTH 1 MASK; /* Status is no not disturb (DND) na BITFIELD LENGTH 1 MASK; /* Status is not available (N/A) fill5 BITFIELD LENGTH 1; occupied BITFIELD LENGTH 1 MASK; /* Status is occupied (BISY) f4chat BITFIELD LENGTH 1 MASK; /* Status is free for chat fill6 BITFIELD LENGTH 2; invis BITFIELD LENGTH 1 MASK; /* Status is invisible END usts; /* /* Here is the list of the known error codes for families error SNACs(xx,01). /* CONSTANT ( invhdr, /* Invalid SNAC header. srvrate, /* Server rate limit exceeded clirate, /* Client rate limit exceeded notloged, /* Recipient is not logged in unavail, /* Requested service unavailable undef, /* Requested service not defined old, /* You sent obsolete SNAC strvsup, /* Not supported by server clisupp, /* Not supported by client refused, /* Refused by client toobig, /* Reply too big lost, /* Responses lost reqdnd, /* Request denied badfmt, /* Incorrect SNAC format nopriv, /* Insufficient rights blocked, /* In local permit/deny (recipient blocked) senderevil, /* Sender too evil recvrevil, /* Receiver too evil tmpna, /* User temporarily unavailable nomatch, /* No match oveflw, /* List overflow ambiguous, /* Request ambiguous queful, /* Server queue full notaol /* Not while on AOL ) EQUALS 1 INCREMENT 1 PREFIX SNAC_ERR$; /* END_MODULE OSCARDEF;