3 #include <time.h> /* for time_t */
12 #define STAT_CONNECTING 4
13 #define STAT_ABORTED 5
17 #define TYPE_CHATRECV 2
18 #define TYPE_CHATSEND 3
20 #define CPS_AVG_WINDOW 10
22 /* can we do 64-bit dcc? */
23 #if defined(G_GINT64_FORMAT)
25 /* we really get only 63 bits, since st_size is signed */
26 #define DCC_SIZE gint64
27 #define DCC_SFMT G_GINT64_FORMAT
29 #define DCC_SIZE unsigned int
36 struct dcc_chat
*dccchat
;
37 struct proxy_state
*proxy
;
38 guint32 addr
; /* the 32bit IP number, host byte order */
39 int fp
; /* file pointer */
41 int iotag
; /* reading io tag */
42 int wiotag
; /* writing/sending io tag */
44 int pasvid
; /* mIRC's passive DCC id */
49 GTimeVal lastcpstv
, firstcpstv
;
53 unsigned char ack_buf
[4]; /* buffer for reading 4-byte ack */
63 char *file
; /* utf8 */
64 char *destfile
; /* utf8 */
65 char *destfile_fs
; /* local filesystem encoding */
67 unsigned char type
; /* 0 = SEND 1 = RECV 2 = CHAT */
68 unsigned char dccstat
; /* 0 = QUEUED 1 = ACTIVE 2 = FAILED 3 = DONE */
69 unsigned int resume_sent
:1; /* resume request sent */
70 unsigned int fastsend
:1;
71 unsigned int ackoffset
:1; /* is reciever sending acks as an offset from */
72 /* the resume point? */
73 unsigned int throttled
:2; /* 0x1 = per send/get throttle
74 0x2 = global throttle */
77 #define MAX_PROXY_BUFFER 1024
81 unsigned char buffer
[MAX_PROXY_BUFFER
];
94 char *name
; /* Display name */
95 int color
; /* Display color (index into colors[] ) */
98 extern struct dccstat_info dccstat
[];
100 gboolean
is_dcc (struct DCC
*dcc
);
101 void dcc_abort (session
*sess
, struct DCC
*dcc
);
102 void dcc_get (struct DCC
*dcc
);
103 int dcc_resume (struct DCC
*dcc
);
104 void dcc_check_timeouts (void);
105 void dcc_change_nick (server
*serv
, char *oldnick
, char *newnick
);
106 void dcc_notify_kill (struct server
*serv
);
107 struct DCC
*dcc_write_chat (char *nick
, char *text
);
108 void dcc_send (struct session
*sess
, char *to
, char *file
, int maxcps
, int passive
);
109 struct DCC
*find_dcc (char *nick
, char *file
, int type
);
110 void dcc_get_nick (struct session
*sess
, char *nick
);
111 void dcc_chat (session
*sess
, char *nick
, int passive
);
112 void handle_dcc (session
*sess
, char *nick
, char *word
[], char *word_eol
[]);
113 void dcc_show_list (session
*sess
);
114 guint32
dcc_get_my_address (void);
115 void dcc_get_with_destfile (struct DCC
*dcc
, char *utf8file
);