⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basic.html

📁 aol和icq使用的oscar协议详细介绍
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<html>
<head>
<title>Basic OSCAR information (FLAP, SNAC, TLV)</title>
<style type="text/css">
  body {background-color: white; font-size: 13px;}
  td {font-size: 16px;}
</style>
</head>

<body bgcolor=white>

<table width=640 bgcolor=darkblue cellSpacing=0 cellPadding=0 border=0><tr><td>
<table width=100% cellSpacing=2 cellPadding=0 border=0><tr><td  bgcolor=#4040FF >
<table width=100% cellSpacing=0 cellPadding=0 border=0>
<tr>
<td><b><font color="white">&nbsp;Basic OSCAR information (FLAP, SNAC, TLV)&nbsp;</font></b></td>
<td width=40% align=right><b><font color="white">&nbsp;</font></b></td>
</tr>
</table>
</td></tr>
</table>
</td></tr></table>

<br>

<table width=640 cellSpacing=0 cellPadding=0 border=0 bgcolor=#E9E9E9>
<tr><td bgcolor=white>
<table width=100% cellSpacing=1 cellPadding=1 align=center border=0>
<tr>
<td bgcolor=#f0f0f0 width=25>&nbsp;1.</td>
<td bgcolor=#f0f0f0>&nbsp;<a href="#b0001">FLAP protocol (version 1.0) description</a></td>
</tr>
<tr>
<td bgcolor=#f0f0f0>&nbsp;2.</td>
<td bgcolor=#f0f0f0>&nbsp;<a href="#b0002">SNAC communication unit description</a></td>
</tr>
<tr>
<td bgcolor=#f0f0f0>&nbsp;3.</td>
<td bgcolor=#f0f0f0>&nbsp;<a href="#b0003">TLV (Type-Length-Value) tuple description</a></td>
</tr>
<tr>
<td bgcolor=#f0f0f0>&nbsp;4.</td>
<td bgcolor=#f0f0f0>&nbsp;<a href="info_block.html">Online userinfo block description</a></td>
</tr>
</table>
</td></tr>
</table>

<br>

<table width=640 cellSpacing=0 cellPadding=0 border=0>
<tr>
<td>

<table width=640 bgcolor=darkblue cellSpacing=0 cellPadding=0 border=0><tr><td>
<table width=100% cellSpacing=2 cellPadding=0 border=0><tr><td  bgcolor=#E9E9E9 >
<table width=100% cellSpacing=0 cellPadding=0 bgcolor="#4040FF" border=0>
<tr>
<td><b><font size=2 color="white">&nbsp;<a name="b0001"></a>FLAP transport (version 1.0)&nbsp;</font></b></td>
</tr>
</table>
</td></tr>

<tr><td  bgcolor=#E9E9E9 >
<table width=100% cellSpacing=0 cellPadding=0 border=0>
<tr><td width=5>&nbsp;</td>
<td><br>
&nbsp;&nbsp;&nbsp;&nbsp;
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:<br><br>

<table width=100% cellSpacing=0 cellPadding=0 align=center border=0>
<tr><td width=20></td>
<td>
<table width=400 bgcolor=darkgreen cellSpacing=0 cellPadding=0 border=0><tr><td>
<table width=100% cellSpacing=2 cellPadding=0 border=0><tr><td  bgcolor=#fafafa >
<table width=400 cellSpacing=0 cellPadding=0 align=center border=0>
<tr>
<td width=20%>&nbsp;2A</td>
<td width=5>&nbsp;</td>
<td width=20%>byte</td>
<td width=5>&nbsp;</td>
<td width=65%>FLAP id byte</td>
</tr>
<tr>
<td>&nbsp;xx</td>
<td>&nbsp;</td>
<td>byte</td>
<td>&nbsp;</td>
<td>FLAP channel</td>
</tr>
<tr>
<td>&nbsp;xx xx</td>
<td>&nbsp;</td>
<td>word</td>
<td>&nbsp;</td>
<td>FLAP datagram seq number</td>
</tr>
<tr>
<td>&nbsp;xx xx</td>
<td>&nbsp;</td>
<td>word</td>
<td>&nbsp;</td>
<td>FLAP data size</td>
</tr>
</table>

</td></tr>
<tr><td  bgcolor=#fafafa >

<table width=400 cellSpacing=0 cellPadding=0 align=center border=0>
<tr><td height=8 colspan=3></td></tr>
<tr><td width=50> </td>
<td>

<table width=350 bgcolor=darkred cellSpacing=0 cellPadding=0 border=0><tr><td>
<table width=100% cellSpacing=2 cellPadding=0 align=center border=0><tr><td  bgcolor=#fafafa >

