From owner-svn-soc-all@freebsd.org Mon Aug 15 03:39:01 2016 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 812A8BBAD0C for ; Mon, 15 Aug 2016 03:39:01 +0000 (UTC) (envelope-from yuanxunzhang@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 65BE41195 for ; Mon, 15 Aug 2016 03:39:01 +0000 (UTC) (envelope-from yuanxunzhang@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u7F3d18u016965 for ; Mon, 15 Aug 2016 03:39:01 GMT (envelope-from yuanxunzhang@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u7F3d0DO016345 for svn-soc-all@FreeBSD.org; Mon, 15 Aug 2016 03:39:00 GMT (envelope-from yuanxunzhang@FreeBSD.org) Date: Mon, 15 Aug 2016 03:39:00 GMT Message-Id: <201608150339.u7F3d0DO016345@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to yuanxunzhang@FreeBSD.org using -f From: yuanxunzhang@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r307606 - soc2016/yuanxunzhang/head/usr.sbin/eaps 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.22 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, 15 Aug 2016 03:39:01 -0000 Author: yuanxunzhang Date: Mon Aug 15 03:38:59 2016 New Revision: 307606 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307606 Log: EAPS: query eaps domian status Modified: soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h Modified: soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c ============================================================================== --- soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c Mon Aug 15 02:42:16 2016 (r307605) +++ soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.c Mon Aug 15 03:38:59 2016 (r307606) @@ -67,7 +67,7 @@ int keyword(const char *); static void create_domain(int, char **, int); static void delete_domain(int, char **, int); -static void display(int, char **); +static void display(int, char **, int); static void usage(const char *); void load_module(const char *); @@ -91,7 +91,7 @@ delete_domain(argc, argv, s); case K_DISPLAY: - display(argc, argv); + eaps_status(argc, argv, s); } usage(*argv); return retval; @@ -164,11 +164,10 @@ } static void -display(int argc, char **argv) +eaps_status(int argc, char **argv) { - int error = 0; - - exit(error); + printf("Debug print: -------.\n"); + return; } static void @@ -179,22 +178,6 @@ errx(EX_USAGE, "usage: eaps command [args]"); } -static void -eaps_status(int s) -{ - printf("Debug print: -------.\n"); - return; -} - -static struct afswtch *afs = NULL; - -void -af_register(struct afswtch *p) -{ - p->af_next = afs; - afs = p; -} - int keyword(const char *cp) { @@ -203,16 +186,4 @@ while (kt->kt_cp != NULL && strcmp(kt->kt_cp, cp) != 0) kt++; return (kt->kt_i); -} - -static struct afswtch af_eaps = { - .af_name = "af_eaps", - .af_af = AF_UNSPEC, - .af_other_status = eaps_status, -}; - -static __constructor void -eaps_ctor(void) -{ - af_register(&af_eaps); } \ No newline at end of file Modified: soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h ============================================================================== --- soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h Mon Aug 15 02:42:16 2016 (r307605) +++ soc2016/yuanxunzhang/head/usr.sbin/eaps/eaps.h Mon Aug 15 03:38:59 2016 (r307606) @@ -33,27 +33,3 @@ * * $FreeBSD$ */ - -#define __constructor __attribute__((constructor)) - -struct afswtch; -struct ifaddrs; - -struct afswtch { - const char *af_name; /* as given on cmd line, e.g. "inet" */ - short af_af; /* AF_* */ - /* - * Status is handled one of two ways; if there is an - * address associated with the interface then the - * associated address family af_status method is invoked - * with the appropriate addressin info. Otherwise, if - * all possible info is to be displayed and af_other_status - * is defined then it is invoked after all address status - * is presented. - */ - void (*af_status)(int, const struct ifaddrs *); - void (*af_other_status)(int); - struct afswtch *af_next; -}; - -void af_register(struct afswtch *); \ No newline at end of file