From owner-svn-soc-all@freebsd.org Mon Jun 29 19:03:32 2015 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4F49B98F9DD for ; Mon, 29 Jun 2015 19:03:32 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 33F6815F2 for ; Mon, 29 Jun 2015 19:03:32 +0000 (UTC) (envelope-from roam@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5TJ3WX3067550 for ; Mon, 29 Jun 2015 19:03:32 GMT (envelope-from roam@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.9/8.14.9/Submit) id t5TJ3Ub7067535 for svn-soc-all@FreeBSD.org; Mon, 29 Jun 2015 19:03:30 GMT (envelope-from roam@FreeBSD.org) Date: Mon, 29 Jun 2015 19:03:30 GMT Message-Id: <201506291903.t5TJ3Ub7067535@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to roam@FreeBSD.org using -f From: roam@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r287739 - soc2015/roam/ng_ayiya MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Jun 2015 19:03:32 -0000 Author: roam Date: Mon Jun 29 19:03:30 2015 New Revision: 287739 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=287739 Log: Remove GET/SET_VERSION/MOTD, handled by responders. As noted by my mentor, the heartbeat, version, "message of the day", and other non-IPv6-data packets would much better be processed in userland. Thus, revert most of rev. 287682 that added four control messages and some private structure members, as well as the blurbs about them in the manual page. ObQuote: "What good's causing problems when no one's complaining?" Modified: soc2015/roam/ng_ayiya/ng_ayiya.4 soc2015/roam/ng_ayiya/ng_ayiya.c soc2015/roam/ng_ayiya/ng_ayiya.h Modified: soc2015/roam/ng_ayiya/ng_ayiya.4 ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.4 Mon Jun 29 19:03:26 2015 (r287738) +++ soc2015/roam/ng_ayiya/ng_ayiya.4 Mon Jun 29 19:03:30 2015 (r287739) @@ -88,12 +88,6 @@ .Tn AYIYA packets. .It * -Configure the node by sending a -.Dv NGM_AYIYA_SET_VERSION -and optionally a -.Dv NGM_AYIYA_SET_MOTD -control message. -.It * Connect the .Va inet6 hook to a @@ -199,16 +193,6 @@ heartbeat packet to the .Va ayiya hook and start forwarding packets between the two. -.It Dv NGM_AYIYA_GET_VERSION -Get the local -.Nm ayiya -node's version string. -.It Dv NGM_AYIYA_GET_MOTD -Get the local -.Nm ayiya -node's -.Dq message of the day -string. .It Dv NGM_AYIYA_SECRETHASH Set the secret hash used for authenticating the .Tn AYIYA @@ -216,16 +200,6 @@ The message parameter should be a SHA1 hash of the .Va Password field obtained via TIC negotiation. -.It Dv NGM_AYIYA_SET_VERSION -Set the local -.Nm ayiya -node's version string. -.It Dv NGM_AYIYA_SET_MOTD -Set the local -.Nm ayiya -node's -.Dq message of the day -string. .El .Sh SHUTDOWN This node shuts down upon receipt of a Modified: soc2015/roam/ng_ayiya/ng_ayiya.c ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.c Mon Jun 29 19:03:26 2015 (r287738) +++ soc2015/roam/ng_ayiya/ng_ayiya.c Mon Jun 29 19:03:30 2015 (r287739) @@ -78,34 +78,6 @@ NULL, &ng_parse_uint32_type, }, - { - NGM_AYIYA_COOKIE, - NGM_AYIYA_SET_VERSION, - "set_version", - &ng_parse_string_type, - NULL, - }, - { - NGM_AYIYA_COOKIE, - NGM_AYIYA_SET_MOTD, - "set_motd", - &ng_parse_string_type, - NULL, - }, - { - NGM_AYIYA_COOKIE, - NGM_AYIYA_GET_VERSION, - "get_version", - NULL, - &ng_parse_string_type, - }, - { - NGM_AYIYA_COOKIE, - NGM_AYIYA_GET_MOTD, - "get_motd", - NULL, - &ng_parse_string_type, - }, { 0 } }; @@ -147,7 +119,6 @@ hook_p hooks[AYIYA_HOOK_LAST]; node_p node; item_p configuring; - struct mbuf *m_version, *m_motd; bool configured; }; typedef struct ng_ayiya_private *priv_p; @@ -184,11 +155,6 @@ return (m2); } -#define AYIYA_VERSION "ng_ayiya 0.1.0.dev177" -#define AYIYA_VERSION_SZ sizeof(AYIYA_VERSION) -#define AYIYA_MOTD "No message of the day defined yet." -#define AYIYA_MOTD_SZ sizeof(AYIYA_MOTD) - static int ng_ayiya_constructor(const node_p node) { @@ -197,27 +163,7 @@ priv = malloc(sizeof(*priv), M_NETGRAPH_AYIYA, M_WAITOK | M_ZERO); NG_NODE_SET_PRIVATE(node, priv); priv->node = node; - - priv->m_version = ayiya_m_getm(AYIYA_VERSION_SZ, M_WAITOK); - if (priv->m_version == NULL) - goto no_mem; - bcopy(AYIYA_VERSION, priv->m_version->m_data, AYIYA_VERSION_SZ); - - priv->m_motd = ayiya_m_getm(AYIYA_MOTD_SZ, M_WAITOK); - if (priv->m_motd == NULL) - goto no_mem; - bcopy(AYIYA_MOTD, priv->m_motd->m_data, AYIYA_MOTD_SZ); - return (0); - -no_mem: - m_freem(priv->m_motd); - priv->m_motd = NULL; - m_freem(priv->m_version); - priv->m_version = NULL; - free(priv, M_NETGRAPH_AYIYA); - NG_NODE_SET_PRIVATE(node, NULL); - return (ENOMEM); } #define ERROUT(x) do { error = (x); goto done; } while (0) @@ -389,42 +335,6 @@ return (0); } - case NGM_AYIYA_GET_VERSION: - { - const priv_p priv = NG_NODE_PRIVATE(node); - NG_MKRESPONSE(resp, msg, priv->m_version->m_len, M_WAITOK); - bcopy(priv->m_version->m_data, resp->data, priv->m_version->m_len); - break; - } - - case NGM_AYIYA_GET_MOTD: - { - const priv_p priv = NG_NODE_PRIVATE(node); - NG_MKRESPONSE(resp, msg, priv->m_motd->m_len, M_WAITOK); - bcopy(priv->m_motd->m_data, resp->data, priv->m_motd->m_len); - break; - } - - case NGM_AYIYA_SET_VERSION: - case NGM_AYIYA_SET_MOTD: - { - const size_t sz = msg->header.arglen; - struct mbuf * const m = ayiya_m_getm(sz, M_WAITOK); - if (m == NULL) { - error = ENOMEM; - break; - } - bcopy(msg->data, m->m_data, sz); - - const priv_p priv = NG_NODE_PRIVATE(node); - struct mbuf ** const mm = - msg->header.cmd == NGM_AYIYA_SET_VERSION? - &priv->m_version: &priv->m_motd; - m_freem(*mm); - *mm = m; - break; - } - default: error = EINVAL; break; @@ -542,8 +452,6 @@ if (priv != NULL) { if (priv->configuring) configuring_respond(node, ECONNABORTED); - m_freem(priv->m_motd); - m_freem(priv->m_version); free(priv, M_NETGRAPH_AYIYA); NG_NODE_SET_PRIVATE(node, NULL); } Modified: soc2015/roam/ng_ayiya/ng_ayiya.h ============================================================================== --- soc2015/roam/ng_ayiya/ng_ayiya.h Mon Jun 29 19:03:26 2015 (r287738) +++ soc2015/roam/ng_ayiya/ng_ayiya.h Mon Jun 29 19:03:30 2015 (r287739) @@ -34,10 +34,6 @@ enum { NGM_AYIYA_SECRETHASH = 1, NGM_AYIYA_CONFIGURE, - NGM_AYIYA_SET_VERSION, - NGM_AYIYA_SET_MOTD, - NGM_AYIYA_GET_VERSION, - NGM_AYIYA_GET_MOTD, }; typedef enum {