1 /* 2 * Includes specific to the tray monitor 3 * 4 * Nicolas Boichat, August MMIV 5 * 6 * Version $Id: tray-monitor.h,v 1.6 2004/08/25 12:20:01 nboichat Exp $ 7 */ 8 /* 9 Copyright (C) 2004 Kern Sibbald and John Walker 10 11 This program is free software; you can redistribute it and/or 12 modify it under the terms of the GNU General Public License as 13 published by the Free Software Foundation; either version 2 of 14 the License, or (at your option) any later version. 15 16 This program is distributed in the hope that it will be useful, 17 but WITHOUT ANY WARRANTY; without even the implied warranty of 18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 19 General Public License for more details. 20 21 You should have received a copy of the GNU General Public 22 License along with this program; if not, write to the Free 23 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, 24 MA 02111-1307, USA. 25 26 */ 27 28 /* 29 * Resource codes -- they must be sequential for indexing 30 */ 31 enum rescode { 32 R_MONITOR = 1001, 33 R_DIRECTOR, 34 R_CLIENT, 35 R_STORAGE, 36 R_FIRST = R_MONITOR, 37 R_LAST = R_STORAGE /* keep this updated */ 38 }; 39 40 41 /* 42 * Some resource attributes 43 */ 44 enum { 45 R_NAME = 1020, 46 R_ADDRESS, 47 R_PASSWORD, 48 R_TYPE, 49 R_BACKUP 50 }; 51 52 /* Director */ 53 struct DIRRES { 54 RES hdr; 55 int DIRport; /* UA server port */ 56 char *address; /* UA server address */ 57 char *password; /* UA server password */ 58 int enable_ssl; /* Use SSL */ 59 }; 60 61 /* 62 * Tray Monitor Resource 63 * 64 */ 65 struct MONITOR { 66 RES hdr; 67 int require_ssl; /* Require SSL for all connections */ 68 MSGS *messages; /* Daemon message handler */ 69 char *password; /* UA server password */ 70 utime_t RefreshInterval; /* Status refresh interval */ 71 utime_t FDConnectTimeout; /* timeout for connect in seconds */ 72 utime_t SDConnectTimeout; /* timeout in seconds */ 73 }; 74 75 76 /* 77 * Client Resource 78 * 79 */ 80 struct CLIENT { 81 RES hdr; 82 83 int FDport; /* Where File daemon listens */ 84 char *address; 85 char *password; 86 int enable_ssl; /* Use SSL */ 87 }; 88 89 /* 90 * Store Resource 91 * 92 */ 93 struct STORE { 94 RES hdr; 95 96 int SDport; /* port where Directors connect */ 97 char *address; 98 char *password; 99 int enable_ssl; /* Use SSL */ 100 }; 101 102 103 104 /* Define the Union of all the above 105 * resource structure definitions. 106 */ 107 union URES { 108 MONITOR res_monitor; 109 DIRRES res_dir; 110 CLIENT res_client; 111 STORE res_store; 112 RES hdr; 113 }; 114 115 116 117 struct monitoritem { 118 rescode type; /* R_DIRECTOR, R_CLIENT or R_STORAGE */ 119 void* resource; /* DIRRES*, CLIENT* or STORE* */ 120 BSOCK *D_sock; 121 }; 122