scapy.py
changeset 806 87949e07281c
parent 805 c919e540a57b
child 807 19df3f1cd92b
     1.1 --- a/scapy.py	Fri Mar 07 16:22:27 2008 +0100
     1.2 +++ b/scapy.py	Wed Apr 23 19:35:18 2008 +0200
     1.3 @@ -2261,7 +2261,7 @@
     1.4  
     1.5  _mib_re_integer = re.compile("^[0-9]+$")
     1.6  _mib_re_both = re.compile("^([a-zA-Z_][a-zA-Z0-9_-]*)\(([0-9]+)\)$")
     1.7 -_mib_re_oiddecl = re.compile("$\s*([a-zA-Z0-9_-]+)\s+OBJECT[^:]+::=\s*\{([^\}]+)\}",re.M)
     1.8 +_mib_re_oiddecl = re.compile("$\s*([a-zA-Z0-9_-]+)\s+OBJECT([^:\{\}]|\{[^:]+\})+::=\s*\{([^\}]+)\}",re.M)
     1.9  _mib_re_strings = re.compile('"[^"]*"')
    1.10  _mib_re_comments = re.compile('--.*(\r|\n)')
    1.11  
    1.12 @@ -2364,7 +2364,8 @@
    1.13              text = f.read()
    1.14              cleantext = " ".join(_mib_re_strings.split(" ".join(_mib_re_comments.split(text))))
    1.15              for m in _mib_re_oiddecl.finditer(cleantext):
    1.16 -                ident,oid = m.groups()
    1.17 +                gr = m.groups()
    1.18 +                ident,oid = gr[0],gr[-1]
    1.19                  ident=fixname(ident)
    1.20                  oid = oid.split()
    1.21                  for i in range(len(oid)):