diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-03-23 09:31:09 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:44:20 -0500 |
commit | f399002e68e626e7bc443e6fcab1772704cc197f (patch) | |
tree | 0d6abf88f3ebf5c619994c929d5baf728a3f579c /include/linux | |
parent | 6b75dced005c7f06b81934167e36bcfc690cc3a7 (diff) |
drbd: distribute former syncer_conf settings to disk, connection, and resource level
This commit breaks the API again.
Move per-volume former syncer options into disk_conf.
Move per-connection former syncer options into net_conf.
Renamed the remainign sync_conf to res_opts
Syncer settings have been changeable at runtime, so we need to prepare
for these settings to be runtime-changeable in their new home as well.
Introduce new configuration operations, and share the netlink attribute
between "attach" (create new disk) and "disk-opts" (change options).
Same for "connect" and "net-opts".
Some fields cannot be changed at runtime, however.
Introduce a new flag GENLA_F_INVARIANT to be able to trigger on that in
the generated validation and assignment functions.
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/drbd_genl.h | 133 | ||||
-rw-r--r-- | include/linux/drbd_limits.h | 2 | ||||
-rw-r--r-- | include/linux/genl_magic_func.h | 49 | ||||
-rw-r--r-- | include/linux/genl_magic_struct.h | 18 |
4 files changed, 123 insertions, 79 deletions
diff --git a/include/linux/drbd_genl.h b/include/linux/drbd_genl.h index a07d69279b1a..938e8560a833 100644 --- a/include/linux/drbd_genl.h +++ b/include/linux/drbd_genl.h | |||
@@ -102,66 +102,73 @@ GENL_struct(DRBD_NLA_CFG_CONTEXT, 2, drbd_cfg_context, | |||
102 | ) | 102 | ) |
103 | 103 | ||
104 | GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf, | 104 | GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf, |
105 | __u64_field(1, GENLA_F_MANDATORY, disk_size) | 105 | __str_field(1, GENLA_F_REQUIRED | GENLA_F_INVARIANT, backing_dev, 128) |
106 | __str_field(2, GENLA_F_REQUIRED, backing_dev, 128) | 106 | __str_field(2, GENLA_F_REQUIRED | GENLA_F_INVARIANT, meta_dev, 128) |
107 | __str_field(3, GENLA_F_REQUIRED, meta_dev, 128) | 107 | __u32_field(3, GENLA_F_REQUIRED | GENLA_F_INVARIANT, meta_dev_idx) |
108 | __u32_field(4, GENLA_F_REQUIRED, meta_dev_idx) | 108 | |
109 | __u32_field(5, GENLA_F_MANDATORY, max_bio_bvecs) | 109 | /* use the resize command to try and change the disk_size */ |
110 | __u64_field(4, GENLA_F_MANDATORY | GENLA_F_INVARIANT, disk_size) | ||
111 | /* we could change the max_bio_bvecs, | ||
112 | * but it won't propagate through the stack */ | ||
113 | __u32_field(5, GENLA_F_MANDATORY | GENLA_F_INVARIANT, max_bio_bvecs) | ||
114 | |||
110 | __u32_field(6, GENLA_F_MANDATORY, on_io_error) | 115 | __u32_field(6, GENLA_F_MANDATORY, on_io_error) |
111 | __u32_field(7, GENLA_F_MANDATORY, fencing) | 116 | __u32_field(7, GENLA_F_MANDATORY, fencing) |
112 | __flg_field(8, GENLA_F_MANDATORY, no_disk_barrier) | 117 | |
113 | __flg_field(9, GENLA_F_MANDATORY, no_disk_flush) | 118 | __u32_field(8, GENLA_F_MANDATORY, resync_rate) |
114 | __flg_field(10, GENLA_F_MANDATORY, no_disk_drain) | 119 | __u32_field(9, GENLA_F_MANDATORY, resync_after) |
115 | __flg_field(11, GENLA_F_MANDATORY, no_md_flush) | 120 | __u32_field(10, GENLA_F_MANDATORY, al_extents) |
116 | __flg_field(12, GENLA_F_MANDATORY, use_bmbv) | 121 | __u32_field(11, GENLA_F_MANDATORY, c_plan_ahead) |
122 | __u32_field(12, GENLA_F_MANDATORY, c_delay_target) | ||
123 | __u32_field(13, GENLA_F_MANDATORY, c_fill_target) | ||
124 | __u32_field(14, GENLA_F_MANDATORY, c_max_rate) | ||
125 | __u32_field(15, GENLA_F_MANDATORY, c_min_rate) | ||
126 | |||
127 | __flg_field(16, GENLA_F_MANDATORY, no_disk_barrier) | ||
128 | __flg_field(17, GENLA_F_MANDATORY, no_disk_flush) | ||
129 | __flg_field(18, GENLA_F_MANDATORY, no_disk_drain) | ||
130 | __flg_field(19, GENLA_F_MANDATORY, no_md_flush) | ||
131 | |||
117 | ) | 132 | ) |
118 | 133 | ||
119 | GENL_struct(DRBD_NLA_SYNCER_CONF, 4, syncer_conf, | 134 | GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, |
120 | __u32_field(1, GENLA_F_MANDATORY, rate) | 135 | __str_field(1, GENLA_F_MANDATORY, cpu_mask, 32) |
121 | __u32_field(2, GENLA_F_MANDATORY, after) | 136 | __u32_field(2, GENLA_F_MANDATORY, on_no_data) |
122 | __u32_field(3, GENLA_F_MANDATORY, al_extents) | ||
123 | __str_field(4, GENLA_F_MANDATORY, cpu_mask, 32) | ||
124 | __str_field(5, GENLA_F_MANDATORY, verify_alg, SHARED_SECRET_MAX) | ||
125 | __str_field(6, GENLA_F_MANDATORY, csums_alg, SHARED_SECRET_MAX) | ||
126 | __flg_field(7, GENLA_F_MANDATORY, use_rle) | ||
127 | __u32_field(8, GENLA_F_MANDATORY, on_no_data) | ||
128 | __u32_field(9, GENLA_F_MANDATORY, c_plan_ahead) | ||
129 | __u32_field(10, GENLA_F_MANDATORY, c_delay_target) | ||
130 | __u32_field(11, GENLA_F_MANDATORY, c_fill_target) | ||
131 | __u32_field(12, GENLA_F_MANDATORY, c_max_rate) | ||
132 | __u32_field(13, GENLA_F_MANDATORY, c_min_rate) | ||
133 | ) | 137 | ) |
134 | 138 | ||
135 | GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf, | 139 | GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf, |
136 | __str_field(1, GENLA_F_MANDATORY | GENLA_F_SENSITIVE, | 140 | __bin_field(1, GENLA_F_REQUIRED | GENLA_F_INVARIANT, my_addr, 128) |
141 | __bin_field(2, GENLA_F_REQUIRED | GENLA_F_INVARIANT, peer_addr, 128) | ||
142 | __str_field(3, GENLA_F_MANDATORY | GENLA_F_SENSITIVE, | ||
137 | shared_secret, SHARED_SECRET_MAX) | 143 | shared_secret, SHARED_SECRET_MAX) |
138 | __str_field(2, GENLA_F_MANDATORY, cram_hmac_alg, SHARED_SECRET_MAX) | 144 | __str_field(4, GENLA_F_MANDATORY, cram_hmac_alg, SHARED_SECRET_MAX) |
139 | __str_field(3, GENLA_F_MANDATORY, integrity_alg, SHARED_SECRET_MAX) | 145 | __str_field(5, GENLA_F_MANDATORY, integrity_alg, SHARED_SECRET_MAX) |
140 | __str_field(4, GENLA_F_REQUIRED, my_addr, 128) | 146 | __str_field(6, GENLA_F_MANDATORY, verify_alg, SHARED_SECRET_MAX) |
141 | __str_field(5, GENLA_F_REQUIRED, peer_addr, 128) | 147 | __str_field(7, GENLA_F_MANDATORY, csums_alg, SHARED_SECRET_MAX) |
142 | __u32_field(6, GENLA_F_REQUIRED, wire_protocol) | 148 | __u32_field(8, GENLA_F_MANDATORY, wire_protocol) |
143 | __u32_field(7, GENLA_F_MANDATORY, try_connect_int) | 149 | __u32_field(9, GENLA_F_MANDATORY, try_connect_int) |
144 | __u32_field(8, GENLA_F_MANDATORY, timeout) | 150 | __u32_field(10, GENLA_F_MANDATORY, timeout) |
145 | __u32_field(9, GENLA_F_MANDATORY, ping_int) | 151 | __u32_field(11, GENLA_F_MANDATORY, ping_int) |
146 | __u32_field(10, GENLA_F_MANDATORY, ping_timeo) | 152 | __u32_field(12, GENLA_F_MANDATORY, ping_timeo) |
147 | __u32_field(11, GENLA_F_MANDATORY, sndbuf_size) | 153 | __u32_field(13, GENLA_F_MANDATORY, sndbuf_size) |
148 | __u32_field(12, GENLA_F_MANDATORY, rcvbuf_size) | 154 | __u32_field(14, GENLA_F_MANDATORY, rcvbuf_size) |
149 | __u32_field(13, GENLA_F_MANDATORY, ko_count) | 155 | __u32_field(15, GENLA_F_MANDATORY, ko_count) |
150 | __u32_field(14, GENLA_F_MANDATORY, max_buffers) | 156 | __u32_field(16, GENLA_F_MANDATORY, max_buffers) |
151 | __u32_field(15, GENLA_F_MANDATORY, max_epoch_size) | 157 | __u32_field(17, GENLA_F_MANDATORY, max_epoch_size) |
152 | __u32_field(16, GENLA_F_MANDATORY, unplug_watermark) | 158 | __u32_field(18, GENLA_F_MANDATORY, unplug_watermark) |
153 | __u32_field(17, GENLA_F_MANDATORY, after_sb_0p) | 159 | __u32_field(19, GENLA_F_MANDATORY, after_sb_0p) |
154 | __u32_field(18, GENLA_F_MANDATORY, after_sb_1p) | 160 | __u32_field(20, GENLA_F_MANDATORY, after_sb_1p) |
155 | __u32_field(19, GENLA_F_MANDATORY, after_sb_2p) | 161 | __u32_field(21, GENLA_F_MANDATORY, after_sb_2p) |
156 | __u32_field(20, GENLA_F_MANDATORY, rr_conflict) | 162 | __u32_field(22, GENLA_F_MANDATORY, rr_conflict) |
157 | __u32_field(21, GENLA_F_MANDATORY, on_congestion) | 163 | __u32_field(23, GENLA_F_MANDATORY, on_congestion) |
158 | __u32_field(22, GENLA_F_MANDATORY, cong_fill) | 164 | __u32_field(24, GENLA_F_MANDATORY, cong_fill) |
159 | __u32_field(23, GENLA_F_MANDATORY, cong_extents) | 165 | __u32_field(25, GENLA_F_MANDATORY, cong_extents) |
160 | __flg_field(24, GENLA_F_MANDATORY, two_primaries) | 166 | __flg_field(26, GENLA_F_MANDATORY, two_primaries) |
161 | __flg_field(25, GENLA_F_MANDATORY, want_lose) | 167 | __flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT, want_lose) |
162 | __flg_field(26, GENLA_F_MANDATORY, no_cork) | 168 | __flg_field(28, GENLA_F_MANDATORY, no_cork) |
163 | __flg_field(27, GENLA_F_MANDATORY, always_asbp) | 169 | __flg_field(29, GENLA_F_MANDATORY, always_asbp) |
164 | __flg_field(28, GENLA_F_MANDATORY, dry_run) | 170 | __flg_field(30, GENLA_F_MANDATORY | GENLA_F_INVARIANT, dry_run) |
171 | __flg_field(31, GENLA_F_MANDATORY, use_rle) | ||
165 | ) | 172 | ) |
166 | 173 | ||
167 | GENL_struct(DRBD_NLA_SET_ROLE_PARMS, 6, set_role_parms, | 174 | GENL_struct(DRBD_NLA_SET_ROLE_PARMS, 6, set_role_parms, |
@@ -270,11 +277,10 @@ GENL_op(DRBD_ADM_ADD_LINK, 7, GENL_doit(drbd_adm_create_connection), | |||
270 | GENL_op(DRBD_ADM_DEL_LINK, 8, GENL_doit(drbd_adm_delete_connection), | 277 | GENL_op(DRBD_ADM_DEL_LINK, 8, GENL_doit(drbd_adm_delete_connection), |
271 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED)) | 278 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED)) |
272 | 279 | ||
273 | /* operates on replication links */ | 280 | GENL_op(DRBD_ADM_RESOURCE_OPTS, 9, |
274 | GENL_op(DRBD_ADM_SYNCER, 9, | 281 | GENL_doit(drbd_adm_resource_opts), |
275 | GENL_doit(drbd_adm_syncer), | ||
276 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) | 282 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) |
277 | GENL_tla_expected(DRBD_NLA_SYNCER_CONF, GENLA_F_MANDATORY) | 283 | GENL_tla_expected(DRBD_NLA_RESOURCE_OPTS, GENLA_F_MANDATORY) |
278 | ) | 284 | ) |
279 | 285 | ||
280 | GENL_op( | 286 | GENL_op( |
@@ -284,16 +290,28 @@ GENL_op( | |||
284 | GENL_tla_expected(DRBD_NLA_NET_CONF, GENLA_F_REQUIRED) | 290 | GENL_tla_expected(DRBD_NLA_NET_CONF, GENLA_F_REQUIRED) |
285 | ) | 291 | ) |
286 | 292 | ||
293 | GENL_op( | ||
294 | DRBD_ADM_CHG_NET_OPTS, 29, | ||
295 | GENL_doit(drbd_adm_net_opts), | ||
296 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) | ||
297 | GENL_tla_expected(DRBD_NLA_NET_CONF, GENLA_F_REQUIRED) | ||
298 | ) | ||
299 | |||
287 | GENL_op(DRBD_ADM_DISCONNECT, 11, GENL_doit(drbd_adm_disconnect), | 300 | GENL_op(DRBD_ADM_DISCONNECT, 11, GENL_doit(drbd_adm_disconnect), |
288 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED)) | 301 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED)) |
289 | 302 | ||
290 | /* operates on minors */ | ||
291 | GENL_op(DRBD_ADM_ATTACH, 12, | 303 | GENL_op(DRBD_ADM_ATTACH, 12, |
292 | GENL_doit(drbd_adm_attach), | 304 | GENL_doit(drbd_adm_attach), |
293 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) | 305 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) |
294 | GENL_tla_expected(DRBD_NLA_DISK_CONF, GENLA_F_REQUIRED) | 306 | GENL_tla_expected(DRBD_NLA_DISK_CONF, GENLA_F_REQUIRED) |
295 | ) | 307 | ) |
296 | 308 | ||
309 | GENL_op(DRBD_ADM_CHG_DISK_OPTS, 28, | ||
310 | GENL_doit(drbd_adm_disk_opts), | ||
311 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, GENLA_F_REQUIRED) | ||
312 | GENL_tla_expected(DRBD_NLA_DISK_OPTS, GENLA_F_REQUIRED) | ||
313 | ) | ||
314 | |||
297 | GENL_op( | 315 | GENL_op( |
298 | DRBD_ADM_RESIZE, 13, | 316 | DRBD_ADM_RESIZE, 13, |
299 | GENL_doit(drbd_adm_resize), | 317 | GENL_doit(drbd_adm_resize), |
@@ -301,7 +319,6 @@ GENL_op( | |||
301 | GENL_tla_expected(DRBD_NLA_RESIZE_PARMS, GENLA_F_MANDATORY) | 319 | GENL_tla_expected(DRBD_NLA_RESIZE_PARMS, GENLA_F_MANDATORY) |
302 | ) | 320 | ) |
303 | 321 | ||
304 | /* operates on all volumes within a resource */ | ||
305 | GENL_op( | 322 | GENL_op( |
306 | DRBD_ADM_PRIMARY, 14, | 323 | DRBD_ADM_PRIMARY, 14, |
307 | GENL_doit(drbd_adm_set_role), | 324 | GENL_doit(drbd_adm_set_role), |
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h index 22920a8af4e2..659a8eb38830 100644 --- a/include/linux/drbd_limits.h +++ b/include/linux/drbd_limits.h | |||
@@ -166,5 +166,7 @@ | |||
166 | #define DRBD_CONG_EXTENTS_MAX DRBD_AL_EXTENTS_MAX | 166 | #define DRBD_CONG_EXTENTS_MAX DRBD_AL_EXTENTS_MAX |
167 | #define DRBD_CONG_EXTENTS_DEF DRBD_AL_EXTENTS_DEF | 167 | #define DRBD_CONG_EXTENTS_DEF DRBD_AL_EXTENTS_DEF |
168 | 168 | ||
169 | #define DRBD_PROTOCOL_DEF DRBD_PROT_C | ||
170 | |||
169 | #undef RANGE | 171 | #undef RANGE |
170 | #endif | 172 | #endif |
diff --git a/include/linux/genl_magic_func.h b/include/linux/genl_magic_func.h index c8c67239f616..e458282a3728 100644 --- a/include/linux/genl_magic_func.h +++ b/include/linux/genl_magic_func.h | |||
@@ -190,11 +190,12 @@ static struct nlattr *nested_attr_tb[128]; | |||
190 | 190 | ||
191 | #undef GENL_struct | 191 | #undef GENL_struct |
192 | #define GENL_struct(tag_name, tag_number, s_name, s_fields) \ | 192 | #define GENL_struct(tag_name, tag_number, s_name, s_fields) \ |
193 | /* static, potentially unused */ \ | 193 | /* *_from_attrs functions are static, but potentially unused */ \ |
194 | int s_name ## _from_attrs(struct s_name *s, struct nlattr *tb[]) \ | 194 | static int __ ## s_name ## _from_attrs(struct s_name *s, \ |
195 | struct genl_info *info, bool exclude_invariants) \ | ||
195 | { \ | 196 | { \ |
196 | const int maxtype = ARRAY_SIZE(s_name ## _nl_policy)-1; \ | 197 | const int maxtype = ARRAY_SIZE(s_name ## _nl_policy)-1; \ |
197 | struct nlattr *tla = tb[tag_number]; \ | 198 | struct nlattr *tla = info->attrs[tag_number]; \ |
198 | struct nlattr **ntb = nested_attr_tb; \ | 199 | struct nlattr **ntb = nested_attr_tb; \ |
199 | struct nlattr *nla; \ | 200 | struct nlattr *nla; \ |
200 | int err; \ | 201 | int err; \ |
@@ -211,33 +212,49 @@ int s_name ## _from_attrs(struct s_name *s, struct nlattr *tb[]) \ | |||
211 | \ | 212 | \ |
212 | s_fields \ | 213 | s_fields \ |
213 | return 0; \ | 214 | return 0; \ |
214 | } | 215 | } __attribute__((unused)) \ |
216 | static int s_name ## _from_attrs(struct s_name *s, \ | ||
217 | struct genl_info *info) \ | ||
218 | { \ | ||
219 | return __ ## s_name ## _from_attrs(s, info, false); \ | ||
220 | } __attribute__((unused)) \ | ||
221 | static int s_name ## _from_attrs_for_change(struct s_name *s, \ | ||
222 | struct genl_info *info) \ | ||
223 | { \ | ||
224 | return __ ## s_name ## _from_attrs(s, info, true); \ | ||
225 | } __attribute__((unused)) \ | ||
215 | 226 | ||
216 | #undef __field | 227 | #define __assign(attr_nr, attr_flag, name, nla_type, type, assignment...) \ |
217 | #define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put) \ | ||
218 | nla = ntb[__nla_type(attr_nr)]; \ | 228 | nla = ntb[__nla_type(attr_nr)]; \ |
219 | if (nla) { \ | 229 | if (nla) { \ |
220 | if (s) \ | 230 | if (exclude_invariants && ((attr_flag) & GENLA_F_INVARIANT)) { \ |
221 | s->name = __get(nla); \ | 231 | pr_info("<< must not change invariant attr: %s\n", #name); \ |
222 | DPRINT_FIELD("<<", nla_type, name, s, nla); \ | 232 | return -EEXIST; \ |
233 | } \ | ||
234 | assignment; \ | ||
235 | } else if (exclude_invariants && ((attr_flag) & GENLA_F_INVARIANT)) { \ | ||
236 | /* attribute missing from payload, */ \ | ||
237 | /* which was expected */ \ | ||
223 | } else if ((attr_flag) & GENLA_F_REQUIRED) { \ | 238 | } else if ((attr_flag) & GENLA_F_REQUIRED) { \ |
224 | pr_info("<< missing attr: %s\n", #name); \ | 239 | pr_info("<< missing attr: %s\n", #name); \ |
225 | return -ENOMSG; \ | 240 | return -ENOMSG; \ |
226 | } | 241 | } |
227 | 242 | ||
243 | #undef __field | ||
244 | #define __field(attr_nr, attr_flag, name, nla_type, type, __get, __put) \ | ||
245 | __assign(attr_nr, attr_flag, name, nla_type, type, \ | ||
246 | if (s) \ | ||
247 | s->name = __get(nla); \ | ||
248 | DPRINT_FIELD("<<", nla_type, name, s, nla)) | ||
249 | |||
228 | /* validate_nla() already checked nla_len <= maxlen appropriately. */ | 250 | /* validate_nla() already checked nla_len <= maxlen appropriately. */ |
229 | #undef __array | 251 | #undef __array |
230 | #define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, __get, __put) \ | 252 | #define __array(attr_nr, attr_flag, name, nla_type, type, maxlen, __get, __put) \ |
231 | nla = ntb[__nla_type(attr_nr)]; \ | 253 | __assign(attr_nr, attr_flag, name, nla_type, type, \ |
232 | if (nla) { \ | ||
233 | if (s) \ | 254 | if (s) \ |
234 | s->name ## _len = \ | 255 | s->name ## _len = \ |
235 | __get(s->name, nla, maxlen); \ | 256 | __get(s->name, nla, maxlen); \ |
236 | DPRINT_ARRAY("<<", nla_type, name, s, nla); \ | 257 | DPRINT_ARRAY("<<", nla_type, name, s, nla)) |
237 | } else if ((attr_flag) & GENLA_F_REQUIRED) { \ | ||
238 | pr_info("<< missing attr: %s\n", #name); \ | ||
239 | return -ENOMSG; \ | ||
240 | } \ | ||
241 | 258 | ||
242 | #include GENL_MAGIC_INCLUDE_FILE | 259 | #include GENL_MAGIC_INCLUDE_FILE |
243 | 260 | ||
diff --git a/include/linux/genl_magic_struct.h b/include/linux/genl_magic_struct.h index 745ebfd6c7e5..9a605b9ee834 100644 --- a/include/linux/genl_magic_struct.h +++ b/include/linux/genl_magic_struct.h | |||
@@ -59,12 +59,20 @@ enum { | |||
59 | GENLA_F_MANDATORY = 1 << 14, | 59 | GENLA_F_MANDATORY = 1 << 14, |
60 | GENLA_F_REQUIRED = 1 << 15, | 60 | GENLA_F_REQUIRED = 1 << 15, |
61 | 61 | ||
62 | /* This will not be present in the __u16 .nla_type, but can be | 62 | /* Below will not be present in the __u16 .nla_type, but can be |
63 | * triggered on in <struct>_to_skb, to exclude "sensitive" | 63 | * triggered on in <struct>_to_skb resp. <struct>_from_attrs */ |
64 | * information from broadcasts, or on unpriviledged get requests. | 64 | |
65 | * This is useful because genetlink multicast groups can be listened in | 65 | /* To exclude "sensitive" information from broadcasts, or on |
66 | * on by anyone. */ | 66 | * unpriviledged get requests. This is useful because genetlink |
67 | * multicast groups can be listened in on by anyone. */ | ||
67 | GENLA_F_SENSITIVE = 1 << 16, | 68 | GENLA_F_SENSITIVE = 1 << 16, |
69 | |||
70 | /* INVARIAN options cannot be changed at runtime. | ||
71 | * Useful to share an attribute policy and struct definition, | ||
72 | * between some "create" and "change" commands, | ||
73 | * but disallow certain fields to be changed online. | ||
74 | */ | ||
75 | GENLA_F_INVARIANT = 1 << 17, | ||
68 | }; | 76 | }; |
69 | 77 | ||
70 | #define __nla_type(x) ((__u16)((__u16)(x) & (__u16)NLA_TYPE_MASK)) | 78 | #define __nla_type(x) ((__u16)((__u16)(x) & (__u16)NLA_TYPE_MASK)) |