/*
  Copyright (c) 2013 Red Hat, Inc. <http://www.redhat.com>
  This file is part of GlusterFS.

  This file is licensed to you under your choice of the GNU Lesser
  General Public License, version 3 or any later version (LGPLv3 or
  later), or the GNU General Public License, version 2 (GPLv2), in all
  cases as published by the Free Software Foundation.
*/

#ifndef _GLUSTERFSD_MESSAGES_H_
#define _GLUSTERFSD_MESSAGES_H_

#ifndef _CONFIG_H
#define _CONFIG_H
#include "config.h"
#endif

#include "glfs-message-id.h"



/* NOTE: Rules for message additions
 * 1) Each instance of a message is _better_ left with a unique message ID, even
 *    if the message format is the same. Reasoning is that, if the message
 *    format needs to change in one instance, the other instances are not
 *    impacted or the new change does not change the ID of the instance being
 *    modified.
 * 2) Addition of a message,
 *       - Should increment the GLFS_NUM_MESSAGES
 *       - Append to the list of messages defined, towards the end
 *       - Retain macro naming as glfs_msg_X (for redability across developers)
 * NOTE: Rules for message format modifications
 * 3) Check acorss the code if the message ID macro in question is reused
 *    anywhere. If reused then then the modifications should ensure correctness
 *    everywhere, or needs a new message ID as (1) above was not adhered to. If
 *    not used anywhere, proceed with the required modification.
 * NOTE: Rules for message deletion
 * 4) Check (3) and if used anywhere else, then cannot be deleted. If not used
 *    anywhere, then can be deleted, but will leave a hole by design, as
 *    addition rules specify modification to the end of the list and not filling
 *    holes.
 */

#define GLFS_COMP_BASE          GLFS_MSGID_COMP_DHT
#define GLFS_NUM_MESSAGES       124
#define GLFS_MSGID_END          (GLFS_COMP_BASE + GLFS_NUM_MESSAGES + 1)

/* Messages with message IDs */



