socsvn commit: r307606 - soc2016/yuanxunzhang/head/usr.sbin/eaps
yuanxunzhang at FreeBSD.org
yuanxunzhang at FreeBSD.org
Mon Aug 15 03:39:01 UTC 2016
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
More information about the svn-soc-all
mailing list