lib/netlink-socket.c: add support for nl_transact() on Windows
authorNithin Raju <nithin@vmware.com>
Fri, 19 Sep 2014 21:30:54 +0000 (14:30 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 19 Sep 2014 21:36:58 +0000 (14:36 -0700)
commit0fd22ae2a256065985adeca650340a8f42e595cb
tree6cc04c6cefc45cb5c9ea97892c6a7009932e8bdd
parent824c061a995d8bbcb3c78c750ebbae6859660998
lib/netlink-socket.c: add support for nl_transact() on Windows

In this patch, we add support for nl_transact() on Windows using
the OVS_IOCTL_TRANSACT ioctl that sends down the request and gets
the reply in the same call to the kernel.

This is obviously a digression from the way it is implemented in
Linux where all the sends are done at once using sendmsg() and
replies are received one at a time.

Initial implementation was in the Linux way using multiple writes
followed by reads, but decided against it since it is not efficient
and also it complicates the state machine in the kernel.

The Windows implementation has equivalent code for handling corner
cases and error coditions similar to Linux. Some of it is not
applicable yet. Eg. the Windows kernel does not embed an error
in the netlink message itself. There's userspace code nevertheless
for this.

Signed-off-by: Nithin Raju <nithin@vmware.com>
Acked-by: Samuel Ghinet <sghinet@cloudbasesolutions.com>
Acked-by: Eitan Eliahu <eliahue@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/netlink-socket.c