| 1 |
pippijn |
1.1 |
/* |
| 2 |
|
|
* Copyright © 2006 Atheme Development Group |
| 3 |
pippijn |
1.2 |
* Rights to this code are as documented in doc/pod/license.pod. |
| 4 |
pippijn |
1.1 |
* |
| 5 |
|
|
* Data structures for sourceinfo |
| 6 |
|
|
* |
| 7 |
pippijn |
1.2 |
* $Id: sourceinfo.h,v 1.1 2007-07-19 08:24:50 pippijn Exp $ |
| 8 |
pippijn |
1.1 |
*/ |
| 9 |
|
|
|
| 10 |
|
|
#ifndef SOURCEINFO_H |
| 11 |
|
|
#define SOURCEINFO_H |
| 12 |
|
|
|
| 13 |
|
|
struct sourceinfo_vtable |
| 14 |
|
|
{ |
| 15 |
|
|
const char *description; |
| 16 |
|
|
void (*cmd_fail) (sourceinfo_t *si, faultcode_t code, const char *message); |
| 17 |
|
|
void (*cmd_success_nodata) (sourceinfo_t *si, const char *message); |
| 18 |
|
|
void (*cmd_success_string) (sourceinfo_t *si, const char *result, const char *message); |
| 19 |
|
|
}; |
| 20 |
|
|
|
| 21 |
|
|
/* structure describing data about a protocol message or service command */ |
| 22 |
|
|
struct sourceinfo_t |
| 23 |
|
|
{ |
| 24 |
|
|
/* fields describing the source of the message */ |
| 25 |
|
|
/* for protocol modules, the following applies to su and s: |
| 26 |
|
|
* at most one of these two can be non-NULL |
| 27 |
|
|
* before server registration, both are NULL, otherwise exactly |
| 28 |
|
|
* one is NULL. |
| 29 |
|
|
* for services commands, s is always NULL and su is non-NULL if |
| 30 |
|
|
* and only if the command was received via IRC. |
| 31 |
|
|
*/ |
| 32 |
|
|
user_t *su; /* source, if it's a user */ |
| 33 |
|
|
server_t *s; /* source, if it's a server */ |
| 34 |
|
|
|
| 35 |
|
|
connection_t *connection; /* physical connection cmd received from */ |
| 36 |
|
|
const char *sourcedesc; /* additional information (e.g. IP address) */ |
| 37 |
|
|
myuser_t *smu; /* login associated with source */ |
| 38 |
|
|
|
| 39 |
|
|
service_t *service; /* destination service */ |
| 40 |
|
|
|
| 41 |
|
|
channel_t *c; /* channel this command applies to (fantasy?) */ |
| 42 |
|
|
|
| 43 |
|
|
struct sourceinfo_vtable *v; /* function pointers, could be NULL */ |
| 44 |
|
|
void *callerdata; /* opaque data pointer for caller */ |
| 45 |
|
|
}; |
| 46 |
|
|
|
| 47 |
|
|
#endif |