g3w   --    Gale-to-Gale Gateway.

This is intended to gateway a set of categories between two Gale clouds
which are not directly connected.


Do not, repeat _DO NOT_ gateway two servers that are connected by other
means.  You will create a messaging loop!  You should only gateway
servers that are not connected.


--**DO NOT GATEWAY TWO CONNECTED SERVERS**--


To build:  Apply the provided patch in your gale source directory (with
something like "patch -b -p1 < patch") and rebuild.  The patch is against
the gale-0.99 sources, but also works on gale-0.99a.
Compile the g3w gateway client with something like:
  cc -I../gale-0.99/include/gale g3w.c -c -o g3w.o
  cc g3w.o -lgale -loop -lcurses -lrsaref -lgc -o g3w

The arguments of the g3w client are: 
  g3w <server1> <subscription1> <server2> <subscription2>
It will ferry all messages matching sub1 on server1 to server2, and
all messages matching sub2 on server2 to server1.  Use "-" to match
no messages:  eg, a one-way gate could be
  g3w external.server : internal.server -


To run as a gateway to the external gale cloud:
  Run a galed as normal on the external machine, with
GALE_LINKS set appropriately.  On the internal machine, run galed with the
new "-l" option, and no GALE_LINKS.  Internal clients should run
with GALE_PROXY set to the internal server, and the external server (but
not the internal) should be accessable as @dom.ain/ to the external gale
cloud.  Invoke g3w as:  g3w external.dom.ain pub:group:@dom.ain/ internal.dom.ain pub:group:-@dom.ain/:-/secret
or something similar.

The g3w could also be used to connect two private clouds, eg:
  g3w server.dom.ain1 share server.dom.ain2 share
If you use multi-hop g3w's, each one must have a different GALE_DOMAIN,
else it will drop messages forwarded by the others as "already gatewayed".

If it is possible to reach the external server from a machine with the
gale keys, then gdomain can be run as "GALE_PROXY=external.server gdomain"
and it will serve keys to the outside and AKD should work, though in
practice there are some issues.


Legalese:  
This code is available free of charge, under the GNU General Public Licence, 
which is provided in the main gale distribution.
  On the flip side, this code is not warranted.  If you believe your 
computer melted into a puddle of radioactive goo as a result of running 
this code:  tough.
