/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */

#ifndef _LINUX_DRBD_GENL_H
#define _LINUX_DRBD_GENL_H

#define DRBD_FAMILY_NAME	"drbd"
#define DRBD_FAMILY_VERSION	1

enum {
	DRBD_NLA_CFG_REPLY = 1,
	DRBD_NLA_CFG_CONTEXT,
	DRBD_NLA_DISK_CONF,
	DRBD_NLA_RESOURCE_OPTS,
	DRBD_NLA_NET_CONF,
	DRBD_NLA_SET_ROLE_PARMS,
	DRBD_NLA_RESIZE_PARMS,
	DRBD_NLA_STATE_INFO,
	DRBD_NLA_START_OV_PARMS,
	DRBD_NLA_NEW_C_UUID_PARMS,
	DRBD_NLA_TIMEOUT_PARMS,
	DRBD_NLA_DISCONNECT_PARMS,
	DRBD_NLA_DETACH_PARMS,
	DRBD_NLA_RESOURCE_INFO = 15,
	DRBD_NLA_DEVICE_INFO,
	DRBD_NLA_CONNECTION_INFO,
	DRBD_NLA_PEER_DEVICE_INFO,
	DRBD_NLA_RESOURCE_STATISTICS,
	DRBD_NLA_DEVICE_STATISTICS,
	DRBD_NLA_CONNECTION_STATISTICS,
	DRBD_NLA_PEER_DEVICE_STATISTICS,
	DRBD_NLA_NOTIFICATION_HEADER,
	DRBD_NLA_HELPER,

	__DRBD_NLA_MAX,
	DRBD_NLA_MAX = (__DRBD_NLA_MAX - 1)
};

enum {
	DRBD_A_DRBD_CFG_REPLY_INFO_TEXT = 1,

	__DRBD_A_DRBD_CFG_REPLY_MAX,
	DRBD_A_DRBD_CFG_REPLY_MAX = (__DRBD_A_DRBD_CFG_REPLY_MAX - 1)
};

enum {
	DRBD_A_DRBD_CFG_CONTEXT_CTX_VOLUME = 1,
	DRBD_A_DRBD_CFG_CONTEXT_CTX_RESOURCE_NAME,
	DRBD_A_DRBD_CFG_CONTEXT_CTX_MY_ADDR,
	DRBD_A_DRBD_CFG_CONTEXT_CTX_PEER_ADDR,

	__DRBD_A_DRBD_CFG_CONTEXT_MAX,
	DRBD_A_DRBD_CFG_CONTEXT_MAX = (__DRBD_A_DRBD_CFG_CONTEXT_MAX - 1)
};

enum {
	DRBD_A_DISK_CONF_BACKING_DEV = 1,
	DRBD_A_DISK_CONF_META_DEV,
	DRBD_A_DISK_CONF_META_DEV_IDX,
	DRBD_A_DISK_CONF_DISK_SIZE,
	DRBD_A_DISK_CONF_MAX_BIO_BVECS,
	DRBD_A_DISK_CONF_ON_IO_ERROR,
	DRBD_A_DISK_CONF_FENCING,
	DRBD_A_DISK_CONF_RESYNC_RATE,
	DRBD_A_DISK_CONF_RESYNC_AFTER,
	DRBD_A_DISK_CONF_AL_EXTENTS,
	DRBD_A_DISK_CONF_C_PLAN_AHEAD,
	DRBD_A_DISK_CONF_C_DELAY_TARGET,
	DRBD_A_DISK_CONF_C_FILL_TARGET,
	DRBD_A_DISK_CONF_C_MAX_RATE,
	DRBD_A_DISK_CONF_C_MIN_RATE,
	DRBD_A_DISK_CONF_DISK_BARRIER,
	DRBD_A_DISK_CONF_DISK_FLUSHES,
	DRBD_A_DISK_CONF_DISK_DRAIN,
	DRBD_A_DISK_CONF_MD_FLUSHES,
	DRBD_A_DISK_CONF_DISK_TIMEOUT,
	DRBD_A_DISK_CONF_READ_BALANCING,
	DRBD_A_DISK_CONF_AL_UPDATES = 23,
	DRBD_A_DISK_CONF_DISCARD_ZEROES_IF_ALIGNED,
	DRBD_A_DISK_CONF_RS_DISCARD_GRANULARITY,
	DRBD_A_DISK_CONF_DISABLE_WRITE_SAME,

	__DRBD_A_DISK_CONF_MAX,
	DRBD_A_DISK_CONF_MAX = (__DRBD_A_DISK_CONF_MAX - 1)
};

enum {
	DRBD_A_RES_OPTS_CPU_MASK = 1,
	DRBD_A_RES_OPTS_ON_NO_DATA,

