summaryrefslogtreecommitdiff
path: root/common/lib/scammer
diff options
context:
space:
mode:
authorNélio Laranjeiro2012-03-02 09:42:10 +0100
committerNélio Laranjeiro2012-04-02 12:45:17 +0200
commitbc5b06b3a7facd5d594c03480c444ee75cc5fe0c (patch)
tree55a51e1ea6c15e2742f015d21de3203ffef67ee6 /common/lib/scammer
parent4da383cbee80f0d8adf756aefc2dbe6d37d1d589 (diff)
common/lib/scammer: get MME Types using mmtcgen, refs #409
Diffstat (limited to 'common/lib/scammer')
-rw-r--r--common/lib/scammer/common.py26
1 files changed, 5 insertions, 21 deletions
diff --git a/common/lib/scammer/common.py b/common/lib/scammer/common.py
index 519fcf4e09..b057017c78 100644
--- a/common/lib/scammer/common.py
+++ b/common/lib/scammer/common.py
@@ -24,28 +24,12 @@ HPAV_CCO_LEVEL = {0:'CCo Level 0', 1:'CCo Level 1', 2:'CCo Level 2'}
# SPC OUI
SPC_OUI = 0x0013d7
-# Get the MME Types.
-base = find_base ()
-sys.path.append ("%s/cesar/maximus/python/lib/cesar/" % base)
-from defineparser import define_parser
-HPAV_MMTYPES_TEMP = define_parser ("%s/cesar/cp/mme.h" % base)
-HPAV_MMTYPES = {}
-types = ["_REQ", "_CNF", "_IND", "_RSP"]
-for i in HPAV_MMTYPES_TEMP:
- if not i.startswith ('CP_MME_') and not i.endswith ('_MIN') \
- and not i.endswith ('_MAX'):
- for j in range (len (types)):
- HPAV_MMTYPES["%s%s" % (i, types[j])] = \
- HPAV_MMTYPES_TEMP[i] + j
- elif i.endswith ('_MIN') or i.endswith ('_MAX'):
- HPAV_MMTYPES[i] = HPAV_MMTYPES_TEMP[i]
-del base
-del types
-del HPAV_MMTYPES_TEMP
-
-# Dict with the keywords base on the hexadecimal value.
+# Create two dictionaries for MMTypes.
+sys.path.append ("%s/common/lib" % find_base ())
+from mmtcgen.mmtcgen import mmtypes_list
+HPAV_MMTYPES = mmtypes_list ()
HPAV_MMTYPES_REVERSE = {}
-for i in HPAV_MMTYPES:
+for i in iter (HPAV_MMTYPES):
HPAV_MMTYPES_REVERSE[HPAV_MMTYPES[i]] = i
HPAV_RESULT = {'success':0, 'failure': 1}