| 351 | |
| 352 | @command.command("inject.tcp") |
| 353 | def inject_tcp(self, flow: Flow, to_client: bool, message: bytes): |
| 354 | if not isinstance(flow, tcp.TCPFlow): |
| 355 | logger.warning("Cannot inject TCP messages into non-TCP flows.") |
| 356 | return |
| 357 | |
| 358 | event = TcpMessageInjected(flow, tcp.TCPMessage(not to_client, message)) |
| 359 | try: |
| 360 | self.inject_event(event) |
| 361 | except ValueError as e: |
| 362 | logger.warning(str(e)) |
| 363 | |
| 364 | @command.command("inject.udp") |
| 365 | def inject_udp(self, flow: Flow, to_client: bool, message: bytes): |