2017-05-26 12:17:45 +00:00
|
|
|
#ifndef OD_ROUTER_H
|
|
|
|
#define OD_ROUTER_H
|
|
|
|
|
|
|
|
/*
|
2018-03-12 14:03:15 +00:00
|
|
|
* Odyssey.
|
2017-05-26 12:17:45 +00:00
|
|
|
*
|
2018-04-04 13:19:58 +00:00
|
|
|
* Scalable PostgreSQL connection pooler.
|
2017-05-26 12:17:45 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
typedef struct od_router od_router_t;
|
|
|
|
|
2017-05-26 13:44:42 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
OD_ROK,
|
|
|
|
OD_RERROR,
|
|
|
|
OD_RERROR_NOT_FOUND,
|
2017-06-08 12:36:21 +00:00
|
|
|
OD_RERROR_LIMIT,
|
|
|
|
OD_RERROR_TIMEDOUT
|
2017-05-26 13:44:42 +00:00
|
|
|
} od_routerstatus_t;
|
|
|
|
|
2017-05-26 12:17:45 +00:00
|
|
|
struct od_router
|
|
|
|
{
|
2018-02-02 11:49:10 +00:00
|
|
|
od_routepool_t route_pool;
|
|
|
|
machine_channel_t *channel;
|
|
|
|
int clients;
|
2018-03-13 13:17:27 +00:00
|
|
|
od_global_t *global;
|
2017-05-26 12:17:45 +00:00
|
|
|
};
|
|
|
|
|
2018-03-13 13:17:27 +00:00
|
|
|
void od_router_init(od_router_t*, od_global_t*);
|
2018-02-02 12:50:23 +00:00
|
|
|
int od_router_start(od_router_t*);
|
2017-05-26 13:44:42 +00:00
|
|
|
|
|
|
|
od_routerstatus_t
|
2017-05-29 15:07:22 +00:00
|
|
|
od_route(od_client_t*);
|
2017-05-26 12:17:45 +00:00
|
|
|
|
2017-06-01 09:28:23 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_unroute(od_client_t*);
|
|
|
|
|
2017-05-27 13:14:39 +00:00
|
|
|
od_routerstatus_t
|
2017-05-29 15:07:22 +00:00
|
|
|
od_router_attach(od_client_t*);
|
2017-05-27 13:14:39 +00:00
|
|
|
|
2017-05-31 10:49:12 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_detach(od_client_t*);
|
|
|
|
|
|
|
|
od_routerstatus_t
|
|
|
|
od_router_detach_and_unroute(od_client_t*);
|
2017-05-27 13:14:39 +00:00
|
|
|
|
2017-12-08 13:30:42 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_close(od_client_t*);
|
|
|
|
|
2017-05-31 10:49:12 +00:00
|
|
|
od_routerstatus_t
|
|
|
|
od_router_close_and_unroute(od_client_t*);
|
2017-05-30 15:04:59 +00:00
|
|
|
|
2017-05-30 11:34:08 +00:00
|
|
|
od_routerstatus_t
|
2018-02-22 13:43:52 +00:00
|
|
|
od_router_cancel(od_client_t*, od_routercancel_t*);
|
2017-05-30 11:34:08 +00:00
|
|
|
|
2017-05-26 12:17:45 +00:00
|
|
|
#endif /* OD_ROUTER_H */
|