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 CMD | ( | c | ) | (strcasecmp(Cmd, c) == 0) |
Definition at line 2597 of file svdrp.c.
Referenced by cSVDRPServer::Execute().
#define dbgsvdrp | ( | a... | ) | if (DumpSVDRPDataTransfer) fprintf(stderr, a) |
Definition at line 45 of file svdrp.c.
Referenced by cSocket::Accept(), cSocket::Connect(), cSocket::Discover(), cSVDRPClient::Process(), cSVDRPServer::Process(), cSVDRPClient::Send(), cSVDRPServer::Send(), and cSocket::SendDgram().
#define EITDISABLETIME 10 |
Definition at line 824 of file svdrp.c.
Referenced by cSVDRPServer::CmdCLRE(), and cSVDRPServer::Execute().
#define MAXHELPTOPIC 10 |
Definition at line 823 of file svdrp.c.
Referenced by GetHelpTopic(), and cSVDRPServer::PrintHelpTopics().
#define MAXUDPBUF 1024 |
Definition at line 99 of file svdrp.c.
Referenced by cSocket::Discover().
#define SVDRPResonseTimeout 5000 |
Referenced by cSVDRPClient::Process().
enum eSvdrpFetchFlags |
void BroadcastSVDRPCommand | ( | const char * | Command | ) |
Sends the given SVDRP Command string to all remote VDRs.
Definition at line 2861 of file svdrp.c.
References ExecSVDRPCommand(), cSVDRPClientHandler::GetServerNames(), cSVDRPClientHandler::Lock(), cVector< T >::Size(), 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 2849 of file svdrp.c.
References cSVDRPClientHandler::Execute(), cSVDRPClientHandler::Lock(), and cSVDRPClientHandler::Unlock().
Referenced by BroadcastSVDRPCommand(), HandleRemoteTimerModifications(), and cMenuTimers::OnOff().
const char* GetHelpPage | ( | const char * | Cmd, |
const char ** | p | ||
) |
Definition at line 1050 of file svdrp.c.
References GetHelpTopic().
Referenced by cSVDRPServer::CmdHELP(), and cSVDRPServer::CmdPLUG().
const char* GetHelpTopic | ( | const char * | HelpPage | ) |
Definition at line 1032 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 2837 of file svdrp.c.
References cSVDRPClientHandler::GetServerNames(), cSVDRPClientHandler::Lock(), and cSVDRPClientHandler::Unlock().
Referenced by cMenuEditTimer::cMenuEditTimer(), and cMenuSetupMisc::Set().
|
static |
Definition at line 1431 of file svdrp.c.
References cRecording::FileName(), cRecordControls::GetRecordControl(), cTimer::Id(), ruCopy, ruCut, ruMove, ruReplay, ruTimer, cString::sprintf(), and cRecordControl::Timer().
Referenced by cSVDRPServer::CmdCPYR(), cSVDRPServer::CmdDELR(), and cSVDRPServer::CmdMOVR().
void SetSVDRPGrabImageDir | ( | const char * | GrabImageDir | ) |
void SetSVDRPPorts | ( | int | TcpPort, |
int | UdpPort | ||
) |
Definition at line 2724 of file svdrp.c.
References SVDRPTcpPort, and SVDRPUdpPort.
Referenced by main().
void StartSVDRPHandler | ( | void | ) |
Definition at line 2812 of file svdrp.c.
References Setup, cThread::Start(), cSetup::SVDRPPeering, SVDRPTcpPort, SVDRPUdpPort, and cSVDRPServerHandler::WaitUntilReady().
Referenced by main(), and cMenuSetupMisc::ProcessKey().
cStateKey StateKeySVDRPRemoteTimersPoll | ( | true | ) |
void StopSVDRPHandler | ( | void | ) |
Definition at line 2828 of file svdrp.c.
References SVDRPClientHandler, and SVDRPServerHandler.
Referenced by main(), and cMenuSetupMisc::ProcessKey().
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 StopSVDRPHandler().
|
static |
Definition at line 2752 of file svdrp.c.
Referenced by StopSVDRPHandler().
|
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().