Skip to content
Snippets Groups Projects
Commit ba60ebfb authored by Rémy Léone's avatar Rémy Léone
Browse files

List creation could be rewritten by list litteral

parent 1b5385d9
No related branches found
No related tags found
No related merge requests found
...@@ -148,10 +148,7 @@ class pcap_stat(Structure): ...@@ -148,10 +148,7 @@ class pcap_stat(Structure):
pass pass
### _fields_ list in Structure is final. ### _fields_ list in Structure is final.
### We need a temp list ### We need a temp list
_tmpList=[] _tmpList = [("ps_recv", c_uint), ("ps_drop", c_uint), ("ps_ifdrop", c_uint)]
_tmpList.append(("ps_recv",c_uint))
_tmpList.append(("ps_drop",c_uint))
_tmpList.append(("ps_ifdrop",c_uint))
if HAVE_REMOTE: if HAVE_REMOTE:
_tmpList.append(("ps_capt",c_uint)) _tmpList.append(("ps_capt",c_uint))
_tmpList.append(("ps_sent",c_uint)) _tmpList.append(("ps_sent",c_uint))
......
...@@ -226,8 +226,7 @@ class CommonHelloTLVField(StrField): ...@@ -226,8 +226,7 @@ class CommonHelloTLVField(StrField):
class CommonSessionTLVField(StrField): class CommonSessionTLVField(StrField):
islist = 1 islist = 1
def m2i(self, pkt, x): def m2i(self, pkt, x):
l = [] l = [struct.unpack("!H", x[6:8])[0]]
l.append(struct.unpack("!H",x[6:8])[0])
octet = struct.unpack("B",x[8:9])[0] octet = struct.unpack("B",x[8:9])[0]
l.append( (octet & 2**7 ) >> 7 ) l.append( (octet & 2**7 ) >> 7 )
l.append( (octet & 2**6 ) >> 6 ) l.append( (octet & 2**6 ) >> 6 )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment