| 254 | return True |
| 255 | |
| 256 | def _verify_l2_frame(self, received_packet: Ether, l3: bool) -> bool: |
| 257 | self._logger.debug("Looking at the Ether layer.") |
| 258 | self._logger.debug( |
| 259 | f"Comparing received dst mac '{received_packet.dst}' " |
| 260 | f"with expected '{self._tg_port_ingress.mac_address}'." |
| 261 | ) |
| 262 | if received_packet.dst != self._tg_port_ingress.mac_address: |
| 263 | return False |
| 264 | |
| 265 | expected_src_mac = self._tg_port_egress.mac_address |
| 266 | if l3: |
| 267 | expected_src_mac = self._sut_port_egress.mac_address |
| 268 | self._logger.debug( |
| 269 | f"Comparing received src mac '{received_packet.src}' " |
| 270 | f"with expected '{expected_src_mac}'." |
| 271 | ) |
| 272 | if received_packet.src != expected_src_mac: |
| 273 | return False |
| 274 | |
| 275 | return True |
| 276 | |
| 277 | def _verify_l3_packet(self, received_packet: IP, expected_packet: IP) -> bool: |
| 278 | self._logger.debug("Looking at the IP layer.") |