X-Git-Url: http://www.project-moonshot.org/gitweb/?p=trust_router.git;a=blobdiff_plain;f=trp%2Ftrp_route.c;h=19d7e228a7cb6de7998918ccf0cd12c0cc35c40e;hp=6178d97725884d42c4ce04787495c59bc6df8425;hb=7d902566f139ab6603c2b4a534c12f465526790d;hpb=b9776b2a5e8fa45749148e34c3f2df6ec4249ead diff --git a/trp/trp_route.c b/trp/trp_route.c index 6178d97..19d7e22 100644 --- a/trp/trp_route.c +++ b/trp/trp_route.c @@ -73,8 +73,8 @@ TRP_ROUTE *trp_route_new(TALLOC_CTX *mem_ctx) entry->comm=NULL; entry->realm=NULL; entry->trust_router=NULL; - entry->trp_port=TRP_PORT; - entry->tid_port=TID_PORT; + entry->trust_router_port=TRP_PORT; + entry->next_hop_port=TID_PORT; entry->peer=NULL; entry->next_hop=NULL; entry->selected=0; @@ -262,3 +262,43 @@ int trp_route_is_triggered(TRP_ROUTE *entry) { return entry->triggered; } + +void trp_route_set_trust_router_port(TRP_ROUTE *entry, int port) +{ + if (entry) + entry->trust_router_port = port; +} + +/** + * Get the port to use for TRP connections to the trust router + * + * @param entry + * @return port, or -1 if entry is null + */ +int trp_route_get_trust_router_port(TRP_ROUTE *entry) +{ + if (entry) + return entry->trust_router_port; + + return -1; +} + +void trp_route_set_next_hop_port(TRP_ROUTE *entry, int port) +{ + if (entry) + entry->next_hop_port = port; +} + +/** + * Get the port to use for TID connections to the next hop + * + * @param entry + * @return port, or -1 if entry is null + */ +int trp_route_get_next_hop_port(TRP_ROUTE *entry) +{ + if (entry) + return entry->next_hop_port; + + return -1; +}