Decorator for version-dependent fields. If get_or_add is True (means get), we return s, self.phantom_value. If it is False (means add), we return s.
(f, get_or_add)
| 80 | |
| 81 | |
| 82 | def phantom_decorate(f, get_or_add): |
| 83 | """ |
| 84 | Decorator for version-dependent fields. |
| 85 | If get_or_add is True (means get), we return s, self.phantom_value. |
| 86 | If it is False (means add), we return s. |
| 87 | """ |
| 88 | def wrapper(*args): |
| 89 | self, pkt, s = args[:3] |
| 90 | if phantom_mode(pkt): |
| 91 | if get_or_add: |
| 92 | return s, self.phantom_value |
| 93 | return s |
| 94 | return f(*args) |
| 95 | return wrapper |
| 96 | |
| 97 | |
| 98 | class SigAndHashAlgField(EnumField): |
no outgoing calls
no test coverage detected
searching dependent graphs…