	__DRBD_A_RES_OPTS_MAX,
	DRBD_A_RES_OPTS_MAX = (__DRBD_A_RES_OPTS_MAX - 1)
};

enum {
	DRBD_A_NET_CONF_SHARED_SECRET = 1,
	DRBD_A_NET_CONF_CRAM_HMAC_ALG,
	DRBD_A_NET_CONF_INTEGRITY_ALG,
	DRBD_A_NET_CONF_VERIFY_ALG,
	DRBD_A_NET_CONF_CSUMS_ALG,
	DRBD_A_NET_CONF_WIRE_PROTOCOL,
	DRBD_A_NET_CONF_CONNECT_INT,
	DRBD_A_NET_CONF_TIMEOUT,
	DRBD_A_NET_CONF_PING_INT,
	DRBD_A_NET_CONF_PING_TIMEO,
	DRBD_A_NET_CONF_SNDBUF_SIZE,
	DRBD_A_NET_CONF_RCVBUF_SIZE,
	DRBD_A_NET_CONF_KO_COUNT,
	DRBD_A_NET_CONF_MAX_BUFFERS,
	DRBD_A_NET_CONF_MAX_EPOCH_SIZE,
	DRBD_A_NET_CONF_UNPLUG_WATERMARK,
	DRBD_A_NET_CONF_AFTER_SB_0P,
	DRBD_A_NET_CONF_AFTER_SB_1P,
	DRBD_A_NET_CONF_AFTER_SB_2P,
	DRBD_A_NET_CONF_RR_CONFLICT,
	DRBD_A_NET_CONF_ON_CONGESTION,
	DRBD_A_NET_CONF_CONG_FILL,
	DRBD_A_NET_CONF_CONG_EXTENTS,
	DRBD_A_NET_CONF_TWO_PRIMARIES,
	DRBD_A_NET_CONF_DISCARD_MY_DATA,
	DRBD_A_NET_CONF_TCP_CORK,
	DRBD_A_NET_CONF_ALWAYS_ASBP,
	DRBD_A_NET_CONF_TENTATIVE,
	DRBD_A_NET_CONF_USE_RLE,
	DRBD_A_NET_CONF_CSUMS_AFTER_CRASH_ONLY = 33,
	DRBD_A_NET_CONF_SOCK_CHECK_TIMEO,

	__DRBD_A_NET_CONF_MAX,
	DRBD_A_NET_CONF_MAX = (__DRBD_A_NET_CONF_MAX - 1)
};

enum {
	DRBD_A_SET_ROLE_PARMS_ASSUME_UPTODATE = 1,

	__DRBD_A_SET_ROLE_PARMS_MAX,
	DRBD_A_SET_ROLE_PARMS_MAX = (__DRBD_A_SET_ROLE_PARMS_MAX - 1)
};

enum {
	DRBD_A_RESIZE_PARMS_RESIZE_SIZE = 1,
	DRBD_A_RESIZE_PARMS_RESIZE_FORCE,
	DRBD_A_RESIZE_PARMS_NO_RESYNC,
	DRBD_A_RESIZE_PARMS_AL_STRIPES,
	DRBD_A_RESIZE_PARMS_AL_STRIPE_SIZE,

	__DRBD_A_RESIZE_PARMS_MAX,
	DRBD_A_RESIZE_PARMS_MAX = (__DRBD_A_RESIZE_PARMS_MAX - 1)
};

enum {
	DRBD_A_STATE_INFO_SIB_REASON = 1,
	DRBD_A_STATE_INFO_CURRENT_STATE,
	DRBD_A_STATE_INFO_CAPACITY,
	DRBD_A_STATE_INFO_ED_UUID,
	DRBD_A_STATE_INFO_PREV_STATE,
	DRBD_A_STATE_INFO_NEW_STATE,
	DRBD_A_STATE_INFO_UUIDS,
	DRBD_A_STATE_INFO_DISK_FLAGS,
	DRBD_A_STATE_INFO_BITS_TOTAL,
	DRBD_A_STATE_INFO_BITS_OOS,
	DRBD_A_STATE_INFO_BITS_RS_TOTAL,
	DRBD_A_STATE_INFO_BITS_RS_FAILED,
	DRBD_A_STATE_INFO_HELPER,
	DRBD_A_STATE_INFO_HELPER_EXIT_CODE,
	DRBD_A_STATE_INFO_SEND_CNT,
	DRBD_A_STATE_INFO_RECV_CNT,
	DRBD_A_STATE_INFO_READ_CNT,
	DRBD_A_STATE_INFO_WRIT_CNT,
	DRBD_A_STATE_INFO_AL_WRIT_CNT,
	DRBD_A_STATE_INFO_BM_WRIT_CNT,
	DRBD_A_STATE_INFO_AP_BIO_CNT,
	DRBD_A_STATE_INFO_AP_PENDING_CNT,
	DRBD_A_STATE_INFO_RS_PENDING_CNT,

