RDK Documentation (Open Sourced RDK Components)
|
Data Structures | |
struct | DTCPIP_Packet_s |
DTCP-IP packet stucture. More... | |
struct | DTCPIP_Session_s |
DTCP-IP session structure. More... | |
Macros | |
#define | DEBUG_INI_OVERRIDE_PATH "/nvram/debug.ini" |
#define | RDK_LOGGER_INIT() |
#define | RDK_LOG rdk_dbg_MsgRaw |
#define | RDK_LOG1 rdk_dbg_MsgRaw1 |
Enumerations | |
enum | rdk_LogLevel |
These values represent the logging 'levels' or 'types', they are each independent. More... | |
Functions | |
void | RDK_LOG_ControlCB (const char *moduleName, const char *subComponentName, const char *loggingLevel, int log_status) |
Variables | |
const char * | rdk_logLevelStrings [ENUM_RDK_LOG_COUNT] |
DTCP_SESSION_HANDLE | DTCPIP_Packet_s::session |
uint32_t | DTCPIP_Packet_s::emi |
uint8_t * | DTCPIP_Packet_s::dataInPtr |
uint8_t * | DTCPIP_Packet_s::dataInPhyPtr |
uint8_t * | DTCPIP_Packet_s::dataOutPtr |
uint8_t * | DTCPIP_Packet_s::dataOutPhyPtr |
uint32_t | DTCPIP_Packet_s::dataLength |
BOOLEAN | DTCPIP_Packet_s::isEOF |
uint8_t * | DTCPIP_Packet_s::pcpHeader |
uint32_t | DTCPIP_Packet_s::pcpHeaderLength |
int | DTCPIP_Packet_s::pcpHeaderOffset |
DTCP_SESSION_HANDLE | DTCPIP_Session_s::session_handle |
DTCPDeviceType | DTCPIP_Session_s::device_type |
char * | DTCPIP_Session_s::remote_ip |
BOOLEAN | DTCPIP_Session_s::uniqueKey |
void | rdk_dbgInit () |
Initialize the underlying MPEOS debug support. This API must be called only once per boot cycle. More... | |
rdk_Error | rdk_logger_init (const char *debugConfigFile) |
Initialize the logger. Sets up the environment variable storage by parsing debug configuration file then Initialize the debug support to the underlying platform. More... | |
rdk_Error | rdk_logger_deinit () |
Cleanup the logger instantiation. More... | |
void | rdk_dbg_MsgRaw (rdk_LogLevel level, const char *module, const char *format,...) __attribute__((format(printf |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect. More... | |
void void | rdk_dbg_MsgRaw1 (rdk_LogLevel level, const char *module, const char *format, va_list args) |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect. More... | |
rdk_logger_Bool | rdk_dbg_enabled (const char *module, rdk_LogLevel level) |
Function to check if a specific log level of a module is enabled. More... | |
void | rdk_log_onboard (const char *module, const char *msg,...) __attribute__((format(printf |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect. More... | |
int | rdk_logger_envGetNum (const char *mod) |
Function will give the registered number of the specified environment variable. More... | |
const char * | rdk_logger_envGetValueFromNum (int number) |
This function is used to get the value of the specified environment variable based on its registered number. More... | |
const char * | rdk_logger_envGetModFromNum (int Num) |
This function is used to get the name of the specified environment variable based on its registered number. More... | |
rdk_Error | rdk_logger_env_add_conf_file (const char *path) |
This Function sets up the environment variable cache by parsing configuration file and adding each name/value pairs to the list. More... | |
enum | DTCPDeviceType |
DTCP-IP device types. More... | |
typedef unsigned char | BOOLEAN |
DTCP Manager return codes. More... | |
typedef unsigned long | DTCP_SESSION_HANDLE |
DTCP-IP session handle. More... | |
typedef struct DTCPIP_Packet_s | DTCPIP_Packet |
DTCP-IP packet stucture. More... | |
typedef struct DTCPIP_Session_s | DTCPIP_Session |
DTCP-IP session structure. More... | |
dtcp_result_t | DTCPMgrStartSource (char *ifName, int portNum) |
Starts the DTCP-IP source. More... | |
dtcp_result_t | DTCPMgrStopSource (void) |
Stops the DTCP-IP source. More... | |
dtcp_result_t | DTCPMgrCreateSourceSession (char *sinkIpAddress, int key_label, int PCPPacketSize, int maxPacketSize, DTCP_SESSION_HANDLE *handle) |
Creates a new DTCP-IP source session. More... | |
dtcp_result_t | DTCPMgrCreateSinkSession (char *srcIpAddress, int srcIpPort, BOOLEAN uniqueKey, int maxPacketSize, DTCP_SESSION_HANDLE *handle) |
Creates a new DTCP-IP sink session. More... | |
dtcp_result_t | DTCPMgrProcessPacket (DTCP_SESSION_HANDLE session, DTCPIP_Packet *packet) |
Processes a DTCP-IP packet. More... | |
dtcp_result_t | DTCPMgrReleasePacket (DTCPIP_Packet *packet) |
Releases a processed DTCP-IP packet. More... | |
dtcp_result_t | DTCPMgrDeleteDTCPSession (DTCP_SESSION_HANDLE session) |
Deletes a DTCP-IP session. More... | |
int | DTCPMgrGetNumSessions (DTCPDeviceType deviceType) |
Gets the number of active sessions. More... | |
dtcp_result_t | DTCPMgrGetSessionInfo (DTCP_SESSION_HANDLE handle, DTCPIP_Session *session) |
Gets session information. More... | |
dtcp_result_t | DTCPMgrSetLogLevel (int level) |
Sets log level. More... | |
struct DTCPIP_Packet_s |
DTCP-IP packet stucture.
This structure defines a DTCP-IP PCP packet.
Data Fields | ||
---|---|---|
DTCP_SESSION_HANDLE | session |
(Input) The session to which this packet belongs. |
uint32_t | emi |
(Input for source, Output for sink) EMI value. |
uint8_t * | dataInPtr |
(Input) Virtual data buffer, allocated by the caller. |
uint8_t * | dataInPhyPtr |
(Input) Physical data buffer, allocated by the caller. (Set to NULL if not available.) |
uint8_t * | dataOutPtr |
(Output) Virtual data buffer, allocated by DTCP Manager. (This will be same as dataInPtr if encrypt/decrypt was done in-place.) |
uint8_t * | dataOutPhyPtr |
(Output) Physical data buffer, allocated by DTCP Manager. (This will be same as dataInPhyPtr if encrypt/decrypt was done in-place.) |
uint32_t | dataLength |
(Input/Output) Length of the buffer. |
BOOLEAN | isEOF |
(Input, source only) Flag specifying whether this is the last buffer for this session. |
uint8_t * | pcpHeader |
(Output, source only) PCP packet header, NULL if no header. |
uint32_t | pcpHeaderLength |
(Output, source only) Length of pcpHeader in bytes, 0 if no header. |
int | pcpHeaderOffset |
(Output, source only) Byte offset into the buffer where header needs to be inserted. (If < 0, no insertion to be done.) |
struct DTCPIP_Session_s |
DTCP-IP session structure.
This structure defines a DTCP-IP session.
Data Fields | ||
---|---|---|
DTCP_SESSION_HANDLE | session_handle |
Unique handle of the session. |
DTCPDeviceType | device_type |
Type of device (source/sink). |
char * | remote_ip |
Remote source/sink IP address. |
BOOLEAN | uniqueKey |
Flag indicating unique key. |
#define DEBUG_INI_OVERRIDE_PATH "/nvram/debug.ini" |
Support for overriding debug.ini file location
Definition at line 147 of file rdk_debug.h.
#define RDK_LOGGER_INIT | ( | ) |
Definition at line 148 of file rdk_debug.h.
#define RDK_LOG rdk_dbg_MsgRaw |
Use RDK_LOG debug message as. RDK_LOG (rdk_LogLevel level, const char *module, const char *format,...)
level | Log level of the log message |
module | Module in which this message belongs to (Use module name same as mentioned in debug.ini) |
format | Printf style string containing the log message. |
Default log level entries for each modules are present in the debug.ini These entries are read at startup and can be modifiy/add as per the requirement.
Bydefault logs are redirected to /opt/logs/ocapri_log.txt. But these can be configure to capture logs for each component in separate files under /opt/logs/ by setting configuration parameter SEPARATE.LOGFILE.SUPPORT as TRUE in debug.ini
Following logs files generated if SEPARATE.LOGFILE.SUPPORT=TRUE
For POD: pod_log.txt
For CANH Daemon: canh_log.txt
For RMFStreamer: rmfstr_log.txt
Definition at line 258 of file rdk_debug.h.
typedef unsigned char BOOLEAN |
typedef unsigned long DTCP_SESSION_HANDLE |
typedef struct DTCPIP_Packet_s DTCPIP_Packet |
DTCP-IP packet stucture.
This structure defines a DTCP-IP PCP packet.
typedef struct DTCPIP_Session_s DTCPIP_Session |
DTCP-IP session structure.
This structure defines a DTCP-IP session.
enum rdk_LogLevel |
These values represent the logging 'levels' or 'types', they are each independent.
Enumerator | |
---|---|
ENUM_RDK_LOG_BEGIN | Used as array index. |
Definition at line 157 of file rdk_debug.h.
enum DTCPDeviceType |
void rdk_dbgInit | ( | ) |
Initialize the underlying MPEOS debug support. This API must be called only once per boot cycle.
Definition at line 100 of file rdk_debug.c.
rdk_Error rdk_logger_init | ( | const char * | debugConfigFile | ) |
Initialize the logger. Sets up the environment variable storage by parsing debug configuration file then Initialize the debug support to the underlying platform.
[in] | debugConfigFile | The character pointer variable of debug configuration file. |
Definition at line 57 of file rdk_logger_init.c.
rdk_Error rdk_logger_deinit | ( | ) |
Cleanup the logger instantiation.
Definition at line 108 of file rdk_logger_init.c.
void rdk_dbg_MsgRaw | ( | rdk_LogLevel | level, |
const char * | module, | ||
const char * | format, | ||
... | |||
) |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect.
[in] | path | Character string representing path of the temp file to be created. |
void void rdk_dbg_MsgRaw1 | ( | rdk_LogLevel | level, |
const char * | module, | ||
const char * | format, | ||
va_list | args | ||
) |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect.
[in] | path | Character string representing path of the temp file to be created. |
Definition at line 139 of file rdk_debug.c.
rdk_logger_Bool rdk_dbg_enabled | ( | const char * | module, |
rdk_LogLevel | level | ||
) |
Function to check if a specific log level of a module is enabled.
[in] | module | The module name or category for for which the log level shall be checked (as mentioned in debug.ini). |
[in] | level | The debug logging level. |
Definition at line 415 of file rdk_debug_priv.c.
void rdk_log_onboard | ( | const char * | module, |
const char * | msg, | ||
... | |||
) |
Dump the debug log. It will Dump all the current settings so that an analysis of a log file will include what logging information to expect.
[in] | path | Character string representing path of the temp file to be created. |
int rdk_logger_envGetNum | ( | const char * | mod | ) |
Function will give the registered number of the specified environment variable.
[in] | mod | It is a pointer to the name of the target environment variable. |
Definition at line 257 of file rdk_logger_util.c.
const char* rdk_logger_envGetValueFromNum | ( | int | number | ) |
This function is used to get the value of the specified environment variable based on its registered number.
[in] | number | Is a registered number of the target environment variable. |
Definition at line 231 of file rdk_logger_util.c.
const char* rdk_logger_envGetModFromNum | ( | int | Num | ) |
This function is used to get the name of the specified environment variable based on its registered number.
[in] | Num | Is a registered number of the target environment variable. |
Definition at line 285 of file rdk_logger_util.c.
rdk_Error rdk_logger_env_add_conf_file | ( | const char * | path | ) |
This Function sets up the environment variable cache by parsing configuration file and adding each name/value pairs to the list.
[in] | path | Path of the configuration file. |
Definition at line 97 of file rdk_logger_util.c.
dtcp_result_t DTCPMgrStartSource | ( | char * | ifName, |
int | portNum | ||
) |
Starts the DTCP-IP source.
This function start the DTCP-IP source and begins listening for AKE requests on the specified interface and port number.
[in] | ifName | Interface name (e.g. "eth0"). |
[in] | portNum | TCP/IP port number that the source listens for AKE requests. |
DTCP_SUCCESS | Successfully started the DTCP-IP source and/or added a listener. |
Definition at line 46 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrStopSource | ( | void | ) |
Stops the DTCP-IP source.
This function stops the DTCP-IP source and removes all AKE request listeners added with DTCPMgrStartSource().
DTCP_SUCCESS | Successfully stopped the DTCP-IP source and removed all listeners. |
Definition at line 53 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrCreateSourceSession | ( | char * | sinkIpAddress, |
int | key_label, | ||
int | PCPPacketSize, | ||
int | maxPacketSize, | ||
DTCP_SESSION_HANDLE * | handle | ||
) |
Creates a new DTCP-IP source session.
This function creates a new authenticated session with a remote DTCP-IP sink.
[in] | sinkIpAddress | IP address of the remote DTCP-IP sink. |
[in] | key_label | Exchange key label, if available from streaming request. If provided, the stream will be encrypted with the session key. |
[in] | PCPPacketSize | Minimum size of a packet. If the buffer provided in DTCPMgrProcessPacket() is less than PCPPacketSize, then the PCP packet is set to PCPPacketSize and fragmented across multiple DTCPIP_Packets. This is for reducing PCP space and processing overheads for low latency low bit-rate transfers where each buffer can be very small. PCPPacketSize of 0 would return every buffer as a PCP packet. i.e. If PCPPacketSize is 64 KB and if the buffer size in DTCPMgrProcessPacket() is 1 KB, the first decrypted buffer would be a PCP packet. And after first packet, decrypted buffer wouldn't have a PCP header until 64 KB. |
[in] | maxPacketSize | Maximum size of a packet. If the DataLength provided in DTCPMgrProcessPacket() is more than MaxPacketSize, the DTCP library can reject the process request. |
[out] | handle | The address of a location to hold the handle for the specified TCP/IP session on return. |
DTCP_SUCCESS | Successfully created a DTCP-IP source session. |
Definition at line 69 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrCreateSinkSession | ( | char * | srcIpAddress, |
int | srcIpPort, | ||
BOOLEAN | uniqueKey, | ||
int | maxPacketSize, | ||
DTCP_SESSION_HANDLE * | handle | ||
) |
Creates a new DTCP-IP sink session.
This function creates a new authenticated session with a remote DTCP-IP source.
[in] | srcIpAddress | IP address of the remote DTCP-IP source. |
[in] | srcIpPort | TCP/IP port of the remote DTCP-IP source. |
[in] | uniqueKey | Flag to request unique exchange keys. (Both server and client should have 'session exchange key' support.) |
[in] | maxPacketSize | Maximum size of packet. If DataLength provided in DTCPMgrProcessPacket() is more than MaxPacketSize, the DTCP library can reject the process request. |
[out] | handle | The address of a location to hold the handle for the specified TCP/IP session on return. |
DTCP_SUCCESS | Successfully created a DTCP-IP sink session. |
Definition at line 87 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrProcessPacket | ( | DTCP_SESSION_HANDLE | session, |
DTCPIP_Packet * | packet | ||
) |
Processes a DTCP-IP packet.
This function processes a DTCP-IP packet - encrypts or decrypts buffers, depending on the session type:
[in] | session | Session handle. |
[in,out] | packet | Address of the location of the of the processed DTCP-IP packet. |
DTCP_SUCCESS | Successfully processed the packet. |
Definition at line 106 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrReleasePacket | ( | DTCPIP_Packet * | packet | ) |
Releases a processed DTCP-IP packet.
This function releases the DTCP-IP packet. The processed packet may contain DTCP Manager allocated/owned buffers/memory - this call frees up these resources.
[in] | packet | Address of the location of the DTCP-IP packet. |
DTCP_SUCCESS | Successfully released packet. |
Definition at line 115 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrDeleteDTCPSession | ( | DTCP_SESSION_HANDLE | session | ) |
Deletes a DTCP-IP session.
This function stops an active DTCP-IP session.
[in] | session | Session handle. |
DTCP_SUCCESS | Successfully deleted the session. |
Definition at line 121 of file dtcpmgr.cpp.
int DTCPMgrGetNumSessions | ( | DTCPDeviceType | deviceType | ) |
Gets the number of active sessions.
This function retrieves the total number of active sessions for the specified device type.
[in] | deviceType | DTCP-IP device type (source/sink). DTCP_UNKNOWN returns total number of sessions of all types. |
Definition at line 130 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrGetSessionInfo | ( | DTCP_SESSION_HANDLE | handle, |
DTCPIP_Session * | session | ||
) |
Gets session information.
This function retrieves information related to an active session.
[in] | handle | DTCP-IP session handle. |
[out] | session | The address of a location of the DTCP-IP session structure to fill on return. |
DTCP_SUCCESS | Successfully returned the session info. |
Definition at line 137 of file dtcpmgr.cpp.
dtcp_result_t DTCPMgrSetLogLevel | ( | int | level | ) |
Sets log level.
This function sets DTCP Manager's logging verbosity level.
[in] | level | Logging level. |
DTCP_SUCCESS | Logging level was set successfully. |
Definition at line 146 of file dtcpmgr.cpp.
const char* rdk_logLevelStrings[ENUM_RDK_LOG_COUNT] |
String names that correspond to the various logging types. Note: This array must match the RDK_LOG_* enum.
DTCP_SESSION_HANDLE DTCPIP_Packet_s::session |
uint32_t DTCPIP_Packet_s::emi |
uint8_t* DTCPIP_Packet_s::dataInPtr |
uint8_t* DTCPIP_Packet_s::dataInPhyPtr |
uint8_t* DTCPIP_Packet_s::dataOutPtr |
uint8_t* DTCPIP_Packet_s::dataOutPhyPtr |
uint32_t DTCPIP_Packet_s::dataLength |
BOOLEAN DTCPIP_Packet_s::isEOF |
uint8_t* DTCPIP_Packet_s::pcpHeader |
uint32_t DTCPIP_Packet_s::pcpHeaderLength |
int DTCPIP_Packet_s::pcpHeaderOffset |
DTCP_SESSION_HANDLE DTCPIP_Session_s::session_handle |
DTCPDeviceType DTCPIP_Session_s::device_type |
char* DTCPIP_Session_s::remote_ip |