Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 1 | /* |
| 2 | * General overview: |
| 3 | * full generic netlink message: |
| 4 | * |nlmsghdr|genlmsghdr|<payload> |
| 5 | * |
| 6 | * payload: |
| 7 | * |optional fixed size family header|<sequence of netlink attributes> |
| 8 | * |
| 9 | * sequence of netlink attributes: |
| 10 | * I chose to have all "top level" attributes NLA_NESTED, |
| 11 | * corresponding to some real struct. |
| 12 | * So we have a sequence of |tla, len|<nested nla sequence> |
| 13 | * |
| 14 | * nested nla sequence: |
| 15 | * may be empty, or contain a sequence of netlink attributes |
| 16 | * representing the struct fields. |
| 17 | * |
| 18 | * The tag number of any field (regardless of containing struct) |
| 19 | * will be available as T_ ## field_name, |
| 20 | * so you cannot have the same field name in two differnt structs. |
| 21 | * |
| 22 | * The tag numbers themselves are per struct, though, |
| 23 | * so should always begin at 1 (not 0, that is the special "NLA_UNSPEC" type, |
| 24 | * which we won't use here). |
| 25 | * The tag numbers are used as index in the respective nla_policy array. |
| 26 | * |
| 27 | * GENL_struct(tag_name, tag_number, struct name, struct fields) - struct and policy |
| 28 | * genl_magic_struct.h |
| 29 | * generates the struct declaration, |
| 30 | * generates an entry in the tla enum, |
| 31 | * genl_magic_func.h |
| 32 | * generates an entry in the static tla policy |
| 33 | * with .type = NLA_NESTED |
| 34 | * generates the static <struct_name>_nl_policy definition, |
| 35 | * and static conversion functions |
| 36 | * |
| 37 | * genl_magic_func.h |
| 38 | * |
| 39 | * GENL_mc_group(group) |
| 40 | * genl_magic_struct.h |
| 41 | * does nothing |
| 42 | * genl_magic_func.h |
| 43 | * defines and registers the mcast group, |
| 44 | * and provides a send helper |
| 45 | * |
| 46 | * GENL_notification(op_name, op_num, mcast_group, tla list) |
| 47 | * These are notifications to userspace. |
| 48 | * |
| 49 | * genl_magic_struct.h |
| 50 | * generates an entry in the genl_ops enum, |
| 51 | * genl_magic_func.h |
| 52 | * does nothing |
| 53 | * |
| 54 | * mcast group: the name of the mcast group this notification should be |
| 55 | * expected on |
| 56 | * tla list: the list of expected top level attributes, |
| 57 | * for documentation and sanity checking. |
| 58 | * |
| 59 | * GENL_op(op_name, op_num, flags and handler, tla list) - "genl operations" |
| 60 | * These are requests from userspace. |
| 61 | * |
| 62 | * _op and _notification share the same "number space", |
| 63 | * op_nr will be assigned to "genlmsghdr->cmd" |
| 64 | * |
| 65 | * genl_magic_struct.h |
| 66 | * generates an entry in the genl_ops enum, |
| 67 | * genl_magic_func.h |
| 68 | * generates an entry in the static genl_ops array, |
| 69 | * and static register/unregister functions to |
Johannes Berg | 489111e | 2016-10-24 14:40:03 +0200 | [diff] [blame] | 70 | * genl_register_family(). |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 71 | * |
| 72 | * flags and handler: |
| 73 | * GENL_op_init( .doit = x, .dumpit = y, .flags = something) |
| 74 | * GENL_doit(x) => .dumpit = NULL, .flags = GENL_ADMIN_PERM |
| 75 | * tla list: the list of expected top level attributes, |
| 76 | * for documentation and sanity checking. |
| 77 | */ |
| 78 | |
| 79 | /* |
| 80 | * STRUCTS |
| 81 | */ |
| 82 | |
| 83 | /* this is sent kernel -> userland on various error conditions, and contains |
| 84 | * informational textual info, which is supposedly human readable. |
| 85 | * The computer relevant return code is in the drbd_genlmsghdr. |
| 86 | */ |
| 87 | GENL_struct(DRBD_NLA_CFG_REPLY, 1, drbd_cfg_reply, |
| 88 | /* "arbitrary" size strings, nla_policy.len = 0 */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 89 | __str_field(1, DRBD_GENLA_F_MANDATORY, info_text, 0) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 90 | ) |
| 91 | |
| 92 | /* Configuration requests typically need a context to operate on. |
| 93 | * Possible keys are device minor (fits in the drbd_genlmsghdr), |
| 94 | * the replication link (aka connection) name, |
| 95 | * and/or the replication group (aka resource) name, |
| 96 | * and the volume id within the resource. */ |
| 97 | GENL_struct(DRBD_NLA_CFG_CONTEXT, 2, drbd_cfg_context, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 98 | __u32_field(1, DRBD_GENLA_F_MANDATORY, ctx_volume) |
Andreas Gruenbacher | 7c3063c | 2011-06-09 17:52:12 +0200 | [diff] [blame] | 99 | __str_field(2, DRBD_GENLA_F_MANDATORY, ctx_resource_name, 128) |
Andreas Gruenbacher | 089c075 | 2011-06-14 18:28:09 +0200 | [diff] [blame] | 100 | __bin_field(3, DRBD_GENLA_F_MANDATORY, ctx_my_addr, 128) |
| 101 | __bin_field(4, DRBD_GENLA_F_MANDATORY, ctx_peer_addr, 128) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 102 | ) |
| 103 | |
| 104 | GENL_struct(DRBD_NLA_DISK_CONF, 3, disk_conf, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 105 | __str_field(1, DRBD_F_REQUIRED | DRBD_F_INVARIANT, backing_dev, 128) |
| 106 | __str_field(2, DRBD_F_REQUIRED | DRBD_F_INVARIANT, meta_dev, 128) |
| 107 | __s32_field(3, DRBD_F_REQUIRED | DRBD_F_INVARIANT, meta_dev_idx) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 108 | |
| 109 | /* use the resize command to try and change the disk_size */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 110 | __u64_field(4, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, disk_size) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 111 | /* we could change the max_bio_bvecs, |
| 112 | * but it won't propagate through the stack */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 113 | __u32_field(5, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, max_bio_bvecs) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 114 | |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 115 | __u32_field_def(6, DRBD_GENLA_F_MANDATORY, on_io_error, DRBD_ON_IO_ERROR_DEF) |
| 116 | __u32_field_def(7, DRBD_GENLA_F_MANDATORY, fencing, DRBD_FENCING_DEF) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 117 | |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 118 | __u32_field_def(8, DRBD_GENLA_F_MANDATORY, resync_rate, DRBD_RESYNC_RATE_DEF) |
| 119 | __s32_field_def(9, DRBD_GENLA_F_MANDATORY, resync_after, DRBD_MINOR_NUMBER_DEF) |
| 120 | __u32_field_def(10, DRBD_GENLA_F_MANDATORY, al_extents, DRBD_AL_EXTENTS_DEF) |
| 121 | __u32_field_def(11, DRBD_GENLA_F_MANDATORY, c_plan_ahead, DRBD_C_PLAN_AHEAD_DEF) |
| 122 | __u32_field_def(12, DRBD_GENLA_F_MANDATORY, c_delay_target, DRBD_C_DELAY_TARGET_DEF) |
| 123 | __u32_field_def(13, DRBD_GENLA_F_MANDATORY, c_fill_target, DRBD_C_FILL_TARGET_DEF) |
| 124 | __u32_field_def(14, DRBD_GENLA_F_MANDATORY, c_max_rate, DRBD_C_MAX_RATE_DEF) |
| 125 | __u32_field_def(15, DRBD_GENLA_F_MANDATORY, c_min_rate, DRBD_C_MIN_RATE_DEF) |
Philipp Reisner | a5ca66c | 2016-06-14 00:26:14 +0200 | [diff] [blame] | 126 | __u32_field_def(20, DRBD_GENLA_F_MANDATORY, disk_timeout, DRBD_DISK_TIMEOUT_DEF) |
| 127 | __u32_field_def(21, 0 /* OPTIONAL */, read_balancing, DRBD_READ_BALANCING_DEF) |
| 128 | __u32_field_def(25, 0 /* OPTIONAL */, rs_discard_granularity, DRBD_RS_DISCARD_GRANULARITY_DEF) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 129 | |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 130 | __flg_field_def(16, DRBD_GENLA_F_MANDATORY, disk_barrier, DRBD_DISK_BARRIER_DEF) |
| 131 | __flg_field_def(17, DRBD_GENLA_F_MANDATORY, disk_flushes, DRBD_DISK_FLUSHES_DEF) |
| 132 | __flg_field_def(18, DRBD_GENLA_F_MANDATORY, disk_drain, DRBD_DISK_DRAIN_DEF) |
| 133 | __flg_field_def(19, DRBD_GENLA_F_MANDATORY, md_flushes, DRBD_MD_FLUSHES_DEF) |
Philipp Reisner | 9a51ab1 | 2012-02-20 21:53:28 +0100 | [diff] [blame] | 134 | __flg_field_def(23, 0 /* OPTIONAL */, al_updates, DRBD_AL_UPDATES_DEF) |
Lars Ellenberg | dd4f699 | 2016-06-14 00:26:20 +0200 | [diff] [blame] | 135 | __flg_field_def(24, 0 /* OPTIONAL */, discard_zeroes_if_aligned, DRBD_DISCARD_ZEROES_IF_ALIGNED) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 136 | ) |
| 137 | |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 138 | GENL_struct(DRBD_NLA_RESOURCE_OPTS, 4, res_opts, |
Andreas Gruenbacher | f44d043 | 2011-07-22 13:53:19 +0200 | [diff] [blame] | 139 | __str_field_def(1, DRBD_GENLA_F_MANDATORY, cpu_mask, DRBD_CPU_MASK_SIZE) |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 140 | __u32_field_def(2, DRBD_GENLA_F_MANDATORY, on_no_data, DRBD_ON_NO_DATA_DEF) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 141 | ) |
| 142 | |
| 143 | GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf, |
Andreas Gruenbacher | 089c075 | 2011-06-14 18:28:09 +0200 | [diff] [blame] | 144 | __str_field_def(1, DRBD_GENLA_F_MANDATORY | DRBD_F_SENSITIVE, |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 145 | shared_secret, SHARED_SECRET_MAX) |
Andreas Gruenbacher | 089c075 | 2011-06-14 18:28:09 +0200 | [diff] [blame] | 146 | __str_field_def(2, DRBD_GENLA_F_MANDATORY, cram_hmac_alg, SHARED_SECRET_MAX) |
| 147 | __str_field_def(3, DRBD_GENLA_F_MANDATORY, integrity_alg, SHARED_SECRET_MAX) |
| 148 | __str_field_def(4, DRBD_GENLA_F_MANDATORY, verify_alg, SHARED_SECRET_MAX) |
| 149 | __str_field_def(5, DRBD_GENLA_F_MANDATORY, csums_alg, SHARED_SECRET_MAX) |
| 150 | __u32_field_def(6, DRBD_GENLA_F_MANDATORY, wire_protocol, DRBD_PROTOCOL_DEF) |
| 151 | __u32_field_def(7, DRBD_GENLA_F_MANDATORY, connect_int, DRBD_CONNECT_INT_DEF) |
| 152 | __u32_field_def(8, DRBD_GENLA_F_MANDATORY, timeout, DRBD_TIMEOUT_DEF) |
| 153 | __u32_field_def(9, DRBD_GENLA_F_MANDATORY, ping_int, DRBD_PING_INT_DEF) |
| 154 | __u32_field_def(10, DRBD_GENLA_F_MANDATORY, ping_timeo, DRBD_PING_TIMEO_DEF) |
| 155 | __u32_field_def(11, DRBD_GENLA_F_MANDATORY, sndbuf_size, DRBD_SNDBUF_SIZE_DEF) |
| 156 | __u32_field_def(12, DRBD_GENLA_F_MANDATORY, rcvbuf_size, DRBD_RCVBUF_SIZE_DEF) |
| 157 | __u32_field_def(13, DRBD_GENLA_F_MANDATORY, ko_count, DRBD_KO_COUNT_DEF) |
| 158 | __u32_field_def(14, DRBD_GENLA_F_MANDATORY, max_buffers, DRBD_MAX_BUFFERS_DEF) |
| 159 | __u32_field_def(15, DRBD_GENLA_F_MANDATORY, max_epoch_size, DRBD_MAX_EPOCH_SIZE_DEF) |
| 160 | __u32_field_def(16, DRBD_GENLA_F_MANDATORY, unplug_watermark, DRBD_UNPLUG_WATERMARK_DEF) |
| 161 | __u32_field_def(17, DRBD_GENLA_F_MANDATORY, after_sb_0p, DRBD_AFTER_SB_0P_DEF) |
| 162 | __u32_field_def(18, DRBD_GENLA_F_MANDATORY, after_sb_1p, DRBD_AFTER_SB_1P_DEF) |
| 163 | __u32_field_def(19, DRBD_GENLA_F_MANDATORY, after_sb_2p, DRBD_AFTER_SB_2P_DEF) |
| 164 | __u32_field_def(20, DRBD_GENLA_F_MANDATORY, rr_conflict, DRBD_RR_CONFLICT_DEF) |
| 165 | __u32_field_def(21, DRBD_GENLA_F_MANDATORY, on_congestion, DRBD_ON_CONGESTION_DEF) |
| 166 | __u32_field_def(22, DRBD_GENLA_F_MANDATORY, cong_fill, DRBD_CONG_FILL_DEF) |
| 167 | __u32_field_def(23, DRBD_GENLA_F_MANDATORY, cong_extents, DRBD_CONG_EXTENTS_DEF) |
| 168 | __flg_field_def(24, DRBD_GENLA_F_MANDATORY, two_primaries, DRBD_ALLOW_TWO_PRIMARIES_DEF) |
| 169 | __flg_field(25, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, discard_my_data) |
| 170 | __flg_field_def(26, DRBD_GENLA_F_MANDATORY, tcp_cork, DRBD_TCP_CORK_DEF) |
| 171 | __flg_field_def(27, DRBD_GENLA_F_MANDATORY, always_asbp, DRBD_ALWAYS_ASBP_DEF) |
Andreas Gruenbacher | 6dff290 | 2011-06-28 14:18:12 +0200 | [diff] [blame] | 172 | __flg_field(28, DRBD_GENLA_F_MANDATORY | DRBD_F_INVARIANT, tentative) |
Andreas Gruenbacher | 089c075 | 2011-06-14 18:28:09 +0200 | [diff] [blame] | 173 | __flg_field_def(29, DRBD_GENLA_F_MANDATORY, use_rle, DRBD_USE_RLE_DEF) |
Philipp Reisner | 9a51ab1 | 2012-02-20 21:53:28 +0100 | [diff] [blame] | 174 | /* 9: __u32_field_def(30, DRBD_GENLA_F_MANDATORY, fencing_policy, DRBD_FENCING_DEF) */ |
Lars Ellenberg | aaaba34 | 2014-03-18 12:30:09 +0100 | [diff] [blame] | 175 | /* 9: __str_field_def(31, DRBD_GENLA_F_MANDATORY, name, SHARED_SECRET_MAX) */ |
| 176 | /* 9: __u32_field(32, DRBD_F_REQUIRED | DRBD_F_INVARIANT, peer_node_id) */ |
| 177 | __flg_field_def(33, 0 /* OPTIONAL */, csums_after_crash_only, DRBD_CSUMS_AFTER_CRASH_ONLY_DEF) |
Philipp Reisner | 5d0b17f | 2014-03-18 14:24:35 +0100 | [diff] [blame] | 178 | __u32_field_def(34, 0 /* OPTIONAL */, sock_check_timeo, DRBD_SOCKET_CHECK_TIMEO_DEF) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 179 | ) |
| 180 | |
| 181 | GENL_struct(DRBD_NLA_SET_ROLE_PARMS, 6, set_role_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 182 | __flg_field(1, DRBD_GENLA_F_MANDATORY, assume_uptodate) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 183 | ) |
| 184 | |
| 185 | GENL_struct(DRBD_NLA_RESIZE_PARMS, 7, resize_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 186 | __u64_field(1, DRBD_GENLA_F_MANDATORY, resize_size) |
| 187 | __flg_field(2, DRBD_GENLA_F_MANDATORY, resize_force) |
| 188 | __flg_field(3, DRBD_GENLA_F_MANDATORY, no_resync) |
Philipp Reisner | d752b26 | 2013-06-25 16:50:08 +0200 | [diff] [blame] | 189 | __u32_field_def(4, 0 /* OPTIONAL */, al_stripes, DRBD_AL_STRIPES_DEF) |
| 190 | __u32_field_def(5, 0 /* OPTIONAL */, al_stripe_size, DRBD_AL_STRIPE_SIZE_DEF) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 191 | ) |
| 192 | |
| 193 | GENL_struct(DRBD_NLA_STATE_INFO, 8, state_info, |
| 194 | /* the reason of the broadcast, |
| 195 | * if this is an event triggered broadcast. */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 196 | __u32_field(1, DRBD_GENLA_F_MANDATORY, sib_reason) |
| 197 | __u32_field(2, DRBD_F_REQUIRED, current_state) |
| 198 | __u64_field(3, DRBD_GENLA_F_MANDATORY, capacity) |
| 199 | __u64_field(4, DRBD_GENLA_F_MANDATORY, ed_uuid) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 200 | |
| 201 | /* These are for broadcast from after state change work. |
| 202 | * prev_state and new_state are from the moment the state change took |
| 203 | * place, new_state is not neccessarily the same as current_state, |
| 204 | * there may have been more state changes since. Which will be |
| 205 | * broadcasted soon, in their respective after state change work. */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 206 | __u32_field(5, DRBD_GENLA_F_MANDATORY, prev_state) |
| 207 | __u32_field(6, DRBD_GENLA_F_MANDATORY, new_state) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 208 | |
| 209 | /* if we have a local disk: */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 210 | __bin_field(7, DRBD_GENLA_F_MANDATORY, uuids, (UI_SIZE*sizeof(__u64))) |
| 211 | __u32_field(8, DRBD_GENLA_F_MANDATORY, disk_flags) |
| 212 | __u64_field(9, DRBD_GENLA_F_MANDATORY, bits_total) |
| 213 | __u64_field(10, DRBD_GENLA_F_MANDATORY, bits_oos) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 214 | /* and in case resync or online verify is active */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 215 | __u64_field(11, DRBD_GENLA_F_MANDATORY, bits_rs_total) |
| 216 | __u64_field(12, DRBD_GENLA_F_MANDATORY, bits_rs_failed) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 217 | |
| 218 | /* for pre and post notifications of helper execution */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 219 | __str_field(13, DRBD_GENLA_F_MANDATORY, helper, 32) |
| 220 | __u32_field(14, DRBD_GENLA_F_MANDATORY, helper_exit_code) |
Philipp Marek | 3174f8c | 2012-03-03 21:04:30 +0100 | [diff] [blame] | 221 | |
| 222 | __u64_field(15, 0, send_cnt) |
| 223 | __u64_field(16, 0, recv_cnt) |
| 224 | __u64_field(17, 0, read_cnt) |
| 225 | __u64_field(18, 0, writ_cnt) |
| 226 | __u64_field(19, 0, al_writ_cnt) |
| 227 | __u64_field(20, 0, bm_writ_cnt) |
| 228 | __u32_field(21, 0, ap_bio_cnt) |
| 229 | __u32_field(22, 0, ap_pending_cnt) |
| 230 | __u32_field(23, 0, rs_pending_cnt) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 231 | ) |
| 232 | |
| 233 | GENL_struct(DRBD_NLA_START_OV_PARMS, 9, start_ov_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 234 | __u64_field(1, DRBD_GENLA_F_MANDATORY, ov_start_sector) |
Lars Ellenberg | 58ffa58 | 2012-07-26 14:09:49 +0200 | [diff] [blame] | 235 | __u64_field(2, DRBD_GENLA_F_MANDATORY, ov_stop_sector) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 236 | ) |
| 237 | |
| 238 | GENL_struct(DRBD_NLA_NEW_C_UUID_PARMS, 10, new_c_uuid_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 239 | __flg_field(1, DRBD_GENLA_F_MANDATORY, clear_bm) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 240 | ) |
| 241 | |
| 242 | GENL_struct(DRBD_NLA_TIMEOUT_PARMS, 11, timeout_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 243 | __u32_field(1, DRBD_F_REQUIRED, timeout_type) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 244 | ) |
| 245 | |
| 246 | GENL_struct(DRBD_NLA_DISCONNECT_PARMS, 12, disconnect_parms, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 247 | __flg_field(1, DRBD_GENLA_F_MANDATORY, force_disconnect) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 248 | ) |
| 249 | |
Philipp Reisner | cdfda63 | 2011-07-05 15:38:59 +0200 | [diff] [blame] | 250 | GENL_struct(DRBD_NLA_DETACH_PARMS, 13, detach_parms, |
| 251 | __flg_field(1, DRBD_GENLA_F_MANDATORY, force_detach) |
| 252 | ) |
| 253 | |
Andreas Gruenbacher | a297284 | 2014-07-31 17:41:33 +0200 | [diff] [blame] | 254 | GENL_struct(DRBD_NLA_RESOURCE_INFO, 15, resource_info, |
| 255 | __u32_field(1, 0, res_role) |
| 256 | __flg_field(2, 0, res_susp) |
| 257 | __flg_field(3, 0, res_susp_nod) |
| 258 | __flg_field(4, 0, res_susp_fen) |
| 259 | /* __flg_field(5, 0, res_weak) */ |
| 260 | ) |
| 261 | |
| 262 | GENL_struct(DRBD_NLA_DEVICE_INFO, 16, device_info, |
| 263 | __u32_field(1, 0, dev_disk_state) |
| 264 | ) |
| 265 | |
| 266 | GENL_struct(DRBD_NLA_CONNECTION_INFO, 17, connection_info, |
| 267 | __u32_field(1, 0, conn_connection_state) |
| 268 | __u32_field(2, 0, conn_role) |
| 269 | ) |
| 270 | |
| 271 | GENL_struct(DRBD_NLA_PEER_DEVICE_INFO, 18, peer_device_info, |
| 272 | __u32_field(1, 0, peer_repl_state) |
| 273 | __u32_field(2, 0, peer_disk_state) |
| 274 | __u32_field(3, 0, peer_resync_susp_user) |
| 275 | __u32_field(4, 0, peer_resync_susp_peer) |
| 276 | __u32_field(5, 0, peer_resync_susp_dependency) |
| 277 | ) |
| 278 | |
| 279 | GENL_struct(DRBD_NLA_RESOURCE_STATISTICS, 19, resource_statistics, |
| 280 | __u32_field(1, 0, res_stat_write_ordering) |
| 281 | ) |
| 282 | |
| 283 | GENL_struct(DRBD_NLA_DEVICE_STATISTICS, 20, device_statistics, |
| 284 | __u64_field(1, 0, dev_size) /* (sectors) */ |
| 285 | __u64_field(2, 0, dev_read) /* (sectors) */ |
| 286 | __u64_field(3, 0, dev_write) /* (sectors) */ |
| 287 | __u64_field(4, 0, dev_al_writes) /* activity log writes (count) */ |
| 288 | __u64_field(5, 0, dev_bm_writes) /* bitmap writes (count) */ |
| 289 | __u32_field(6, 0, dev_upper_pending) /* application requests in progress */ |
| 290 | __u32_field(7, 0, dev_lower_pending) /* backing device requests in progress */ |
| 291 | __flg_field(8, 0, dev_upper_blocked) |
| 292 | __flg_field(9, 0, dev_lower_blocked) |
| 293 | __flg_field(10, 0, dev_al_suspended) /* activity log suspended */ |
| 294 | __u64_field(11, 0, dev_exposed_data_uuid) |
| 295 | __u64_field(12, 0, dev_current_uuid) |
| 296 | __u32_field(13, 0, dev_disk_flags) |
| 297 | __bin_field(14, 0, history_uuids, HISTORY_UUIDS * sizeof(__u64)) |
| 298 | ) |
| 299 | |
| 300 | GENL_struct(DRBD_NLA_CONNECTION_STATISTICS, 21, connection_statistics, |
| 301 | __flg_field(1, 0, conn_congested) |
| 302 | ) |
| 303 | |
| 304 | GENL_struct(DRBD_NLA_PEER_DEVICE_STATISTICS, 22, peer_device_statistics, |
| 305 | __u64_field(1, 0, peer_dev_received) /* sectors */ |
| 306 | __u64_field(2, 0, peer_dev_sent) /* sectors */ |
| 307 | __u32_field(3, 0, peer_dev_pending) /* number of requests */ |
| 308 | __u32_field(4, 0, peer_dev_unacked) /* number of requests */ |
| 309 | __u64_field(5, 0, peer_dev_out_of_sync) /* sectors */ |
| 310 | __u64_field(6, 0, peer_dev_resync_failed) /* sectors */ |
| 311 | __u64_field(7, 0, peer_dev_bitmap_uuid) |
| 312 | __u32_field(9, 0, peer_dev_flags) |
| 313 | ) |
| 314 | |
| 315 | GENL_struct(DRBD_NLA_NOTIFICATION_HEADER, 23, drbd_notification_header, |
| 316 | __u32_field(1, DRBD_GENLA_F_MANDATORY, nh_type) |
| 317 | ) |
| 318 | |
| 319 | GENL_struct(DRBD_NLA_HELPER, 24, drbd_helper_info, |
| 320 | __str_field(1, DRBD_GENLA_F_MANDATORY, helper_name, 32) |
| 321 | __u32_field(2, DRBD_GENLA_F_MANDATORY, helper_status) |
| 322 | ) |
| 323 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 324 | /* |
| 325 | * Notifications and commands (genlmsghdr->cmd) |
| 326 | */ |
| 327 | GENL_mc_group(events) |
| 328 | |
| 329 | /* kernel -> userspace announcement of changes */ |
| 330 | GENL_notification( |
| 331 | DRBD_EVENT, 1, events, |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 332 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 333 | GENL_tla_expected(DRBD_NLA_STATE_INFO, DRBD_F_REQUIRED) |
| 334 | GENL_tla_expected(DRBD_NLA_NET_CONF, DRBD_GENLA_F_MANDATORY) |
| 335 | GENL_tla_expected(DRBD_NLA_DISK_CONF, DRBD_GENLA_F_MANDATORY) |
| 336 | GENL_tla_expected(DRBD_NLA_SYNCER_CONF, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 337 | ) |
| 338 | |
| 339 | /* query kernel for specific or all info */ |
| 340 | GENL_op( |
| 341 | DRBD_ADM_GET_STATUS, 2, |
| 342 | GENL_op_init( |
| 343 | .doit = drbd_adm_get_status, |
| 344 | .dumpit = drbd_adm_get_status_all, |
| 345 | /* anyone may ask for the status, |
| 346 | * it is broadcasted anyways */ |
| 347 | ), |
| 348 | /* To select the object .doit. |
| 349 | * Or a subset of objects in .dumpit. */ |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 350 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 351 | ) |
| 352 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 353 | /* add DRBD minor devices as volumes to resources */ |
Andreas Gruenbacher | 05a10ec | 2011-06-07 22:54:17 +0200 | [diff] [blame] | 354 | GENL_op(DRBD_ADM_NEW_MINOR, 5, GENL_doit(drbd_adm_new_minor), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 355 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Andreas Gruenbacher | 05a10ec | 2011-06-07 22:54:17 +0200 | [diff] [blame] | 356 | GENL_op(DRBD_ADM_DEL_MINOR, 6, GENL_doit(drbd_adm_del_minor), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 357 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 358 | |
Andreas Gruenbacher | 789c1b6 | 2011-06-06 16:16:44 +0200 | [diff] [blame] | 359 | /* add or delete resources */ |
| 360 | GENL_op(DRBD_ADM_NEW_RESOURCE, 7, GENL_doit(drbd_adm_new_resource), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 361 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Andreas Gruenbacher | 789c1b6 | 2011-06-06 16:16:44 +0200 | [diff] [blame] | 362 | GENL_op(DRBD_ADM_DEL_RESOURCE, 8, GENL_doit(drbd_adm_del_resource), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 363 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 364 | |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 365 | GENL_op(DRBD_ADM_RESOURCE_OPTS, 9, |
| 366 | GENL_doit(drbd_adm_resource_opts), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 367 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 368 | GENL_tla_expected(DRBD_NLA_RESOURCE_OPTS, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 369 | ) |
| 370 | |
| 371 | GENL_op( |
| 372 | DRBD_ADM_CONNECT, 10, |
| 373 | GENL_doit(drbd_adm_connect), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 374 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 375 | GENL_tla_expected(DRBD_NLA_NET_CONF, DRBD_F_REQUIRED) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 376 | ) |
| 377 | |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 378 | GENL_op( |
| 379 | DRBD_ADM_CHG_NET_OPTS, 29, |
| 380 | GENL_doit(drbd_adm_net_opts), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 381 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 382 | GENL_tla_expected(DRBD_NLA_NET_CONF, DRBD_F_REQUIRED) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 383 | ) |
| 384 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 385 | GENL_op(DRBD_ADM_DISCONNECT, 11, GENL_doit(drbd_adm_disconnect), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 386 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 387 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 388 | GENL_op(DRBD_ADM_ATTACH, 12, |
| 389 | GENL_doit(drbd_adm_attach), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 390 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 391 | GENL_tla_expected(DRBD_NLA_DISK_CONF, DRBD_F_REQUIRED) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 392 | ) |
| 393 | |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 394 | GENL_op(DRBD_ADM_CHG_DISK_OPTS, 28, |
| 395 | GENL_doit(drbd_adm_disk_opts), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 396 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 397 | GENL_tla_expected(DRBD_NLA_DISK_OPTS, DRBD_F_REQUIRED) |
Lars Ellenberg | f399002 | 2011-03-23 14:31:09 +0100 | [diff] [blame] | 398 | ) |
| 399 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 400 | GENL_op( |
| 401 | DRBD_ADM_RESIZE, 13, |
| 402 | GENL_doit(drbd_adm_resize), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 403 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 404 | GENL_tla_expected(DRBD_NLA_RESIZE_PARMS, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 405 | ) |
| 406 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 407 | GENL_op( |
| 408 | DRBD_ADM_PRIMARY, 14, |
| 409 | GENL_doit(drbd_adm_set_role), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 410 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 411 | GENL_tla_expected(DRBD_NLA_SET_ROLE_PARMS, DRBD_F_REQUIRED) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 412 | ) |
| 413 | |
| 414 | GENL_op( |
| 415 | DRBD_ADM_SECONDARY, 15, |
| 416 | GENL_doit(drbd_adm_set_role), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 417 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 418 | GENL_tla_expected(DRBD_NLA_SET_ROLE_PARMS, DRBD_F_REQUIRED) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 419 | ) |
| 420 | |
| 421 | GENL_op( |
| 422 | DRBD_ADM_NEW_C_UUID, 16, |
| 423 | GENL_doit(drbd_adm_new_c_uuid), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 424 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 425 | GENL_tla_expected(DRBD_NLA_NEW_C_UUID_PARMS, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 426 | ) |
| 427 | |
| 428 | GENL_op( |
| 429 | DRBD_ADM_START_OV, 17, |
| 430 | GENL_doit(drbd_adm_start_ov), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 431 | GENL_tla_expected(DRBD_NLA_START_OV_PARMS, DRBD_GENLA_F_MANDATORY) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 432 | ) |
| 433 | |
| 434 | GENL_op(DRBD_ADM_DETACH, 18, GENL_doit(drbd_adm_detach), |
Philipp Reisner | cdfda63 | 2011-07-05 15:38:59 +0200 | [diff] [blame] | 435 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 436 | GENL_tla_expected(DRBD_NLA_DETACH_PARMS, DRBD_GENLA_F_MANDATORY)) |
| 437 | |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 438 | GENL_op(DRBD_ADM_INVALIDATE, 19, GENL_doit(drbd_adm_invalidate), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 439 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 440 | GENL_op(DRBD_ADM_INVAL_PEER, 20, GENL_doit(drbd_adm_invalidate_peer), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 441 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 442 | GENL_op(DRBD_ADM_PAUSE_SYNC, 21, GENL_doit(drbd_adm_pause_sync), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 443 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 444 | GENL_op(DRBD_ADM_RESUME_SYNC, 22, GENL_doit(drbd_adm_resume_sync), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 445 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 446 | GENL_op(DRBD_ADM_SUSPEND_IO, 23, GENL_doit(drbd_adm_suspend_io), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 447 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 448 | GENL_op(DRBD_ADM_RESUME_IO, 24, GENL_doit(drbd_adm_resume_io), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 449 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 450 | GENL_op(DRBD_ADM_OUTDATE, 25, GENL_doit(drbd_adm_outdate), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 451 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | ec2c35a | 2011-03-07 10:20:08 +0100 | [diff] [blame] | 452 | GENL_op(DRBD_ADM_GET_TIMEOUT_TYPE, 26, GENL_doit(drbd_adm_get_timeout_type), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 453 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Lars Ellenberg | 85f75dd7 | 2011-03-15 16:26:37 +0100 | [diff] [blame] | 454 | GENL_op(DRBD_ADM_DOWN, 27, GENL_doit(drbd_adm_down), |
Andreas Gruenbacher | 5f93592 | 2011-05-19 17:39:28 +0200 | [diff] [blame] | 455 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED)) |
Andreas Gruenbacher | a297284 | 2014-07-31 17:41:33 +0200 | [diff] [blame] | 456 | |
Andreas Gruenbacher | a55bbd3 | 2014-08-28 13:31:14 +0200 | [diff] [blame] | 457 | GENL_op(DRBD_ADM_GET_RESOURCES, 30, |
| 458 | GENL_op_init( |
| 459 | .dumpit = drbd_adm_dump_resources, |
| 460 | ), |
| 461 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY) |
| 462 | GENL_tla_expected(DRBD_NLA_RESOURCE_INFO, DRBD_GENLA_F_MANDATORY) |
| 463 | GENL_tla_expected(DRBD_NLA_RESOURCE_STATISTICS, DRBD_GENLA_F_MANDATORY)) |
| 464 | |
| 465 | GENL_op(DRBD_ADM_GET_DEVICES, 31, |
| 466 | GENL_op_init( |
| 467 | .dumpit = drbd_adm_dump_devices, |
| 468 | .done = drbd_adm_dump_devices_done, |
| 469 | ), |
| 470 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY) |
| 471 | GENL_tla_expected(DRBD_NLA_DEVICE_INFO, DRBD_GENLA_F_MANDATORY) |
| 472 | GENL_tla_expected(DRBD_NLA_DEVICE_STATISTICS, DRBD_GENLA_F_MANDATORY)) |
| 473 | |
| 474 | GENL_op(DRBD_ADM_GET_CONNECTIONS, 32, |
| 475 | GENL_op_init( |
| 476 | .dumpit = drbd_adm_dump_connections, |
| 477 | .done = drbd_adm_dump_connections_done, |
| 478 | ), |
| 479 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY) |
| 480 | GENL_tla_expected(DRBD_NLA_CONNECTION_INFO, DRBD_GENLA_F_MANDATORY) |
| 481 | GENL_tla_expected(DRBD_NLA_CONNECTION_STATISTICS, DRBD_GENLA_F_MANDATORY)) |
| 482 | |
| 483 | GENL_op(DRBD_ADM_GET_PEER_DEVICES, 33, |
| 484 | GENL_op_init( |
| 485 | .dumpit = drbd_adm_dump_peer_devices, |
| 486 | .done = drbd_adm_dump_peer_devices_done, |
| 487 | ), |
| 488 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY) |
| 489 | GENL_tla_expected(DRBD_NLA_PEER_DEVICE_INFO, DRBD_GENLA_F_MANDATORY) |
| 490 | GENL_tla_expected(DRBD_NLA_PEER_DEVICE_STATISTICS, DRBD_GENLA_F_MANDATORY)) |
| 491 | |
Andreas Gruenbacher | a297284 | 2014-07-31 17:41:33 +0200 | [diff] [blame] | 492 | GENL_notification( |
| 493 | DRBD_RESOURCE_STATE, 34, events, |
| 494 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 495 | GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED) |
| 496 | GENL_tla_expected(DRBD_NLA_RESOURCE_INFO, DRBD_F_REQUIRED) |
| 497 | GENL_tla_expected(DRBD_NLA_RESOURCE_STATISTICS, DRBD_F_REQUIRED)) |
| 498 | |
| 499 | GENL_notification( |
| 500 | DRBD_DEVICE_STATE, 35, events, |
| 501 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 502 | GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED) |
| 503 | GENL_tla_expected(DRBD_NLA_DEVICE_INFO, DRBD_F_REQUIRED) |
| 504 | GENL_tla_expected(DRBD_NLA_DEVICE_STATISTICS, DRBD_F_REQUIRED)) |
| 505 | |
| 506 | GENL_notification( |
| 507 | DRBD_CONNECTION_STATE, 36, events, |
| 508 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 509 | GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED) |
| 510 | GENL_tla_expected(DRBD_NLA_CONNECTION_INFO, DRBD_F_REQUIRED) |
| 511 | GENL_tla_expected(DRBD_NLA_CONNECTION_STATISTICS, DRBD_F_REQUIRED)) |
| 512 | |
| 513 | GENL_notification( |
| 514 | DRBD_PEER_DEVICE_STATE, 37, events, |
| 515 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 516 | GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED) |
| 517 | GENL_tla_expected(DRBD_NLA_PEER_DEVICE_INFO, DRBD_F_REQUIRED) |
| 518 | GENL_tla_expected(DRBD_NLA_PEER_DEVICE_STATISTICS, DRBD_F_REQUIRED)) |
| 519 | |
| 520 | GENL_op( |
| 521 | DRBD_ADM_GET_INITIAL_STATE, 38, |
| 522 | GENL_op_init( |
| 523 | .dumpit = drbd_adm_get_initial_state, |
| 524 | ), |
| 525 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_GENLA_F_MANDATORY)) |
| 526 | |
| 527 | GENL_notification( |
| 528 | DRBD_HELPER, 40, events, |
| 529 | GENL_tla_expected(DRBD_NLA_CFG_CONTEXT, DRBD_F_REQUIRED) |
| 530 | GENL_tla_expected(DRBD_NLA_HELPER, DRBD_F_REQUIRED)) |
| 531 | |
| 532 | GENL_notification( |
| 533 | DRBD_INITIAL_STATE_DONE, 41, events, |
| 534 | GENL_tla_expected(DRBD_NLA_NOTIFICATION_HEADER, DRBD_F_REQUIRED)) |