1 /* 2 * dcc.h: Things dealing client to client connections. 3 * 4 * Written By Troy Rollo <troy@plod.cbme.unsw.oz.au> 5 * 6 * Copyright (c) 1990 Michael Sandrof. 7 * Copyright (c) 1991, 1992 Troy Rollo. 8 * Copyright (c) 1992-2014 Matthew R. Green. 9 * All rights reserved. 10 * 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that the following conditions 13 * are met: 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials provided with the distribution. 19 * 3. The name of the author may not be used to endorse or promote products 20 * derived from this software without specific prior written permission. 21 * 22 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS OR 23 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 24 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 25 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, 26 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)$eterna: dcc.h,v 1.34 2014/03/09 08:35:46 mrg Exp $ 35 */ 36 37 /* 38 * this file must be included after irc.h as i needed <sys/types.h> 39 * <netinet/in.h> and <apra/inet.h> and, possibly, <sys/select.h> 40 */ 41 42 #ifndef irc__dcc_h_ 43 #define irc__dcc_h_ 44 45 /* 46 * this list needs to be kept in sync with the dcc_types[] array 47 * in dcc.c 48 */ 49 #define DCC_CHAT ((unsigned) 0x0001) 50 #define DCC_FILEOFFER ((unsigned) 0x0002) 51 #define DCC_FILEREAD ((unsigned) 0x0003) 52 #define DCC_RAW_LISTEN ((unsigned) 0x0004) 53 #define DCC_RAW ((unsigned) 0x0005) 54 #define DCC_TYPES ((unsigned) 0x000f) 55 56 #define DCC_WAIT ((unsigned) 0x0010) 57 #define DCC_ACTIVE ((unsigned) 0x0020) 58 #define DCC_OFFER ((unsigned) 0x0040) 59 #define DCC_DELETE ((unsigned) 0x0080) 60 #define DCC_TWOCLIENTS ((unsigned) 0x0100) 61 #ifdef NON_BLOCKING_CONNECTS 62 #define DCC_CNCT_PEND ((unsigned) 0x0200) 63 #endif /* NON_BLOCKING_CONNECTS */ 64 #define DCC_STATES ((unsigned) 0xfff0) 65 66 void register_dcc_offer(u_char *, u_char *, u_char *, u_char *, u_char *, u_char *); 67 void process_dcc(u_char *); 68 u_char *dcc_raw_connect(u_char *, u_int); 69 u_char *dcc_raw_listen(u_int); 70 void dcc_list(u_char *); 71 void dcc_chat_transmit(u_char *, u_char *); 72 void dcc_message_transmit(u_char *, u_char *, int, int); 73 void close_all_dcc(void); 74 void set_dcc_bits(fd_set *, fd_set *); 75 void dcc_check(fd_set *, fd_set *); 76 u_char *dcc_list_func(u_char *); 77 u_char *dcc_chatpeers_func(void); 78 void set_dcchost(u_char *); 79 u_char *get_dcchost(void); 80 81 #endif /* irc__dcc_h_ */ 82