2009-11-09 12:53:04

by Rui Paulo

[permalink] [raw]
Subject: iw [PATCH] print a header before printing the list of mesh paths

Signed-off-by: Rui Paulo <[email protected]>
---
mpath.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/mpath.c b/mpath.c
index e848481..eb5ad6a 100644
--- a/mpath.c
+++ b/mpath.c
@@ -184,6 +184,8 @@ static int handle_mpath_dump(struct nl80211_state *state,
struct nl_msg *msg,
int argc, char **argv)
{
+ printf("DEST ADDR NEXT HOP IFACE\tDSN\tMETRIC\tQLEN\t"
+ "EXPTIME\t\tDTIM\tDRET\tFLAGS\n");
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL);
return 0;
}
--
1.5.6.5



2009-11-09 12:53:13

by Rui Paulo

[permalink] [raw]
Subject: iw [PATCH] update to latest kernel changes (mesh)

This introduces a new mesh parameter mesh_hwmp_rootmode to make the
mesh point act as a root node using mesh RANN frames.

Signed-off-by: Rui Paulo <[email protected]>
---
mesh.c | 2 ++
mpath.c | 8 ++++----
nl80211.h | 11 +++++++----
3 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/mesh.c b/mesh.c
index 624ec37..8a03282 100644
--- a/mesh.c
+++ b/mesh.c
@@ -165,6 +165,8 @@ const static struct mesh_param_descr _mesh_param_descrs[] =
{"mesh_hwmp_net_diameter_traversal_time",
NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
_my_nla_put_u16, _parse_u16, _print_u16_in_TUs},
+ {"mesh_hwmp_rootmode", NL80211_MESHCONF_HWMP_ROOTMODE,
+ _my_nla_put_u8, _parse_u8, _print_u8},
};

static void print_all_mesh_param_descr(void)
diff --git a/mpath.c b/mpath.c
index eb5ad6a..8f5a334 100644
--- a/mpath.c
+++ b/mpath.c
@@ -38,7 +38,7 @@ static int print_mpath_handler(struct nl_msg *msg, void *arg)
char dst[20], next_hop[20], dev[20];
static struct nla_policy mpath_policy[NL80211_MPATH_INFO_MAX + 1] = {
[NL80211_MPATH_INFO_FRAME_QLEN] = { .type = NLA_U32 },
- [NL80211_MPATH_INFO_DSN] = { .type = NLA_U32 },
+ [NL80211_MPATH_INFO_SN] = { .type = NLA_U32 },
[NL80211_MPATH_INFO_METRIC] = { .type = NLA_U32 },
[NL80211_MPATH_INFO_EXPTIME] = { .type = NLA_U32 },
[NL80211_MPATH_INFO_DISCOVERY_TIMEOUT] = { .type = NLA_U32 },
@@ -70,9 +70,9 @@ static int print_mpath_handler(struct nl_msg *msg, void *arg)
mac_addr_n2a(next_hop, nla_data(tb[NL80211_ATTR_MPATH_NEXT_HOP]));
if_indextoname(nla_get_u32(tb[NL80211_ATTR_IFINDEX]), dev);
printf("%s %s %s", dst, next_hop, dev);
- if (pinfo[NL80211_MPATH_INFO_DSN])
+ if (pinfo[NL80211_MPATH_INFO_SN])
printf("\t%u",
- nla_get_u32(pinfo[NL80211_MPATH_INFO_DSN]));
+ nla_get_u32(pinfo[NL80211_MPATH_INFO_SN]));
if (pinfo[NL80211_MPATH_INFO_METRIC])
printf("\t%u",
nla_get_u32(pinfo[NL80211_MPATH_INFO_METRIC]));
@@ -184,7 +184,7 @@ static int handle_mpath_dump(struct nl80211_state *state,
struct nl_msg *msg,
int argc, char **argv)
{
- printf("DEST ADDR NEXT HOP IFACE\tDSN\tMETRIC\tQLEN\t"
+ printf("DEST ADDR NEXT HOP IFACE\tSN\tMETRIC\tQLEN\t"
"EXPTIME\t\tDTIM\tDRET\tFLAGS\n");
nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, print_mpath_handler, NULL);
return 0;
diff --git a/nl80211.h b/nl80211.h
index a8d71ed..8d58267 100644
--- a/nl80211.h
+++ b/nl80211.h
@@ -895,14 +895,14 @@ enum nl80211_sta_info {
*
* @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active
* @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running
- * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN
+ * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN
* @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set
* @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded
*/
enum nl80211_mpath_flags {
NL80211_MPATH_FLAG_ACTIVE = 1<<0,
NL80211_MPATH_FLAG_RESOLVING = 1<<1,
- NL80211_MPATH_FLAG_DSN_VALID = 1<<2,
+ NL80211_MPATH_FLAG_SN_VALID = 1<<2,
NL80211_MPATH_FLAG_FIXED = 1<<3,
NL80211_MPATH_FLAG_RESOLVED = 1<<4,
};
@@ -915,7 +915,7 @@ enum nl80211_mpath_flags {
*
* @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
* @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination
- * @NL80211_ATTR_MPATH_DSN: destination sequence number
+ * @NL80211_ATTR_MPATH_SN: destination sequence number
* @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path
* @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now
* @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in
@@ -926,7 +926,7 @@ enum nl80211_mpath_flags {
enum nl80211_mpath_info {
__NL80211_MPATH_INFO_INVALID,
NL80211_MPATH_INFO_FRAME_QLEN,
- NL80211_MPATH_INFO_DSN,
+ NL80211_MPATH_INFO_SN,
NL80211_MPATH_INFO_METRIC,
NL80211_MPATH_INFO_EXPTIME,
NL80211_MPATH_INFO_FLAGS,
@@ -1196,6 +1196,8 @@ enum nl80211_mntr_flags {
* @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs)
* that it takes for an HWMP information element to propagate across the mesh
*
+ * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not
+ *
* @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute
*
* @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use
@@ -1215,6 +1217,7 @@ enum nl80211_meshconf_params {
NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT,
NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL,
NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME,
+ NL80211_MESHCONF_HWMP_ROOTMODE,

/* keep last */
__NL80211_MESHCONF_ATTR_AFTER_LAST,
--
1.5.6.5


2009-11-16 18:57:36

by Johannes Berg

[permalink] [raw]
Subject: Re: iw [PATCH] update to latest kernel changes (mesh)

On Mon, 2009-11-09 at 12:53 +0000, Rui Paulo wrote:

> mpath.c | 8 ++++----
> nl80211.h | 11 +++++++----

> - [NL80211_MPATH_INFO_DSN] = { .type = NLA_U32 },
> + [NL80211_MPATH_INFO_SN] = { .type = NLA_U32 },

I've kinda taken this, but it shouldn't have been necessary for
compiling.

Please don't ever again make API changes in nl80211.h without keeping a
backward compatible #define and noting so explicitly. I'd also
appreciate a patch adding the #define DSN SN just in case there are
other tools using nl80211.h and relying on it already.

johannes


Attachments:
signature.asc (801.00 B)
This is a digitally signed message part