diff --git a/include/common/tgrant.h b/include/common/tgrant.h index 80b0ee2147acc761d2e614fced297c8433a0d073..9aeaef5489c38fb776090fdb4cfbafb71e799038 100644 --- a/include/common/tgrant.h +++ b/include/common/tgrant.h @@ -48,6 +48,16 @@ typedef enum { TSDB_GRANT_TABLE, } EGrantType; +#define GRANT_ACTIVE_ON ((int8_t)0x01) +#define GRANT_CONN_ACTIVE_ON ((int8_t)0x02) + +#define SET_GRANT_ACTIVE_ON(f) ((f) |= GRANT_ACTIVE_ON) +#define SET_GRANT_CONN_ACTIVE_ON(f) ((f) |= GRANT_CONN_ACTIVE_ON) + +#define IS_GRANT_ACTIVE_CODES_ON(f) ((f) != 0x0) +#define IS_GRANT_ACTIVE_ON(f) (((f)&0x01) == GRANT_ACTIVE_ON) +#define IS_GRANT_CONN_ACTIVE_ON(f) (((f)&0x02) == GRANT_CONN_ACTIVE_ON) + int32_t grantCheck(EGrantType grant); #ifndef GRANTS_CFG diff --git a/include/util/tdef.h b/include/util/tdef.h index a1289f5c27b1a0aa492713166acb524d490e3360..1e00dfa76d14dbb6fe6c6c2bf6cf1dedff69ddd9 100644 --- a/include/util/tdef.h +++ b/include/util/tdef.h @@ -268,7 +268,7 @@ typedef enum ELogicConditionType { #define TSDB_DNODE_VALUE_LEN 256 #define TSDB_ACTIVE_KEY_LEN 109 -#define TSDB_CONN_ACTIVE_KEY_LEN 257 +#define TSDB_CONN_ACTIVE_KEY_LEN 109 #define TSDB_DEFAULT_PKT_SIZE 65480 // same as RPC_MAX_UDP_SIZE