|
@@ -70,5 +70,60 @@ int synchronize_all_udomains(void);
|
|
|
unsigned long get_number_of_users(void);
|
|
|
|
|
|
|
|
|
+/*!
|
|
|
+ * \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 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 Find a particular domain, small wrapper around find_dlist
|
|
|
+ * \param _d domain name
|
|
|
+ * \param _p pointer to domain if found
|
|
|
+ * \return 1 if domain was found, 0 otherwise
|
|
|
+ */
|
|
|
+int find_domain(str* _d, udomain_t** _p);
|
|
|
+
|
|
|
|
|
|
#endif
|