Installation of the netclip server
----------------------------------

Step 1) Compilation
    make

Setp 2) Installation
    make install
    
Notes for Step 2 : 

 - A binary called netclipd will be installed in /usr/bin.
 - A script called netclipd will be installed in /usr/rc.d/init.d
 - A file /var/netclipd/current will be created
 - The netclipd server will be started

/usr/rc.d/init.d/netclipd :
----------------------------------
To activate this script at startup you must first get to know your
runlevel (at /etc/inittab) and then make a link like this (where
$RUNLEVEL is the runlevel. This will probably be 2 for console or 5 
if your Linux automaticly starts in X)

# ln -s /etc/rc.d/rc$RUNLEVEL.d/S99netclipd /etc/rc.d/init.d/netclipd
so -> 
# ln -s /etc/rc.d/rc2.d/S99netclipd /etc/rc.d/init.d/netclipd

Note that this is for RedHat. Some distrubutions might have another way
of working. Also note that RedHat has a tool named 'setup' which allows
you to configure the system services in a text user interface. After
make install you should see an item called 'netclipd' in this menu.
You can enable starting netclipd at startup by selecting this item
in that list .. it goes like this :) ->
# setup
  -> select "System services"
     -> ...
	[ ] netclipd [press spacebar]
	[*] netclipd
Difficult heh .. this will create the symlinks which are described above
for you.


Security :
-----------
Please note that when installing the default way, netclipd will be started 
as root which could be a security issue. If security is importand and the 
computer is also connected with another network (like for example the 
internet), you can firewall port 6671 (man ipchains, but make sure that you 
don't block the local network..since the other hosts on this network are 
going to connect to this port). You can also make a user (netclipd) and start
the server as this user. Note that the file /var/netclip/current must be 
writable for this user !

To block the port:
ipchains -A input -p tcp -d externalip/externalmask 6671 -j REJECT


../config.h
------------
#define CURFILE		"/var/netclip/current"
#define PORT		6671
#define MAXLEN		5000
#define	EOFCHAR		'^'

In this file some defines are set. If you change them, you must also
recompile all clients.

    - CURFILE is the file where the current netclipboard is stored
    - PORT is the port where the clients must connect to
    - MAXLEN is the max length of the netclipboard. When a clients sends
      more then MAXLEN characters, he will be disconnected and the
      first MAXLEN chars will be set to the netclipboard.
    - EOFCHAR is the end-of-file char. When a client (while setting the
      netclipboard -[Set] button-) sends this char then the netclipd
      will stop reciving data and set the new netclipboard.

Final note
----------
Test the netclipd by telnetting to it :

telnet localhost 6671

There, use r to read the current netclipboard and w to write a new one. 
This also illustrates the security of the server :) If you don't block 
the port then everybody on the internet can read -and set your 
netclipboard. And depending on my stupidity ... some cracking people 
can also root your box using programming mistakes that I made in 
netclipd. To avoid this .. run netclipd as user and block the port 
if the computer where you are running netclipd on is also connected 
to a non-privat network .. like the internet. Password protection
and ssh encryption are plans for future releases :).