	__DRBD_A_STATE_INFO_MAX,
	DRBD_A_STATE_INFO_MAX = (__DRBD_A_STATE_INFO_MAX - 1)
};

enum {
	DRBD_A_START_OV_PARMS_OV_START_SECTOR = 1,
	DRBD_A_START_OV_PARMS_OV_STOP_SECTOR,

	__DRBD_A_START_OV_PARMS_MAX,
	DRBD_A_START_OV_PARMS_MAX = (__DRBD_A_START_OV_PARMS_MAX - 1)
};

enum {
	DRBD_A_NEW_C_UUID_PARMS_CLEAR_BM = 1,

	__DRBD_A_NEW_C_UUID_PARMS_MAX,
	DRBD_A_NEW_C_UUID_PARMS_MAX = (__DRBD_A_NEW_C_UUID_PARMS_MAX - 1)
};

enum {
	DRBD_A_TIMEOUT_PARMS_TIMEOUT_TYPE = 1,

	__DRBD_A_TIMEOUT_PARMS_MAX,
	DRBD_A_TIMEOUT_PARMS_MAX = (__DRBD_A_TIMEOUT_PARMS_MAX - 1)
};

enum {
	DRBD_A_DISCONNECT_PARMS_FORCE_DISCONNECT = 1,

	__DRBD_A_DISCONNECT_PARMS_MAX,
	DRBD_A_DISCONNECT_PARMS_MAX = (__DRBD_A_DISCONNECT_PARMS_MAX - 1)
};

enum {
	DRBD_A_DETACH_PARMS_FORCE_DETACH = 1,

	__DRBD_A_DETACH_PARMS_MAX,
	DRBD_A_DETACH_PARMS_MAX = (__DRBD_A_DETACH_PARMS_MAX - 1)
};

enum {
	DRBD_A_RESOURCE_INFO_RES_ROLE = 1,
	DRBD_A_RESOURCE_INFO_RES_SUSP,
	DRBD_A_RESOURCE_INFO_RES_SUSP_NOD,
	DRBD_A_RESOURCE_INFO_RES_SUSP_FEN,

	__DRBD_A_RESOURCE_INFO_MAX,
	DRBD_A_RESOURCE_INFO_MAX = (__DRBD_A_RESOURCE_INFO_MAX - 1)
};

enum {
	DRBD_A_DEVICE_INFO_DEV_DISK_STATE = 1,

	__DRBD_A_DEVICE_INFO_MAX,
	DRBD_A_DEVICE_INFO_MAX = (__DRBD_A_DEVICE_INFO_MAX - 1)
};

enum {
	DRBD_A_CONNECTION_INFO_CONN_CONNECTION_STATE = 1,
	DRBD_A_CONNECTION_INFO_CONN_ROLE,

	__DRBD_A_CONNECTION_INFO_MAX,
	DRBD_A_CONNECTION_INFO_MAX = (__DRBD_A_CONNECTION_INFO_MAX - 1)
};

enum {
	DRBD_A_PEER_DEVICE_INFO_PEER_REPL_STATE = 1,
	DRBD_A_PEER_DEVICE_INFO_PEER_DISK_STATE,
	DRBD_A_PEER_DEVICE_INFO_PEER_RESYNC_SUSP_USER,
	DRBD_A_PEER_DEVICE_INFO_PEER_RESYNC_SUSP_PEER,
	DRBD_A_PEER_DEVICE_INFO_PEER_RESYNC_SUSP_DEPENDENCY,

	__DRBD_A_PEER_DEVICE_INFO_MAX,
	DRBD_A_PEER_DEVICE_INFO_MAX = (__DRBD_A_PEER_DEVICE_INFO_MAX - 1)
};

enum {
	DRBD_A_RESOURCE_STATISTICS_RES_STAT_WRITE_ORDERING = 1,

	__DRBD_A_RESOURCE_STATISTICS_MAX,
	DRBD_A_RESOURCE_STATISTICS_MAX = (__DRBD_A_RESOURCE_STATISTICS_MAX - 1)
};

