monotone

monotone Mtn Source Tree

Root/constants.hh

1#ifndef __CONSTANTS_HH__
2#define __CONSTANTS_HH__
3
4// copyright (C) 2002, 2003 graydon hoare <graydon@pobox.com>
5// all rights reserved.
6// licensed to the public under the terms of the GNU GPL (>= 2)
7// see the file COPYING for details
8
9#include <unistd.h>
10#include "numeric_vocab.hh"
11
12namespace constants
13{
14
15 // this file contains magic constants which you could, in theory, tweak.
16 // probably best not to tweak them though.
17
18 // number of bits in an RSA key we use
19 extern size_t const keylen;
20
21 // number of bytes of random noise we seed vcheck packets with
22 extern size_t const vchecklen;
23
24 // number of characters in a SHA1 id
25 extern size_t const idlen;
26
27 // number of seconds in window, in which to consider CVS commits equivalent
28 // if they have otherwise compatible contents (author, changelog)
29 extern size_t const cvs_window;
30
31 // number of bytes accepted in a database row (also used as a file upload
32 // limit in the depot code).
33 extern size_t const maxbytes;
34
35 // advisory number of bytes sent in a single network transmission; not a
36 // strict limit (single packets beyond this size will post as a unit) but a
37 // "suggested maximum size" for each posting.
38 extern size_t const postsz;
39
40 // number of bytes to use in buffers, for buffered i/o operations
41 extern size_t const bufsz;
42
43 // size of a line of database traffic logging, beyond which lines will be
44 // truncated.
45 extern size_t const db_log_line_sz;
46
47 // size of a line of text in the log buffer, beyond which log lines will be
48 // truncated.
49 extern size_t const log_line_sz;
50
51 // all the ASCII characters (bytes) which are legal in a packet
52 extern char const * const legal_packet_bytes;
53
54 // all the ASCII characters (bytes) which are legal in an ACE string
55 extern char const * const legal_ace_bytes;
56
57 // all the ASCII characters (bytes) which are legal in a SHA1 hex id
58 extern char const * const legal_id_bytes;
59
60 // all the ASCII characters (bytes) which can occur in URLs
61 extern char const * const legal_url_bytes;
62
63 // all the ASCII characters (bytes) which can occur in cert names
64 extern char const * const legal_cert_name_bytes;
65
66 // all the ASCII characters (bytes) which can occur in key names
67 extern char const * const legal_key_name_bytes;
68
69 // all the ASCII characters (bytes) which are illegal in a (file|local)_path
70 extern char const * const illegal_path_bytes;
71
72
73 // remaining constants are related to netsync protocol
74
75 // number of bytes in the hash used in netsync
76 extern size_t const merkle_hash_length_in_bytes;
77
78 // number of bits of merkle prefix consumed by each level of tree
79 extern size_t const merkle_fanout_bits;
80
81 // derived from hash_length_in_bytes
82 extern size_t const merkle_hash_length_in_bits;
83
84 // derived from fanout_bits
85 extern size_t const merkle_num_tree_levels;
86
87 // derived from fanout_bits
88 extern size_t const merkle_num_slots;
89
90 // derived from fanout_bits
91 extern size_t const merkle_bitmap_length_in_bits;
92
93 // derived from fanout_bits
94 extern size_t const merkle_bitmap_length_in_bytes;
95
96 // the current netcmd/netsync protocol version
97 extern u8 const netcmd_current_protocol_version;
98
99 // minimum size of any netcmd on the wire
100 extern size_t const netcmd_minsz;
101
102 // largest command *payload* allowed in a netcmd
103 extern size_t const netcmd_payload_limit;
104
105 // maximum size of any netcmd on the wire, including payload
106 extern size_t const netcmd_maxsz;
107
108 // netsync fragments larger than this are gzipped
109 extern size_t const netcmd_minimum_bytes_to_bother_with_gzip;
110
111 // TCP port to listen on / connect to when doing netsync
112 extern size_t const netsync_default_port;
113
114 // maximum number of simultaneous clients on a server
115 extern size_t const netsync_connection_limit;
116
117 // number of seconds a connection can be idle before it's dropped
118 extern size_t const netsync_timeout_seconds;
119
120}
121
122#endif // __CONSTANTS_HH__

Archive Download this file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status