Encode and replace the mrcode value to its IGMPv3 encoded time value if needed, # noqa: E501 as specified in rfc3376#section-4.1.1. If value < 128, return the value specified. If >= 128, encode as a floating # noqa: E501 point value. Value can be 0 - 31744.
(self)
| 61 | XShortField("chksum", None)] |
| 62 | |
| 63 | def encode_maxrespcode(self): |
| 64 | """Encode and replace the mrcode value to its IGMPv3 encoded time value if needed, # noqa: E501 |
| 65 | as specified in rfc3376#section-4.1.1. |
| 66 | |
| 67 | If value < 128, return the value specified. If >= 128, encode as a floating # noqa: E501 |
| 68 | point value. Value can be 0 - 31744. |
| 69 | """ |
| 70 | value = self.mrcode |
| 71 | if value < 128: |
| 72 | code = value |
| 73 | elif value > 31743: |
| 74 | code = 255 |
| 75 | else: |
| 76 | exp = 0 |
| 77 | value >>= 3 |
| 78 | while value > 31: |
| 79 | exp += 1 |
| 80 | value >>= 1 |
| 81 | exp <<= 4 |
| 82 | code = 0x80 | exp | (value & 0x0F) |
| 83 | self.mrcode = code |
| 84 | |
| 85 | def mysummary(self): |
| 86 | """Display a summary of the IGMPv3 object.""" |