]> git.evergreen-ils.org Git - OpenSRF.git/blob - src/router/osrf_router.h
6ba60f3692caacc91a0f6cc317f4faf2be457dda
[OpenSRF.git] / src / router / osrf_router.h
1 #ifndef OSRF_ROUTER_H
2 #define OSRF_ROUTER_H
3
4 #include <sys/select.h>
5 #include <signal.h>
6 #include <stdio.h>
7
8 #include "opensrf/utils.h"
9 #include "opensrf/log.h"
10 #include "opensrf/osrf_list.h"
11 #include "opensrf/osrf_hash.h"
12
13 #include "opensrf/string_array.h"
14 #include "opensrf/transport_client.h"
15 #include "opensrf/transport_message.h"
16
17 #include "opensrf/osrf_message.h"
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 struct osrfRouterStruct;
24 typedef struct osrfRouterStruct osrfRouter;
25
26 /**
27   Allocates a new router.  
28   @param domain The jabber domain to connect to
29   @param name The login name for the router
30   @param resource The login resource for the router
31   @param password The login password for the new router
32   @param port The port to connect to the jabber server on
33   @param trustedClients The array of client domains that we allow to send requests through us
34   @param trustedServers The array of server domains that we allow to register, etc. with ust.
35   @return The allocated router or NULL on memory error
36   */
37 osrfRouter* osrfNewRouter( const char* domain, const char* name, const char* resource, 
38         const char* password, int port, osrfStringArray* trustedClients,
39         osrfStringArray* trustedServers );
40
41 int osrfRouterConnect( osrfRouter* router );
42
43 /**
44   Waits for incoming data to route
45   If this function returns, then the router's connection to the jabber server
46   has failed.
47   */
48 void osrfRouterRun( osrfRouter* router );
49
50 void router_stop( osrfRouter* router );
51
52 /**
53   Frees a router
54   */
55 void osrfRouterFree( osrfRouter* router );
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif
62