#define DHT_ALLOC_FAILED                (GLFS_COMP_BASE + 1)
#define DHT_ATTR_SET_FAILED             (GLFS_COMP_BASE + 2)
#define DHT_CHECK_SCHED                 (GLFS_COMP_BASE + 3)
#define DHT_CHILD_LOC_BUILD_FAILED      (GLFS_COMP_BASE + 4)
#define DHT_CHOWN_FAILED                (GLFS_COMP_BASE + 5)
#define DHT_COMPILE_REGEX_FAILED        (GLFS_COMP_BASE + 6)
#define DHT_CREATE                      (GLFS_COMP_BASE + 7)
#define DHT_CREATE_SYMLNK_FAILED        (GLFS_COMP_BASE + 8)
#define DHT_DANGLING_VOLUME             (GLFS_COMP_BASE + 9)
#define DHT_DATA_TO_BIN_FAILED          (GLFS_COMP_BASE + 10)
#define DHT_DEL_LNKFILE_FAILED          (GLFS_COMP_BASE + 11)
#define DHT_DICT_ADD_FAILED             (GLFS_COMP_BASE + 12)
#define DHT_DICT_GET_FAILED             (GLFS_COMP_BASE + 13)
#define DHT_DICT_GET_NODE_UUID_FAILED   (GLFS_COMP_BASE + 14)
#define DHT_DICT_NEW_FAILED             (GLFS_COMP_BASE + 15)
#define DHT_DICT_NULL                   (GLFS_COMP_BASE + 16)
#define DHT_DICT_SET_FAILED             (GLFS_COMP_BASE + 17)
#define DHT_DICT_SET_STR_FAILED         (GLFS_COMP_BASE + 18)
#define DHT_DICT_SET_VAL_FAILED         (GLFS_COMP_BASE + 19)
#define DHT_DISK_INFO_FAILED            (GLFS_COMP_BASE + 20)
#define DHT_DISK_LAYOUT_EXTRACT_FAILED  (GLFS_COMP_BASE + 21)
#define DHT_DISTRIBUTE_SINGLE_SUBVOL    (GLFS_COMP_BASE + 22)
#define DHT_FD_CREATE_FAILED            (GLFS_COMP_BASE + 23)
#define DHT_FD_OPEN_FAILED              (GLFS_COMP_BASE + 24)
#define DHT_FD_SEND_OPEN_FAILED         (GLFS_COMP_BASE + 25)
#define DHT_FILE_CREATE_FAILED          (GLFS_COMP_BASE + 26)
#define DHT_FILE_EXISTS                 (GLFS_COMP_BASE + 27)
#define DHT_FILE_GFID_MISMATCH          (GLFS_COMP_BASE + 28)
#define DHT_FILE_HAS_HARDLINKS          (GLFS_COMP_BASE + 29)
#define DHT_FILE_OPEN_FAILED            (GLFS_COMP_BASE + 30)
#define DHT_FILETYPE_MISMATCH           (GLFS_COMP_BASE + 31)
#define DHT_FSTAT_FAILED                (GLFS_COMP_BASE + 32)
#define DHT_FSYNC_FAILED                (GLFS_COMP_BASE + 33)
#define DHT_FTRUNCATE_FAILED            (GLFS_COMP_BASE + 34)
#define DHT_GET_STATFS_FAILED           (GLFS_COMP_BASE + 35)
#define DHT_GFID_DIFF                   (GLFS_COMP_BASE + 36)
#define DHT_GFID_MISSING                (GLFS_COMP_BASE + 37)
#define DHT_GFID_NULL                   (GLFS_COMP_BASE + 38)
#define DHT_GFID_SET_FAILED             (GLFS_COMP_BASE + 39)
#define DHT_HASH_COMPUTE_FAILED         (GLFS_COMP_BASE + 40)
#define DHT_HASHED_SUBVOL_NOT_FOUND     (GLFS_COMP_BASE + 41)
#define DHT_INODE_CTX_SET_FAILED        (GLFS_COMP_BASE + 42)
#define DHT_INODE_LINK_LAYOUT_FAILED    (GLFS_COMP_BASE + 43)
#define DHT_INT_FOP_SET_FAILED          (GLFS_COMP_BASE + 44)
#define DHT_INVALID_DIR_SPREAD_COUNT    (GLFS_COMP_BASE + 45)
#define DHT_INVALID_NUMBER_FORMAT       (GLFS_COMP_BASE + 46)
#define DHT_LAYOUT_ANOMALIES_FAILED     (GLFS_COMP_BASE + 47)
#define DHT_LAYOUT_ANOMALIES_INFO       (GLFS_COMP_BASE + 48)
#define DHT_LAYOUT_CREATE_FAILED        (GLFS_COMP_BASE + 49)
#define DHT_LAYOUT_FIX_FAILED           (GLFS_COMP_BASE + 50)
#define DHT_LAYOUT_FIXING               (GLFS_COMP_BASE + 51)
#define DHT_LAYOUT_INVALID_COUNT        (GLFS_COMP_BASE + 52)
#define DHT_LAYOUT_MERGE_FAILED         (GLFS_COMP_BASE + 53)
#define DHT_LAYOUT_MISMATCH             (GLFS_COMP_BASE + 54)
#define DHT_LAYOUT_NO_PRESET            (GLFS_COMP_BASE + 55)
#define DHT_LAYOUT_NOT_FOUND            (GLFS_COMP_BASE + 56)
#define DHT_LAYOUT_NULL                 (GLFS_COMP_BASE + 57)
#define DHT_LAYOUT_PRESET_FAILED        (GLFS_COMP_BASE + 58)
#define DHT_LAYOUT_SET_FAILED           (GLFS_COMP_BASE + 59)
#define DHT_LAYOUT_SORT_FAILED          (GLFS_COMP_BASE + 60)
#define DHT_LISTENER_SOCKET_UNLINK_FAILED       (GLFS_COMP_BASE + 61)
#define DHT_LNK_FOUND_REVALIDATE                (GLFS_COMP_BASE + 62)
#define DHT_LNK_NO                      (GLFS_COMP_BASE + 63)
#define DHT_LOOKUP_FAILED               (GLFS_COMP_BASE + 64)
#define DHT_MEM_ACCOUNT_INIT_FAILED     (GLFS_COMP_BASE + 65)
#define DHT_MEM_ALLOC_FAILED            (GLFS_COMP_BASE + 66)
#define DHT_MERGE_NO_LAYOUT             (GLFS_COMP_BASE + 67)
#define DHT_MIGRATE_DATA_CALLED         (GLFS_COMP_BASE + 68)
#define DHT_MIGRATE_DATA_FAILED         (GLFS_COMP_BASE + 69)
#define DHT_MIGRATE_FAILED              (GLFS_COMP_BASE + 70)
#define DHT_MIGRATE_FILE_ON_DIR         (GLFS_COMP_BASE + 71)
#define DHT_MIGRATE_FILES_STATS         (GLFS_COMP_BASE + 72)
#define DHT_MIGRATE_TARGET_INSUFF_SPACE (GLFS_COMP_BASE + 73)
#define DHT_MIGRATE_TARGET_LESS_SPACE   (GLFS_COMP_BASE + 74)
#define DHT_MIGRATION_COMPLETE          (GLFS_COMP_BASE + 75)
#define DHT_MIGRATION_DIR_INFO          (GLFS_COMP_BASE + 76)
#define DHT_MIGRATION_FILE_INFO         (GLFS_COMP_BASE + 77)
#define DHT_MIGRATION_HARDLNK           (GLFS_COMP_BASE + 78)
#define DHT_MKNOD_FAILED                (GLFS_COMP_BASE + 79)
#define DHT_MOVE_ATTEMPT                (GLFS_COMP_BASE + 80)
#define DHT_NO_HOSTNAME                 (GLFS_COMP_BASE + 81)
#define DHT_NO_LOCAL_BRICK              (GLFS_COMP_BASE + 82)
#define DHT_NO_SUBVOL_FOR_HASH          (GLFS_COMP_BASE + 83)
#define DHT_NO_SUBVOL_IN_LAYOUT         (GLFS_COMP_BASE + 84)
#define DHT_NOT_LNKFILE                 (GLFS_COMP_BASE + 85)
#define DHT_NOT_SUBVOL                  (GLFS_COMP_BASE + 86)
#define DHT_NUFA_NO_LOCAL_SUBVOL        (GLFS_COMP_BASE + 87)
#define DHT_OPENDIR_FAILED              (GLFS_COMP_BASE + 88)
#define DHT_PARGFID_NULL                (GLFS_COMP_BASE + 89)
#define DHT_PARSE_FAILED                (GLFS_COMP_BASE + 90)
#define DHT_PARSE_UUID_FAILED           (GLFS_COMP_BASE + 91)
#define DHT_POOL_CREATE_FAILED          (GLFS_COMP_BASE + 92)
#define DHT_READDIR_FAILED              (GLFS_COMP_BASE + 93)
#define DHT_READLINK_FAILED             (GLFS_COMP_BASE + 94)
#define DHT_REBALANCE_STATUS            (GLFS_COMP_BASE + 95)
#define DHT_REBALANCE_STOP_RECV         (GLFS_COMP_BASE + 96)
#define DHT_RENAME_FAILED               (GLFS_COMP_BASE + 97)
#define DHT_SELFHEAL_DIR_FAILED         (GLFS_COMP_BASE + 98)
#define DHT_STALE_LINKFILE              (GLFS_COMP_BASE + 99)
#define DHT_STAT_FAILED                 (GLFS_COMP_BASE + 100)
#define DHT_SUBVOL_DECOMMISSION         (GLFS_COMP_BASE + 101)
#define DHT_SUBVOL_DOWN                 (GLFS_COMP_BASE + 102)
#define DHT_SUBVOL_FILE_CONFLICT        (GLFS_COMP_BASE + 103)
#define DHT_SUBVOL_FILE_DIR_CONFLICT    (GLFS_COMP_BASE + 104)
#define DHT_SUBVOL_GET_CACHED_FAILED    (GLFS_COMP_BASE + 105)
#define DHT_SUBVOL_GET_HASHED_FAILED    (GLFS_COMP_BASE + 106)
#define DHT_SUBVOL_GET_LINK_FAILED      (GLFS_COMP_BASE + 107)
#define DHT_SUBVOL_LOCAL_FOUND          (GLFS_COMP_BASE + 108)
#define DHT_SUBVOL_NO_CACHED            (GLFS_COMP_BASE + 109)
#define DHT_SUBVOL_OUT_OF_INODES        (GLFS_COMP_BASE + 110)
#define DHT_SUBVOL_OUT_OF_SPACE         (GLFS_COMP_BASE + 111)
#define DHT_SUBVOL_SET_LAYOUT_FAILED    (GLFS_COMP_BASE + 112)
#define DHT_SUBVOL_UNRECOVERABLE_ERROR  (GLFS_COMP_BASE + 113)
#define DHT_SYNCTASK_CREATE_FAILED      (GLFS_COMP_BASE + 114)
#define DHT_TASK_CREATE_FAILED          (GLFS_COMP_BASE + 115)
#define DHT_TRUNCATE_FAILED             (GLFS_COMP_BASE + 116)
#define DHT_UNKNOWN_LAYOUT_TYPE         (GLFS_COMP_BASE + 117)
#define DHT_UNLINK_FAILED               (GLFS_COMP_BASE + 118)
#define DHT_UNLINKING                   (GLFS_COMP_BASE + 119)
#define DHT_WRITE_FAILED                (GLFS_COMP_BASE + 120)
#define DHT_XATTR_GET_FAILED            (GLFS_COMP_BASE + 121)
#define DHT_XATTR_GET_NODE_UUID_FAILED  (GLFS_COMP_BASE + 122)
#define DHT_XATTR_REM_FAILED            (GLFS_COMP_BASE + 123)
#define DHT_XATTR_SET_FAILED            (GLFS_COMP_BASE + 124)


#define glfs_msg_end_x GLFS_MSGID_END, "Invalid: End of messages"


#endif /* !_GLUSTERFSD_MESSAGES_H_ */