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 characters in a SHA1 id
22 extern size_t const idlen;
23
24 // number of characters in an encoded epoch
25 extern size_t const epochlen;
26
27 // number of characters in a raw epoch
28 extern size_t const epochlen_bytes;
29
30 // number of seconds in window, in which to consider CVS commits equivalent
31 // if they have otherwise compatible contents (author, changelog)
32 extern size_t const cvs_window;
33
34 // number of bytes in a password buffer. further bytes will be dropped.
35 extern size_t const maxpasswd;
36
37 // number of bytes to use in buffers, for buffered i/o operations
38 extern size_t const bufsz;
39
40 // size of a line of database traffic logging, beyond which lines will be
41 // truncated.
42 extern size_t const db_log_line_sz;
43
44 // size in bytes of the database xdelta version reconstruction cache
45 extern size_t const db_version_cache_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 cert names
61 extern char const * const legal_cert_name_bytes;
62
63 // all the ASCII characters (bytes) which can occur in key names
64 extern char const * const legal_key_name_bytes;
65
66 // all the ASCII characters (bytes) which are illegal in a (file|local)_path
67 extern char const * const illegal_path_bytes;
68
69 // how many revisions back to verify the sanity of revisions before allowing
70 // them into the database
71 extern int const verify_depth;
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