protocol.hon commit Merge branch 'cl/t9001-cleanup' into maint (b1bdf46)
   1#ifndef PROTOCOL_H
   2#define PROTOCOL_H
   3
   4enum protocol_version {
   5        protocol_unknown_version = -1,
   6        protocol_v0 = 0,
   7        protocol_v1 = 1,
   8};
   9
  10/*
  11 * Used by a client to determine which protocol version to request be used when
  12 * communicating with a server, reflecting the configured value of the
  13 * 'protocol.version' config.  If unconfigured, a value of 'protocol_v0' is
  14 * returned.
  15 */
  16extern enum protocol_version get_protocol_version_config(void);
  17
  18/*
  19 * Used by a server to determine which protocol version should be used based on
  20 * a client's request, communicated via the 'GIT_PROTOCOL' environment variable
  21 * by setting appropriate values for the key 'version'.  If a client doesn't
  22 * request a particular protocol version, a default of 'protocol_v0' will be
  23 * used.
  24 */
  25extern enum protocol_version determine_protocol_version_server(void);
  26
  27/*
  28 * Used by a client to determine which protocol version the server is speaking
  29 * based on the server's initial response.
  30 */
  31extern enum protocol_version determine_protocol_version_client(const char *server_response);
  32
  33#endif /* PROTOCOL_H */