(self, pkt, s, val)
| 2468 | ) |
| 2469 | |
| 2470 | def addfield(self, pkt, s, val): |
| 2471 | fmt = _e(pkt.ndrendian) + self.switch_fmt[pkt.ndr64] |
| 2472 | if not isinstance(val, NDRUnion): |
| 2473 | raise ValueError( |
| 2474 | "Expected NDRUnion in %s. You are using it wrong!" % self.name |
| 2475 | ) |
| 2476 | _set_ctx_on(val.value, pkt) |
| 2477 | # First, align the whole tag+union against the align param |
| 2478 | s = NDRAlign(Field("", 0, fmt=fmt), align=self.align).addfield(pkt, s, val.tag) |
| 2479 | # Then, compute the subfield with its own alignment |
| 2480 | return super(_NDRUnionField, self).addfield(pkt, s, val) |
| 2481 | |
| 2482 | def _find_fld_pkt_val(self, pkt, val): |
| 2483 | fld, val = super(_NDRUnionField, self)._find_fld_pkt_val(pkt, val) |
nothing calls this directly
no test coverage detected