8 #include <trust_router/tr_dh.h>
10 #define TRP_PORT 12310
12 typedef struct trp_req {
16 typedef struct trp_resp {
20 typedef struct trps_instance TRPS_INSTANCE;
22 typedef int (TRPS_REQ_FUNC)(TRPS_INSTANCE *, TRP_REQ *, TRP_RESP *, void *);
23 typedef void (TRPS_RESP_FUNC)(TRPS_INSTANCE *, TRP_REQ *, TRP_RESP *, void *);
24 typedef int (trps_auth_func)(gss_name_t client_name, TR_NAME *display_name, void *cookie);
27 /* TRP Client Instance Data */
28 typedef struct trpc_instance {
29 DH *client_dh; /* Client's DH struct with priv and pub keys */
32 /* TRP Server Instance Data */
33 struct trps_instance {
36 TRPS_REQ_FUNC *req_handler;
37 trps_auth_func *auth_handler;
39 struct tr_rp_client *rp_gss; /* Client matching GSS name, TBD -- FIX ME (??) */
44 TRPC_INSTANCE *trpc_create (TALLOC_CTX *mem_ctx);
45 void trpc_destroy (TRPC_INSTANCE *trpc);
46 int trpc_open_connection (TRPC_INSTANCE *trpc, char *server, unsigned int port, gss_ctx_id_t *gssctx);
47 int trpc_send_msg (TRPC_INSTANCE *trpc, int conn, gss_ctx_id_t gssctx, const char *msg_content,
48 int *resp_handler(), void *cookie);
50 TRPS_INSTANCE *trps_create (TALLOC_CTX *mem_ctx);
51 void trps_destroy (TRPS_INSTANCE *trps);
52 int tr_trps_event_init(struct event_base *base, TRPS_INSTANCE *trps, TR_CFG_MGR *cfg_mgr,
53 struct tr_socket_event *trps_ev);
54 int trps_accept(TRPS_INSTANCE *trps, int listen);