1
2
3 """AOL Instant Messenger."""
4
5 import dpkt
6 import struct
7
8
9
10 -class FLAP(dpkt.Packet):
11 __hdr__ = (
12 ('ast', 'B', 0x2a),
13 ('type', 'B', 0),
14 ('seq', 'H', 0),
15 ('len', 'H', 0)
16 )
23
24 -class SNAC(dpkt.Packet):
25 __hdr__ = (
26 ('family', 'H', 0),
27 ('subtype', 'H', 0),
28 ('flags', 'H', 0),
29 ('reqid', 'I', 0)
30 )
31
33 n = 4
34 try:
35 t, l = struct.unpack('>HH', buf[:n])
36 except struct.error:
37 raise dpkt.UnpackError
38 v = buf[n:n+l]
39 if len(v) < l:
40 raise dpkt.NeedData
41 buf = buf[n+l:]
42 return (t,l,v, buf)
43
44
45
46
47