1 /* SAMHAIN file system integrity testing */ 2 /* Copyright (C) 1999, 2015 Rainer Wichmann */ 3 /* */ 4 /* This program is free software; you can redistribute it */ 5 /* and/or modify */ 6 /* it under the terms of the GNU General Public License as */ 7 /* published by */ 8 /* the Free Software Foundation; either version 2 of the License, or */ 9 /* (at your option) any later version. */ 10 /* */ 11 /* This program is distributed in the hope that it will be useful, */ 12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ 14 /* GNU General Public License for more details. */ 15 /* */ 16 /* You should have received a copy of the GNU General Public License */ 17 /* along with this program; if not, write to the Free Software */ 18 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 19 20 #ifndef SH_XFER_H 21 #define SH_XFER_H 22 23 #ifndef SH_STANDALONE 24 int sh_xfer_set_strip (const char * str); 25 #endif 26 27 /* generate a random password 28 */ 29 int sh_xfer_create_password (const char * dummy); 30 31 /* set timeout for active client connections 32 */ 33 int sh_xfer_set_timeout (const char * c); 34 35 /* set time limit after which client is reported dead 36 */ 37 int sh_xfer_set_time_limit(const char * str); 38 39 /* error level for lookup failure 40 */ 41 int sh_xfer_lookup_level (const char * c); 42 43 /* create client entry for given password 44 */ 45 int sh_xfer_make_client (const char * str); 46 47 /* set port to which we connect 48 */ 49 int sh_xfer_server_port (const char * str); 50 51 #ifdef SH_WITH_SERVER 52 53 #ifdef INET_SYSLOG 54 int set_syslog_active(const char * c); 55 #endif 56 57 /* create socket and start listening 58 */ 59 void create_server_tcp_socket (void); 60 61 /* whether to use client address as known to the communication layer 62 * and set by accept() 63 */ 64 int set_socket_peer (const char * c); 65 66 /* whether to use client severity 67 */ 68 int sh_xfer_use_clt_sev (const char * c); 69 70 /* whether to use client class 71 */ 72 int sh_xfer_use_clt_class (const char * c); 73 74 /* server port 75 */ 76 int sh_xfer_set_port(const char * c); 77 78 /* server interface 79 */ 80 int sh_xfer_set_interface(const char * c); 81 82 /* a wrapper function 83 */ 84 void sh_xfer_html_write(void); 85 86 /* register a client 87 */ 88 int sh_xfer_register_client (const char * str); 89 90 /* start server 91 */ 92 void sh_xfer_start_server(void); 93 94 /* free() everything 95 */ 96 void sh_xfer_free_all (void); 97 98 #endif 99 100 #if defined(SH_WITH_CLIENT) || defined(SH_WITH_SERVER) 101 /* talk to server 102 */ 103 long sh_xfer_report (char * errmsg); 104 105 /* set log server 106 */ 107 int sh_xfer_set_logserver (const char * address); 108 void reset_count_dev_server(void); 109 #endif 110 111 #ifdef SH_WITH_CLIENT 112 113 /* Throttle file download 114 */ 115 int sh_xfer_set_throttle_delay (const char * c); 116 117 /* request file from server. file may be "CONF" or "DATA" or a UUID. 118 */ 119 long sh_xfer_request_file (const char * file); 120 121 #endif 122 123 #endif 124 125