Changeset 862:52d055e522bd
- Timestamp:
- 08/11/08 18:01:50
(5 months ago)
- Author:
- Phil <phil@secdev.org>
- Parents:
861:1dbeceddbb8a 807:19df3f1cd92b
- Message:
Merged with one-file scapy
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r846 |
r862 |
|
| 16 | 16 | _mib_re_integer = re.compile("^[0-9]+$") |
|---|
| 17 | 17 | _mib_re_both = re.compile("^([a-zA-Z_][a-zA-Z0-9_-]*)\(([0-9]+)\)$") |
|---|
| 18 | | _mib_re_oiddecl = re.compile("$\s*([a-zA-Z0-9_-]+)\s+OBJECT[^:]+::=\s*\{([^\}]+)\}",re.M) |
|---|
| | 18 | _mib_re_oiddecl = re.compile("$\s*([a-zA-Z0-9_-]+)\s+OBJECT([^:\{\}]|\{[^:]+\})+::=\s*\{([^\}]+)\}",re.M) |
|---|
| 19 | 19 | _mib_re_strings = re.compile('"[^"]*"') |
|---|
| 20 | 20 | _mib_re_comments = re.compile('--.*(\r|\n)') |
|---|
| … | … | |
| 119 | 119 | cleantext = " ".join(_mib_re_strings.split(" ".join(_mib_re_comments.split(text)))) |
|---|
| 120 | 120 | for m in _mib_re_oiddecl.finditer(cleantext): |
|---|
| 121 | | ident,oid = m.groups() |
|---|
| | 121 | gr = m.groups() |
|---|
| | 122 | ident,oid = gr[0],gr[-1] |
|---|
| 122 | 123 | ident=fixname(ident) |
|---|
| 123 | 124 | oid = oid.split() |
|---|
| r851 |
r862 |
|
| 335 | 335 | if x is None: |
|---|
| 336 | 336 | x = "" |
|---|
| | 337 | elif type(x) is not str: |
|---|
| | 338 | x=str(x) |
|---|
| 337 | 339 | return x |
|---|
| 338 | 340 | def addfield(self, pkt, s, val): |
|---|
| r846 |
r862 |
|
| 383 | 383 | filter = None |
|---|
| 384 | 384 | |
|---|
| 385 | | def parse_options(iffrom, ifto, replace, pattern="", ignorepattern=""): |
|---|
| | 385 | def parse_options(self, iffrom, ifto, replace, pattern="", ignorepattern=""): |
|---|
| 386 | 386 | self.iffrom = iffrom |
|---|
| 387 | 387 | self.ifto = ifto |
|---|