首页 | 数据结构 | 文件列表 | 数据字段 | 全局定义

packet_parse.h

浏览该文件的文档。
00001 
00023 // START OF FILE
00024 /*****************************************************************************/
00025 #ifndef _QQ_PACKET_PARSE_H_
00026 #define _QQ_PACKED_PARSE_H_
00027 
00028 #include <glib.h>
00029 
00030 /* According to "UNIX Network Programming", all TCP/IP implementations
00031  * must support a minimum IP datagram size of 576 bytes, regardless of the MTU.
00032  * Assuming a 20 byte IP header and 8 byte UDP header, this leaves 548 bytes 
00033  * as a safe maximum size for UDP messages.
00034  *
00035  * TCP allows packet 64K
00036  */
00037 #define MAX_PACKET_SIZE 65535
00038 
00039 gint read_packet_b(guint8 * buf, guint8 ** cursor, gint buflen, guint8 * b);
00040 gint read_packet_w(guint8 * buf, guint8 ** cursor, gint buflen, guint16 * w);
00041 gint read_packet_dw(guint8 * buf, guint8 ** cursor, gint buflen, guint32 * dw);
00042 gint read_packet_data(guint8 * buf, guint8 ** cursor, gint buflen, guint8 * data, gint datalen);
00043 gint create_packet_b(guint8 * buf, guint8 ** cursor, guint8 b);
00044 gint create_packet_w(guint8 * buf, guint8 ** cursor, guint16 w);
00045 gint create_packet_dw(guint8 * buf, guint8 ** cursor, guint32 dw);
00046 gint create_packet_data(guint8 * buf, guint8 ** cursor, guint8 * data, gint datalen);
00047 
00048 #endif
00049 /*****************************************************************************/
00050 // END OF FILE

Generated at Mon May 8 15:41:24 2006 for OpenQ by  doxygen 1.4.4