enum {
	DRBD_A_DEVICE_STATISTICS_DEV_SIZE = 1,
	DRBD_A_DEVICE_STATISTICS_DEV_READ,
	DRBD_A_DEVICE_STATISTICS_DEV_WRITE,
	DRBD_A_DEVICE_STATISTICS_DEV_AL_WRITES,
	DRBD_A_DEVICE_STATISTICS_DEV_BM_WRITES,
	DRBD_A_DEVICE_STATISTICS_DEV_UPPER_PENDING,
	DRBD_A_DEVICE_STATISTICS_DEV_LOWER_PENDING,
	DRBD_A_DEVICE_STATISTICS_DEV_UPPER_BLOCKED,
	DRBD_A_DEVICE_STATISTICS_DEV_LOWER_BLOCKED,
	DRBD_A_DEVICE_STATISTICS_DEV_AL_SUSPENDED,
	DRBD_A_DEVICE_STATISTICS_DEV_EXPOSED_DATA_UUID,
	DRBD_A_DEVICE_STATISTICS_DEV_CURRENT_UUID,
	DRBD_A_DEVICE_STATISTICS_DEV_DISK_FLAGS,
	DRBD_A_DEVICE_STATISTICS_HISTORY_UUIDS,

	__DRBD_A_DEVICE_STATISTICS_MAX,
	DRBD_A_DEVICE_STATISTICS_MAX = (__DRBD_A_DEVICE_STATISTICS_MAX - 1)
};

enum {
	DRBD_A_CONNECTION_STATISTICS_CONN_CONGESTED = 1,

	__DRBD_A_CONNECTION_STATISTICS_MAX,
	DRBD_A_CONNECTION_STATISTICS_MAX = (__DRBD_A_CONNECTION_STATISTICS_MAX - 1)
};

enum {
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_RECEIVED = 1,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_SENT,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_PENDING,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_UNACKED,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_OUT_OF_SYNC,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_RESYNC_FAILED,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_BITMAP_UUID,
	DRBD_A_PEER_DEVICE_STATISTICS_PEER_DEV_FLAGS = 9,

	__DRBD_A_PEER_DEVICE_STATISTICS_MAX,
	DRBD_A_PEER_DEVICE_STATISTICS_MAX = (__DRBD_A_PEER_DEVICE_STATISTICS_MAX - 1)
};

enum {
	DRBD_A_DRBD_NOTIFICATION_HEADER_NH_TYPE = 1,

	__DRBD_A_DRBD_NOTIFICATION_HEADER_MAX,
	DRBD_A_DRBD_NOTIFICATION_HEADER_MAX = (__DRBD_A_DRBD_NOTIFICATION_HEADER_MAX - 1)
};

enum {
	DRBD_A_DRBD_HELPER_INFO_HELPER_NAME = 1,
	DRBD_A_DRBD_HELPER_INFO_HELPER_STATUS,

	__DRBD_A_DRBD_HELPER_INFO_MAX,
	DRBD_A_DRBD_HELPER_INFO_MAX = (__DRBD_A_DRBD_HELPER_INFO_MAX - 1)
};

enum {
	DRBD_ADM_EVENT = 1,
	DRBD_ADM_GET_STATUS,
	DRBD_ADM_NEW_MINOR = 5,
	DRBD_ADM_DEL_MINOR,
	DRBD_ADM_NEW_RESOURCE,
	DRBD_ADM_DEL_RESOURCE,
	DRBD_ADM_RESOURCE_OPTS,
	DRBD_ADM_CONNECT,
	DRBD_ADM_DISCONNECT,
	DRBD_ADM_ATTACH,
	DRBD_ADM_RESIZE,
	DRBD_ADM_PRIMARY,
	DRBD_ADM_SECONDARY,
	DRBD_ADM_NEW_C_UUID,
	DRBD_ADM_START_OV,
	DRBD_ADM_DETACH,
	DRBD_ADM_INVALIDATE,
	DRBD_ADM_INVAL_PEER,
	DRBD_ADM_PAUSE_SYNC,
	DRBD_ADM_RESUME_SYNC,
	DRBD_ADM_SUSPEND_IO,
	DRBD_ADM_RESUME_IO,
	DRBD_ADM_OUTDATE,
	DRBD_ADM_GET_TIMEOUT_TYPE,
	DRBD_ADM_DOWN,
	DRBD_ADM_CHG_DISK_OPTS,
	DRBD_ADM_CHG_NET_OPTS,
	DRBD_ADM_GET_RESOURCES,
	DRBD_ADM_GET_DEVICES,
	DRBD_ADM_GET_CONNECTIONS,
	DRBD_ADM_GET_PEER_DEVICES,
	DRBD_ADM_RESOURCE_STATE,
	DRBD_ADM_DEVICE_STATE,
	DRBD_ADM_CONNECTION_STATE,
	DRBD_ADM_PEER_DEVICE_STATE,
	DRBD_ADM_GET_INITIAL_STATE,
	DRBD_ADM_HELPER = 40,
	DRBD_ADM_INITIAL_STATE_DONE,

	__DRBD_ADM_MAX,
	DRBD_ADM_MAX = (__DRBD_ADM_MAX - 1)
};

#define DRBD_MCGRP_EVENTS	"events"

#endif /* _LINUX_DRBD_GENL_H */