"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/rpc/rpc-lib/src/protocol-common.h" (16 Sep 2020, 10182 Bytes) of package /linux/misc/glusterfs-8.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "protocol-common.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2   Copyright (c) 2008-2012 Red Hat, Inc. <http://www.redhat.com>
    3   This file is part of GlusterFS.
    4 
    5   This file is licensed to you under your choice of the GNU Lesser
    6   General Public License, version 3 or any later version (LGPLv3 or
    7   later), or the GNU General Public License, version 2 (GPLv2), in all
    8   cases as published by the Free Software Foundation.
    9 */
   10 
   11 #ifndef _PROTOCOL_COMMON_H
   12 #define _PROTOCOL_COMMON_H
   13 
   14 enum gf_fop_procnum {
   15     GFS3_OP_NULL, /* 0 */
   16     GFS3_OP_STAT,
   17     GFS3_OP_READLINK,
   18     GFS3_OP_MKNOD,
   19     GFS3_OP_MKDIR,
   20     GFS3_OP_UNLINK,
   21     GFS3_OP_RMDIR,
   22     GFS3_OP_SYMLINK,
   23     GFS3_OP_RENAME,
   24     GFS3_OP_LINK,
   25     GFS3_OP_TRUNCATE,
   26     GFS3_OP_OPEN,
   27     GFS3_OP_READ,
   28     GFS3_OP_WRITE,
   29     GFS3_OP_STATFS,
   30     GFS3_OP_FLUSH,
   31     GFS3_OP_FSYNC,
   32     GFS3_OP_SETXATTR,
   33     GFS3_OP_GETXATTR,
   34     GFS3_OP_REMOVEXATTR,
   35     GFS3_OP_OPENDIR,
   36     GFS3_OP_FSYNCDIR,
   37     GFS3_OP_ACCESS,
   38     GFS3_OP_CREATE,
   39     GFS3_OP_FTRUNCATE,
   40     GFS3_OP_FSTAT,
   41     GFS3_OP_LK,
   42     GFS3_OP_LOOKUP,
   43     GFS3_OP_READDIR,
   44     GFS3_OP_INODELK,
   45     GFS3_OP_FINODELK,
   46     GFS3_OP_ENTRYLK,
   47     GFS3_OP_FENTRYLK,
   48     GFS3_OP_XATTROP,
   49     GFS3_OP_FXATTROP,
   50     GFS3_OP_FGETXATTR,
   51     GFS3_OP_FSETXATTR,
   52     GFS3_OP_RCHECKSUM,
   53     GFS3_OP_SETATTR,
   54     GFS3_OP_FSETATTR,
   55     GFS3_OP_READDIRP,
   56     GFS3_OP_RELEASE,
   57     GFS3_OP_RELEASEDIR,
   58     GFS3_OP_FREMOVEXATTR,
   59     GFS3_OP_FALLOCATE,
   60     GFS3_OP_DISCARD,
   61     GFS3_OP_ZEROFILL,
   62     GFS3_OP_IPC,
   63     GFS3_OP_SEEK,
   64     GFS3_OP_COMPOUND,
   65     GFS3_OP_LEASE,
   66     GFS3_OP_GETACTIVELK,
   67     GFS3_OP_SETACTIVELK,
   68     GFS3_OP_ICREATE,
   69     GFS3_OP_NAMELINK,
   70     GFS3_OP_PUT,
   71     GFS3_OP_COPY_FILE_RANGE,
   72     GFS3_OP_MAXVALUE,
   73 };
   74 
   75 enum gf_handshake_procnum {
   76     GF_HNDSK_NULL,
   77     GF_HNDSK_SETVOLUME,
   78     GF_HNDSK_GETSPEC,
   79     GF_HNDSK_PING,
   80     GF_HNDSK_SET_LK_VER,
   81     GF_HNDSK_EVENT_NOTIFY,
   82     GF_HNDSK_GET_VOLUME_INFO,
   83     GF_HNDSK_GET_SNAPSHOT_INFO,
   84     GF_HNDSK_MAXVALUE,
   85 };
   86 
   87 enum gf_pmap_procnum {
   88     GF_PMAP_NULL = 0,
   89     GF_PMAP_PORTBYBRICK,
   90     GF_PMAP_BRICKBYPORT,
   91     /*
   92      * SIGNUP is not used, and shouldn't be used.  It was kept here only
   93      * to avoid changing the numbers for things that come after it in this
   94      * list.
   95      */
   96     GF_PMAP_SIGNUP,
   97     GF_PMAP_SIGNIN,
   98     GF_PMAP_SIGNOUT,
   99     GF_PMAP_MAXVALUE,
  100 };
  101 
  102 enum gf_aggregator_procnum {
  103     GF_AGGREGATOR_NULL = 0,
  104     GF_AGGREGATOR_LOOKUP,
  105     GF_AGGREGATOR_GETLIMIT,
  106     GF_AGGREGATOR_MAXVALUE,
  107 };
  108 
  109 enum gf_pmap_port_type {
  110     GF_PMAP_PORT_FREE = 0,
  111     GF_PMAP_PORT_FOREIGN, /* it actually means, not sure who is using it, but it
  112                              is in-use */
  113     GF_PMAP_PORT_LEASED,
  114     GF_PMAP_PORT_ANY,
  115     GF_PMAP_PORT_BRICKSERVER, /* port used by brick process */
  116 };
  117 typedef enum gf_pmap_port_type gf_pmap_port_type_t;
  118 
  119 enum gf_probe_resp {
  120     GF_PROBE_SUCCESS,
  121     GF_PROBE_LOCALHOST,
  122     GF_PROBE_FRIEND,
  123     GF_PROBE_ANOTHER_CLUSTER,
  124     GF_PROBE_VOLUME_CONFLICT,
  125     GF_PROBE_SAME_UUID,
  126     GF_PROBE_UNKNOWN_PEER,
  127     GF_PROBE_ADD_FAILED,
  128     GF_PROBE_QUORUM_NOT_MET,
  129     GF_PROBE_MISSED_SNAP_CONFLICT,
  130     GF_PROBE_SNAP_CONFLICT,
  131     GF_PROBE_FRIEND_DETACHING,
  132 };
  133 
  134 enum gf_deprobe_resp {
  135     GF_DEPROBE_SUCCESS,
  136     GF_DEPROBE_LOCALHOST,
  137     GF_DEPROBE_NOT_FRIEND,
  138     GF_DEPROBE_BRICK_EXIST,
  139     GF_DEPROBE_FRIEND_DOWN,
  140     GF_DEPROBE_QUORUM_NOT_MET,
  141     GF_DEPROBE_FRIEND_DETACHING,
  142     GF_DEPROBE_SNAP_BRICK_EXIST,
  143 };
  144 
  145 enum gf_cbk_procnum {
  146     GF_CBK_NULL = 0,
  147     GF_CBK_FETCHSPEC,
  148     GF_CBK_INO_FLUSH,
  149     GF_CBK_EVENT_NOTIFY,
  150     GF_CBK_GET_SNAPS,
  151     GF_CBK_CACHE_INVALIDATION,
  152     GF_CBK_CHILD_UP,
  153     GF_CBK_CHILD_DOWN,
  154     GF_CBK_RECALL_LEASE,
  155     GF_CBK_STATEDUMP,
  156     GF_CBK_INODELK_CONTENTION,
  157     GF_CBK_ENTRYLK_CONTENTION,
  158     GF_CBK_MAXVALUE,
  159 };
  160 
  161 enum gluster_cli_procnum {
  162     GLUSTER_CLI_NULL, /* 0 */
  163     GLUSTER_CLI_PROBE,
  164     GLUSTER_CLI_DEPROBE,
  165     GLUSTER_CLI_LIST_FRIENDS,
  166     GLUSTER_CLI_CREATE_VOLUME,
  167     GLUSTER_CLI_GET_VOLUME,
  168     GLUSTER_CLI_GET_NEXT_VOLUME,
  169     GLUSTER_CLI_DELETE_VOLUME,
  170     GLUSTER_CLI_START_VOLUME,
  171     GLUSTER_CLI_STOP_VOLUME,
  172     GLUSTER_CLI_RENAME_VOLUME,
  173     GLUSTER_CLI_DEFRAG_VOLUME,
  174     GLUSTER_CLI_SET_VOLUME,
  175     GLUSTER_CLI_ADD_BRICK,
  176     GLUSTER_CLI_REMOVE_BRICK,
  177     GLUSTER_CLI_REPLACE_BRICK,
  178     GLUSTER_CLI_LOG_ROTATE,
  179     GLUSTER_CLI_GETSPEC,
  180     GLUSTER_CLI_PMAP_PORTBYBRICK,
  181     GLUSTER_CLI_SYNC_VOLUME,
  182     GLUSTER_CLI_RESET_VOLUME,
  183     GLUSTER_CLI_FSM_LOG,
  184     GLUSTER_CLI_GSYNC_SET,
  185     GLUSTER_CLI_PROFILE_VOLUME,
  186     GLUSTER_CLI_QUOTA,
  187     GLUSTER_CLI_TOP_VOLUME,
  188     GLUSTER_CLI_GETWD,
  189     GLUSTER_CLI_STATUS_VOLUME,
  190     GLUSTER_CLI_STATUS_ALL,
  191     GLUSTER_CLI_MOUNT,
  192     GLUSTER_CLI_UMOUNT,
  193     GLUSTER_CLI_HEAL_VOLUME,
  194     GLUSTER_CLI_STATEDUMP_VOLUME,
  195     GLUSTER_CLI_LIST_VOLUME,
  196     GLUSTER_CLI_CLRLOCKS_VOLUME,
  197     GLUSTER_CLI_UUID_RESET,
  198     GLUSTER_CLI_UUID_GET,
  199     GLUSTER_CLI_COPY_FILE,
  200     GLUSTER_CLI_SYS_EXEC,
  201     GLUSTER_CLI_SNAP,
  202     GLUSTER_CLI_BARRIER_VOLUME,
  203     GLUSTER_CLI_GET_VOL_OPT,
  204     GLUSTER_CLI_GANESHA,
  205     GLUSTER_CLI_BITROT,
  206     GLUSTER_CLI_ATTACH_TIER,
  207     GLUSTER_CLI_TIER,
  208     GLUSTER_CLI_GET_STATE,
  209     GLUSTER_CLI_RESET_BRICK,
  210     GLUSTER_CLI_REMOVE_TIER_BRICK,
  211     GLUSTER_CLI_ADD_TIER_BRICK,
  212     GLUSTER_CLI_MAXVALUE,
  213 };
  214 
  215 enum glusterd_mgmt_procnum {
  216     GLUSTERD_MGMT_NULL, /* 0 */
  217     GLUSTERD_MGMT_CLUSTER_LOCK,
  218     GLUSTERD_MGMT_CLUSTER_UNLOCK,
  219     GLUSTERD_MGMT_STAGE_OP,
  220     GLUSTERD_MGMT_COMMIT_OP,
  221     GLUSTERD_MGMT_MAXVALUE,
  222 };
  223 
  224 enum glusterd_friend_procnum {
  225     GLUSTERD_FRIEND_NULL, /* 0 */
  226     GLUSTERD_PROBE_QUERY,
  227     GLUSTERD_FRIEND_ADD,
  228     GLUSTERD_FRIEND_REMOVE,
  229     GLUSTERD_FRIEND_UPDATE,
  230     GLUSTERD_FRIEND_MAXVALUE,
  231 };
  232 
  233 enum glusterd_brick_procnum {
  234     GLUSTERD_BRICK_NULL, /* 0 */
  235     GLUSTERD_BRICK_TERMINATE,
  236     GLUSTERD_BRICK_XLATOR_INFO,
  237     GLUSTERD_BRICK_XLATOR_OP,
  238     GLUSTERD_BRICK_STATUS,
  239     GLUSTERD_BRICK_OP,
  240     GLUSTERD_BRICK_XLATOR_DEFRAG,
  241     GLUSTERD_NODE_PROFILE,
  242     GLUSTERD_NODE_STATUS,
  243     GLUSTERD_VOLUME_BARRIER_OP,
  244     GLUSTERD_BRICK_BARRIER,
  245     GLUSTERD_NODE_BITROT,
  246     GLUSTERD_BRICK_ATTACH,
  247     GLUSTERD_DUMP_METRICS,
  248     GLUSTERD_SVC_ATTACH,
  249     GLUSTERD_SVC_DETACH,
  250     GLUSTERD_BRICK_MAXVALUE,
  251 };
  252 
  253 enum glusterd_mgmt_hndsk_procnum {
  254     GD_MGMT_HNDSK_NULL,
  255     GD_MGMT_HNDSK_VERSIONS,
  256     GD_MGMT_HNDSK_VERSIONS_ACK,
  257     GD_MGMT_HNDSK_MAXVALUE,
  258 };
  259 
  260 typedef enum {
  261     GF_SHD_OP_INVALID,
  262     GF_SHD_OP_HEAL_INDEX,
  263     GF_SHD_OP_HEAL_FULL,
  264     GF_SHD_OP_INDEX_SUMMARY,
  265     GF_SHD_OP_HEALED_FILES,
  266     GF_SHD_OP_HEAL_FAILED_FILES,
  267     GF_SHD_OP_SPLIT_BRAIN_FILES,
  268     GF_SHD_OP_STATISTICS,
  269     GF_SHD_OP_STATISTICS_HEAL_COUNT,
  270     GF_SHD_OP_STATISTICS_HEAL_COUNT_PER_REPLICA,
  271     GF_SHD_OP_SBRAIN_HEAL_FROM_BIGGER_FILE,
  272     GF_SHD_OP_SBRAIN_HEAL_FROM_BRICK,
  273     GF_SHD_OP_HEAL_ENABLE,
  274     GF_SHD_OP_HEAL_DISABLE,
  275     GF_SHD_OP_SBRAIN_HEAL_FROM_LATEST_MTIME,
  276     GF_SHD_OP_GRANULAR_ENTRY_HEAL_ENABLE,
  277     GF_SHD_OP_GRANULAR_ENTRY_HEAL_DISABLE,
  278     GF_SHD_OP_HEAL_SUMMARY,
  279 } gf_xl_afr_op_t;
  280 
  281 struct gf_gsync_detailed_status_ {
  282     char node[NAME_MAX];
  283     char master[NAME_MAX];
  284     char brick[PATH_MAX];
  285     char slave_user[NAME_MAX];
  286     char slave[NAME_MAX];
  287     char slave_node[NAME_MAX];
  288     char worker_status[NAME_MAX];
  289     char crawl_status[NAME_MAX];
  290     char last_synced[NAME_MAX];
  291     char last_synced_utc[NAME_MAX];
  292     char entry[NAME_MAX];
  293     char data[NAME_MAX];
  294     char meta[NAME_MAX];
  295     char failures[NAME_MAX];
  296     char checkpoint_time[NAME_MAX];
  297     char checkpoint_time_utc[NAME_MAX];
  298     char checkpoint_completed[NAME_MAX];
  299     char checkpoint_completion_time[NAME_MAX];
  300     char checkpoint_completion_time_utc[NAME_MAX];
  301     char brick_host_uuid[NAME_MAX];
  302     char slavekey[NAME_MAX];
  303     char session_slave[NAME_MAX];
  304 };
  305 
  306 enum glusterd_mgmt_v3_procnum {
  307     GLUSTERD_MGMT_V3_NULL, /* 0 */
  308     GLUSTERD_MGMT_V3_LOCK,
  309     GLUSTERD_MGMT_V3_PRE_VALIDATE,
  310     GLUSTERD_MGMT_V3_BRICK_OP,
  311     GLUSTERD_MGMT_V3_COMMIT,
  312     GLUSTERD_MGMT_V3_POST_VALIDATE,
  313     GLUSTERD_MGMT_V3_UNLOCK,
  314     GLUSTERD_MGMT_V3_MAXVALUE,
  315 };
  316 
  317 typedef struct gf_gsync_detailed_status_ gf_gsync_status_t;
  318 
  319 enum gf_get_volume_info_type {
  320     GF_GET_VOLUME_NONE, /* 0 */
  321     GF_GET_VOLUME_UUID
  322 };
  323 
  324 typedef enum gf_get_volume_info_type gf_get_volume_info_type;
  325 
  326 enum gf_get_snapshot_info_type {
  327     GF_GET_SNAPSHOT_LIST,
  328 };
  329 typedef enum gf_get_snapshot_info_type gf_get_snapshot_info_type;
  330 
  331 enum gf_getspec_flags_type { GF_GETSPEC_FLAG_SERVERS_LIST = 1 };
  332 typedef enum gf_getspec_flags_type gf_getspec_flags_type;
  333 
  334 #define GLUSTER_HNDSK_PROGRAM 14398633 /* Completely random */
  335 #define GLUSTER_HNDSK_VERSION 2        /* 0.0.2 */
  336 
  337 #define GLUSTER_PMAP_PROGRAM 34123456
  338 #define GLUSTER_PMAP_VERSION 1
  339 
  340 #define GLUSTER_CBK_PROGRAM 52743234 /* Completely random */
  341 #define GLUSTER_CBK_VERSION 1        /* 0.0.1 */
  342 
  343 #define GLUSTER_FOP_PROGRAM 1298437 /* Completely random */
  344 #define GLUSTER_FOP_VERSION 330     /* 3.3.0 */
  345 #define GLUSTER_FOP_PROCCNT GFS3_OP_MAXVALUE
  346 
  347 #define GLUSTER_FOP_VERSION_v2 400 /* 4.0.0 */
  348 
  349 /* Aggregator */
  350 #define GLUSTER_AGGREGATOR_PROGRAM 29852134 /* Completely random */
  351 #define GLUSTER_AGGREGATOR_VERSION 1
  352 
  353 /* Second version */
  354 #define GD_MGMT_PROGRAM 1238433 /* Completely random */
  355 #define GD_MGMT_VERSION 2       /* 0.0.2 */
  356 
  357 #define GD_FRIEND_PROGRAM 1238437 /* Completely random */
  358 #define GD_FRIEND_VERSION 2       /* 0.0.2 */
  359 
  360 #define GLUSTER_CLI_PROGRAM 1238463 /* Completely random */
  361 #define GLUSTER_CLI_VERSION 2       /* 0.0.2 */
  362 
  363 #define GD_BRICK_PROGRAM 4867634 /*Completely random*/
  364 #define GD_BRICK_VERSION 2
  365 
  366 /* Third version */
  367 #define GD_MGMT_V3_VERSION 3
  368 
  369 /* OP-VERSION handshake */
  370 #define GD_MGMT_HNDSK_PROGRAM 1239873 /* Completely random */
  371 #define GD_MGMT_HNDSK_VERSION 1
  372 
  373 #define GD_VOLUME_NAME_MAX                                                     \
  374     ((NAME_MAX + 1) - 5) /* Maximum size of volume name */
  375 #define GD_VOLUME_NAME_MAX_TIER                                                \
  376     (GD_VOLUME_NAME_MAX + 5) /* +5 needed for '-hot'                           \
  377                                 and '-cold' suffixes*/
  378 
  379 #define GLUSTER_PROCESS_UUID_FMT                                               \
  380     "CTX_ID:%s-GRAPH_ID:%d-PID:%d-HOST:%s-PC_NAME:%s-RECON_NO:%s"
  381 #endif /* !_PROTOCOL_COMMON_H */