Giter Club home page Giter Club logo

inputpipe's Introduction

===========
 Inputpipe
===========
Version 0.5


Introduction
------------

Inputpipe is a client/server application for making any Linux input
device network-transparent. An inputpipe client runs on a computer with
some arbitrary input devices, forwarding information and status from
those devices to an inputpipe server. The server creates local input
devices that are for all practical purposes identical copies of the
devices being forwarded.

Build with "make", install with "make install". Nothing fancy there.

Inputpipe is licensed under the GNU GPL.


Contents
--------

conf:
  Sample config files. Currently this contains an example of running
  inputpipe-server via xinetd.

uinput:
  A modified version of the uinput driver that supports force feedback
  and includes some small bugfixes. This has been submitted upstream
  so hopefully you should see it in a stable kernel soon.
  This is not required.

src:
  Source for inputpipe-server and inputpipe-client


Server setup
------------

(Requires Linux 2.6 or later and the 'uinput' kernel module)

The inputpipe server is the machine you wish forwarded input devices
to appear on. It uses the 'uinput' kernel module to create the forwarded
input devices- therefore it requires Linux 2.6.x.

IMPORTANT: inputpipe-server on its own has no security features. It is
           intended mainly for use on closed networks. If you require
           a little extra security you can run inputpipe-server in inetd
           mode and use wrappers or inetd features to accept only certain
           connections.

           Even if you authenticate connections to inputpipe, note that
           the data will not be encrypted! Don't use inputpipe for devices
           that may be used to enter passwords.

That said, you can get started just by running "inputpipe-server" with
no arguments. For more advanced usage, see the --help text and the sample
xinetd.conf provided in the 'conf' directory.


Client setup
------------

(Requires Linux 2.4 or later and the 'evdev' kernel module)

Inputpipe clients can run on Linux 2.4 or Linux 2.6 machines, though
clients using Linux 2.4 will be less bandwidth-efficient and won't support
a few fun features like physical paths and "rumble" force feedback.

The inputpipe client needs to know what server to connect to, and where to
find input devices to forward. You can give it individual event devices,
you can give it categories of devices to forward, or any combination of the
two. In the case that inputpipe-client is forwarding a broad category of
devices, it will support hotplugging. New devices will automagically appear
on the server when plugged in, if they match the criteria given to
inputpipe-client.

Read the output of "inputpipe-client --help" for details, but here are some
quick examples:

1. Forwarding a single event device to the host "warzok":

 inputpipe-client warzok /dev/input/event5

2. Forwarding all joystick devices to warzok:

 inputpipe-client -j warzok

3. Forwarding all mice plus a single known input device to warzok:

 inputpipe-client -m warzok /dev/input/event3

Note that in example 1, inputpipe-client will exit if the device is removed
or warzok goes down. In the other examples, inputpipe-client will keep scanning
for new hotplugged devices. Also note that as long as the inputpipe server is
alive when inputpipe-client first connects, it can go down and come back up
without killing inputpipe-client- the client will retry failed connections.


Internals
---------

Inputpipe uses a simple but extensible binary protocol over TCP. Most input
traffic consists of thinly encapsulated and network-byte-order-adjusted
input_event structures, but inputpipe defines numerous other packet types
used for communicating a device's identity and capabilities. For full details
on the protocol, see src/inputpipe.h


Contacts
------

Micah Dowty <[email protected]>

The latest code is in a Subversion repository at:
  http://navi.cx/svn/misc/trunk/inputpipe/

--- The End ---

inputpipe's People

Contributors

g4bwy avatar

Stargazers

Angus H. avatar PM Alamy avatar Mark Vainomaa avatar Arti Zirk avatar Sergey Zhuravlevich avatar Adam Petrone avatar

Watchers

 avatar

Forkers

baraban artizirk

inputpipe's Issues

not working under arch linux

this patch fixes it for me

From f4ddd5d3e7583f693799bcc9256f0f9abc4ed400 Mon Sep 17 00:00:00 2001
From: Arti Zirk <[email protected]>
Date: Fri, 23 Jan 2015 15:32:55 +0200
Subject: [PATCH] fix

---
 Makefile     | 2 +-
 src/client.c | 6 ++++--
 src/packet.h | 2 +-
 src/server.c | 4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile
index 83b9bf2..466d46e 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,7 @@ SERVER_OBJS = $(COMMON_OBJS) \
 CLIENT_OBJS = $(COMMON_OBJS) \
    src/client.o

-CFLAGS = -I uinput -I src -g
+CFLAGS = -I src -g

 all: $(BINS)

diff --git a/src/client.c b/src/client.c
index 80398c6..fabe3c3 100644
--- a/src/client.c
+++ b/src/client.c
@@ -41,7 +41,7 @@
 #include <getopt.h>
 #include <signal.h>

-#include <input.h>
+#include <linux/input.h>
 #include "inputpipe.h"
 #include "packet.h"

@@ -396,14 +396,16 @@ static int evdev_send_event(struct evdev *self, struct server *svr)

   compute_grab(self, &ev);

-  if (grab_devices && !(ev.type == EV_KEY && ev.code == MAGIC_GRAB_KEY)) {
+  if (!(ev.type == EV_KEY && ev.code == MAGIC_GRAB_KEY)) {
      /* Translate and send this event. If it's an event we think should
       * only be sent from app to device, assume it's an echo from
       * a write and discard it.
       */
+      
      hton_input_event(&ip_ev, &ev);
      if (is_output_event(&ev))
        return 0;
+
      packet_socket_write(svr->socket, IPIPE_EVENT, sizeof(ip_ev), &ip_ev);

      /* Does this device support synchronization events?
diff --git a/src/packet.h b/src/packet.h
index 23edc61..7d538c1 100644
--- a/src/packet.h
+++ b/src/packet.h
@@ -26,7 +26,7 @@

 #include <stdio.h>

-#include <input.h>
+#include <linux/input.h>
 #include "inputpipe.h"

 struct packet_socket {
diff --git a/src/server.c b/src/server.c
index 7c3109d..6cf9d1c 100644
--- a/src/server.c
+++ b/src/server.c
@@ -37,8 +37,8 @@
 #include <sys/select.h>
 #include <linux/tcp.h>

-#include <input.h>
-#include <uinput.h>
+#include <linux/input.h>
+#include <linux/uinput.h>
 #include "inputpipe.h"
 #include "packet.h"

--
libgit2 0.21.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.