-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathfmq_msg.xml
More file actions
104 lines (81 loc) · 3.61 KB
/
fmq_msg.xml
File metadata and controls
104 lines (81 loc) · 3.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<class
name = "fmq_msg"
signature = "3"
title = "The FileMQ Protocol"
script = "zproto_codec_c"
package_dir = "../include"
source_dir = "."
>
<!-- This file describes the FileMQ protocol as specified by
the zproto project from ZeroMQ, found at...
https://github.com/zeromq/zproto
The corresponding source and header files are generated by
running this file through gsl with the zproto_codec_c.gsl
script, e.g.
$ gsl fmq_msg.xml
Obviously, to do this, one needs to have gsl installed. It can
be found at...
https://github.com/imatix/gsl -->
This is the FILEMQ protocol version 2.0
<!-- As layed out by zproject, the license is in the main dir -->
<include filename = "../license.xml" />
<!-- This file represents version 2 of the FILEMQ protocol which
is documented at http://rfc.zeromq.org/spec:35 -->
<!-- Protocol version -->
<define name = "VERSION" value = "2" />
<!-- File operations -->
<define name = "FILE CREATE" value = "1" />
<define name = "FILE DELETE" value = "2" />
<message name = "OHAI" id = "1">
Client opens peering
<field name = "protocol" type = "string" value = "FILEMQ">Constant "FILEMQ"</field>
<field name = "version" type = "number" size = "2" value = "FMQ_MSG_VERSION">Protocol version 2</field>
</message>
<message name = "OHAI OK" id = "4">
Server grants the client access
</message>
<!-- An important note to remeber is that the type "string" is a
stack variable array with a size of 256. The type "longstr" is a
heap allocated buffer for a string. -->
<message name = "ICANHAZ" id = "5">
Client subscribes to a path
<field name = "path" type = "longstr">Full path or path prefix</field>
<field name = "options" type = "hash">Subscription options</field>
<field name = "cache" type = "hash">File SHA-1 signatures</field>
</message>
<message name = "ICANHAZ OK" id = "6">
Server confirms the subscription
</message>
<message name = "NOM" id = "7">
Client sends credit to the server
<field name = "credit" type = "number" size = "8">Credit, in bytes</field>
<field name = "sequence" type = "number" size = "8">Chunk sequence, 0 and up</field>
</message>
<message name = "CHEEZBURGER" id = "8">
The server sends a file chunk
<field name = "sequence" type = "number" size = "8">File offset in bytes</field>
<field name = "operation" type = "number" size = "1">Create=%d1 delete=%d2</field>
<field name = "filename" type = "longstr">Relative name of file</field>
<field name = "offset" type = "number" size = "8">File offset in bytes</field>
<field name = "eof" type = "number" size = "1">Last chunk in file?</field>
<field name = "headers" type = "hash">File properties</field>
<field name = "chunk" type = "chunk">Data chunk</field>
</message>
<message name = "HUGZ" id = "9">
Client sends a heartbeat
</message>
<message name = "HUGZ OK" id = "10">
Server answers a heartbeat
</message>
<message name = "KTHXBAI" id = "11">
Client closes the peering
</message>
<message name = "SRSLY" id = "128">
Server refuses client due to access rights
<field name = "reason" type = "string">Printable explanation, 255 characters</field>
</message>
<message name = "RTFM" id = "129">
Server tells client it sent an invalid message
<field name = "reason" type = "string">Printable explanation, 255 characters</field>
</message>
</class>