idset.c File Reference

Parsing of GLOBSET structures. More...

#include "libmapi/libmapi.h"
#include "libmapi/libmapi_private.h"

Functions

_PUBLIC_ uint64_t exchange_globcnt (uint64_t globcnt)
 
_PUBLIC_ struct globset_range * GLOBSET_parse (TALLOC_CTX *mem_ctx, DATA_BLOB buffer, uint32_t *countP, uint32_t *byte_countP)
 
_PUBLIC_ enum MAPISTATUS IDSET_check_ranges (const struct idset *idset)
 
_PUBLIC_ void IDSET_dump (const struct idset *idset, const char *label)
 
_PUBLIC_ bool IDSET_includes_eid (const struct idset *idset, uint64_t eid)
 
_PUBLIC_ bool IDSET_includes_guid_glob (const struct idset *idset, struct GUID *replica_guid, uint64_t id)
 
_PUBLIC_ struct idset * IDSET_merge_idsets (TALLOC_CTX *mem_ctx, const struct idset *left, const struct idset *right)
 
_PUBLIC_ struct idset * IDSET_parse (TALLOC_CTX *mem_ctx, DATA_BLOB buffer, bool idbased)
 
_PUBLIC_ struct Binary_r * IDSET_serialize (TALLOC_CTX *mem_ctx, const struct idset *idset)
 
_PUBLIC_ void ndr_push_idset (struct ndr_push *ndr, struct idset *idset)
 

Detailed Description

Parsing of GLOBSET structures.

Function Documentation

◆ exchange_globcnt()

_PUBLIC_ uint64_t exchange_globcnt ( uint64_t  globcnt)

Inverts the bytes of a globcnt, such as for the ids returned by Exchange

Referenced by IDSET_check_ranges(), IDSET_dump(), IDSET_includes_eid(), and IDSET_includes_guid_glob().

◆ GLOBSET_parse()

_PUBLIC_ struct globset_range* GLOBSET_parse ( TALLOC_CTX *  mem_ctx,
DATA_BLOB  buffer,
uint32_t *  countP,
uint32_t *  byte_countP 
)

deserialize a GLOBSET following the format described in [OXCFXICS - 2.2.2.5]

Referenced by IDSET_parse().

◆ IDSET_check_ranges()

_PUBLIC_ enum MAPISTATUS IDSET_check_ranges ( const struct idset *  idset)

check GLOBCNT ranges from an idset structure. [MS-OXCFXICS] Section 3.1.5.4.3.2.4

Parameters
idsetpointer to the idset structure to check
Returns
MAPI_E_SUCCESS on success, ecRpcFormat if any range is incorrect (low > high) ,or any range is NULL, or the idset is NULL.

References exchange_globcnt().

Referenced by IDSET_merge_idsets().

◆ IDSET_dump()

_PUBLIC_ void IDSET_dump ( const struct idset *  idset,
const char *  label 
)

dump an idset structure

Parameters
idsetpointer to the idset structure to dump
labelstring to define the dump in log

References exchange_globcnt().

◆ IDSET_includes_eid()

_PUBLIC_ bool IDSET_includes_eid ( const struct idset *  idset,
uint64_t  eid 
)

tests the presence of a specific id in the ranges of a ReplID-based idset structure

References exchange_globcnt().

◆ IDSET_includes_guid_glob()

_PUBLIC_ bool IDSET_includes_guid_glob ( const struct idset *  idset,
struct GUID *  replica_guid,
uint64_t  id 
)

tests the presence of a specific id in the ranges of a ReplGUID-based idset structure

References exchange_globcnt().

◆ IDSET_merge_idsets()

_PUBLIC_ struct idset* IDSET_merge_idsets ( TALLOC_CTX *  mem_ctx,
const struct idset *  left,
const struct idset *  right 
)

merge two idsets structures into a third one. That is, putting the GLOBSET ranges from the same REPLID/REPLGUID in the same subset to, afterwards, reorder and compact ranges.

Parameters
mem_ctxpointer to the memory context where merged idset is allocated
leftthe left idset to merge
rightthe right idset to merge
Returns
pointer to the new merged idset
Note
It only takes into account those idsets whose all GLOBSET ranges are correct, ie, the high value is greater than the low value.

References IDSET_check_ranges().

◆ IDSET_parse()

_PUBLIC_ struct idset* IDSET_parse ( TALLOC_CTX *  mem_ctx,
DATA_BLOB  buffer,
bool  idbased 
)

deserialize an IDSET following the format described in [OXCFXICS - 2.2.2.4]

Returns
the parsed IDSET or NULL if the parsing does not succeeded

References GLOBSET_parse().

◆ IDSET_serialize()

_PUBLIC_ struct Binary_r* IDSET_serialize ( TALLOC_CTX *  mem_ctx,
const struct idset *  idset 
)

serialize an idset structure in a struct SBinary_r

Referenced by ndr_push_idset().

◆ ndr_push_idset()

_PUBLIC_ void ndr_push_idset ( struct ndr_push *  ndr,
struct idset *  idset 
)

push an idset on an ndr stream

References IDSET_serialize().


Creative Commons License
Creative Commons Attribution icon Creative Commons Share Alike icon
This content is licensed under the Creative Commons
Attribution ShareAlike License v. 3.0:
http://creativecommons.org/licenses/by-sa/3.0/