A FieldListField for NDR
| 2035 | |
| 2036 | |
| 2037 | class NDRFieldListField(NDRConstructedType, FieldListField): |
| 2038 | """ |
| 2039 | A FieldListField for NDR |
| 2040 | """ |
| 2041 | |
| 2042 | islist = 1 |
| 2043 | |
| 2044 | def __init__(self, *args, **kwargs): |
| 2045 | kwargs.pop("ptr_pack", None) # TODO: unimplemented |
| 2046 | if "length_is" in kwargs: |
| 2047 | kwargs["count_from"] = kwargs.pop("length_is") |
| 2048 | elif "size_is" in kwargs: |
| 2049 | kwargs["count_from"] = kwargs.pop("size_is") |
| 2050 | FieldListField.__init__(self, *args, **kwargs) |
| 2051 | NDRConstructedType.__init__(self, [self.field]) |
| 2052 | |
| 2053 | def i2len(self, pkt, x): |
| 2054 | return len(x) |
| 2055 | |
| 2056 | def valueof(self, pkt, x): |
| 2057 | return [self.field.valueof(pkt, y) for y in x] |
| 2058 | |
| 2059 | |
| 2060 | class NDRVaryingArray(_NDRPacket): |
no outgoing calls
no test coverage detected
searching dependent graphs…