File: constants.hh

package info (click to toggle)
monotone 0.18-1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 16,440 kB
  • ctags: 13,394
  • sloc: sh: 130,618; ansic: 70,657; cpp: 51,980; perl: 421; makefile: 359; python: 184; lisp: 132; sql: 83
file content (122 lines) | stat: -rw-r--r-- 3,879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
#ifndef __CONSTANTS_HH__
#define __CONSTANTS_HH__

// copyright (C) 2002, 2003 graydon hoare <graydon@pobox.com>
// all rights reserved.
// licensed to the public under the terms of the GNU GPL (>= 2)
// see the file COPYING for details

#include <unistd.h>
#include "numeric_vocab.hh"

namespace constants
{

  // this file contains magic constants which you could, in theory, tweak.
  // probably best not to tweak them though.

  // number of bits in an RSA key we use
  extern size_t const keylen; 

  // number of characters in a SHA1 id
  extern size_t const idlen; 

  // number of characters in an encoded epoch
  extern size_t const epochlen;

  // number of characters in a raw epoch
  extern size_t const epochlen_bytes;

  // number of seconds in window, in which to consider CVS commits equivalent
  // if they have otherwise compatible contents (author, changelog)
  extern size_t const cvs_window; 

  // number of bytes in a password buffer. further bytes will be dropped.
  extern size_t const maxpasswd;

  // number of bytes to use in buffers, for buffered i/o operations
  extern size_t const bufsz;

  // size of a line of database traffic logging, beyond which lines will be
  // truncated.
  extern size_t const db_log_line_sz;

  // size in bytes of the database xdelta version reconstruction cache
  extern size_t const db_version_cache_sz;

  // size of a line of text in the log buffer, beyond which log lines will be
  // truncated.
  extern size_t const log_line_sz;

  // all the ASCII characters (bytes) which are legal in a packet
  extern char const * const legal_packet_bytes;

  // all the ASCII characters (bytes) which are legal in an ACE string
  extern char const * const legal_ace_bytes;

  // all the ASCII characters (bytes) which are legal in a SHA1 hex id
  extern char const * const legal_id_bytes;

  // all the ASCII characters (bytes) which can occur in cert names
  extern char const * const legal_cert_name_bytes;

  // all the ASCII characters (bytes) which can occur in key names
  extern char const * const legal_key_name_bytes;

  // all the ASCII characters (bytes) which are illegal in a (file|local)_path
  extern char const * const illegal_path_bytes;

  // how many revisions back to verify the sanity of revisions before allowing
  // them into the database
  extern int const verify_depth;

  // remaining constants are related to netsync protocol

  // number of bytes in the hash used in netsync
  extern size_t const merkle_hash_length_in_bytes;

  // number of bits of merkle prefix consumed by each level of tree
  extern size_t const merkle_fanout_bits;

  // derived from hash_length_in_bytes
  extern size_t const merkle_hash_length_in_bits;

  // derived from fanout_bits
  extern size_t const merkle_num_tree_levels;

  // derived from fanout_bits
  extern size_t const merkle_num_slots;

  // derived from fanout_bits
  extern size_t const merkle_bitmap_length_in_bits;

  // derived from fanout_bits
  extern size_t const merkle_bitmap_length_in_bytes;

  // the current netcmd/netsync protocol version
  extern u8 const netcmd_current_protocol_version;

  // minimum size of any netcmd on the wire
  extern size_t const netcmd_minsz;
  
  // largest command *payload* allowed in a netcmd
  extern size_t const netcmd_payload_limit;

  // maximum size of any netcmd on the wire, including payload
  extern size_t const netcmd_maxsz;

  // netsync fragments larger than this are gzipped
  extern size_t const netcmd_minimum_bytes_to_bother_with_gzip;

  // TCP port to listen on / connect to when doing netsync
  extern size_t const netsync_default_port;

  // maximum number of simultaneous clients on a server
  extern size_t const netsync_connection_limit;

  // number of seconds a connection can be idle before it's dropped
  extern size_t const netsync_timeout_seconds;

}

#endif // __CONSTANTS_HH__