Introduce "remote" routes that we know about but cannot contact directly.
[trust_router.git] / include / tr_idp.h
index 25d281d..f06f3dd 100644 (file)
@@ -35,6 +35,8 @@
 #ifndef TR_IDP_H
 #define TR_IDP_H
 
+#include <talloc.h>
+
 #include <trust_router/tr_name.h>
 #include <tr_apc.h>
 
@@ -43,6 +45,14 @@ typedef struct tr_aaa_server {
   TR_NAME *hostname;
 } TR_AAA_SERVER;
 
+/* may also want to use in tr_rp.h */
+typedef enum tr_realm_origin {
+  TR_REALM_LOCAL=0, /* realm we were configured to contact */
+  TR_REALM_REMOTE_INCOMPLETE, /* realm we were configured to know about, without contact info yet */
+  TR_REALM_REMOTE, /* realm we were configured to know about, with discovered contact info */
+  TR_REALM_DISCOVERED /* realm we learned about from a peer */
+} TR_REALM_ORIGIN;
+
 typedef struct tr_idp_realm {
   struct tr_idp_realm *next;
   struct tr_idp_realm *comm_next; /* for linked list in comm config */
@@ -50,8 +60,11 @@ typedef struct tr_idp_realm {
   int shared_config;
   TR_AAA_SERVER *aaa_servers;
   TR_APC *apcs;
+  TR_REALM_ORIGIN origin; /* how did we learn about this realm? */
 } TR_IDP_REALM;
   
+TR_IDP_REALM *tr_idp_realm_new(TALLOC_CTX *mem_ctx);
+
 TR_AAA_SERVER *tr_idp_aaa_server_lookup(TR_IDP_REALM *idp_realms, TR_NAME *idp_realm_name, TR_NAME *comm);
 TR_AAA_SERVER *tr_default_server_lookup(TR_AAA_SERVER *default_servers, TR_NAME *comm);
 #endif