Introduction
============

Babeld for windows can work in the Cygwin 1.7 and later.

Changed files
-------------
        Makefile
        net.c
        kernel.c

New files
---------
        kernel_cygwin.c
        cyginet.h
        cyginet.c
        README.cygwin

Building in the cygwin
======================

Required packages:
         Cygwin 1.7
         gcc 4.5.3 for cygwin 

In the Windows XP, 

$ WINVER=XP make

Later Windows Vista,

$ WINVER=VISTA make

It will generate babeld.exe in the current directory.

Build testc.exe, it's used to verify the functions in the cyginet.c

$ WINVER=XP make testc.exe
$ ./testc.exe

Interface Names
===============

Use network connection name as interface name. 

Notes
=====

1. If network connection is disabeld, its interface name will NOT be
   recognize by Babeld in the Cygwin.

2. For the option "-z", kind value could be "0", "1", others is not
   supported. Because no any API channels in the Windows XP, even for
   wireless interface.

3. Only -t 0, -T 0 is valid, no multi-route tables in the Windows.

4. IPV6_TCLASS doesn't work, so babeld will complain:
   "Couldn't set traffic class"

5. Ipv6 option "IPV6_V6ONLY" only works in the Windows Vista later.

6. If one connection is assigned more than one ipv4 address, babeld
   returns the first one only, is it right? I'm not sure.

7. Regarding IPV6CTL_FORWARDING and IPV6CTL_SENDREDIRECTS, MSDN says
   that you can set both of options for Ipv4 in the registry:
   "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters",
   but says nothing for Ipv6. Does it work for ipv6 in the registry:
   "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip6\Parameters"
   ?

8. There is no RTM_BLACKHOLE, RTM_REJECT, NULLROUTE in the windows, in
   the kernel_cygwin.c!kernel_route, we only use local address as
   gateway in the BLACKHOLE route entry. Is it OK?

   A: It's not OK actually. In the Windows, you can't use 127.0.0.1 as
      gateway when add route entry. So the solution is find one
      interface other than loopback interface, then use its
      uni-address as gateway, it will be a blackhole route entry. For
      example, if you have an interface which ip addr is
      192.168.128.100, and ifindex is 5, then

      $ route add 100.28.0.0 mask 255.255.0.0 192.168.128.100 if 5

      Destination network 100.28.0.0/16 will be unreachable.
      

9. IN6_LINKLOCAL_IFINDEX && SET_IN6_LINKLOCAL_IFINDEX, do both of them
   work in the Windows?