+
+/*
+ * cmd_netp() - authenticate to the server as another Citadel node polling
+ * for network traffic
+ */
+void cmd_netp(char *cmdbuf)
+{
+ char node[SIZ];
+ char pass[SIZ];
+
+ char secret[SIZ];
+ char nexthop[SIZ];
+
+ extract(node, cmdbuf, 0);
+ extract(pass, cmdbuf, 1);
+
+ if (is_valid_node(nexthop, secret, node) != 0) {
+ cprintf("%d authentication failed\n", ERROR);
+ return;
+ }
+
+ if (strcasecmp(pass, secret)) {
+ cprintf("%d authentication failed\n", ERROR);
+ return;
+ }
+
+ safestrncpy(CC->net_node, node, sizeof CC->net_node);
+ cprintf("%d authenticated as network node '%s'\n", OK,
+ CC->net_node);
+}
+
+
+