1 |
/** |
2 |
* uplink.h: Data structures related to our uplink. Modules usually don't need this. |
3 |
* |
4 |
* Copyright © 2007 Pippijn van Steenhoven / The Ermyth Team |
5 |
* Rights to this code are as documented in COPYING. |
6 |
* |
7 |
* |
8 |
* Portions of this file were derived from sources bearing the following license: |
9 |
* Copyright © 2005 William Pitcock, et al. |
10 |
* Rights to this code are as documented in doc/pod/license.pod. |
11 |
* |
12 |
* $Id: uplink.h,v 1.4 2007-09-16 18:54:42 pippijn Exp $ |
13 |
*/ |
14 |
|
15 |
#ifndef _UPLINK_H |
16 |
#define _UPLINK_H |
17 |
|
18 |
#include <util/containers.h> |
19 |
|
20 |
struct uplink_t : zero_initialised |
21 |
{ |
22 |
unsigned index; |
23 |
typedef indexing_vector<uplink_t> list_type; |
24 |
|
25 |
char *name; |
26 |
char *host; |
27 |
char *pass; |
28 |
char *vhost; |
29 |
|
30 |
unsigned int port; |
31 |
|
32 |
connection_t *conn; |
33 |
|
34 |
unsigned int flags; |
35 |
}; |
36 |
|
37 |
#define UPF_ILLEGAL 0x80000000 /* not in conf anymore, delete when disconnected */ |
38 |
|
39 |
/* uplink.c */ |
40 |
E uplink_t::list_type uplinks; |
41 |
E uplink_t *curr_uplink; |
42 |
|
43 |
E void init_uplinks (void); |
44 |
E uplink_t *uplink_add (char *name, char *host, char *password, char *vhost, int port); |
45 |
E void uplink_delete (uplink_t *u); |
46 |
E uplink_t *uplink_find (char *name); |
47 |
E void uplink_connect (void); |
48 |
E void uplink_cleanup (); |
49 |
|
50 |
/* packet.c */ |
51 |
/* bursting timer */ |
52 |
#if HAVE_GETTIMEOFDAY |
53 |
E struct timeval burstime; |
54 |
#endif |
55 |
|
56 |
E void init_ircpacket (void); |
57 |
|
58 |
/* parse.c */ |
59 |
E void (*parse) (char *line); |
60 |
E void irc_parse (char *line); |
61 |
E void p10_parse (char *line); |
62 |
|
63 |
/* send.c */ |
64 |
E int sts (char const * const fmt, ...); |
65 |
E void reconn (void *arg); |
66 |
E void io_loop (void); |
67 |
|
68 |
#endif |