Move AAA server methods out of tr_idp.[ch] into their own files
[trust_router.git] / common / tr_idp.c
index 50a9330..a3d84a7 100644 (file)
 #include <talloc.h>
 #include <time.h>
 
+#include <tr_aaa_server.h>
 #include <tr_name_internal.h>
 #include <tr_idp.h>
 #include <tr_config.h>
 #include <tr_debug.h>
 
-static int tr_aaa_server_destructor(void *obj)
-{
-  TR_AAA_SERVER *aaa=talloc_get_type_abort(obj, TR_AAA_SERVER);
-  if (aaa->hostname!=NULL)
-    tr_free_name(aaa->hostname);
-  return 0;
-}
-
-TR_AAA_SERVER *tr_aaa_server_new(TALLOC_CTX *mem_ctx, TR_NAME *hostname)
-{
-  TR_AAA_SERVER *aaa=talloc(mem_ctx, TR_AAA_SERVER);
-  if (aaa!=NULL) {
-    aaa->next=NULL;
-    aaa->hostname=hostname;
-    talloc_set_destructor((void *)aaa, tr_aaa_server_destructor);
-  }
-  return aaa;
-}
-
-void tr_aaa_server_free(TR_AAA_SERVER *aaa)
-{
-  talloc_free(aaa);
-}
-
-TR_AAA_SERVER_ITER *tr_aaa_server_iter_new(TALLOC_CTX *mem_ctx)
-{
-  return talloc(mem_ctx, TR_AAA_SERVER_ITER);
-}
-
-void tr_aaa_server_iter_free(TR_AAA_SERVER_ITER *iter)
-{
-  talloc_free(iter);
-}
-
-TR_AAA_SERVER *tr_aaa_server_iter_first(TR_AAA_SERVER_ITER *iter, TR_AAA_SERVER *aaa)
-{
-  iter->this=aaa;
-  return iter->this;
-}
-
-TR_AAA_SERVER *tr_aaa_server_iter_next(TR_AAA_SERVER_ITER *iter)
-{
-  if (iter->this!=NULL) {
-    iter->this=iter->this->next;
-  }
-  return iter->this;
-}
-
-
 /* fills in shared if pointer not null */
 TR_AAA_SERVER *tr_idp_aaa_server_lookup(TR_IDP_REALM *idp_realms, TR_NAME *idp_realm_name, TR_NAME *comm, int *shared_out)
 {