00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifndef dccH
00038 #define dccH
00039
00040
00041 #include <time.h>
00042
00043 #include "logic.h"
00044 #include "sock.h"
00045 #include "filesys.h"
00046
00047
00048
00049
00050
00051 #define DCC_NO_SUCH_FILE 1
00052
00053
00054
00055
00056 #define DCC_ACCESS_DENIED 2
00057
00058
00059
00060
00061 #define DCC_IO_ERROR 3
00062
00063
00064
00065
00066
00067
00068
00069 struct s_dcc_awaiting_user {
00070 bool using_ipv6;
00071 char user_name_as_in_logic[128];
00072 in_addr addr4;
00073 in_addr6_ addr6;
00074 time_t start_time;
00075
00076 string nick;
00077 string ident;
00078 string host;
00079 string fullname;
00080
00081 s_dcc_awaiting_user()
00082 {
00083 memset(user_name_as_in_logic,0,sizeof(user_name_as_in_logic));
00084 memset(&addr4,0,sizeof(addr4));
00085 memset(&addr6,0,sizeof(addr6));
00086 using_ipv6=false;
00087 start_time=0;
00088 nick=ident=host=fullname="";
00089 }
00090 };
00091
00092 void dcc_make_server(int ipv, int group, const char* bind_ip, unsigned short bind_port, string server_type);
00093 void dcc_make_telnet_server(int ipv, const char* bind_ip, unsigned short bind_port);
00094 string dcc_get_string(string msg, int& dcc_group);
00095
00096 string dcc_get_password(string user);
00097
00098 void dcc_partyline_message(string channel, string message);
00099 void dcc_user_pong(string time_, string user, string origin_bot);
00100 void dcc_user_pong(string user, string origin_bot, string name, string number, string comment);
00101
00102 void dcc_notify(string user, int reason, string incomplete_file);
00103
00104 int dcc_send_file(bool from_dcc, string public_name, string nick, int dcc_group);
00105
00106 void dcc_file_has_been_read(string public_name, string nick);
00107
00108 void dcc_loop();
00109
00110 void dcc_rehashed(string who);
00111
00112 void dcc_upgrade_bot_join(string nick, string ident, string host, string fullname, string channel);
00113 void dcc_upgrade_bot_mode(string nick, string ident, string host, string fullname, string channel, string mode);
00114 void dcc_upgrade_bot_nick(string nick, string ident, string host, string fullname, string new_nick);
00115
00116 void dcc_broadcast(string user_mask, string msg, string sender, string bot_mask);
00117
00118 #endif