2012-05-21 18:07:43 -04:00
|
|
|
#ifndef RSGXSFLAGS_H
|
|
|
|
#define RSGXSFLAGS_H
|
|
|
|
|
|
|
|
#include "inttypes.h"
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/**
|
|
|
|
* The GXS_SERV namespace serves a single point of reference for definining grp and msg flags
|
|
|
|
* Declared and defined here are:
|
|
|
|
* - privacy flags which define the level of privacy that can be given \n
|
|
|
|
* to a group
|
|
|
|
* - authentication types which defined types of authentication needed for a given message to
|
|
|
|
* confirm its authenticity
|
|
|
|
* - subscription flags: This used only locally by the peer to subscription status to a \n
|
|
|
|
* a group
|
|
|
|
* -
|
|
|
|
*/
|
2012-05-21 18:07:43 -04:00
|
|
|
namespace GXS_SERV {
|
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** START privacy **/
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
static const uint32_t FLAG_PRIVACY_MASK = 0x0000000f;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
|
|
|
// pub key encrypted
|
2012-10-01 16:57:56 -04:00
|
|
|
static const uint32_t FLAG_PRIVACY_PRIVATE = 0x00000001;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// publish private key needed to publish
|
|
|
|
static const uint32_t FLAG_PRIVACY_RESTRICTED = 0x00000002;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// anyone can publish, publish key pair not needed
|
|
|
|
static const uint32_t FLAG_PRIVACY_PUBLIC = 0x00000004;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** END privacy **/
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** START authentication **/
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
static const uint32_t FLAG_AUTHEN_MASK = 0x000000f0;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// identity
|
|
|
|
static const uint32_t FLAG_AUTHEN_IDENTITY = 0x000000010;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// publish key
|
|
|
|
static const uint32_t FLAG_AUTHEN_PUBLISH = 0x000000020;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// admin key
|
|
|
|
static const uint32_t FLAG_AUTHEN_ADMIN = 0x00000040;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
// pgp sign identity
|
|
|
|
static const uint32_t FLAG_AUTHEN_PGP_IDENTITY = 0x00000080;
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** END authentication **/
|
2012-05-21 18:07:43 -04:00
|
|
|
|
2012-11-10 18:42:38 -05:00
|
|
|
/** START msg authentication flags **/
|
|
|
|
|
|
|
|
static const uint8_t MSG_AUTHEN_MASK = 0x0f;
|
|
|
|
|
|
|
|
static const uint8_t MSG_AUTHEN_ROOT_PUBLISH_SIGN = 0x01;
|
|
|
|
|
|
|
|
static const uint8_t MSG_AUTHEN_CHILD_PUBLISH_SIGN = 0x02;
|
|
|
|
|
|
|
|
static const uint8_t MSG_AUTHEN_ROOT_AUTHOR_SIGN = 0x04;
|
|
|
|
|
|
|
|
static const uint8_t MSG_AUTHEN_CHILD_AUTHOR_SIGN = 0x08;
|
|
|
|
|
|
|
|
/** END msg authentication flags **/
|
|
|
|
|
|
|
|
/** START group options flag **/
|
|
|
|
|
|
|
|
static const uint8_t GRP_OPTION_AUTHEN_AUTHOR_SIGN = 0x01;
|
|
|
|
|
|
|
|
/** END group options flag **/
|
2012-09-04 18:32:52 -04:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** START Subscription Flags. (LOCAL) **/
|
2012-09-04 18:32:52 -04:00
|
|
|
|
2012-11-10 18:42:38 -05:00
|
|
|
static const uint32_t GROUP_SUBSCRIBE_ADMIN = 0x01;
|
2012-10-01 16:57:56 -04:00
|
|
|
|
2012-11-10 18:42:38 -05:00
|
|
|
static const uint32_t GROUP_SUBSCRIBE_PUBLISH = 0x02;
|
2012-10-01 16:57:56 -04:00
|
|
|
|
2012-11-10 18:42:38 -05:00
|
|
|
static const uint32_t GROUP_SUBSCRIBE_SUBSCRIBED = 0x04;
|
2012-10-01 16:57:56 -04:00
|
|
|
|
2012-11-10 18:42:38 -05:00
|
|
|
static const uint32_t GROUP_SUBSCRIBE_NOT_SUBSCRIBED = 0x08;
|
2012-10-01 16:57:56 -04:00
|
|
|
|
2013-03-16 12:44:33 -04:00
|
|
|
/*!
|
|
|
|
* Simply defines the range of bits that deriving services
|
|
|
|
* should not use
|
|
|
|
*/
|
2012-09-13 18:58:42 -04:00
|
|
|
static const uint32_t GROUP_SUBSCRIBE_MASK = 0x0000000f;
|
2012-09-04 18:32:52 -04:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** END Subscription Flags. (LOCAL) **/
|
|
|
|
|
|
|
|
/** START GXS Msg status flags **/
|
|
|
|
|
2013-03-23 10:07:52 -04:00
|
|
|
static const uint32_t GXS_MSG_STATUS_UNPROCESSED = 0x0000001;
|
2012-10-21 15:45:35 -04:00
|
|
|
|
2013-03-23 10:07:52 -04:00
|
|
|
static const uint32_t GXS_MSG_STATUS_UNREAD = 0x000002;
|
2012-10-21 15:45:35 -04:00
|
|
|
|
2013-03-23 10:07:52 -04:00
|
|
|
static const uint32_t GXS_MSG_STATUS_READ = 0x000004;
|
|
|
|
|
|
|
|
static const uint32_t GXS_MSG_STATUS_KEEP = 0x000008;
|
|
|
|
|
|
|
|
static const uint32_t GXS_MSG_STATUS_DELETE = 0x0000020;
|
2012-12-08 16:50:13 -05:00
|
|
|
|
2012-10-21 15:45:35 -04:00
|
|
|
/** END GXS Msg status flags **/
|
|
|
|
|
2012-11-17 09:35:21 -05:00
|
|
|
/** START GXS Grp status flags **/
|
|
|
|
|
|
|
|
static const uint32_t GXS_GRP_STATUS_UNPROCESSED = 0x000000100;
|
|
|
|
|
|
|
|
static const uint32_t GXS_GRP_STATUS_UNREAD = 0x00000200;
|
|
|
|
|
|
|
|
/** END GXS Grp status flags **/
|
2012-05-21 18:07:43 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-02-26 18:34:42 -05:00
|
|
|
// GENERIC GXS MACROS
|
|
|
|
#define IS_MSG_NEW(status) (status & GXS_SERV::GXS_MSG_STATUS_UNPROCESSED)
|
2013-03-16 08:31:31 -04:00
|
|
|
|
2013-02-26 18:34:42 -05:00
|
|
|
#define IS_MSG_UNREAD(status) (status & GXS_SERV::GXS_MSG_STATUS_UNREAD)
|
|
|
|
#define IS_GROUP_ADMIN(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)
|
2013-03-16 08:31:31 -04:00
|
|
|
#define IS_GROUP_PUBLISHER(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH)
|
2013-03-24 11:56:21 -04:00
|
|
|
#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)
|
2013-03-16 08:31:31 -04:00
|
|
|
#define IS_GROUP_NOT_SUBSCRIBED(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED)
|
|
|
|
|
|
|
|
#define IS_MSG_UNPROCESSED(status) (status & GXS_SERV::GXS_MSG_STATUS_UNPROCESSED)
|
2013-02-26 18:34:42 -05:00
|
|
|
|
|
|
|
|
2012-05-21 18:07:43 -04:00
|
|
|
#endif // RSGXSFLAGS_H
|