diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-08-07 10:17:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:13:43 -0400 |
commit | f5ea9120be2e5d5c846243416cfdce01d02f5836 (patch) | |
tree | cade27e47a90dde79a523598b96a2ebb50770d2f /include/linux | |
parent | f401a6f7ede753e56b84025e7d2db0d5ef560ce6 (diff) |
nl80211: add generation number to all dumps
In order for userspace to be able to figure out whether
it obtained a consistent snapshot of data or not when
using netlink dumps, we need to have a generation number
in each dump message that indicates whether the list has
changed or not -- its value is arbitrary.
This patch adds such a number to all dumps, this needs
some mac80211 involvement to keep track of a generation
number to start with when adding/removing mesh paths or
stations.
The wiphy and netdev lists can be fully handled within
cfg80211, of course, but generation numbers need to be
stored there as well.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/nl80211.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index cb3dc6027fd9..a8d71ed43a0e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -480,10 +480,6 @@ enum nl80211_commands { | |||
480 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 480 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
481 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 481 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
482 | * scanning and include a zero-length SSID (wildcard) for wildcard scan | 482 | * scanning and include a zero-length SSID (wildcard) for wildcard scan |
483 | * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the | ||
484 | * scan result list changes (BSS expired or added) so that applications | ||
485 | * can verify that they got a single, consistent snapshot (when all dump | ||
486 | * messages carried the same generation number) | ||
487 | * @NL80211_ATTR_BSS: scan result BSS | 483 | * @NL80211_ATTR_BSS: scan result BSS |
488 | * | 484 | * |
489 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain | 485 | * @NL80211_ATTR_REG_INITIATOR: indicates who requested the regulatory domain |
@@ -580,6 +576,14 @@ enum nl80211_commands { | |||
580 | * | 576 | * |
581 | * @NL80211_ATTR_PID: Process ID of a network namespace. | 577 | * @NL80211_ATTR_PID: Process ID of a network namespace. |
582 | * | 578 | * |
579 | * @NL80211_ATTR_GENERATION: Used to indicate consistent snapshots for | ||
580 | * dumps. This number increases whenever the object list being | ||
581 | * dumped changes, and as such userspace can verify that it has | ||
582 | * obtained a complete and consistent snapshot by verifying that | ||
583 | * all dump messages contain the same generation number. If it | ||
584 | * changed then the list changed and the dump should be repeated | ||
585 | * completely from scratch. | ||
586 | * | ||
583 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 587 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
584 | * @__NL80211_ATTR_AFTER_LAST: internal use | 588 | * @__NL80211_ATTR_AFTER_LAST: internal use |
585 | */ | 589 | */ |
@@ -651,7 +655,7 @@ enum nl80211_attrs { | |||
651 | 655 | ||
652 | NL80211_ATTR_SCAN_FREQUENCIES, | 656 | NL80211_ATTR_SCAN_FREQUENCIES, |
653 | NL80211_ATTR_SCAN_SSIDS, | 657 | NL80211_ATTR_SCAN_SSIDS, |
654 | NL80211_ATTR_SCAN_GENERATION, | 658 | NL80211_ATTR_GENERATION, /* replaces old SCAN_GENERATION */ |
655 | NL80211_ATTR_BSS, | 659 | NL80211_ATTR_BSS, |
656 | 660 | ||
657 | NL80211_ATTR_REG_INITIATOR, | 661 | NL80211_ATTR_REG_INITIATOR, |
@@ -716,6 +720,9 @@ enum nl80211_attrs { | |||
716 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 720 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
717 | }; | 721 | }; |
718 | 722 | ||
723 | /* source-level API compatibility */ | ||
724 | #define NL80211_ATTR_SCAN_GENERATION NL80211_ATTR_GENERATION | ||
725 | |||
719 | /* | 726 | /* |
720 | * Allow user space programs to use #ifdef on new attributes by defining them | 727 | * Allow user space programs to use #ifdef on new attributes by defining them |
721 | * here | 728 | * here |