4 #include <trust_router/tr_name.h>
5 #include <trp_internal.h>
8 static int trp_req_destructor(void *object)
10 TRP_REQ *req=talloc_get_type_abort(object, TRP_REQ);
12 /* clean up TR_NAME data, which are not managed by talloc */
13 if (req->comm != NULL)
14 tr_free_name(req->comm);
16 if (req->realm != NULL)
17 tr_free_name(req->realm);
19 if (req->peer != NULL)
20 tr_free_name(req->peer);
25 TRP_REQ *trp_req_new(TALLOC_CTX *mem_ctx)
27 TRP_REQ *new_req=talloc(mem_ctx, TRP_REQ);
29 if (new_req != NULL) {
35 talloc_set_destructor((void *)new_req, trp_req_destructor);
39 void trp_req_free(TRP_REQ *req)
45 TR_NAME *trp_req_get_comm(TRP_REQ *req)
53 void trp_req_set_comm(TRP_REQ *req, TR_NAME *comm)
59 TR_NAME *trp_req_get_realm(TRP_REQ *req)
68 void trp_req_set_realm(TRP_REQ *req, TR_NAME *realm)
74 TR_NAME *trp_req_get_peer(TRP_REQ *req)
83 void trp_req_set_peer(TRP_REQ *req, TR_NAME *peer)