]> git.ipfire.org Git - thirdparty/git.git/blame - protocol.h
The ninteenth batch
[thirdparty/git.git] / protocol.h
CommitLineData
373d70ef
BW
1#ifndef PROTOCOL_H
2#define PROTOCOL_H
3
331b094e
EN
4/*
5 * Intensive research over the course of many years has shown that
6 * port 9418 is totally unused by anything else. Or
7 *
8 * Your search - "port 9418" - did not match any documents.
9 *
10 * as www.google.com puts it.
11 *
12 * This port has been properly assigned for git use by IANA:
13 * git (Assigned-9418) [I06-050728-0001].
14 *
15 * git 9418/tcp git pack transfer service
16 * git 9418/udp git pack transfer service
17 *
18 * with Linus Torvalds <torvalds@osdl.org> as the point of
19 * contact. September 2005.
20 *
d05b08cd 21 * See https://www.iana.org/assignments/port-numbers
331b094e
EN
22 */
23#define DEFAULT_GIT_PORT 9418
24
373d70ef
BW
25enum protocol_version {
26 protocol_unknown_version = -1,
27 protocol_v0 = 0,
28 protocol_v1 = 1,
8f6982b4 29 protocol_v2 = 2,
373d70ef
BW
30};
31
32/*
33 * Used by a client to determine which protocol version to request be used when
34 * communicating with a server, reflecting the configured value of the
35 * 'protocol.version' config. If unconfigured, a value of 'protocol_v0' is
36 * returned.
37 */
55454427 38enum protocol_version get_protocol_version_config(void);
373d70ef
BW
39
40/*
41 * Used by a server to determine which protocol version should be used based on
42 * a client's request, communicated via the 'GIT_PROTOCOL' environment variable
43 * by setting appropriate values for the key 'version'. If a client doesn't
44 * request a particular protocol version, a default of 'protocol_v0' will be
45 * used.
46 */
55454427 47enum protocol_version determine_protocol_version_server(void);
373d70ef
BW
48
49/*
50 * Used by a client to determine which protocol version the server is speaking
51 * based on the server's initial response.
52 */
55454427 53enum protocol_version determine_protocol_version_client(const char *server_response);
373d70ef
BW
54
55#endif /* PROTOCOL_H */