vdr
2.4.0
|
#include "svdrp.h"
#include <arpa/inet.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#include <ifaddrs.h>
#include <netinet/in.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <unistd.h>
#include "channels.h"
#include "config.h"
#include "device.h"
#include "eitscan.h"
#include "keys.h"
#include "menu.h"
#include "plugin.h"
#include "recording.h"
#include "remote.h"
#include "skins.h"
#include "timers.h"
#include "videodir.h"
Go to the source code of this file.
Classes | |
class | cIpAddress |
class | cSocket |
class | cSVDRPClient |
class | cSVDRPServerParams |
class | cSVDRPClientHandler |
class | cPUTEhandler |
class | cSVDRPServer |
class | cSVDRPServerHandler |
Macros | |
#define | dbgsvdrp(a...) if (DumpSVDRPDataTransfer) fprintf(stderr, a) |
#define | MAXUDPBUF 1024 |
#define | SVDRPResonseTimeout 5000 |
#define | MAXHELPTOPIC 10 |
#define | EITDISABLETIME 10 |
#define | CMD(c) (strcasecmp(Cmd, c) == 0) |
Enumerations | |
enum | eSvdrpFetchFlags { sffNone = 0b00000000, sffConn = 0b00000001, sffPing = 0b00000010, sffTimers = 0b00000100 } |
Functions | |
cStateKey | StateKeySVDRPRemoteTimersPoll (true) |
const char * | GetHelpTopic (const char *HelpPage) |
const char * | GetHelpPage (const char *Cmd, const char **p) |
static cString | RecordingInUseMessage (int Reason, const char *RecordingId, cRecording *Recording) |
void | SetSVDRPPorts (int TcpPort, int UdpPort) |
void | SetSVDRPGrabImageDir (const char *GrabImageDir) |
void | StartSVDRPHandler (void) |
void | StopSVDRPHandler (void) |
bool | GetSVDRPServerNames (cStringList *ServerNames) |
bool | ExecSVDRPCommand (const char *ServerName, const char *Command, cStringList *Response) |
void | BroadcastSVDRPCommand (const char *Command) |
Variables | |
static bool | DumpSVDRPDataTransfer = false |
static int | SVDRPTcpPort = 0 |
static int | SVDRPUdpPort = 0 |
static cPoller | SVDRPClientPoller |
static cSVDRPClientHandler * | SVDRPClientHandler = NULL |
const char * | HelpPages [] |
static cString | grabImageDir |
static cPoller | SVDRPServerPoller |
static cSVDRPServerHandler * | SVDRPServerHandler = NULL |
static cMutex | SVDRPHandlerMutex |
#define dbgsvdrp | ( | a... | ) | if (DumpSVDRPDataTransfer) fprintf(stderr, a) |
#define SVDRPResonseTimeout 5000 |
enum eSvdrpFetchFlags |
void BroadcastSVDRPCommand | ( | const char * | Command | ) |
Sends the given SVDRP Command string to all remote VDRs.
Definition at line 2805 of file svdrp.c.
References ExecSVDRPCommand(), cSVDRPClientHandler::GetServerNames(), cSVDRPClientHandler::Lock(), cVector< T >::Size(), SVDRPClientHandler, SVDRPHandlerMutex, and cSVDRPClientHandler::Unlock().
bool ExecSVDRPCommand | ( | const char * | ServerName, |
const char * | Command, | ||
cStringList * | Response = NULL |
||
) |
Sends the given SVDRP Command string to the remote VDR identified by ServerName and collects all of the response strings in Response.
If no Response parameter is given, the response from command execution is ignored. Returns true if the data exchange was successful. Whether or not the actual SVDRP command was successful depends on the resulting strings from the remote VDR, which can be accessed through Response. If Response is given, it will be cleared before the command is actually executed.
Definition at line 2793 of file svdrp.c.
References cSVDRPClientHandler::Execute(), cSVDRPClientHandler::Lock(), SVDRPClientHandler, SVDRPHandlerMutex, and cSVDRPClientHandler::Unlock().
Referenced by BroadcastSVDRPCommand(), HandleRemoteTimerModifications(), and cMenuTimers::OnOff().
const char* GetHelpPage | ( | const char * | Cmd, |
const char ** | p | ||
) |
Definition at line 1046 of file svdrp.c.
References GetHelpTopic().
Referenced by cSVDRPServer::CmdHELP(), and cSVDRPServer::CmdPLUG().
const char* GetHelpTopic | ( | const char * | HelpPage | ) |
Definition at line 1028 of file svdrp.c.
References MAXHELPTOPIC.
Referenced by GetHelpPage(), and cSVDRPServer::PrintHelpTopics().
bool GetSVDRPServerNames | ( | cStringList * | ServerNames | ) |
Gets a list of all available VDRs this VDR is connected to via SVDRP, and stores it in the given ServerNames list.
The list is cleared before getting the server names. Returns true if the resulting list is not empty.
Definition at line 2781 of file svdrp.c.
References cSVDRPClientHandler::GetServerNames(), cSVDRPClientHandler::Lock(), SVDRPClientHandler, SVDRPHandlerMutex, and cSVDRPClientHandler::Unlock().
Referenced by cMenuEditTimer::cMenuEditTimer(), and cMenuSetupMisc::Set().
|
static |
Definition at line 1426 of file svdrp.c.
References cRecording::FileName(), cRecordControls::GetRecordControl(), cTimer::Id(), ruCopy, ruCut, ruMove, ruReplay, ruTimer, cString::sprintf(), and cRecordControl::Timer().
Referenced by cSVDRPServer::CmdDELR(), and cSVDRPServer::CmdMOVR().
void SetSVDRPGrabImageDir | ( | const char * | GrabImageDir | ) |
Definition at line 2674 of file svdrp.c.
References grabImageDir.
Referenced by main().
void SetSVDRPPorts | ( | int | TcpPort, |
int | UdpPort | ||
) |
Definition at line 2668 of file svdrp.c.
References SVDRPTcpPort, and SVDRPUdpPort.
Referenced by main().
void StartSVDRPHandler | ( | void | ) |
Definition at line 2756 of file svdrp.c.
References Setup, cThread::Start(), SVDRPClientHandler, SVDRPHandlerMutex, cSetup::SVDRPPeering, SVDRPServerHandler, SVDRPTcpPort, SVDRPUdpPort, and cSVDRPServerHandler::WaitUntilReady().
Referenced by main(), and cMenuSetupMisc::ProcessKey().
cStateKey StateKeySVDRPRemoteTimersPoll | ( | true | ) |
Referenced by cSVDRPClientHandler::ProcessConnections().
void StopSVDRPHandler | ( | void | ) |
Definition at line 2772 of file svdrp.c.
References SVDRPClientHandler, SVDRPHandlerMutex, and SVDRPServerHandler.
Referenced by main(), and cMenuSetupMisc::ProcessKey().
|
static |
Definition at line 1059 of file svdrp.c.
Referenced by cSVDRPServer::CmdGRAB(), and SetSVDRPGrabImageDir().
const char* HelpPages[] |
Definition at line 827 of file svdrp.c.
Referenced by cSVDRPServer::CmdHELP(), and cPluginSvdrpdemo::SVDRPHelpPages().
|
static |
Definition at line 615 of file svdrp.c.
Referenced by BroadcastSVDRPCommand(), cSVDRPServer::CmdCONN(), cSVDRPServer::CmdPOLL(), ExecSVDRPCommand(), GetSVDRPServerNames(), StartSVDRPHandler(), and StopSVDRPHandler().
|
static |
Definition at line 344 of file svdrp.c.
Referenced by cSVDRPClientHandler::Action(), cSVDRPClient::Close(), and cSVDRPClient::cSVDRPClient().
|
static |
Definition at line 2754 of file svdrp.c.
Referenced by BroadcastSVDRPCommand(), ExecSVDRPCommand(), GetSVDRPServerNames(), StartSVDRPHandler(), and StopSVDRPHandler().
|
static |
Definition at line 2696 of file svdrp.c.
Referenced by StartSVDRPHandler(), and StopSVDRPHandler().
|
static |
Definition at line 1120 of file svdrp.c.
Referenced by cSVDRPServerHandler::Action(), cSVDRPServer::Close(), and cSVDRPServer::cSVDRPServer().
|
static |
Definition at line 47 of file svdrp.c.
Referenced by cSVDRPClientHandler::ProcessConnections(), SetSVDRPPorts(), and StartSVDRPHandler().
|
static |
Definition at line 48 of file svdrp.c.
Referenced by SetSVDRPPorts(), and StartSVDRPHandler().