|
@@ -53,6 +53,19 @@ typedef struct dlist {
|
|
|
extern dlist_t* root;
|
|
|
|
|
|
|
|
|
+/*!
|
|
|
+ * \brief Registers a new domain with usrloc
|
|
|
+ *
|
|
|
+ * Registers a new domain with usrloc. If the domain exists,
|
|
|
+ * a pointer to existing structure will be returned, otherwise
|
|
|
+ * a new domain will be created
|
|
|
+ * \param _n domain name
|
|
|
+ * \param _d new created domain
|
|
|
+ * \return 0 on success, -1 on failure
|
|
|
+ */
|
|
|
+int register_udomain(const char* _n, udomain_t** _d);
|
|
|
+
|
|
|
+
|
|
|
/*!
|
|
|
* \brief Free all allocated memory for domains
|
|
|
*/
|
|
@@ -73,6 +86,42 @@ void print_all_udomains(FILE* _f);
|
|
|
int synchronize_all_udomains(void);
|
|
|
|
|
|
|
|
|
+/*!
|
|
|
+ * \brief Get all contacts from the usrloc, in partitions if wanted
|
|
|
+ *
|
|
|
+ * Return list of all contacts for all currently registered
|
|
|
+ * users in all domains. The caller must provide buffer of
|
|
|
+ * sufficient length for fitting all those contacts. In the
|
|
|
+ * case when buffer was exhausted, the function returns
|
|
|
+ * estimated amount of additional space needed, in this
|
|
|
+ * case the caller is expected to repeat the call using
|
|
|
+ * this value as the hint.
|
|
|
+ *
|
|
|
+ * Information is packed into the buffer as follows:
|
|
|
+ *
|
|
|
+ * +------------+----------+-----+------+-----+
|
|
|
+ * |contact1.len|contact1.s|sock1|flags1|path1|
|
|
|
+ * +------------+----------+-----+------+-----+
|
|
|
+ * |contact2.len|contact2.s|sock2|flags2|path1|
|
|
|
+ * +------------+----------+-----+------+-----+
|
|
|
+ * |..........................................|
|
|
|
+ * +------------+----------+-----+------+-----+
|
|
|
+ * |contactN.len|contactN.s|sockN|flagsN|pathN|
|
|
|
+ * +------------+----------+-----+------+-----+
|
|
|
+ * |000000000000|
|
|
|
+ * +------------+
|
|
|
+ *
|
|
|
+ * \param buf target buffer
|
|
|
+ * \param len length of buffer
|
|
|
+ * \param flags contact flags
|
|
|
+ * \param part_idx part index
|
|
|
+ * \param part_max maximal part
|
|
|
+ * \return 0 on success, positive if buffer size was not sufficient, negative on failure
|
|
|
+ */
|
|
|
+int get_all_ucontacts(void *, int, unsigned int,
|
|
|
+ unsigned int part_idx, unsigned int part_max);
|
|
|
+
|
|
|
+
|
|
|
/*!
|
|
|
* \brief Loops through all domains summing up the number of users
|
|
|
* \return the number of users, could be zero
|