<class
    name = "zgossip_msg"
    title = "ZeroMQ Gossip Protocol"
    script = "zproto_codec_c"
    package_dir = "."
    project_header = "czmq_classes.h"
    export_macro = "CZMQ_EXPORT"
    >
    This is a server implementation of the ZeroMQ Gossip Protocol (ZGP)
    <include filename = "../license.xml" />

    <grammar>
    C:HELLO ( C:PUBLISH / S:PUBLISH / heartbeat )
    heartbeat = C:PING / S:PONG
    </grammar>

    <!-- Header for all messages -->
    <header>
        <field name = "version" type = "number" size = "1" value = "1">Version = 1</field>
    </header>

    <message name = "hello">
        Client says hello to server
    </message>

    <message name = "publish">
        Client or server announces a new tuple
        <field name = "key" type = "string">Tuple key, globally unique</field>
        <field name = "value" type = "longstr">Tuple value, as printable string</field>
        <field name = "ttl" type = "number" size = "4">Time to live, msecs</field>
    </message>

    <message name = "ping">
        Client signals liveness
    </message>

    <message name = "pong">
        Server responds to ping; note that pongs are not correlated with pings,
        and may be mixed with other commands, and the client should treat any
        incoming traffic as valid activity.
    </message>

    <message name = "invalid">
        Server rejects command as invalid
    </message>
</class>
