You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ipmsg.h 5.5 kB

8 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. #ifndef IPMSG_H
  2. #define IPMSG_H
  3. #define IPMSG_PORT 2425
  4. /* command */
  5. #define IPMSG_NOOPERATION 0x00000000
  6. #define IPMSG_BR_ENTRY 0x00000001 //用户上线
  7. #define IPMSG_BR_EXIT 0x00000002//用户下线
  8. #define IPMSG_ANSENTRY 0x00000003//通报在线,回复【用户上线】
  9. #define IPMSG_BR_ABSENCE 0x00000004//通报离线模式取消或用户名变更
  10. //下面这组不知道干嘛的
  11. #define IPMSG_BR_ISGETLIST 0x00000010
  12. #define IPMSG_OKGETLIST 0x00000011
  13. #define IPMSG_GETLIST 0x00000012
  14. #define IPMSG_ANSLIST 0x00000013
  15. #define IPMSG_BR_ISGETLIST2 0x00000018
  16. #define IPMSG_SENDMSG 0x00000020//发送一条消息,如果发送者不认识,发送IPMSG_BR_ENTRY,但如果标记了IPMSG_NOADDLISTOPT,放过他
  17. #define IPMSG_RECVMSG 0x00000021//通知消息已经接收,仅当设置IPMSG_SENDCHECKOPT,附加区写入原始包序号
  18. #define IPMSG_READMSG 0x00000030//响应IPMSG_SECRETOPT+SENDMSG,附加区写入原始包序号
  19. #define IPMSG_DELMSG 0x00000031//?
  20. #define IPMSG_ANSREADMSG 0x00000032//响应READMSG+READCHECKOPT
  21. #define IPMSG_GETINFO 0x00000040//请求ipmsg协议版本
  22. #define IPMSG_SENDINFO 0x00000041//发送ipmsg协议版本
  23. #define IPMSG_GETABSENCEINFO 0x00000050//请问你离线了吗?
  24. #define IPMSG_SENDABSENCEINFO 0x00000051//对啊,离线;Not absence mode没离线
  25. #define IPMSG_GETFILEDATA 0x00000060
  26. #define IPMSG_RELEASEFILES 0x00000061
  27. #define IPMSG_GETDIRFILES 0x00000062
  28. #define IPMSG_GETPUBKEY 0x00000072
  29. #define IPMSG_ANSPUBKEY 0x00000073
  30. //飞秋的扩展协议
  31. #define IPMSG_OPEN_YOU 0x00000077//no extra
  32. #define IPMSG_INPUTING 0x00000079//no extra。发送完消息也会跟一条,并且没有7a,why?
  33. #define IPMSG_INPUT_END 0x0000007a//no extra
  34. #define IPMSG_KNOCK 0x000000d1//窗口抖动
  35. #define IPMSG_SENDIMAGE 0x000000c0//发送图片
  36. /* option for all command */
  37. #define IPMSG_ABSENCEOPT 0x00000100
  38. #define IPMSG_SERVEROPT 0x00000200
  39. #define IPMSG_DIALUPOPT 0x00010000
  40. #define IPMSG_FILEATTACHOPT 0x00200000
  41. #define IPMSG_ENCRYPTOPT 0x00400000
  42. #define IPMSG_UTF8OPT 0x00800000
  43. /* option for send command */
  44. #define IPMSG_SENDCHECKOPT 0x00000100
  45. #define IPMSG_SECRETOPT 0x00000200
  46. #define IPMSG_BROADCASTOPT 0x00000400
  47. #define IPMSG_MULTICASTOPT 0x00000800
  48. #define IPMSG_NOPOPUPOPT 0x00001000
  49. #define IPMSG_AUTORETOPT 0x00002000
  50. #define IPMSG_RETRYOPT 0x00004000
  51. #define IPMSG_PASSWORDOPT 0x00008000
  52. #define IPMSG_NOLOGOPT 0x00020000
  53. #define IPMSG_NEWMUTIOPT 0x00040000
  54. #define IPMSG_NOADDLISTOPT 0x00080000
  55. #define IPMSG_READCHECKOPT 0x00100000
  56. #define IPMSG_SECRETEXOPT (IPMSG_READCHECKOPT | IPMSG_SECRETOPT)
  57. #define IPMSG_NO_REPLY_OPTS (IPMSG_BROADCASTOPT | IPMSG_AUTORETOPT)
  58. /* encryption flags for encrypt command */
  59. #define IPMSG_RSA_512 0x00000001
  60. #define IPMSG_RSA_1024 0x00000002
  61. #define IPMSG_RSA_2048 0x00000004
  62. #define IPMSG_RC2_40 0x00001000
  63. #define IPMSG_RC2_128 0x00004000
  64. #define IPMSG_RC2_256 0x00008000
  65. #define IPMSG_BLOWFISH_128 0x00020000
  66. #define IPMSG_BLOWFISH_256 0x00040000
  67. #define IPMSG_AES_128 0x00100000
  68. #define IPMSG_AES_192 0x00200000
  69. #define IPMSG_AES_256 0x00400000
  70. #define IPMSG_SIGN_STAMPOPT 0x01000000
  71. #define IPMSG_SIGN_MD5 0x10000000
  72. #define IPMSG_SIGN_SHA1 0x20000000
  73. /* compatibilty for Win beta version */
  74. #define IPMSG_RC2_40OLD 0x00000010 // for beta1-4 only
  75. #define IPMSG_RC2_128OLD 0x00000040 // for beta1-4 only
  76. #define IPMSG_BLOWFISH_128OLD 0x00000400 // for beta1-4 only
  77. #define IPMSG_RC2_40ALL (IPMSG_RC2_40 | IPMSG_RC2_40OLD)
  78. #define IPMSG_RC2_128ALL (IPMSG_RC2_128 | IPMSG_RC2_128OLD)
  79. #define IPMSG_BLOWFISH_128ALL (IPMSG_BLOWFISH_128 | IPMSG_BLOWFISH_128OLD)
  80. /* file types for fileattach command */
  81. #define IPMSG_FILE_REGULAR 0x00000001
  82. #define IPMSG_FILE_DIR 0x00000002
  83. #define IPMSG_FILE_RETPARENT 0x00000003 // return parent directory
  84. #define IPMSG_FILE_SYMLINK 0x00000004
  85. #define IPMSG_FILE_CDEV 0x00000005 // for UNIX
  86. #define IPMSG_FILE_BDEV 0x00000006 // for UNIX
  87. #define IPMSG_FILE_FIFO 0x00000007 // for UNIX
  88. #define IPMSG_FILE_RESFORK 0x00000010 // for Mac
  89. /* file attribute options for fileattach command */
  90. #define IPMSG_FILE_RONLYOPT 0x00000100
  91. #define IPMSG_FILE_HIDDENOPT 0x00001000
  92. #define IPMSG_FILE_EXHIDDENOPT 0x00002000 // for MacOS X
  93. #define IPMSG_FILE_ARCHIVEOPT 0x00004000
  94. #define IPMSG_FILE_SYSTEMOPT 0x00008000
  95. /* extend attribute types for fileattach command */
  96. #define IPMSG_FILE_UID 0x00000001
  97. #define IPMSG_FILE_USERNAME 0x00000002 // uid by string
  98. #define IPMSG_FILE_GID 0x00000003
  99. #define IPMSG_FILE_GROUPNAME 0x00000004 // gid by string
  100. #define IPMSG_FILE_PERM 0x00000010 // for UNIX
  101. #define IPMSG_FILE_MAJORNO 0x00000011 // for UNIX devfile
  102. #define IPMSG_FILE_MINORNO 0x00000012 // for UNIX devfile
  103. #define IPMSG_FILE_CTIME 0x00000013 // for UNIX
  104. #define IPMSG_FILE_MTIME 0x00000014
  105. #define IPMSG_FILE_ATIME 0x00000015
  106. #define IPMSG_FILE_CREATETIME 0x00000016
  107. #define IPMSG_FILE_CREATOR 0x00000020 // for Mac
  108. #define IPMSG_FILE_FILETYPE 0x00000021 // for Mac
  109. #define IPMSG_FILE_FINDERINFO 0x00000022 // for Mac
  110. #define IPMSG_FILE_ACL 0x00000030
  111. #define IPMSG_FILE_ALIASFNAME 0x00000040 // alias fname
  112. #define IPMSG_FILE_UNICODEFNAME 0x00000041 // UNICODE fname
  113. #define FILELIST_SEPARATOR (char)0x7
  114. #define HOSTLIST_DUMMY (char)0x8
  115. #define HLIST_ENTRY_SEPARATOR (char)0x3a
  116. #define IS_CMD_SET(cmd, test) (((cmd) & 0xFF) == test)
  117. #define IS_OPT_SET(cmd, opt) (((cmd) & opt) == opt)
  118. #endif // IPMSG_H

mac下的“飞秋”大多数只是飞鸽传书协议,而且未发现令人满意的开源项目,所以基于c++与qt实现了基础的飞秋协议。

Contributors (1)