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 tr_debug("trp_req_destructor: freed community");
18 if (req->realm != NULL) {
19 tr_free_name(req->realm);
21 tr_debug("trp_req_destructor: freed realm");
26 TRP_REQ *trp_req_new(TALLOC_CTX *mem_ctx)
28 TRP_REQ *new_req=talloc(mem_ctx, TRP_REQ);
30 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)