Commit 8c4e52f6 authored by aleajactaest's avatar aleajactaest

update decoder database.xml

parent 8e9c92c5
......@@ -107,9 +107,10 @@ class SpyPcap():
databaseRawXml = fp.read()
fp.close()
self.databaseXml = ET.fromstring(databaseRawXml)
self.decodeImpulseSimple.loadDatabase(self.databaseXml)
#self.decodeImpulseSimple.loadDatabase(self.databaseXml)
self.decodeDatabase = DecodeDatabase.DecodeDatabase()
self.decodeDatabase.loadDatabase(self.databaseXml)
self.decodeImpulseSimple.loadDatabase(self.decodeDatabase)
# outyaml
self.outyaml = outyaml
......@@ -946,12 +947,13 @@ def main():
# logger.append(logging.getLogger(CStringManager.LOGGER))
#logger.append(logging.getLogger(CAction.LOGGER))
#logger.append(logging.getLogger(CActionFactory.LOGGER))
# logger.append(logging.getLogger(BitStream.LOGGER))
logger.append(logging.getLogger(BitStream.LOGGER))
#logger.append(logging.getLogger(DecodeDatabase.LOGGER))
#logger.append(logging.getLogger(Impulse.LOGGER))
#logger.append(logging.getLogger(TVPNodeBase.LOGGER))
# CImpulseDecoder
# logger.append(logging.getLogger('CGenericMultiPartTemp'))
logger.append(logging.getLogger(DecodeDatabase.LOGGER))
parser = argparse.ArgumentParser()
parser.add_argument("--khanat-host-service", help="filter to detect khanat host:service (FES)")
......
This diff is collapsed.
......@@ -57,6 +57,9 @@ class CBitSet:
mask= bitNumber&(self.NL_BITLEN-1);
mask= 1<<mask;
return self.data[bitNumber >> 5] & mask != 0
def setUint(self, srcValue, i):
self.data[i] = srcValue
def setBit(self, bitNumber):
self.set(bitNumber, True)
......@@ -66,6 +69,10 @@ class CBitSet:
def __str__(self):
return '.'.join([hex(x) for x in self.data])
def showBitString(self):
return ''.join(["{0:032b}".format(x) for x in reversed(self.data)])
def writeSerial(self, msgout):
# v = 0 # currentVersion
# if v >= 0xff:
......@@ -94,6 +101,23 @@ class CBitSet:
y = msgin.readUint32( name+':Data' )
self.data[i] = y
def readSerialExtra(self, msgin, nbBit, name):
needread = nbBit
print("----", nbBit, nbBit // 32 + 1)
self.resize(nbBit)
i = 0
while needread>32:
print("---<", nbBit, nbBit // 32 + 1, i, needread)
y = msgin.readUint32( name+' Data' + str(i))
self.data[i] = y
needread -= 32
i += 1
print(self.data)
if needread > 0:
print("--->", nbBit, nbBit // 32 + 1, i, needread)
y = msgin.readSerial( needread, name+' Data' + str(i), typeName="I" + str(needread) )
self.data[i] = y
def TestCBitSet():
cBitSet = CBitSet()
cBitSet.resize(1024)
......
This diff is collapsed.
......@@ -21,6 +21,18 @@
from enum import IntEnum
def GetNameIntEnum(typeEnum, value):
for key in typeEnum.__dict__:
try:
print("-"*80)
print(key, dir(typeEnum.__dict__[key]))
print(key, typeEnum.__dict__[key].value)
if typeEnum.__dict__[key].value == value:
return key
except:
pass
return None
class TConnectionState(IntEnum):
NotInitialised = 0 # nothing happened yet
NotConnected = 1 # init() called
......@@ -610,7 +622,8 @@ class TCDBBank(IntEnum):
CDBOutpost = 2,
# CDBGlobal,
NB_CDB_BANKS = 3,
INVALID_CDB_BANK = 4
INVALID_CDB_BANK = 4,
NB_BITS_FOR_CDBBANK = 2 # normally calculate with NB_CDB_BANKS // ------ for ( nbits=1; (1<<nbits) < NB_CDB_BANKS; ++nbits ) {}
class TPropIndex(IntEnum):
PROPERTY_POSITION = 0,
......
This diff is collapsed.
......@@ -34,3 +34,14 @@ def getPowerOf2_Bis(v):
ret += 1
res *= 2
return ret
def getPowerOf2_ter(v):
res=1;
ret=0;
while res<v:
ret += 1
res *= 2
if ret == 0:
ret = 1
return ret
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment