How to track the flow of raw (character) devices on Unix?

I am trying to trace what is happening on a raw (character) device on a Unix system (for example:) /dev/tty.basebandfor DEBUG purposes.

I am thinking of creating a deamon that:

  • after starting rename /dev/tty.basebandto /dev/tty.baseband.old.
  • create raw node /dev/tty.baseband
  • create two threads:

  • Topic 1: reading a /dev/tty.baseband.oldrecord in/dev/tty.baseband

  • Topic 2: reading a /dev/tty.basebandrecord in/dev/tty.baseband.old

This will work a bit like the MITM process. I wonder if there is a “standard” way to do this.

+3
source share
1 answer

Nevermind I found how to do this. The path to the following:

  • create process
  • create a new pseudo-terminal, open / dev / ptmx
  • grantpt unlockpt
  • intecept
  • ,

, - :

http://fabiensanglard.net/cellphoneModem/index2.php

+1

Source: https://habr.com/ru/post/1743761/


All Articles