Merge pull request #414 from ianbarber/master

Fix build breaking typos in monitor VA code
Fix char_traits<unsigned char> to what looks like correct behavior.

char_traits<unsigned char>::to_char_type(x) used to return 0 no matter
what x was, and likewise to_int_type(x) used to return 0 no matter what.
(0 is what you get when you default-construct an integral type, which
is what the old code was doing.) This seemed like buggy behavior to me,
so I've changed it.
Silence all "unused parameter" warnings from Clang.

Compiling without warnings is a good goal, because it makes
new warnings (which probably indicate bugs) stand out rather
than getting lost in the spam.

My fixes fall into two categories:

    - Adding (void) casts of unused parameters, where their
      unusedness seems like a TODO (or in some cases a bug?).

    - Removing parameter names altogether, where the function
      is clearly a stub that will never use its parameters.

Should be no change in behavior.
Verify the value of the "void *s" passed to the monitor function.

This formerly unused parameter actually represents the socket
on which the event was received. As such, we should check that
its value makes sense: it must be either "rep" or "req", and in
the case of some kinds of events, it must be specifically one
or the other.

After this change, "s" is no longer unused.
Remove unused argc/argv parameters in tests.
Merge pull request #415 from Quuxplusone/unused-parameters

Silence all "unused parameter" warnings from Clang.
Fixed license to remove references to X11 code
Merge pull request #416 from hintjens/master

Fixed COPYING.LESSER
Extend ZTP/1.0 protocol

The new protocol adds support for protocol version and  exchanges the
socket type, so that the library can reject a connection when the
sockets do not match.

The protocol was designed so that it's possible to detect and fully
support ZTP/1.0 peers.

When a new connection is set up, peers exchange greeting messages. The
greeting message encodes both the protocol verion and the socket type.
The format of the greeting message is as follows:

    greeting    = tag1, adaptation, tag2, version, length, socket_type
    tag1        = BYTE / 0xff
    adaptation  = 8 BYTES
    tag2        = BYTE / 0x7f
    version     = BYTE / 1
    length      = BYTE / 1
    socket_type = BYTE

The protocol does not define the value of adaptation field.

When interoperability with ZTP/1.0 peers is required, the adaptaion
encodes, in network byte order, the length of identity message increased
by 1. When adaptaion consists of eight zeros, the current
implementatatio of 0MQ 2.x closes the connection.

This patch supports both ZTP/1.0 and new protocol.
Decouple encoder_t and decoder_t from session_base_t

This patch introduces i_msg_sink and i_msg_source interfaces. This
allows us to make message encoder and decoder more general.
Make ZMQ interoperate with ZMQ 2.x SUB sockets

Since ZMQ 2.x does not support subscription forwarding, it's not
possible to use ZMQ 2.x SUB socket to receive messages from a PUB
socket.

This patch adds some compatibility layer so that ZMQ 2.x SUB socket
receives messages from PUB socket.
Merge pull request #418 from hurtonm/versioned_ztp

Introduce versioning into ZTP
Remove unused member variable
Remove superfluous statement
Merge pull request #419 from hurtonm/code_cleanup

Code cleanup
Fixing PGM issues

Hopefully fixed LIBZMQ-427 - there was a slight typo in the init_address
refactor. The encoder refactoring had also broken pgm_sender and
receiver, but just required updating to use the new functions.