firmware.h

Go to the documentation of this file.
00001 /*
00002  * Asterisk -- An open source telephony toolkit.
00003  *
00004  * Copyright (C) 2013, Digium, Inc.
00005  *
00006  * Mark Spencer <markster@digium.com>
00007  *
00008  * See http://www.asterisk.org for more information about
00009  * the Asterisk project. Please do not directly contact
00010  * any of the maintainers of this project for assistance;
00011  * the project provides a web site, mailing lists and IRC
00012  * channels for your use.
00013  *
00014  * This program is free software, distributed under the terms of
00015  * the GNU General Public License Version 2. See the LICENSE file
00016  * at the top of the source tree.
00017  */
00018 
00019 /*! \file
00020  *
00021  * \brief IAX Firmware Support header file
00022  */
00023 
00024 #ifndef _IAX2_FIRMWARE_H
00025 #define _IAX2_FIRMWARE_H
00026 
00027 #include "parser.h"
00028 
00029 /*!
00030  * \internal
00031  * \brief Reload the list of available firmware.
00032  *
00033  * Searches the IAX firmware directory, adding new firmware that is available
00034  * and removing firmware that is no longer available.
00035  *
00036  * \return Nothing
00037  */
00038 void iax_firmware_reload(void);
00039 
00040 /*!
00041  * \internal
00042  * \brief Unload all of the currently loaded firmware.
00043  *
00044  * return Nothing
00045  */
00046 void iax_firmware_unload(void);
00047 
00048 /*!
00049  * \internal
00050  * \brief Determine the version number of the specified firmware.
00051  *
00052  * \param      device_name The device name of the firmware for which we want the
00053  *                         version.
00054  * \param[out] version     Pointer to a variable where the version number is
00055  *                         stored upon return.
00056  *
00057  * \retval 1 on success
00058  * \retval 0 on failure
00059  */
00060 int iax_firmware_get_version(const char *device_name,
00061    uint16_t *version);
00062 
00063 /*!
00064  * \internal
00065  * \brief Add firwmare related IEs to an IAX2 IE buffer.
00066  *
00067  * \param ie_data     The IE buffer being appended to.
00068  * \param device_name The name of the requested firmware.
00069  * \param block_desc  The requested firmware block identification.
00070  *
00071  * Search the list of loaded firmware for \c device_name and, if found, add the
00072  * appropriate FWBLOCKDESC and FWBLOCKDATA IEs to the specified \c ie_data
00073  * list.
00074  *
00075  * \retval 0 on success
00076  * \retval non-zero on failure
00077  */
00078 int iax_firmware_append(struct iax_ie_data *ie_data,
00079    const char *device_name, unsigned int block_desc);
00080 
00081 /*!
00082  * \internal
00083  * \brief Iterate over the list of currently loaded IAX firmware.
00084  *
00085  * \param prefix    The prefix of the device to filter for, or \c NULL to visit
00086  *                  all firmware records.
00087  * \param callback  A pointer to a function to call for each firmware record
00088  *                  that is visited.
00089  * \param user_data A pointer to user supplied data that will be passed to the
00090  *                  \c callback function each time it is invoked.
00091  *
00092  * This function visits each of the elements in the IAX firmware list, calling
00093  * the specfied \c callback for each element. Iteration continues until the end
00094  * of the list is reached, or the \c callback returns non-zero.
00095  *
00096  * The \c callback function receives a pointer to the firmware header and the
00097  * value of the \c user_data argument that was passed in, which may be \c NULL.
00098  *
00099  * \return Nothing
00100  */
00101 void iax_firmware_traverse(const char *prefix,
00102    int (*callback)(struct ast_iax2_firmware_header *header, void *user_data),
00103    void *user_data);
00104 
00105 #endif

Generated on Thu Apr 16 06:27:34 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6