<options script = "sockopts">
    <!--
    Copyright (c) the Contributors as noted in the AUTHORS file.
    This file is part of CZMQ, the high-level C binding for 0MQ:
    http://czmq.zeromq.org.

    This Source Code Form is subject to the terms of the Mozilla Public
    License, v. 2.0. If a copy of the MPL was not distributed with this
    file, You can obtain one at http://mozilla.org/MPL/2.0/.
    -->
    <version major = "4" minor = "3" style = "macro">
        <!-- Options that are new in 4.3 -->
        <option name = "router_notify"     type = "int"    mode = "rw" test = "ROUTER"
            test_value = "3" />
        <option name = "multicast_loop"    type = "int"    mode = "rw" test = "RADIO"
            test_value = "1" />
        <option name = "metadata"          type = "string" mode = "rw" test = "DEALER"
            test_value = "X-testkey:testvalue" />
        <option name = "loopback_fastpath" type = "int"    mode = "rw" test = "DEALER"
            test_value = "1" />
        <option name = "zap_enforce_domain" type = "int"   mode = "rw" test = "DEALER"
            test_value = "1" />

        <!-- We don't test these as libzmq doesn't always support GSSAPI -->
        <option name = "gssapi_principal_nametype"  type = "int" mode = "rw" />
        <option name = "gssapi_service_principal_nametype" type = "int" mode = "rw" />

        <!-- We don't test this as it requires CAP_NET_RAW or root -->
        <option name = "bindtodevice"      type = "string" mode = "rw" />
    </version>

    <version major = "4" minor = "2" style = "macro">
        <!-- Options that are new in 4.2 -->
        <option name = "heartbeat_ivl"     type = "int"    mode = "rw" test = "DEALER"
            test_value = "2000" />
        <option name = "heartbeat_ttl"     type = "int"    mode = "rw"  test = "DEALER"
            test_value = "4000" />
        <option name = "heartbeat_timeout" type = "int"    mode = "rw"  test = "DEALER"
            test_value = "6000" />
        <option name = "use_fd"            type = "int"    mode = "rw"  test = "REQ"
            test_value = "3" />
        <option name = "xpub_manual"       type = "int"    mode = "w"  test = "XPUB"
            test_value = "1" >
            <restrict type = "XPUB" />
        </option>
        <option name = "xpub_welcome_msg"  type = "string" mode = "w"  test = "XPUB"
            test_value = "welcome" >
            <restrict type = "XPUB" />
        </option>
        <option name = "stream_notify"     type = "int"    mode = "w"  test = "STREAM"
            test_value = "1" >
            <restrict type = "STREAM" />
        </option>
        <option name = "invert_matching"   type = "int"    mode = "rw" test = "XPUB"
            test_value = "1" >
            <restrict type = "XPUB" />
            <restrict type = "PUB" />
            <restrict type = "SUB" />
        </option>
        <option name = "xpub_verboser"     type = "int"    mode = "w"  test = "XPUB"
            test_value = "1" >
            <restrict type = "XPUB" />
        </option>
        <option name = "connect_timeout"   type = "int"    mode = "rw" test = "DEALER"
            test_value = "200" />
        <option name = "tcp_maxrt"         type = "int"    mode = "rw" test = "DEALER"
            test_value = "200" />
        <option name = "thread_safe"       type = "int"    mode = "r"  test = "DEALER"
            test_value = "0" />
        <option name = "multicast_maxtpdu" type = "int"    mode = "rw" test = "DEALER"
            test_value = "1400" />

        <!-- We don't test these as libzmq doesn't always support VMCI -->
        <option name = "vmci_buffer_size"  type = "uint64" mode = "rw" />
        <option name = "vmci_buffer_min_size" type = "uint64" mode = "rw" />
        <option name = "vmci_buffer_max_size" type = "uint64" mode = "rw" />
        <option name = "vmci_connect_timeout" type = "int" mode = "rw" />
    </version>

    <version major = "4" minor = "1" style = "macro">
        <!-- Options that are new in 4.1 -->
        <option name = "tos"               type = "int"    mode = "rw" test = "DEALER" />
        <option name = "router_handover"   type = "int"    mode = "w"  test = "ROUTER">
            <restrict type = "ROUTER" />
        </option>
        <option name = "connect_rid"       type = "key"    mode = "w"  test = "ROUTER"
            test_value = "ABCD" >
            <restrict type = "ROUTER" />
            <restrict type = "STREAM" />
        </option>
        <option name = "handshake_ivl"     type = "int"    mode = "rw" test = "DEALER"
            test_value = "200" />
        <option name = "socks_proxy"       type = "string" mode = "rw" test = "DEALER"
            test_value = "127.0.0.1" />
        <option name = "xpub_nodrop"       type = "int"    mode = "w"  test = "XPUB"
            test_value = "1" >
            <restrict type = "XPUB" />
            <restrict type = "PUB" />
        </option>
    </version>

    <version major = "4" style = "macro">
        <!-- Options that are new in 4.0 -->
        <option name = "router_mandatory"  type = "int"    mode = "w"  test = "ROUTER">
            <restrict type = "ROUTER" />
        </option>
        <option name = "probe_router"      type = "int"    mode = "w"  test = "DEALER">
            <restrict type = "ROUTER" />
            <restrict type = "DEALER" />
            <restrict type = "REQ" />
        </option>
        <option name = "req_relaxed"       type = "int"    mode = "w"  test = "REQ">
            <restrict type = "REQ" />
        </option>
        <option name = "req_correlate"     type = "int"    mode = "w"  test = "REQ">
            <restrict type = "REQ" />
        </option>
        <option name = "conflate"          type = "int"    mode = "w"  test = "PUSH">
            <restrict type = "PUSH" />
            <restrict type = "PULL" />
            <restrict type = "PUB" />
            <restrict type = "SUB" />
            <restrict type = "DEALER" />
        </option>
        
        <!-- Security options -->
        <option name = "zap_domain"        type = "string" mode = "rw" test = "SUB" />
        <option name = "mechanism"         type = "int"    mode = "r"  test = "SUB" />

        <option name = "plain_server"      type = "int"    mode = "rw" test = "PUB" />
        <option name = "plain_username"    type = "string" mode = "rw" test = "SUB" />
        <option name = "plain_password"    type = "string" mode = "rw" test = "SUB" />

        <!-- We don't test these as libzmq doesn't always support CURVE security -->
        <option name = "curve_server"      type = "int"    mode = "rw" />
        <option name = "curve_publickey"   type = "key"    mode = "rw" />
        <option name = "curve_secretkey"   type = "key"    mode = "rw" />
        <option name = "curve_serverkey"   type = "key"    mode = "rw" />

        <!-- We don't test these as libzmq doesn't always support GSSAPI security -->
        <option name = "gssapi_server"     type = "int"    mode = "rw" />
        <option name = "gssapi_plaintext"  type = "int"    mode = "rw" />
        <option name = "gssapi_principal"  type = "string" mode = "rw" />
        <option name = "gssapi_service_principal"
                                           type = "string" mode = "rw" />

        <!-- New names for deprecated 3.x options -->
        <option name = "ipv6"              type = "int"    mode = "rw" test = "SUB" />
        <option name = "immediate"         type = "int"    mode = "rw" test = "DEALER" />
    </version>
    
    <version major = "3" style = "macro">
        <!-- Options that are carried forward to 4.0 -->
        <option name = "sndhwm"            type = "int"    mode = "rw" test = "PUB" />
        <option name = "rcvhwm"            type = "int"    mode = "rw" test = "SUB" />
        <option name = "maxmsgsize"        type = "int64"  mode = "rw" test = "SUB" />
        <option name = "multicast_hops"    type = "int"    mode = "rw" test = "SUB" />
        <option name = "xpub_verbose"      type = "int"    mode = "w"  test = "XPUB">
            <restrict type = "XPUB" />
        </option>
        <option name = "tcp_keepalive"     type = "int"    mode = "rw" test = "SUB" />
        <option name = "tcp_keepalive_idle"
                                           type = "int"    mode = "rw" test = "SUB" />
        <option name = "tcp_keepalive_cnt" type = "int"    mode = "rw" test = "SUB" />
        <option name = "tcp_keepalive_intvl"
                                           type = "int"    mode = "rw" test = "SUB" />
        <option name = "tcp_accept_filter" type = "string" mode = "rw" test = "SUB"
                test_value = "127.0.0.1" />
        <option name = "last_endpoint"     type = "string" mode = "r"  test = "SUB" />

        <!-- Options that are deprecated in 4.0 -->
        <option name = "router_raw"        type = "int"    mode = "w"  test = "ROUTER" >
            <restrict type = "ROUTER" />
        </option>
        <option name = "ipv4only"          type = "int"    mode = "rw" test = "SUB" />
        <option name = "delay_attach_on_connect"
                                           type = "int"    mode = "w"  test = "PUB" />
    </version>

    <!-- Legacy version 2 -->
    <version major = "2" style = "macro">
        <option name = "hwm"               type = "uint64" mode = "rw" test = "SUB" major_removed = "3" />
        <option name = "swap"              type = "int64"  mode = "rw" test = "SUB" major_removed = "3" />
        <option name = "affinity"          type = "uint64" mode = "rw" test = "SUB" />
        <option name = "identity"          type = "string" mode = "rw" test = "DEALER">
            <restrict type = "REQ" />
            <restrict type = "REP" />
            <restrict type = "DEALER" />
            <restrict type = "ROUTER" />
        </option>
        <option name = "rate"              type = "int64"  mode = "rw" test = "SUB" major_changed = "3" type_new = "int" />
        <option name = "recovery_ivl"      type = "int64"  mode = "rw" test = "SUB" major_changed = "3" type_new = "int" />
        <option name = "recovery_ivl_msec" type = "int64"  mode = "rw" test = "SUB" major_removed = "3" />
        <option name = "mcast_loop"        type = "int64"  mode = "rw" test = "SUB" major_removed = "3" />
        <option name = "rcvtimeo"          type = "int"    mode = "rw" test = "SUB" minor = "2" />
        <option name = "sndtimeo"          type = "int"    mode = "rw" test = "SUB" minor = "2" />
        <option name = "sndbuf"            type = "uint64" mode = "rw" test = "SUB" major_changed = "3" type_new = "int" />
        <option name = "rcvbuf"            type = "uint64" mode = "rw" test = "SUB" major_changed = "3" type_new = "int" />
        <option name = "linger"            type = "int"    mode = "rw" test = "SUB" />
        <option name = "reconnect_ivl"     type = "int"    mode = "rw" test = "SUB" />
        <option name = "reconnect_ivl_max" type = "int"    mode = "rw" test = "SUB" />
        <option name = "backlog"           type = "int"    mode = "rw" test = "SUB" />
        <option name = "subscribe"         type = "string" mode = "w"  test = "SUB">
            <restrict type = "SUB" />
        </option>
        <option name = "unsubscribe"       type = "string" mode = "w"  test = "SUB">
            <restrict type = "SUB" />
        </option>
        <option name = "type"              type = "int"    mode = "r"  test = "SUB" />
        <option name = "rcvmore"           type = "int64"  mode = "r"  test = "SUB" major_changed = "3" type_new = "int" />
        <option name = "fd"                type = "socket" mode = "r"  test = "SUB" />
        <option name = "events"            type = "uint32" mode = "r"  test = "SUB" major_changed = "3" type_new = "int" />
    </version>
</options>
