4 #include <sys/select.h>
8 #include "opensrf/utils.h"
9 #include "opensrf/log.h"
10 #include "opensrf/osrf_list.h"
11 #include "opensrf/osrf_hash.h"
13 #include "opensrf/string_array.h"
14 #include "opensrf/transport_client.h"
15 #include "opensrf/transport_message.h"
17 #include "opensrf/osrf_message.h"
23 /* a router maintains a list of server classes */
24 struct _osrfRouterStruct {
26 osrfHash* classes; /* our list of server classes */
27 char* domain; /* our login domain */
33 osrfStringArray* trustedClients;
34 osrfStringArray* trustedServers;
36 transport_client* connection;
39 typedef struct _osrfRouterStruct osrfRouter;
42 Allocates a new router.
43 @param domain The jabber domain to connect to
44 @param name The login name for the router
45 @param resource The login resource for the router
46 @param password The login password for the new router
47 @param port The port to connect to the jabber server on
48 @param trustedClients The array of client domains that we allow to send requests through us
49 @param trustedServers The array of server domains that we allow to register, etc. with ust.
50 @return The allocated router or NULL on memory error
52 osrfRouter* osrfNewRouter( const char* domain, const char* name, const char* resource,
53 const char* password, int port, osrfStringArray* trustedClients,
54 osrfStringArray* trustedServers );
57 Connects the given router to the network
59 int osrfRouterConnect( osrfRouter* router );
62 Waits for incoming data to route
63 If this function returns, then the router's connection to the jabber server
66 void osrfRouterRun( osrfRouter* router );
72 void osrfRouterFree( osrfRouter* router );
75 Handles connects, disconnects, etc.
77 //int osrfRouterHandeStatusMessage( osrfRouter* router, transport_message* msg );
80 Handles REQUEST messages
82 //int osrfRouterHandleRequestMessage( osrfRouter* router, transport_message* msg );