snacs.go 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102
  1. package wire
  2. import (
  3. "bytes"
  4. "errors"
  5. )
  6. // ErrUnsupportedFoodGroup indicates that a foodgroup value is either invalid
  7. // or unsupported by a method.
  8. var ErrUnsupportedFoodGroup = errors.New("foodgroup is unsupported")
  9. //
  10. // Food Group Codes
  11. //
  12. const (
  13. OService uint16 = 0x0001
  14. Locate uint16 = 0x0002
  15. Buddy uint16 = 0x0003
  16. ICBM uint16 = 0x0004
  17. Advert uint16 = 0x0005
  18. Invite uint16 = 0x0006
  19. Admin uint16 = 0x0007
  20. Popup uint16 = 0x0008
  21. PermitDeny uint16 = 0x0009
  22. UserLookup uint16 = 0x000A
  23. Stats uint16 = 0x000B
  24. Translate uint16 = 0x000C
  25. ChatNav uint16 = 0x000D
  26. Chat uint16 = 0x000E
  27. ODir uint16 = 0x000F
  28. BART uint16 = 0x0010
  29. Feedbag uint16 = 0x0013
  30. ICQ uint16 = 0x0015
  31. BUCP uint16 = 0x0017
  32. Alert uint16 = 0x0018
  33. Plugin uint16 = 0x0022
  34. UnnamedFG24 uint16 = 0x0024
  35. MDir uint16 = 0x0025
  36. ARS uint16 = 0x044A
  37. )
  38. //
  39. // General Error Codes
  40. //
  41. const (
  42. ErrorCodeInvalidSnac uint16 = 0x01
  43. ErrorCodeRateToHost uint16 = 0x02
  44. ErrorCodeRateToClient uint16 = 0x03
  45. ErrorCodeNotLoggedOn uint16 = 0x04
  46. ErrorCodeServiceUnavailable uint16 = 0x05
  47. ErrorCodeServiceNotDefined uint16 = 0x06
  48. ErrorCodeObsoleteSnac uint16 = 0x07
  49. ErrorCodeNotSupportedByHost uint16 = 0x08
  50. ErrorCodeNotSupportedByClient uint16 = 0x09
  51. ErrorCodeRefusedByClient uint16 = 0x0A
  52. ErrorCodeReplyTooBig uint16 = 0x0B
  53. ErrorCodeResponsesLost uint16 = 0x0C
  54. ErrorCodeRequestDenied uint16 = 0x0D
  55. ErrorCodeBustedSnacPayload uint16 = 0x0E
  56. ErrorCodeInsufficientRights uint16 = 0x0F
  57. ErrorCodeInLocalPermitDeny uint16 = 0x10
  58. ErrorCodeTooEvilSender uint16 = 0x11
  59. ErrorCodeTooEvilReceiver uint16 = 0x12
  60. ErrorCodeUserTempUnavail uint16 = 0x13
  61. ErrorCodeNoMatch uint16 = 0x14
  62. ErrorCodeListOverflow uint16 = 0x15
  63. ErrorCodeRequestAmbigous uint16 = 0x16
  64. ErrorCodeQueueFull uint16 = 0x17
  65. ErrorCodeNotWhileOnAol uint16 = 0x18
  66. ErrorCodeQueryFail uint16 = 0x19
  67. ErrorCodeTimeout uint16 = 0x1A
  68. ErrorCodeErrorText uint16 = 0x1B
  69. ErrorCodeGeneralFailure uint16 = 0x1C
  70. ErrorCodeProgress uint16 = 0x1D
  71. ErrorCodeInFreeArea uint16 = 0x1E
  72. ErrorCodeRestrictedByPc uint16 = 0x1F
  73. ErrorCodeRemoteRestrictedByPc uint16 = 0x20
  74. )
  75. //
  76. // Authentication
  77. //
  78. const (
  79. LoginTLVTagsScreenName uint16 = 0x01
  80. LoginTLVTagsRoastedPassword uint16 = 0x02
  81. LoginTLVTagsReconnectHere uint16 = 0x05
  82. LoginTLVTagsAuthorizationCookie uint16 = 0x06
  83. LoginTLVTagsErrorSubcode uint16 = 0x08
  84. LoginTLVTagsPasswordHash uint16 = 0x25
  85. )
  86. const (
  87. LoginErrInvalidUsernameOrPassword uint16 = 0x01
  88. )
  89. //
  90. // 0x01: OService
  91. //
  92. const (
  93. OServiceErr uint16 = 0x0001
  94. OServiceClientOnline uint16 = 0x0002
  95. OServiceHostOnline uint16 = 0x0003
  96. OServiceServiceRequest uint16 = 0x0004
  97. OServiceServiceResponse uint16 = 0x0005
  98. OServiceRateParamsQuery uint16 = 0x0006
  99. OServiceRateParamsReply uint16 = 0x0007
  100. OServiceRateParamsSubAdd uint16 = 0x0008
  101. OServiceRateDelParamSub uint16 = 0x0009
  102. OServiceRateParamChange uint16 = 0x000A
  103. OServicePauseReq uint16 = 0x000B
  104. OServicePauseAck uint16 = 0x000C
  105. OServiceResume uint16 = 0x000D
  106. OServiceUserInfoQuery uint16 = 0x000E
  107. OServiceUserInfoUpdate uint16 = 0x000F
  108. OServiceEvilNotification uint16 = 0x0010
  109. OServiceIdleNotification uint16 = 0x0011
  110. OServiceMigrateGroups uint16 = 0x0012
  111. OServiceMotd uint16 = 0x0013
  112. OServiceSetPrivacyFlags uint16 = 0x0014
  113. OServiceWellKnownUrls uint16 = 0x0015
  114. OServiceNoop uint16 = 0x0016
  115. OServiceClientVersions uint16 = 0x0017
  116. OServiceHostVersions uint16 = 0x0018
  117. OServiceMaxConfigQuery uint16 = 0x0019
  118. OServiceMaxConfigReply uint16 = 0x001A
  119. OServiceStoreConfig uint16 = 0x001B
  120. OServiceConfigQuery uint16 = 0x001C
  121. OServiceConfigReply uint16 = 0x001D
  122. OServiceSetUserInfoFields uint16 = 0x001E
  123. OServiceProbeReq uint16 = 0x001F
  124. OServiceProbeAck uint16 = 0x0020
  125. OServiceBartReply uint16 = 0x0021
  126. OServiceBartQuery2 uint16 = 0x0022
  127. OServiceBartReply2 uint16 = 0x0023
  128. OServiceUserInfoUserFlags uint16 = 0x01
  129. OServiceUserInfoSignonTOD uint16 = 0x03
  130. OServiceUserInfoIdleTime uint16 = 0x04
  131. OServiceUserInfoStatus uint16 = 0x06
  132. OServiceUserInfoOscarCaps uint16 = 0x0D
  133. OServiceUserInfoBARTInfo uint16 = 0x1D
  134. OServiceUserFlagOSCARFree uint32 = 0x00000010 // AIM (not AOL) account
  135. OServiceUserFlagNormal uint32 = 0x00000000 // user is normal
  136. OServiceUserFlagAway uint32 = 0x00000001 // user is also away
  137. OServiceUserFlagDND uint32 = 0x00000002 // don't disturb user
  138. OServiceUserFlagOut uint32 = 0x00000004 // user is not available
  139. OServiceUserFlagBusy uint32 = 0x00000010 // user is busy
  140. OServiceUserFlagInvisible uint32 = 0x00000100 // user is invisible
  141. OServiceUserFlagUnavailable uint32 = 0x00000020 // user is away
  142. OServiceUserFlagEvil uint32 = 0x00003000 // user is evil
  143. OServiceUserFlagDepression uint32 = 0x00004000 // user is having a depression :(
  144. OServiceUserFlagAtHome uint32 = 0x00005000 // user is at home
  145. OServiceUserFlagAtWork uint32 = 0x00006000 // user is at work
  146. OServiceUserFlagLunch uint32 = 0x00002001 // user is having a lunch
  147. OServiceUserFlagBirthday uint32 = 0x00080000 // user is having a birthday :DDD
  148. OServicePrivacyFlagIdle uint32 = 0x00000001
  149. OServicePrivacyFlagMember uint32 = 0x00000002
  150. OServiceStatusWebAware uint32 = 0x00010000
  151. OServiceStatusHideIP uint32 = 0x00020000
  152. OServiceStatusICQHomePage uint32 = 0x00200000
  153. OServiceStatusDirectRequireAuth uint32 = 0x10000000
  154. OServiceTLVTagsReconnectHere uint16 = 0x05
  155. OServiceTLVTagsLoginCookie uint16 = 0x06
  156. OServiceTLVTagsGroupID uint16 = 0x0D
  157. OServiceTLVTagsSSLCertName uint16 = 0x8D
  158. OServiceTLVTagsSSLState uint16 = 0x8E
  159. )
  160. type SNAC_0x01_0x02_OServiceClientOnline struct {
  161. GroupVersions []struct {
  162. FoodGroup uint16
  163. Version uint16
  164. ToolID uint16
  165. ToolVersion uint16
  166. }
  167. }
  168. type SNAC_0x01_0x03_OServiceHostOnline struct {
  169. FoodGroups []uint16
  170. }
  171. type SNAC_0x01_0x04_OServiceServiceRequest struct {
  172. FoodGroup uint16
  173. TLVRestBlock
  174. }
  175. type SNAC_0x01_0x04_TLVRoomInfo struct {
  176. Exchange uint16
  177. Cookie string `len_prefix:"uint8"`
  178. InstanceNumber uint16
  179. }
  180. type SNAC_0x01_0x05_OServiceServiceResponse struct {
  181. TLVRestBlock
  182. }
  183. // SNAC_0x01_0x07_OServiceRateParamsReply contains rate limits for rate classes and groups.
  184. //
  185. // Rate Classes:
  186. // - ID: Unique identifier for the rate class.
  187. // - WindowSize: The number of previously sent commands included in calculating
  188. // the current "rate average."
  189. // - ClearLevel: The threshold the average must reach to clear a rate limit.
  190. // - AlertLevel: The threshold for triggering an alert that tells the client
  191. // that it's getting close to the limit.
  192. // - LimitLevel: SNACs will be dropped if the rate falls below this value.
  193. // - DisconnectLevel: Server will disconnect if the rate falls below this value.
  194. // - CurrentLevel: The current value for the class; higher values are preferable.
  195. // Represents the current "rate average," resembling a moving average of the
  196. // times between each of the last WindowSize commands.
  197. // - MaxLevel: The maximum rate value; if the current value surpasses this,
  198. // it should be reset. The upper limit for a rate average.
  199. // - LastTime: Time elapsed since the last message was received by the server.
  200. // - CurrentState: Indicates whether the server is dropping SNACs for this rate class.
  201. //
  202. // Rate Groups:
  203. // - ID: Unique identifier for the rate group.
  204. // - Pairs: List of SNAC types associated with the rate group, including FoodGroup
  205. // (e.g., wire.ICBM) and SubGroup (e.g., wire.ICBMChannelMsgToHost).
  206. type SNAC_0x01_0x07_OServiceRateParamsReply struct {
  207. RateClasses []struct {
  208. ID uint16
  209. WindowSize uint32
  210. ClearLevel uint32
  211. AlertLevel uint32
  212. LimitLevel uint32
  213. DisconnectLevel uint32
  214. CurrentLevel uint32
  215. MaxLevel uint32
  216. LastTime uint32
  217. CurrentState uint8
  218. } `count_prefix:"uint16"`
  219. RateGroups []struct {
  220. ID uint16
  221. Pairs []struct {
  222. FoodGroup uint16
  223. SubGroup uint16
  224. } `count_prefix:"uint16"`
  225. }
  226. }
  227. type SNAC_0x01_0x08_OServiceRateParamsSubAdd struct {
  228. TLVRestBlock
  229. }
  230. type SNAC_0x01_0x0F_OServiceUserInfoUpdate struct {
  231. TLVUserInfo
  232. }
  233. type SNAC_0x01_0x10_OServiceEvilNotification struct {
  234. NewEvil uint16
  235. TLVUserInfo
  236. }
  237. type SNAC_0x01_0x10_OServiceEvilNotificationAnon struct {
  238. NewEvil uint16
  239. }
  240. type SNAC_0x01_0x11_OServiceIdleNotification struct {
  241. IdleTime uint32
  242. }
  243. type SNAC_0x01_0x14_OServiceSetPrivacyFlags struct {
  244. PrivacyFlags uint32
  245. }
  246. // IdleFlag returns whether other AIM users can see how long the user has been
  247. // idle.
  248. func (s SNAC_0x01_0x14_OServiceSetPrivacyFlags) IdleFlag() bool {
  249. return s.PrivacyFlags&OServicePrivacyFlagIdle == OServicePrivacyFlagIdle
  250. }
  251. // MemberFlag returns whether other AIM users can see how long the user has been
  252. // a member.
  253. func (s SNAC_0x01_0x14_OServiceSetPrivacyFlags) MemberFlag() bool {
  254. return s.PrivacyFlags&OServicePrivacyFlagMember == OServicePrivacyFlagMember
  255. }
  256. type SNAC_0x01_0x17_OServiceClientVersions struct {
  257. Versions []uint16
  258. }
  259. type SNAC_0x01_0x18_OServiceHostVersions struct {
  260. Versions []uint16
  261. }
  262. type SNAC_0x01_0x1E_OServiceSetUserInfoFields struct {
  263. TLVRestBlock
  264. }
  265. type SNAC_0x01_0x21_OServiceBARTReply struct {
  266. BARTID
  267. }
  268. //
  269. // 0x02: Locate
  270. //
  271. const (
  272. LocateErr uint16 = 0x0001
  273. LocateRightsQuery uint16 = 0x0002
  274. LocateRightsReply uint16 = 0x0003
  275. LocateSetInfo uint16 = 0x0004
  276. LocateUserInfoQuery uint16 = 0x0005
  277. LocateUserInfoReply uint16 = 0x0006
  278. LocateWatcherSubRequest uint16 = 0x0007
  279. LocateWatcherNotification uint16 = 0x0008
  280. LocateSetDirInfo uint16 = 0x0009
  281. LocateSetDirReply uint16 = 0x000A
  282. LocateGetDirInfo uint16 = 0x000B
  283. LocateGetDirReply uint16 = 0x000C
  284. LocateGroupCapabilityQuery uint16 = 0x000D
  285. LocateGroupCapabilityReply uint16 = 0x000E
  286. LocateSetKeywordInfo uint16 = 0x000F
  287. LocateSetKeywordReply uint16 = 0x0010
  288. LocateGetKeywordInfo uint16 = 0x0011
  289. LocateGetKeywordReply uint16 = 0x0012
  290. LocateFindListByEmail uint16 = 0x0013
  291. LocateFindListReply uint16 = 0x0014
  292. LocateUserInfoQuery2 uint16 = 0x0015
  293. LocateTypeSig uint32 = 0x00000001
  294. LocateTypeUnavailable uint32 = 0x00000002
  295. LocateTypeCapabilities uint32 = 0x00000004
  296. LocateTypeCerts uint32 = 0x00000008
  297. LocateTypeHtmlInfo uint32 = 0x00000400
  298. LocateTLVTagsInfoSigMime uint16 = 0x01
  299. LocateTLVTagsInfoSigData uint16 = 0x02
  300. LocateTLVTagsInfoUnavailableMime uint16 = 0x03
  301. LocateTLVTagsInfoUnavailableData uint16 = 0x04
  302. LocateTLVTagsInfoCapabilities uint16 = 0x05
  303. LocateTLVTagsInfoCerts uint16 = 0x06
  304. LocateTLVTagsInfoSigTime uint16 = 0x0A
  305. LocateTLVTagsInfoUnavailableTime uint16 = 0x0B
  306. LocateTLVTagsInfoSupportHostSig uint16 = 0x0C
  307. LocateTLVTagsInfoHtmlInfoData uint16 = 0x0E
  308. LocateTLVTagsInfoHtmlInfoType uint16 = 0x0D
  309. // LocateTLVTagsRightsMaxSigLen is the max signature length
  310. LocateTLVTagsRightsMaxSigLen uint16 = 0x01
  311. // LocateTLVTagsRightsMaxCapabilitiesLen is the max allowed # of full UUID capabilities
  312. LocateTLVTagsRightsMaxCapabilitiesLen uint16 = 0x02
  313. // LocateTLVTagsRightsMaxFindByEmailList is the maximum # of email addresses to look up at once
  314. LocateTLVTagsRightsMaxFindByEmailList uint16 = 0x03
  315. // LocateTLVTagsRightsMaxCertsLen is the largest CERT length for e2e crypto
  316. LocateTLVTagsRightsMaxCertsLen uint16 = 0x04
  317. // LocateTLVTagsRightsMaxMaxShortCapabilities is the max allowed # of short UUID capabilities allowed
  318. LocateTLVTagsRightsMaxMaxShortCapabilities uint16 = 0x05
  319. )
  320. type SNAC_0x02_0x03_LocateRightsReply struct {
  321. TLVRestBlock
  322. }
  323. type SNAC_0x02_0x04_LocateSetInfo struct {
  324. TLVRestBlock
  325. }
  326. type SNAC_0x02_0x06_LocateUserInfoReply struct {
  327. TLVUserInfo
  328. LocateInfo TLVRestBlock
  329. }
  330. type SNAC_0x02_0x09_LocateSetDirInfo struct {
  331. TLVRestBlock
  332. }
  333. type SNAC_0x02_0x0A_LocateSetDirReply struct {
  334. Result uint16
  335. }
  336. type SNAC_0x02_0x0B_LocateGetDirInfo struct {
  337. WatcherScreenNames string `len_prefix:"uint8"`
  338. }
  339. type SNAC_0x02_0x0F_LocateSetKeywordInfo struct {
  340. TLVRestBlock
  341. }
  342. type SNAC_0x02_0x10_LocateSetKeywordReply struct {
  343. // Unknown is a field whose purpose is not known
  344. Unknown uint16
  345. }
  346. type SNAC_0x02_0x05_LocateUserInfoQuery struct {
  347. Type uint16
  348. ScreenName string `len_prefix:"uint8"`
  349. }
  350. func (s SNAC_0x02_0x05_LocateUserInfoQuery) RequestProfile() bool {
  351. return s.Type&uint16(LocateTypeSig) == uint16(LocateTypeSig)
  352. }
  353. func (s SNAC_0x02_0x05_LocateUserInfoQuery) RequestAwayMessage() bool {
  354. return s.Type&uint16(LocateTypeUnavailable) == uint16(LocateTypeUnavailable)
  355. }
  356. type SNAC_0x02_0x15_LocateUserInfoQuery2 struct {
  357. Type2 uint32
  358. ScreenName string `len_prefix:"uint8"`
  359. }
  360. //
  361. // 0x03: Buddy
  362. //
  363. const (
  364. BuddyErr uint16 = 0x0001
  365. BuddyRightsQuery uint16 = 0x0002
  366. BuddyRightsReply uint16 = 0x0003
  367. BuddyAddBuddies uint16 = 0x0004
  368. BuddyDelBuddies uint16 = 0x0005
  369. BuddyWatcherListQuery uint16 = 0x0006
  370. BuddyWatcherListResponse uint16 = 0x0007
  371. BuddyWatcherSubRequest uint16 = 0x0008
  372. BuddyWatcherNotification uint16 = 0x0009
  373. BuddyRejectNotification uint16 = 0x000A
  374. BuddyArrived uint16 = 0x000B
  375. BuddyDeparted uint16 = 0x000C
  376. BuddyAddTempBuddies uint16 = 0x000F
  377. BuddyDelTempBuddies uint16 = 0x0010
  378. BuddyTLVTagsParmMaxBuddies uint16 = 0x01
  379. BuddyTLVTagsParmMaxWatchers uint16 = 0x02
  380. BuddyTLVTagsParmMaxIcqBroad uint16 = 0x03
  381. BuddyTLVTagsParmMaxTempBuddies uint16 = 0x04
  382. )
  383. type SNAC_0x03_0x02_BuddyRightsQuery struct {
  384. TLVRestBlock
  385. }
  386. type SNAC_0x03_0x03_BuddyRightsReply struct {
  387. TLVRestBlock
  388. }
  389. type SNAC_0x03_0x04_BuddyAddBuddies struct {
  390. Buddies []struct {
  391. ScreenName string `len_prefix:"uint8"`
  392. }
  393. }
  394. type SNAC_0x03_0x05_BuddyDelBuddies struct {
  395. Buddies []struct {
  396. ScreenName string `len_prefix:"uint8"`
  397. }
  398. }
  399. type SNAC_0x03_0x0B_BuddyArrived struct {
  400. TLVUserInfo
  401. }
  402. type SNAC_0x03_0x0C_BuddyDeparted struct {
  403. TLVUserInfo
  404. }
  405. //
  406. // 0x04: ICBM
  407. //
  408. const (
  409. ICBMErr uint16 = 0x0001
  410. ICBMAddParameters uint16 = 0x0002
  411. ICBMDelParameters uint16 = 0x0003
  412. ICBMParameterQuery uint16 = 0x0004
  413. ICBMParameterReply uint16 = 0x0005
  414. ICBMChannelMsgToHost uint16 = 0x0006
  415. ICBMChannelMsgToClient uint16 = 0x0007
  416. ICBMEvilRequest uint16 = 0x0008
  417. ICBMEvilReply uint16 = 0x0009
  418. ICBMMissedCalls uint16 = 0x000A
  419. ICBMClientErr uint16 = 0x000B
  420. ICBMHostAck uint16 = 0x000C
  421. ICBMSinStored uint16 = 0x000D
  422. ICBMSinListQuery uint16 = 0x000E
  423. ICBMSinListReply uint16 = 0x000F
  424. ICBMSinRetrieve uint16 = 0x0010
  425. ICBMSinDelete uint16 = 0x0011
  426. ICBMNotifyRequest uint16 = 0x0012
  427. ICBMNotifyReply uint16 = 0x0013
  428. ICBMClientEvent uint16 = 0x0014
  429. ICBMSinReply uint16 = 0x0017
  430. ICBMTLVTagRequestHostAck uint16 = 0x03
  431. ICBMTLVTagsWantEvents uint16 = 0x0B
  432. )
  433. type SNAC_0x04_0x02_ICBMAddParameters struct {
  434. Channel uint16
  435. ICBMFlags uint32
  436. MaxIncomingICBMLen uint16
  437. MaxSourceEvil uint16
  438. MaxDestinationEvil uint16
  439. MinInterICBMInterval uint32
  440. }
  441. type SNAC_0x04_0x05_ICBMParameterReply struct {
  442. MaxSlots uint16
  443. ICBMFlags uint32
  444. MaxIncomingICBMLen uint16
  445. MaxSourceEvil uint16
  446. MaxDestinationEvil uint16
  447. MinInterICBMInterval uint32
  448. }
  449. type SNAC_0x04_0x06_ICBMChannelMsgToHost struct {
  450. Cookie uint64
  451. ChannelID uint16
  452. ScreenName string `len_prefix:"uint8"`
  453. TLVRestBlock
  454. }
  455. type SNAC_0x04_0x07_ICBMChannelMsgToClient struct {
  456. Cookie uint64
  457. ChannelID uint16
  458. TLVUserInfo
  459. TLVRestBlock
  460. }
  461. type SNAC_0x04_0x08_ICBMEvilRequest struct {
  462. SendAs uint16
  463. ScreenName string `len_prefix:"uint8"`
  464. }
  465. type SNAC_0x04_0x09_ICBMEvilReply struct {
  466. EvilDeltaApplied uint16
  467. UpdatedEvilValue uint16
  468. }
  469. type SNAC_0x04_0x0B_ICBMClientErr struct {
  470. Cookie uint64
  471. ChannelID uint16
  472. ScreenName string `len_prefix:"uint8"`
  473. Code uint16
  474. ErrInfo []byte
  475. }
  476. type SNAC_0x04_0x0C_ICBMHostAck struct {
  477. Cookie uint64
  478. ChannelID uint16
  479. ScreenName string `len_prefix:"uint8"`
  480. }
  481. type SNAC_0x04_0x14_ICBMClientEvent struct {
  482. Cookie uint64
  483. ChannelID uint16
  484. ScreenName string `len_prefix:"uint8"`
  485. Event uint16
  486. }
  487. //
  488. // 0x09: PermitDeny
  489. //
  490. const (
  491. PermitDenyErr uint16 = 0x0001
  492. PermitDenyRightsQuery uint16 = 0x0002
  493. PermitDenyRightsReply uint16 = 0x0003
  494. PermitDenySetGroupPermitMask uint16 = 0x0004
  495. PermitDenyAddPermListEntries uint16 = 0x0005
  496. PermitDenyDelPermListEntries uint16 = 0x0006
  497. PermitDenyAddDenyListEntries uint16 = 0x0007
  498. PermitDenyDelDenyListEntries uint16 = 0x0008
  499. PermitDenyBosErr uint16 = 0x0009
  500. PermitDenyAddTempPermitListEntries uint16 = 0x000A
  501. PermitDenyDelTempPermitListEntries uint16 = 0x000B
  502. PermitDenyTLVMaxPermits uint16 = 0x01
  503. PermitDenyTLVMaxDenies uint16 = 0x02
  504. PermitDenyTLVMaxTempPermits uint16 = 0x03
  505. )
  506. type SNAC_0x09_0x03_PermitDenyRightsReply struct {
  507. TLVRestBlock
  508. }
  509. //
  510. // 0x0D: ChatNav
  511. //
  512. const (
  513. ChatNavErr uint16 = 0x0001
  514. ChatNavRequestChatRights uint16 = 0x0002
  515. ChatNavRequestExchangeInfo uint16 = 0x0003
  516. ChatNavRequestRoomInfo uint16 = 0x0004
  517. ChatNavRequestMoreRoomInfo uint16 = 0x0005
  518. ChatNavRequestOccupantList uint16 = 0x0006
  519. ChatNavSearchForRoom uint16 = 0x0007
  520. ChatNavCreateRoom uint16 = 0x0008
  521. ChatNavNavInfo uint16 = 0x0009
  522. ChatNavTLVMaxConcurrentRooms uint16 = 0x0002
  523. ChatNavTLVExchangeInfo uint16 = 0x0003
  524. ChatNavTLVRoomInfo uint16 = 0x0004
  525. )
  526. type SNAC_0x0D_0x04_ChatNavRequestRoomInfo struct {
  527. Exchange uint16
  528. Cookie string `len_prefix:"uint8"`
  529. InstanceNumber uint16
  530. DetailLevel uint8
  531. }
  532. type SNAC_0x0D_0x09_ChatNavNavInfo struct {
  533. TLVRestBlock
  534. }
  535. type SNAC_0x0D_0x09_TLVExchangeInfo struct {
  536. Identifier uint16
  537. TLVBlock
  538. }
  539. //
  540. // 0x0E: Chat
  541. //
  542. const (
  543. ChatErr uint16 = 0x0001
  544. ChatRoomInfoUpdate uint16 = 0x0002
  545. ChatUsersJoined uint16 = 0x0003
  546. ChatUsersLeft uint16 = 0x0004
  547. ChatChannelMsgToHost uint16 = 0x0005
  548. ChatChannelMsgToClient uint16 = 0x0006
  549. ChatEvilRequest uint16 = 0x0007
  550. ChatEvilReply uint16 = 0x0008
  551. ChatClientErr uint16 = 0x0009
  552. ChatPauseRoomReq uint16 = 0x000A
  553. ChatPauseRoomAck uint16 = 0x000B
  554. ChatResumeRoom uint16 = 0x000C
  555. ChatShowMyRow uint16 = 0x000D
  556. ChatShowRowByUsername uint16 = 0x000E
  557. ChatShowRowByNumber uint16 = 0x000F
  558. ChatShowRowByName uint16 = 0x0010
  559. ChatRowInfo uint16 = 0x0011
  560. ChatListRows uint16 = 0x0012
  561. ChatRowListInfo uint16 = 0x0013
  562. ChatMoreRows uint16 = 0x0014
  563. ChatMoveToRow uint16 = 0x0015
  564. ChatToggleChat uint16 = 0x0016
  565. ChatSendQuestion uint16 = 0x0017
  566. ChatSendComment uint16 = 0x0018
  567. ChatTallyVote uint16 = 0x0019
  568. ChatAcceptBid uint16 = 0x001A
  569. ChatSendInvite uint16 = 0x001B
  570. ChatDeclineInvite uint16 = 0x001C
  571. ChatAcceptInvite uint16 = 0x001D
  572. ChatNotifyMessage uint16 = 0x001E
  573. ChatGotoRow uint16 = 0x001F
  574. ChatStageUserJoin uint16 = 0x0020
  575. ChatStageUserLeft uint16 = 0x0021
  576. ChatUnnamedSnac22 uint16 = 0x0022
  577. ChatClose uint16 = 0x0023
  578. ChatUserBan uint16 = 0x0024
  579. ChatUserUnban uint16 = 0x0025
  580. ChatJoined uint16 = 0x0026
  581. ChatUnnamedSnac27 uint16 = 0x0027
  582. ChatUnnamedSnac28 uint16 = 0x0028
  583. ChatUnnamedSnac29 uint16 = 0x0029
  584. ChatRoomInfoOwner uint16 = 0x0030
  585. ChatTLVPublicWhisperFlag uint16 = 0x01
  586. ChatTLVSenderInformation uint16 = 0x03
  587. ChatTLVEnableReflectionFlag uint16 = 0x06
  588. // referenced from protocols/oscar/family_chatnav.c in lib purple
  589. ChatRoomTLVClassPerms uint16 = 0x02
  590. ChatRoomTLVMaxConcurrentRooms uint16 = 0x03 // required by aim 2.x-3.x
  591. ChatRoomTLVMaxNameLen uint16 = 0x04
  592. ChatRoomTLVFullyQualifiedName uint16 = 0x6A
  593. ChatRoomTLVCreateTime uint16 = 0xCA
  594. ChatRoomTLVFlags uint16 = 0xC9
  595. ChatRoomTLVMaxMsgLen uint16 = 0xD1
  596. ChatRoomTLVMaxOccupancy uint16 = 0xD2
  597. ChatRoomTLVRoomName uint16 = 0xD3
  598. ChatRoomTLVNavCreatePerms uint16 = 0xD5
  599. ChatRoomTLVCharSet1 uint16 = 0xD6
  600. ChatRoomTLVLang1 uint16 = 0xD7
  601. ChatRoomTLVCharSet2 uint16 = 0xD8
  602. ChatRoomTLVLang2 uint16 = 0xD9
  603. )
  604. type SNAC_0x0E_0x02_ChatRoomInfoUpdate struct {
  605. Exchange uint16
  606. Cookie string `len_prefix:"uint8"`
  607. InstanceNumber uint16
  608. DetailLevel uint8
  609. TLVBlock
  610. }
  611. type SNAC_0x0E_0x03_ChatUsersJoined struct {
  612. Users []TLVUserInfo
  613. }
  614. type SNAC_0x0E_0x04_ChatUsersLeft struct {
  615. Users []TLVUserInfo
  616. }
  617. type SNAC_0x0E_0x05_ChatChannelMsgToHost struct {
  618. Cookie uint64
  619. Channel uint16
  620. TLVRestBlock
  621. }
  622. type SNAC_0x0E_0x06_ChatChannelMsgToClient struct {
  623. Cookie uint64
  624. Channel uint16
  625. TLVRestBlock
  626. }
  627. //
  628. // 0x10: BART
  629. //
  630. //
  631. const (
  632. BARTTypesBuddyIconSmall uint16 = 0x00
  633. BARTTypesBuddyIcon uint16 = 0x01
  634. BARTTypesStatusStr uint16 = 0x02
  635. BARTTypesArriveSound uint16 = 0x03
  636. BARTTypesRichName uint16 = 0x04
  637. BARTTypesSuperIcon uint16 = 0x05
  638. BARTTypesRadioStation uint16 = 0x06
  639. BARTTypesSuperIconTrigger uint16 = 0x07
  640. BARTTypesStatusTextLink uint16 = 0x09
  641. BARTTypesLocation uint16 = 0x0B
  642. BARTTypesBuddyIconBig uint16 = 0x0C
  643. BARTTypesStatusTextTimestamp uint16 = 0x0D
  644. BARTTypesCurrentAvtrack uint16 = 0x0F
  645. BARTTypesDepartSound uint16 = 0x60
  646. BARTTypesImBackground uint16 = 0x80
  647. BARTTypesImChrome uint16 = 0x81
  648. BARTTypesImSkin uint16 = 0x82
  649. BARTTypesImSound uint16 = 0x83
  650. BARTTypesBadge uint16 = 0x84
  651. BARTTypesBadgeUrl uint16 = 0x85
  652. BARTTypesImInitialSound uint16 = 0x86
  653. BARTTypesFlashWallpaper uint16 = 0x88
  654. BARTTypesImmersiveWallpaper uint16 = 0x89
  655. BARTTypesBuddylistBackground uint16 = 0x100
  656. BARTTypesBuddylistImage uint16 = 0x101
  657. BARTTypesBuddylistSkin uint16 = 0x102
  658. BARTTypesSmileySet uint16 = 0x400
  659. BARTTypesEncrCertChain uint16 = 0x402
  660. BARTTypesSignCertChain uint16 = 0x403
  661. BARTTypesGatewayCert uint16 = 0x404
  662. )
  663. const (
  664. BARTErr uint16 = 0x0001
  665. BARTUploadQuery uint16 = 0x0002
  666. BARTUploadReply uint16 = 0x0003
  667. BARTDownloadQuery uint16 = 0x0004
  668. BARTDownloadReply uint16 = 0x0005
  669. BARTDownload2Query uint16 = 0x0006
  670. BARTDownload2Reply uint16 = 0x0007
  671. )
  672. const (
  673. BARTFlagsKnown uint8 = 0x00
  674. BARTFlagsCustom uint8 = 0x01
  675. BARTFlagsUrl uint8 = 0x02
  676. BARTFlagsData uint8 = 0x04
  677. BARTFlagsUnknown uint8 = 0x40
  678. BARTFlagsRedirect uint8 = 0x80
  679. BARTFlagsBanned uint8 = 0xC0
  680. )
  681. const (
  682. BARTReplyCodesSuccess uint8 = 0x00
  683. BARTReplyCodesInvalid uint8 = 0x01
  684. BARTReplyCodesNoCustom uint8 = 0x02
  685. BARTReplyCodesTooSmall uint8 = 0x03
  686. BARTReplyCodesTooBig uint8 = 0x04
  687. BARTReplyCodesInvalidType uint8 = 0x05
  688. BARTReplyCodesBanned uint8 = 0x06
  689. BARTReplyCodesNotfound uint8 = 0x07
  690. )
  691. // GetClearIconHash returns an opaque value set in BARTID hash that indicates
  692. // the user wants to clear their buddy icon.
  693. func GetClearIconHash() []byte {
  694. return []byte{0x02, 0x01, 0xd2, 0x04, 0x72}
  695. }
  696. // BARTInfo represents a BART feedbag item
  697. type BARTInfo struct {
  698. Flags uint8
  699. Hash []byte `len_prefix:"uint8"`
  700. }
  701. // HasClearIconHash reports whether the BART ID hash contains the
  702. // ClearIconHash sentinel value.
  703. func (h BARTInfo) HasClearIconHash() bool {
  704. return bytes.Equal(h.Hash, GetClearIconHash())
  705. }
  706. type BARTID struct {
  707. Type uint16
  708. BARTInfo
  709. }
  710. type SNAC_0x10_0x02_BARTUploadQuery struct {
  711. Type uint16
  712. Data []byte `len_prefix:"uint16"`
  713. }
  714. type SNAC_0x10_0x03_BARTUploadReply struct {
  715. Code uint8
  716. ID BARTID
  717. }
  718. type SNAC_0x10_0x04_BARTDownloadQuery struct {
  719. ScreenName string `len_prefix:"uint8"`
  720. Command uint8
  721. BARTID
  722. }
  723. type SNAC_0x10_0x05_BARTDownloadReply struct {
  724. ScreenName string `len_prefix:"uint8"`
  725. BARTID BARTID
  726. Data []byte `len_prefix:"uint16"`
  727. }
  728. // 0x13: Feedbag
  729. //
  730. const (
  731. FeedbagClassIdBuddy uint16 = 0x0000
  732. FeedbagClassIdGroup uint16 = 0x0001
  733. FeedbagClassIDPermit uint16 = 0x0002
  734. FeedbagClassIDDeny uint16 = 0x0003
  735. FeedbagClassIdPdinfo uint16 = 0x0004
  736. FeedbagClassIdBuddyPrefs uint16 = 0x0005
  737. FeedbagClassIdNonbuddy uint16 = 0x0006
  738. FeedbagClassIdTpaProvider uint16 = 0x0007
  739. FeedbagClassIdTpaSubscription uint16 = 0x0008
  740. FeedbagClassIdClientPrefs uint16 = 0x0009
  741. FeedbagClassIdStock uint16 = 0x000A
  742. FeedbagClassIdWeather uint16 = 0x000B
  743. FeedbagClassIdWatchList uint16 = 0x000D
  744. FeedbagClassIdIgnoreList uint16 = 0x000E
  745. FeedbagClassIdDateTime uint16 = 0x000F
  746. FeedbagClassIdExternalUser uint16 = 0x0010
  747. FeedbagClassIdRootCreator uint16 = 0x0011
  748. FeedbagClassIdFish uint16 = 0x0012
  749. FeedbagClassIdImportTimestamp uint16 = 0x0013
  750. FeedbagClassIdBart uint16 = 0x0014
  751. FeedbagClassIdRbOrder uint16 = 0x0015
  752. FeedbagClassIdPersonality uint16 = 0x0016
  753. FeedbagClassIdAlProf uint16 = 0x0017
  754. FeedbagClassIdAlInfo uint16 = 0x0018
  755. FeedbagClassIdInteraction uint16 = 0x0019
  756. FeedbagClassIdVanityInfo uint16 = 0x001D
  757. FeedbagClassIdFavoriteLocation uint16 = 0x001E
  758. FeedbagClassIdBartPdinfo uint16 = 0x001F
  759. FeedbagClassIdCustomEmoticons uint16 = 0x0024
  760. FeedbagClassIdMaxPredefined uint16 = 0x0024
  761. FeedbagClassIdXIcqStatusNote uint16 = 0x015C
  762. FeedbagClassIdMin uint16 = 0x0400
  763. FeedbagAttributesShared uint16 = 0x0064
  764. FeedbagAttributesInvited uint16 = 0x0065
  765. FeedbagAttributesPending uint16 = 0x0066
  766. FeedbagAttributesTimeT uint16 = 0x0067
  767. FeedbagAttributesDenied uint16 = 0x0068
  768. FeedbagAttributesSwimIndex uint16 = 0x0069
  769. FeedbagAttributesRecentBuddy uint16 = 0x006A
  770. FeedbagAttributesAutoBot uint16 = 0x006B
  771. FeedbagAttributesInteraction uint16 = 0x006D
  772. FeedbagAttributesMegaBot uint16 = 0x006F
  773. FeedbagAttributesOrder uint16 = 0x00C8
  774. FeedbagAttributesBuddyPrefs uint16 = 0x00C9
  775. FeedbagAttributesPdMode uint16 = 0x00CA
  776. FeedbagAttributesPdMask uint16 = 0x00CB
  777. FeedbagAttributesPdFlags uint16 = 0x00CC
  778. FeedbagAttributesClientPrefs uint16 = 0x00CD
  779. FeedbagAttributesLanguage uint16 = 0x00CE
  780. FeedbagAttributesFishUri uint16 = 0x00CF
  781. FeedbagAttributesWirelessPdMode uint16 = 0x00D0
  782. FeedbagAttributesWirelessIgnoreMode uint16 = 0x00D1
  783. FeedbagAttributesFishPdMode uint16 = 0x00D2
  784. FeedbagAttributesFishIgnoreMode uint16 = 0x00D3
  785. FeedbagAttributesCreateTime uint16 = 0x00D4
  786. FeedbagAttributesBartInfo uint16 = 0x00D5
  787. FeedbagAttributesBuddyPrefsValid uint16 = 0x00D6
  788. FeedbagAttributesBuddyPrefs2 uint16 = 0x00D7
  789. FeedbagAttributesBuddyPrefs2Valid uint16 = 0x00D8
  790. FeedbagAttributesBartList uint16 = 0x00D9
  791. FeedbagAttributesArriveSound uint16 = 0x012C
  792. FeedbagAttributesLeaveSound uint16 = 0x012D
  793. FeedbagAttributesImage uint16 = 0x012E
  794. FeedbagAttributesColorBg uint16 = 0x012F
  795. FeedbagAttributesColorFg uint16 = 0x0130
  796. FeedbagAttributesAlias uint16 = 0x0131
  797. FeedbagAttributesPassword uint16 = 0x0132
  798. FeedbagAttributesDisabled uint16 = 0x0133
  799. FeedbagAttributesCollapsed uint16 = 0x0134
  800. FeedbagAttributesUrl uint16 = 0x0135
  801. FeedbagAttributesActiveList uint16 = 0x0136
  802. FeedbagAttributesEmailAddr uint16 = 0x0137
  803. FeedbagAttributesPhoneNumber uint16 = 0x0138
  804. FeedbagAttributesCellPhoneNumber uint16 = 0x0139
  805. FeedbagAttributesSmsPhoneNumber uint16 = 0x013A
  806. FeedbagAttributesWireless uint16 = 0x013B
  807. FeedbagAttributesNote uint16 = 0x013C
  808. FeedbagAttributesAlertPrefs uint16 = 0x013D
  809. FeedbagAttributesBudalertSound uint16 = 0x013E
  810. FeedbagAttributesStockalertValue uint16 = 0x013F
  811. FeedbagAttributesTpalertEditUrl uint16 = 0x0140
  812. FeedbagAttributesTpalertDeleteUrl uint16 = 0x0141
  813. FeedbagAttributesTpprovMorealertsUrl uint16 = 0x0142
  814. FeedbagAttributesFish uint16 = 0x0143
  815. FeedbagAttributesXunconfirmedxLastAccess uint16 = 0x0145
  816. FeedbagAttributesImSent uint16 = 0x0150
  817. FeedbagAttributesOnlineTime uint16 = 0x0151
  818. FeedbagAttributesAwayMsg uint16 = 0x0152
  819. FeedbagAttributesImReceived uint16 = 0x0153
  820. FeedbagAttributesBuddyfeedView uint16 = 0x0154
  821. FeedbagAttributesWorkPhoneNumber uint16 = 0x0158
  822. FeedbagAttributesOtherPhoneNumber uint16 = 0x0159
  823. FeedbagAttributesWebPdMode uint16 = 0x015F
  824. FeedbagAttributesFirstCreationTimeXc uint16 = 0x0167
  825. FeedbagAttributesPdModeXc uint16 = 0x016E
  826. FeedbagRightsMaxClassAttrs uint16 = 0x02
  827. FeedbagRightsMaxItemAttrs uint16 = 0x03
  828. FeedbagRightsMaxItemsByClass uint16 = 0x04
  829. FeedbagRightsMaxClientItems uint16 = 0x05
  830. FeedbagRightsMaxItemNameLen uint16 = 0x06
  831. FeedbagRightsMaxRecentBuddies uint16 = 0x07
  832. FeedbagRightsInteractionBuddies uint16 = 0x08
  833. FeedbagRightsInteractionHalfLife uint16 = 0x09
  834. FeedbagRightsInteractionMaxScore uint16 = 0x0A
  835. FeedbagRightsMaxUnknown0b uint16 = 0x0B
  836. FeedbagRightsMaxBuddiesPerGroup uint16 = 0x0C
  837. FeedbagRightsMaxMegaBots uint16 = 0x0D
  838. FeedbagRightsMaxSmartGroups uint16 = 0x0E
  839. FeedbagErr uint16 = 0x0001
  840. FeedbagRightsQuery uint16 = 0x0002
  841. FeedbagRightsReply uint16 = 0x0003
  842. FeedbagQuery uint16 = 0x0004
  843. FeedbagQueryIfModified uint16 = 0x0005
  844. FeedbagReply uint16 = 0x0006
  845. FeedbagUse uint16 = 0x0007
  846. FeedbagInsertItem uint16 = 0x0008
  847. FeedbagUpdateItem uint16 = 0x0009
  848. FeedbagDeleteItem uint16 = 0x000A
  849. FeedbagInsertClass uint16 = 0x000B
  850. FeedbagUpdateClass uint16 = 0x000C
  851. FeedbagDeleteClass uint16 = 0x000D
  852. FeedbagStatus uint16 = 0x000E
  853. FeedbagReplyNotModified uint16 = 0x000F
  854. FeedbagDeleteUser uint16 = 0x0010
  855. FeedbagStartCluster uint16 = 0x0011
  856. FeedbagEndCluster uint16 = 0x0012
  857. FeedbagAuthorizeBuddy uint16 = 0x0013
  858. FeedbagPreAuthorizeBuddy uint16 = 0x0014
  859. FeedbagPreAuthorizedBuddy uint16 = 0x0015
  860. FeedbagRemoveMe uint16 = 0x0016
  861. FeedbagRemoveMe2 uint16 = 0x0017
  862. FeedbagRequestAuthorizeToHost uint16 = 0x0018
  863. FeedbagRequestAuthorizeToClient uint16 = 0x0019
  864. FeedbagRespondAuthorizeToHost uint16 = 0x001A
  865. FeedbagRespondAuthorizeToClient uint16 = 0x001B
  866. FeedbagBuddyAdded uint16 = 0x001C
  867. FeedbagRequestAuthorizeToBadog uint16 = 0x001D
  868. FeedbagRespondAuthorizeToBadog uint16 = 0x001E
  869. FeedbagBuddyAddedToBadog uint16 = 0x001F
  870. FeedbagTestSnac uint16 = 0x0021
  871. FeedbagForwardMsg uint16 = 0x0022
  872. FeedbagIsAuthRequiredQuery uint16 = 0x0023
  873. FeedbagIsAuthRequiredReply uint16 = 0x0024
  874. FeedbagRecentBuddyUpdate uint16 = 0x0025
  875. )
  876. type SNAC_0x13_0x02_FeedbagRightsQuery struct {
  877. TLVRestBlock
  878. }
  879. type SNAC_0x13_0x03_FeedbagRightsReply struct {
  880. TLVRestBlock
  881. }
  882. type SNAC_0x13_0x05_FeedbagQueryIfModified struct {
  883. LastUpdate uint32
  884. Count uint8
  885. }
  886. type SNAC_0x13_0x06_FeedbagReply struct {
  887. Version uint8
  888. Items []FeedbagItem `count_prefix:"uint16"`
  889. LastUpdate uint32
  890. }
  891. type SNAC_0x13_0x08_FeedbagInsertItem struct {
  892. Items []FeedbagItem
  893. }
  894. type SNAC_0x13_0x09_FeedbagUpdateItem struct {
  895. Items []FeedbagItem
  896. }
  897. type SNAC_0x13_0x0A_FeedbagDeleteItem struct {
  898. Items []FeedbagItem
  899. }
  900. type SNAC_0x13_0x0E_FeedbagStatus struct {
  901. Results []uint16
  902. }
  903. type SNAC_0x13_0x11_FeedbagStartCluster struct {
  904. TLVRestBlock
  905. }
  906. //
  907. // 0x17: BUCP
  908. //
  909. const (
  910. BUCPErr uint16 = 0x0001
  911. BUCPLoginRequest uint16 = 0x0002
  912. BUCPLoginResponse uint16 = 0x0003
  913. BUCPRegisterRequest uint16 = 0x0004
  914. BUCPChallengeRequest uint16 = 0x0006
  915. BUCPChallengeResponse uint16 = 0x0007
  916. BUCPAsasnRequest uint16 = 0x0008
  917. BUCPSecuridRequest uint16 = 0x000A
  918. BUCPRegistrationImageRequest uint16 = 0x000C
  919. )
  920. type SNAC_0x17_0x02_BUCPLoginRequest struct {
  921. TLVRestBlock
  922. }
  923. type SNAC_0x17_0x03_BUCPLoginResponse struct {
  924. TLVRestBlock
  925. }
  926. type SNAC_0x17_0x06_BUCPChallengeRequest struct {
  927. TLVRestBlock
  928. }
  929. type SNAC_0x17_0x07_BUCPChallengeResponse struct {
  930. AuthKey string `len_prefix:"uint16"`
  931. }
  932. //
  933. // 0x18: Alert
  934. //
  935. const (
  936. AlertErr uint16 = 0x0001
  937. AlertSetAlertRequest uint16 = 0x0002
  938. AlertSetAlertReply uint16 = 0x0003
  939. AlertGetSubsRequest uint16 = 0x0004
  940. AlertGetSubsResponse uint16 = 0x0005
  941. AlertNotifyCapabilities uint16 = 0x0006
  942. AlertNotify uint16 = 0x0007
  943. AlertGetRuleRequest uint16 = 0x0008
  944. AlertGetRuleReply uint16 = 0x0009
  945. AlertGetFeedRequest uint16 = 0x000A
  946. AlertGetFeedReply uint16 = 0x000B
  947. AlertRefreshFeed uint16 = 0x000D
  948. AlertEvent uint16 = 0x000E
  949. AlertQogSnac uint16 = 0x000F
  950. AlertRefreshFeedStock uint16 = 0x0010
  951. AlertNotifyTransport uint16 = 0x0011
  952. AlertSetAlertRequestV2 uint16 = 0x0012
  953. AlertSetAlertReplyV2 uint16 = 0x0013
  954. AlertTransitReply uint16 = 0x0014
  955. AlertNotifyAck uint16 = 0x0015
  956. AlertNotifyDisplayCapabilities uint16 = 0x0016
  957. AlertUserOnline uint16 = 0x0017
  958. )
  959. type SNACOServiceErr struct {
  960. Code uint16
  961. }
  962. type TLVUserInfo struct {
  963. ScreenName string `len_prefix:"uint8"`
  964. WarningLevel uint16
  965. TLVBlock
  966. }
  967. type FeedbagItem struct {
  968. Name string `len_prefix:"uint16"`
  969. GroupID uint16
  970. ItemID uint16
  971. ClassID uint16
  972. TLVLBlock
  973. }