summaryrefslogtreecommitdiff
path: root/include/asterisk/channel.h
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-03-08 13:24:46 +0000
committerJoshua Colp <jcolp@digium.com>2017-03-27 19:54:44 +0000
commit5d938045d465d66e28bb49816c482a8b68f99342 (patch)
tree50b25c29fc199a66c246c95871b492e242a68c7a /include/asterisk/channel.h
parentf5603cb1ece5001d1288004c9bc6ed51448deb81 (diff)
channel: Remove old epoll support and fixed max number of file descriptors.
This change removes the old epoll support which has not been used or maintained in quite some time. The fixed number of file descriptors on a channel has also been removed. File descriptors are now contained in a growable vector. This can be used like before by specifying a specific position to store a file descriptor at or using a new API call, ast_channel_fd_add, which adds a file descriptor to the channel and returns its position. Tests have been added which cover the growing behavior of the vector and the new API call. ASTERISK-26885 Change-Id: I1a754b506c009b83dfdeeb08c2d2815db30ef928
Diffstat (limited to 'include/asterisk/channel.h')
-rw-r--r--include/asterisk/channel.h38
1 files changed, 26 insertions, 12 deletions
diff --git a/include/asterisk/channel.h b/include/asterisk/channel.h
index 9a3a967e2..391e58ccf 100644
--- a/include/asterisk/channel.h
+++ b/include/asterisk/channel.h
@@ -183,7 +183,8 @@ extern "C" {
#define DATASTORE_INHERIT_FOREVER INT_MAX
-#define AST_MAX_FDS 11
+#define AST_MAX_FDS 11 /*!< original maximum number of file descriptors */
+#define AST_EXTENDED_FDS 12 /*!< the start of extended file descriptor positions */
/*
* We have AST_MAX_FDS file descriptors in a channel.
* Some of them have a fixed use:
@@ -2402,12 +2403,6 @@ void ast_channel_set_caller_event(struct ast_channel *chan, const struct ast_par
/*! Set the file descriptor on the channel */
void ast_channel_set_fd(struct ast_channel *chan, int which, int fd);
-/*! Add a channel to an optimized waitfor */
-void ast_poll_channel_add(struct ast_channel *chan0, struct ast_channel *chan1);
-
-/*! Delete a channel from an optimized waitfor */
-void ast_poll_channel_del(struct ast_channel *chan0, struct ast_channel *chan1);
-
/*! Start a tone going */
int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol);
/*! Stop a tone from playing */
@@ -4300,11 +4295,30 @@ void ast_channel_internal_fd_set(struct ast_channel *chan, int which, int value)
int ast_channel_fd(const struct ast_channel *chan, int which);
int ast_channel_fd_isset(const struct ast_channel *chan, int which);
-/* epoll data internal accessors */
-#ifdef HAVE_EPOLL
-struct ast_epoll_data *ast_channel_internal_epfd_data(const struct ast_channel *chan, int which);
-void ast_channel_internal_epfd_data_set(struct ast_channel *chan, int which , struct ast_epoll_data *value);
-#endif
+/*!
+ * \since 15
+ * \brief Retrieve the number of file decriptor positions present on the channel
+ *
+ * \param chan The channel to get the count of
+ *
+ * \pre chan is locked
+ *
+ * \return The number of file descriptor positions
+ */
+int ast_channel_fd_count(const struct ast_channel *chan);
+
+/*!
+ * \since 15
+ * \brief Add a file descriptor to the channel without a fixed position
+ *
+ * \param chan The channel to add the file descriptor to
+ * \param value The file descriptor
+ *
+ * \pre chan is locked
+ *
+ * \return The position of the file descriptor
+ */
+int ast_channel_fd_add(struct ast_channel *chan, int value);
pthread_t ast_channel_blocker(const struct ast_channel *chan);
void ast_channel_blocker_set(struct ast_channel *chan, pthread_t value);