IR: 1 RC for several PCs / software switchboard
Posted: Mon Feb 23, 2004 8:18 pm
[PROBLEM]
since IR-clients can connect to the lircd to receive IR signals from one central receiver, it's possible to control all other computers in the network.
I'm using IRAssistant (on the windows side), but when trying to perform different tasks on different computers with ONE remote, ALL listening machines are simultaneously interpreting the incoming signals. This might lead to undesired side-effects (such as one computer suddenly shutting down, because a part of a sequence was misinterpreted).
To avoid this it would be desirable to 'disconnect' certain computers from the lircd, but without their clients realizing it (since this would lead to error-messages like "failure to connect to lircd").
[SOLUTION]
The basic communication between the client and the server only produces packets of 40 to 50 bytes size. When blocking all packets above this, the client assumes an established connection, but cannot receive IR commands (they are 75 bytes and above).
This can be done by using iptables:
------------------------------------------
$IPTABLES -R OUTPUT 1 -p TCP -d $IP_ALLOW --sport 8765 -j ACCEPT
$IPTABLES -I OUTPUT 2 -m length --length 50:65535 -p TCP --sport 8765 -j DROP
------------------------------------------
the first line allows IR commands to be sent to $IP_ALLOW, the second one blocks them for all other clients.
since IR-clients can connect to the lircd to receive IR signals from one central receiver, it's possible to control all other computers in the network.
I'm using IRAssistant (on the windows side), but when trying to perform different tasks on different computers with ONE remote, ALL listening machines are simultaneously interpreting the incoming signals. This might lead to undesired side-effects (such as one computer suddenly shutting down, because a part of a sequence was misinterpreted).
To avoid this it would be desirable to 'disconnect' certain computers from the lircd, but without their clients realizing it (since this would lead to error-messages like "failure to connect to lircd").
[SOLUTION]
The basic communication between the client and the server only produces packets of 40 to 50 bytes size. When blocking all packets above this, the client assumes an established connection, but cannot receive IR commands (they are 75 bytes and above).
This can be done by using iptables:
------------------------------------------
$IPTABLES -R OUTPUT 1 -p TCP -d $IP_ALLOW --sport 8765 -j ACCEPT
$IPTABLES -I OUTPUT 2 -m length --length 50:65535 -p TCP --sport 8765 -j DROP
------------------------------------------
the first line allows IR commands to be sent to $IP_ALLOW, the second one blocks them for all other clients.