summaryrefslogtreecommitdiff
path: root/src/ipcpd/ipcp.c
diff options
context:
space:
mode:
authorSander Vrijders <[email protected]>2016-10-25 13:22:51 +0200
committerSander Vrijders <[email protected]>2016-10-26 11:52:53 +0200
commitf0646875d0bc941e339d305d0c68b13543cd6f2a (patch)
tree0a3dde0e4f6284ece935d6eff99f26234126f1ab /src/ipcpd/ipcp.c
parent1c06b9ff80a2bf7ee6042534fee6098f7e452b59 (diff)
downloadouroboros-f0646875d0bc941e339d305d0c68b13543cd6f2a.tar.gz
ouroboros-f0646875d0bc941e339d305d0c68b13543cd6f2a.zip
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.
Diffstat (limited to 'src/ipcpd/ipcp.c')
-rw-r--r--src/ipcpd/ipcp.c17
1 files changed, 14 insertions, 3 deletions
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 <ouroboros/config.h>
+#include <ouroboros/logs.h>
#include <ouroboros/time_utils.h>
#include <ouroboros/utils.h>
#include <ouroboros/sockets.h>
@@ -28,13 +32,11 @@
#include <ouroboros/dev.h>
#include <ouroboros/np1_flow.h>
-#define OUROBOROS_PREFIX "ipcpd/ipcp"
-#include <ouroboros/logs.h>
+#include "ipcp.h"
#include <string.h>
#include <sys/socket.h>
#include <stdlib.h>
-#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.");