<table width=350 cellSpacing=0 cellPadding=0 align=center border=0>
<tr>
<td height=50 align=center valign=middle>&nbsp;......</td>
<td valign=middle width=65%>FLAP data</td>
</tr>
</table>

</td></tr>
</table>
</td></tr></table>

</td><td width=5> </td>
</tr>
<tr><td height=5 colspan=3> </td></tr>
</table>

</td></tr>
</table>
</td></tr></table>
</td></tr>
</table>
<br>

&nbsp;&nbsp;&nbsp;&nbsp;
FLAP id byte is always 0x2A. It is frame-start sign.<br><br>
	
&nbsp;&nbsp;&nbsp;&nbsp;
The flap sequence numbers used for errors detection. So server can detect problem 
when client set flap data size field = 10 and write 20 bytes 0x2A as data. The flap 
sequence number origins are picked quite randomly. There is no connection between 
the sequence number set from the server and the set from the client. Sequence numbers are 
always incremented upward (towards 0x8000) for each command sent. If the sequence number 
does reach 0x8000, it will wrap to 0x0000, for obvious reasons. If you start a new connection, 
it is recommended that a new sequence number origin is picked for that connection, for purposes 
of internal coherency. Sequence numbers are independent of channels: there's a single series 
of sequence numbers per TCP connection (per socket).<br><br>

&nbsp;&nbsp;&nbsp;&nbsp;
Channels are the method used to multiplex separate paths of communication across the same 
TCP socket. These are analogous to TCP/UDP port numbers. Five channels are currently used 
by OSCAR: 
<ul>
<li><b>0x01</b> - New Connection Negotiation </li>
<li><b>0x02</b> - <a href="basic.html#b0002">SNAC</a> data</li>
<li><b>0x03</b> - FLAP-level Error </li>
<li><b>0x04</b> - Close Connection Negotiation </li>
<li><b>0x05</b> - Keep alive</li>
</ul>

&nbsp;&nbsp;&nbsp;&nbsp;
After a new connection (socket) is set up using channel 0x01, data should only be carried 
on channel 0x02, until a low-level FLAP error occurs (channel 0x03) or there is planned 
termination, which gets "negotiated" (on channel 0x04). Most live events processed during 
the lifespan of the client are done over channel 0x02. <b><a href="basic.html#b0002">SNACs</a> are 
never transmitted on any channel other than 0x02</b><br><br>

&nbsp;&nbsp;&nbsp;&nbsp;
The best way to read an incoming FLAP command is to first read only the starting 6 bytes 
(the FLAP headers). From these 6bytes, you can determine how many more bytes you need to 
read to complete the command, and how much memory you need to allocate to store it. Never 
read more or less than the number of bytes specified in the FLAP headers, or your read will 
result in a truncated or uninterpretable command. (If you read too much, you will probably 
end up reading the start of the next command, which is bad. Lost data is unacceptable in 
the AIM standard.)<br><br>

&nbsp;&nbsp;&nbsp;&nbsp;
Because every command must follow FLAP guidelines, I'd recommend using a low-level routine 
to add the FLAP headers (normally, this will be the "flush transmit queue" routine, so that 
addition of sequence numbers and the rest of the FLAP headers is done as close timewise as 
possible to the command being put on the wire). This is the best way to prevent out-of-order 
seqnums from getting used (which, as stated earlier, is quite fatal). <br><br>

</td>
<td width=5></td></tr>
</table>
</td></tr>
</table>
</td></tr></table>

</td>
</tr>
</table>

<br>

<table width=640 cellSpacing=0 cellPadding=0 border=0>
<tr>
<td>

<table width=640 bgcolor=darkblue cellSpacing=0 cellPadding=0 border=0><tr><td>
<table width=100% cellSpacing=2 cellPadding=0 border=0><tr><td  bgcolor=#E9E9E9 >
<table width=100% cellSpacing=0 cellPadding=0 bgcolor="#4040FF" border=0>
<tr>
<td><b><font size=2 color="white">&nbsp;<a name="b0002"></a>SNAC format description&nbsp;</font></b></td>
</tr>
</table>
</td></tr>

<tr><td  bgcolor=#E9E9E9 >
<table width=100% cellSpacing=0 cellPadding=0 border=0>
<tr><td width=5>&nbsp;</td>
<td><br>
&nbsp;&nbsp;&nbsp;&nbsp;
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:<br><br>

<table width=100% cellSpacing=0 cellPadding=0 align=center border=0>
<tr><td width=20></td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -