dcc.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           dcc.h  -  description
00003                              -------------------
00004     begin                : Thu Dec 9 2004
00005     copyright            : (C) 2004 by VooDooMan
00006     email                : vdmfun@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010 
00011 VooDoo cIRCle - an IRC (ro)bot
00012 Copyright (C) 2004 by Marian VooDooMan Meravy (vdmfun@hotmail.com)
00013 
00014 This program is free software; you can redistribute it and/or
00015 modify it under the terms of the GNU General Public License
00016 as published by the Free Software Foundation; either version 2
00017 of the License, or (at your option) any later version.
00018 
00019 This program is distributed in the hope that it will be useful,
00020 but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License
00025 along with this program; if not, write to the Free Software
00026 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00027 
00028 ****************************************************************************/
00029 
00030 /*!
00031     \file
00032     \brief Handles DCC / telnet communication
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     \def DCC_NO_SUCH_FILE
00049     \brief No such file
00050 */
00051 #define DCC_NO_SUCH_FILE        1
00052 /*!
00053     \def DCC_ACCESS_DENIED
00054     \brief Access denied
00055 */
00056 #define DCC_ACCESS_DENIED       2
00057 /*!
00058     \def DCC_IO_ERROR
00059     \brief I/O error while accessing file
00060 */
00061 #define DCC_IO_ERROR            3
00062 
00063 /*!
00064     \brief Stores awaiting user on DCC request to process
00065     \author VooDooMan
00066     \version 2
00067     \date 2004
00068 */
00069 struct s_dcc_awaiting_user {
00070     bool using_ipv6;                        //!< Are we awaitng IPv6 connection?
00071     char user_name_as_in_logic[128];        //!< Name of user as in "logic.txt"
00072     in_addr addr4;                          //!< IPv4 address of remote user
00073     in_addr6_ addr6;                        //!< IPv6 address of remote user
00074     time_t start_time;                      //!< Time of user's initialization
00075 
00076     string nick;                            //!< Nick of user at initaition
00077     string ident;                           //!< Ident of user at initaition
00078     string host;                            //!< Host of user at initaition
00079     string fullname;                        //!< Full name of user at initaition
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

Generated on Sun Jul 10 03:22:52 2005 for VooDoo cIRCle by doxygen 1.4.3

Hosted by SourceForge.net Logo