From f0646875d0bc941e339d305d0c68b13543cd6f2a Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Tue, 25 Oct 2016 13:22:51 +0200 Subject: lib, irmd, ipcpd: Add name querying to IPCPs This adds the ability to query IPCPs if a name can be reached through them, e.g. if a name is available in a DIF. This means that in the shim-udp a DNS query is performed, in the shim-eth-llc an ARP-like query has been added, in the local a check is done to see if the name is registered, and in the normal currently no application is reachable through it. --- src/ipcpd/ipcp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/ipcpd/ipcp.c') diff --git a/src/ipcpd/ipcp.c b/src/ipcpd/ipcp.c index c2d343f8..90fb94ef 100644 --- a/src/ipcpd/ipcp.c +++ b/src/ipcpd/ipcp.c @@ -20,7 +20,11 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#define OUROBOROS_PREFIX "ipcpd/ipcp" + #include +#include #include #include #include @@ -28,13 +32,11 @@ #include #include -#define OUROBOROS_PREFIX "ipcpd/ipcp" -#include +#include "ipcp.h" #include #include #include -#include "ipcp.h" int ipcp_init(enum ipcp_type type, struct ipcp_ops * ops) { @@ -307,6 +309,15 @@ void * ipcp_main_loop(void * o) ret_msg.result = ipcpi.ops->ipcp_name_unreg(msg->name); break; + case IPCP_MSG_CODE__IPCP_NAME_QUERY: + if (ipcpi.ops->ipcp_name_query == NULL) { + LOG_ERR("Ap_query unsupported."); + break; + } + ret_msg.has_result = true; + ret_msg.result = + ipcpi.ops->ipcp_name_query(msg->name); + break; case IPCP_MSG_CODE__IPCP_FLOW_ALLOC: if (ipcpi.ops->ipcp_flow_alloc == NULL) { LOG_ERR("Flow_alloc unsupported."); -- cgit v1.2.3