summaryrefslogtreecommitdiff
path: root/include/asterisk/strings.h
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2014-08-07 19:26:32 +0000
committerMark Michelson <mmichelson@digium.com>2014-08-07 19:26:32 +0000
commit99d0bccd350cd42941c195667a5733ca6a4368a4 (patch)
treedf35d3d85a37e598bbfd8c7604ab65248cca19df /include/asterisk/strings.h
parentea7d4ab09e05a2ebffc8ec81acb3c242d78a3732 (diff)
Add support for RFC 4662 resource list subscriptions.
This commit adds the ability for a user to configure a resource list in pjsip.conf. Subscribing to this list simultaneously subscribes the subscriber to all resources listed. This has the potential to reduce the amount of SIP traffic when loads of subscribers on a system attempt to subscribe to each others' states. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@420384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/strings.h')
-rw-r--r--include/asterisk/strings.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/asterisk/strings.h b/include/asterisk/strings.h
index 5dbebba95..0b98a2bb0 100644
--- a/include/asterisk/strings.h
+++ b/include/asterisk/strings.h
@@ -1196,4 +1196,20 @@ int ast_str_container_add(struct ao2_container *str_container, const char *add);
*/
void ast_str_container_remove(struct ao2_container *str_container, const char *remove);
+/*!
+ * \brief Create a pseudo-random string of a fixed length.
+ *
+ * This function is useful for generating a string whose randomness
+ * does not need to be across all time and space, does not need to
+ * be cryptographically secure, and needs to fit in a limited space.
+ *
+ * This function will write a null byte at the final position
+ * in the buffer (buf[size - 1]). So if you pass in a size of
+ * 10, then this will generate a random 9-character string.
+ *
+ * \param buf Buffer to write random string into.
+ * \param size The size of the buffer.
+ * \return A pointer to buf
+ */
+char *ast_generate_random_string(char *buf, size_t size);
#endif /* _ASTERISK_STRINGS_H */