/*************************************************************************** * Copyright (c) 2008, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #ifndef CA_PARSER_H__ #define CA_PARSER_H__ #include "bstd.h" #include "berr_ids.h" #ifdef HOST_BUILD #define BDBG_MSG(x) #define BDBG_WRN(x) printf x //#define BDBG_ERR(x) printf x #endif #ifdef __cplusplus extern "C" { #endif #ifndef TS_PSI_DT_CA #define TS_PSI_DT_CA 0x09 #endif #define CA_LENGTH_OFFSET 1 /* offset relative to CA descriptor header */ #define CA_MAX_PRIV_DATA 32 /* maximum private data */ typedef struct ca_descriptor { uint16_t CA_system_ID; /* 16 bit system ID */ uint16_t CA_PID; /* 13 bit CA PID */ uint8_t priv_length; /* length of private data */ uint8_t priv_data[CA_MAX_PRIV_DATA]; /* private data */ uint32_t sig; /* signature */ } ca_descriptor; uint8_t *cat_parser(const uint8_t *ca_buf, size_t *psize); int ca_parser(const uint8_t *ca_buf, size_t size, ca_descriptor *ca_desc); void ca_dump_descriptor(ca_descriptor *ca_desc); #ifdef __cplusplus } #endif #endif /* CA_PARSER_H__ */