1 /* 2 * Copyright (c) 2011-2014 - Mauro Carvalho Chehab 3 * Copyright (c) 2012 - Andre Roth <neolynx@gmail.com> 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU Lesser General Public License as published by 7 * the Free Software Foundation version 2.1 of the License. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 * Or, point your browser to http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 * 19 */ 20 21 /** 22 * @file desc_network_name.h 23 * @ingroup descriptors 24 * @brief Provides the descriptors for the network name descriptor 25 * @copyright GNU Lesser General Public License version 2.1 (LGPLv2.1) 26 * @author Mauro Carvalho Chehab 27 * @author Andre Roth 28 * 29 * @par Relevant specs 30 * The descriptor described herein is defined at: 31 * - ETSI EN 300 468 V1.11.1 (2010-04) 32 * 33 * @par Bug Report 34 * Please submit bug reports and patches to linux-media@vger.kernel.org 35 */ 36 37 #ifndef _DESC_NETWORK_NAME_H 38 #define _DESC_NETWORK_NAME_H 39 40 #include <libdvbv5/descriptors.h> 41 42 /** 43 * @struct dvb_desc_network_name 44 * @ingroup descriptors 45 * @brief Struct containing the network name descriptor 46 * 47 * @param type descriptor tag 48 * @param length descriptor length 49 * @param next pointer to struct dvb_desc 50 * @param network_name network name string 51 * @param network_name_emph network name emphasis string 52 * 53 * @details 54 * The emphasis text is the one that uses asterisks. For example, in the text: 55 * "the quick *fox* jumps over the lazy table" the emphasis would be "fox". 56 */ 57 struct dvb_desc_network_name { 58 uint8_t type; 59 uint8_t length; 60 struct dvb_desc *next; 61 62 char *network_name; 63 char *network_name_emph; 64 } __attribute__((packed)); 65 66 struct dvb_v5_fe_parms; 67 68 #ifdef __cplusplus 69 extern "C" { 70 #endif 71 72 /** 73 * @brief Initializes and parses the network name descriptor 74 * @ingroup descriptors 75 * 76 * @param parms struct dvb_v5_fe_parms pointer to the opened device 77 * @param buf buffer containing the descriptor's raw data 78 * @param desc pointer to struct dvb_desc to be allocated and filled 79 * 80 * This function allocates a the descriptor and fills the fields inside 81 * the struct. It also makes sure that all fields will follow the CPU 82 * endianness. Due to that, the content of the buffer may change. 83 * 84 * @return On success, it returns the size of the allocated struct. 85 * A negative value indicates an error. 86 */ 87 int dvb_desc_network_name_init(struct dvb_v5_fe_parms *parms, 88 const uint8_t *buf, struct dvb_desc *desc); 89 90 /** 91 * @brief Prints the content of the network name descriptor 92 * @ingroup descriptors 93 * 94 * @param parms struct dvb_v5_fe_parms pointer to the opened device 95 * @param desc pointer to struct dvb_desc 96 */ 97 void dvb_desc_network_name_print(struct dvb_v5_fe_parms *parms, 98 const struct dvb_desc *desc); 99 100 /** 101 * @brief Frees all data allocated by the network name descriptor 102 * @ingroup descriptors 103 * 104 * @param desc pointer to struct dvb_desc to be freed 105 */ 106 void dvb_desc_network_name_free(struct dvb_desc *desc); 107 108 #ifdef __cplusplus 109 } 110 #endif 111 112 #endif 113