mod_tile 0.9.1
Renders map tiles with Mapnik and serves them using Apache HTTP Server
Loading...
Searching...
No Matches
protocol.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007 - 2026 by mod_tile contributors (see AUTHORS file)
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; If not, see http://www.gnu.org/licenses/.
16 */
17
18#ifndef PROTOCOL_H
19#define PROTOCOL_H
20
21#include "config.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Protocol between client and render daemon
28 *
29 * ver = 2;
30 *
31 * cmdRender(z,x,y,xmlconfig), response: {cmdDone(z,x,y), cmdBusy(z,x,y)}
32 * cmdDirty(z,x,y,xmlconfig), no response
33 *
34 * A client may not bother waiting for a response if the render daemon is too slow
35 * causing responses to get slightly out of step with requests.
36 */
37
39#define TILE_PATH_MAX (256)
40
42#define PROTO_VER (3)
43
44#ifndef RENDERD_SOCKET
46#define RENDERD_SOCKET "/run/renderd/renderd.sock"
47#endif
48
49#ifndef RENDERD_HOST
51#define RENDERD_HOST "localhost"
52#endif
53
54#ifndef RENDERD_PORT
56#define RENDERD_PORT 7654
57#endif
58
60#define XMLCONFIG_MAX 41
61
83
107
113 struct protocol_v1 {
115 int ver;
119 int x;
121 int y;
123 int z;
124 };
125
131 struct protocol_v2 {
133 int ver;
137 int x;
139 int y;
141 int z;
144 };
145
146#ifdef __cplusplus
147}
148#endif
149
150#endif /* PROTOCOL_H */
#define XMLCONFIG_MAX
Maximum buffer size (including NUL terminator) for map style names, MIME types, and options.
Definition protocol.h:60
protoCmd
Command opcodes exchanged over the mod_tile / renderd IPC wire protocol.
Definition protocol.h:65
@ cmdNotDone
Response from renderd indicating the request was dropped or the daemon is busy.
Definition protocol.h:75
@ cmdRenderBulk
Bulk/batch tile render request (e.g. from render_list).
Definition protocol.h:79
@ cmdRender
Standard interactive tile render request (expects cmdDone or cmdNotDone reply).
Definition protocol.h:69
@ cmdRenderLow
Low-priority interactive tile render request (e.g. expired tile served stale).
Definition protocol.h:81
@ cmdIgnore
No-op / ignored message.
Definition protocol.h:67
@ cmdDirty
Mark a metatile as dirty for background re-rendering (no reply expected).
Definition protocol.h:71
@ cmdRenderPrio
High-priority interactive tile render request (e.g. missing tile on disk).
Definition protocol.h:77
@ cmdDone
Response from renderd indicating the requested metatile finished rendering.
Definition protocol.h:73
Legacy version 1 wire protocol message packet (ver == 1).
Definition protocol.h:113
int z
Tile zoom level.
Definition protocol.h:123
int x
Tile X coordinate.
Definition protocol.h:119
int y
Tile Y coordinate.
Definition protocol.h:121
int ver
Protocol version number (1).
Definition protocol.h:115
enum protoCmd cmd
Request or response command opcode.
Definition protocol.h:117
Legacy version 2 wire protocol message packet (ver == 2).
Definition protocol.h:131
int y
Tile Y coordinate.
Definition protocol.h:139
enum protoCmd cmd
Request or response command opcode.
Definition protocol.h:135
int ver
Protocol version number (2).
Definition protocol.h:133
int x
Tile X coordinate.
Definition protocol.h:137
char xmlname[41]
Null-terminated target map configuration (xmlconfig) name.
Definition protocol.h:143
int z
Tile zoom level.
Definition protocol.h:141
Version 3 wire protocol message packet (PROTO_VER == 3).
Definition protocol.h:89
char options[41]
Null-terminated style parameterization options string.
Definition protocol.h:105
int ver
Protocol version number (3 for struct protocol).
Definition protocol.h:91
enum protoCmd cmd
Request or response command opcode.
Definition protocol.h:93
int x
Tile X coordinate.
Definition protocol.h:95
int y
Tile Y coordinate.
Definition protocol.h:97
int z
Tile zoom level.
Definition protocol.h:99
char xmlname[41]
Null-terminated target map configuration (xmlconfig) name.
Definition protocol.h:101
char mimetype[41]
Null-terminated requested output MIME type (e.g. "image/png").
Definition protocol.h:103