svn commit: r195445 - projects/mesh11s/sbin/ifconfig

Rui Paulo rpaulo at FreeBSD.org
Wed Jul 8 11:21:10 UTC 2009


Author: rpaulo
Date: Wed Jul  8 11:21:07 2009
New Revision: 195445
URL: http://svn.freebsd.org/changeset/base/195445

Log:
  Try to fix build errors.

Modified:
  projects/mesh11s/sbin/ifconfig/ifieee80211.c

Modified: projects/mesh11s/sbin/ifconfig/ifieee80211.c
==============================================================================
--- projects/mesh11s/sbin/ifconfig/ifieee80211.c	Wed Jul  8 10:21:52 2009	(r195444)
+++ projects/mesh11s/sbin/ifconfig/ifieee80211.c	Wed Jul  8 11:21:07 2009	(r195445)
@@ -84,7 +84,6 @@
 #include <net80211/ieee80211_superg.h>
 #include <net80211/ieee80211_tdma.h>
 #include <net80211/ieee80211_mesh.h>
-#include <net80211/ieee80211_hwmp.h>
 
 #include <assert.h>
 #include <ctype.h>
@@ -1280,7 +1279,7 @@ DECL_CMD_FUNC(set80211maccmd, val, d)
 }
 
 static void
-set80211hwmpmac(int s, int req, const char *val)
+set80211meshrtmac(int s, int req, const char *val)
 {
 	char *temp;
 	struct sockaddr_dl sdl;
@@ -1295,26 +1294,26 @@ set80211hwmpmac(int s, int req, const ch
 	free(temp);
 	if (sdl.sdl_alen != IEEE80211_ADDR_LEN)
 		errx(1, "malformed link-level address");
-	set80211(s, IEEE80211_IOC_HWMP_CMD, req,
+	set80211(s, IEEE80211_IOC_MESH_RTCMD, req,
 	    IEEE80211_ADDR_LEN, LLADDR(&sdl));
 }
 
 static
-DECL_CMD_FUNC(set80211addhwmp, val, d)
+DECL_CMD_FUNC(set80211addmeshrt, val, d)
 {
-	set80211hwmpmac(s, IEEE80211_HWMP_CMD_ADD, val);
+	set80211meshrtmac(s, IEEE80211_MESH_RTCMD_ADD, val);
 }
 
 static
-DECL_CMD_FUNC(set80211delhwmp, val, d)
+DECL_CMD_FUNC(set80211delmeshrt, val, d)
 {
-	set80211hwmpmac(s, IEEE80211_HWMP_CMD_DELETE, val);
+	set80211meshrtmac(s, IEEE80211_MESH_RTCMD_DELETE, val);
 }
 
 static
-DECL_CMD_FUNC(set80211hwmpcmd, val, d)
+DECL_CMD_FUNC(set80211meshrtcmd, val, d)
 {
-	set80211(s, IEEE80211_IOC_HWMP_CMD, d, 0, NULL);
+	set80211(s, IEEE80211_IOC_MESH_RTCMD, d, 0, NULL);
 }
 
 static
@@ -3368,7 +3367,7 @@ mesh_linkstate_string(uint8_t state)
 }
 
 static void
-list_mesh(int s)
+list_peers(int s)
 {
 	union {
 		struct ieee80211req_sta_req req;
@@ -3966,39 +3965,44 @@ list_regdomain(int s, int channelsalso)
 }
 
 static void
-list_hwmp(int s)
+list_mesh(int s)
 {
 	int i;
 	struct ieee80211req ireq;
-	struct ieee80211_hwmp_route routes[100];
+	struct ieee80211req_mesh_route routes[128];
 
 	(void) memset(&ireq, 0, sizeof(ireq));
 	(void) strncpy(ireq.i_name, name, sizeof(ireq.i_name));
-	ireq.i_type = IEEE80211_IOC_HWMP_CMD;
-	ireq.i_val = IEEE80211_HWMP_CMD_LIST;
+	ireq.i_type = IEEE80211_IOC_MESH_RTCMD;
+	ireq.i_val = IEEE80211_MESH_RTCMD_LIST;
 	ireq.i_data = &routes;
 	ireq.i_len = sizeof(routes);
 	if (ioctl(s, SIOCG80211, &ireq) < 0)
-	 	err(1, "unable to get HWMP routing table");
+	 	err(1, "unable to get the Mesh routing table");
 
-	printf("%-17.17s %-17.17s %4s %4s %4s %4s %4s\n"
+	printf("%-17.17s %-17.17s %4s %4s %4s\n"
 		, "DEST"
 		, "NEXT HOP"
 		, "HOPS"
 		, "METRIC"
-		, "LIFETIME"
+		, "LIFETIME");
+#if 0
 		, "SEQ"
 		, "PREQID");
+#endif
 
 	for (i = 0; i < ireq.i_len / sizeof(*routes); i++) {
-		printf("%s ", ether_ntoa((const struct ether_addr *)
-		    routes[i].rt_dest));
-		printf("%s %4u   %4d   %6d %4d %6d\n",
+		printf("%s ",
+		    ether_ntoa((const struct ether_addr *)routes[i].imr_dest));
+		printf("%s %4u   %4d   %6dn",
 			ether_ntoa((const struct ether_addr *)
-			    routes[i].rt_nexthop),
-			routes[i].rt_nhops, routes[i].rt_metric,
-			routes[i].rt_lifetime, routes[i].rt_seq,
+			    routes[i].imr_nexthop),
+			routes[i].imr_nhops, routes[i].imr_metric,
+			routes[i].imr_lifetime);
+#if 0
+		, routes[i].rt_seq,
 			routes[i].rt_preqid);
+#endif
 	}
 }
 
@@ -4035,10 +4039,10 @@ DECL_CMD_FUNC(set80211list, arg, d)
 		list_regdomain(s, 1);
 	else if (iseq(arg, "countries"))
 		list_countries();
+	else if (iseq(arg, "peers"))
+		list_peers(s);
 	else if (iseq(arg, "mesh"))
 		list_mesh(s);
-	else if (iseq(arg, "hwmp"))
-		list_hwmp(s);
 	else
 		errx(1, "Don't know how to list %s for %s", arg, name);
 	LINE_BREAK();
@@ -5245,9 +5249,9 @@ static struct cmd ieee80211_cmds[] = {
 	DEF_CMD("-meshforward",	0,	set80211meshforward),
 	DEF_CMD("meshpeering",	1,	set80211meshpeering),
 	DEF_CMD("-meshpeering",	0,	set80211meshpeering),
-	DEF_CMD("hwmp:flush",	IEEE80211_HWMP_CMD_FLUSH,	set80211hwmpcmd),
-	DEF_CMD_ARG("hwmp:add",		set80211addhwmp),
-	DEF_CMD_ARG("hwmp:del",		set80211delhwmp),
+	DEF_CMD("meshrt:flush",	IEEE80211_MESH_RTCMD_FLUSH,	set80211meshrtcmd),
+	DEF_CMD_ARG("meshrt:add",	set80211addmeshrt),
+	DEF_CMD_ARG("meshrt:del",	set80211delmeshrt),
 	DEF_CMD_ARG("hwmprootmode",	set80211hwmprootmode),
 	DEF_CMD_ARG("hwmpmaxhops",	set80211hwmpmaxhops),
 	DEF_CMD_ARG("hwmptll",		set80211hwmpttl),


More information about the svn-src-projects mailing list