Enable TCP-MD5 on the given socket.

    :param s: Socket
    :param addr: Associated address.  On some platforms, this has no effect.
    :param key: Key.  On some platforms, this has no effect.

def set_tcp_md5sig(s, addr, key):
    """Enable TCP-MD5 on the given socket.

    :param s: Socket
    :param addr: Associated address.  On some platforms, this has no effect.
    :param key: Key.  On some platforms, this has no effect.
    """
    impls = {
        'FreeBSD': _set_tcp_md5sig_bsd,
        'Linux': _set_tcp_md5sig_linux,
        'NetBSD': _set_tcp_md5sig_bsd,
    }
    system = platform.system()
    try:
        impl = impls[system]
    except KeyError:
        raise NotImplementedError("TCP-MD5 unsupported on this platform")
    impl(s, addr, key)