Constants.hpp 4.06 KB
Newer Older
1
/******************************************************************************
2
 *                      castor/tape/tapebridge/Constants.hpp
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 *
 * This file is part of the Castor project.
 * See http://castor.web.cern.ch/castor
 *
 * Copyright (C) 2003  CERN
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 *
 *
 *
 * @author Nicola.Bessone@cern.ch Steven.Murray@cern.ch
 *****************************************************************************/

26
27
#ifndef CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP
#define CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP 1
28
29
30
31
32
33
34
35
36

#include "h/Castor_limits.h"

#include <stdint.h>
#include <stdlib.h>


namespace castor     {
namespace tape       {
37
namespace tapebridge {
38
39
  	
  /**
40
   * The minumim timeout in seconds between pings to the tapebridge clients.
41
42
43
44
45
46
47
48
49
50
51
   * Please note that the tape gateway is not pinged.
   */
  const int CLIENTPINGTIMEOUT = 5;

  /**
   * The size of an RTCOPY message header.  The header contains 3 32-bit integer
   * fields: magic number, request type and length or status.
   */
  const size_t HDRBUFSIZ = 3 * sizeof(uint32_t);

  /**
52
   * The maximum number of pending transfers between the tapebridge and RTCPD.
53
54
55
56
57
58
59
60
61
62
63
64
65
   * The theoretical maximum number of outstanding pending transfers is equal
   * to the memory allocated to memory buffers of RTCPD divided by the average
   * file size.
   */
  const int MAXPENDINGTRANSFERS = 100000;

  /**
   * The maximum size of an RTCOPY message in bytes including both message
   * header and message body.
   */
  const size_t RTCPMSGBUFSIZE = 4096;

  /**
66
   * The program name of the tapebridge daemon.
67
   */
68
  const char *const TAPEBRIDGEPROGRAMNAME = "tapebridged";
69
70
71
72
73
74
75
76
77
78
79
80
81

  /**
   * The tape record format.
   */
  const char *const RECORDFORMAT = "F";

  /**
   * The timeout in seconds used when sending and receiving RTCPD network
   * messages.
   */
  const int RTCPDNETRWTIMEOUT = 55;

  /**
82
   * The timeout in seconds for which the tapebridge waits for RTCPD to call it
83
84
85
86
87
88
   * back.
   */
  const int RTCPDCALLBACKTIMEOUT = 55;

  /**
   * The minimum timeout in seconds between sending a ping message from the
89
   * tapebridge to RTCPD.
90
91
92
93
94
95
96
97
   */
  const int RTCPDPINGTIMEOUT = 30;

  /**
   * The timeout in seconds used when sending and receiving client network
   * messages, where client refers to either tape gateway, readtp, writetp or
   * dumptp.  A value less than 60 seconds should be used because the default
   * timeout used by rtcpd when sending and receiving messages to and from the
98
   * tapebridge is 60 seconds.  The file CASTOR2/h/rtcp_constants.h contains
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
   * the following line:
   * <code>
   * #define RTCP_NETTIMEOUT (60)
   * </code>
   */
  const int CLIENTNETRWTIMEOUT = 55;

  /**
   * The maximum size of a VMGR message in bytes including both message header
   * and message body.
   */
  const size_t VMGRMSGBUFSIZE = 4096;

  /**
   * The timeout in seconds used when sending and receiving VMGR network
   * messages.  A value less than 60 seconds should be used because the default
   * timeout used by rtcpd when sending and receiving messages to and from the
116
   * tapebridge is 60 seconds.  The file CASTOR2/h/rtcp_constants.h contains
117
118
119
120
121
122
123
124
125
126
127
128
   * the following line:
   * <code>
   * #define RTCP_NETTIMEOUT (60)
   * </code>
   */
  const int VMGRNETRWTIMEOUT = 55;

  /**
   * An empty volume serial number.
   */
  const char EMPTYVSN[CA_MAXVSNLEN+1] = "";

129
} // namespace tapebridge
130
131
132
133
} // namespace tape
} // namespace castor


134
#endif // CASTOR_TAPE_TAPEBRIDGE_CONSTANTS_HPP