Commit 27f3b188 authored by Damien Lucas's avatar Damien Lucas

. Removed configure file from the cvs

. Added a bootstrap

. Added a configure option to keep backward compatibility to telnet functions
  (./configure --with-extrafunc=manager_backwardcomp.cpp)

. Begin of backward compatibility (start --loop option fix), still
  a lot of work to do

. fixed 2 segfaults

. added port 1234 as default if none specified at net4output construction

. Some optims
parent ebe8a9c9
......@@ -82,6 +82,7 @@ LCFLAGS+=-D_REENTRANT
# Specific flags
#
CCFLAGS+=-DCONFIG_PATH='"$(sysconfdir)/videolan/vls"'
CCFLAGS+= @MANAGER_EXTRA_FLAG@
VLS_LCFLAGS = @VLS_LCFLAGS@
VLS_LIB = @VLS_LIB@
......@@ -109,7 +110,6 @@ VLS_LIB += $(BUILTINS_LIB)
CCFLAGS+=-DBUGGY_VLC -DYY_NO_UNPUT
################################################################################
# Build control
################################################################################
......
#! /bin/sh
## Minimalistic boostrap file for vls
## $Id: bootstrap,v 1.1 2003/08/13 15:59:31 nitrox Exp $
LANG=C
export LANG
CYGWIN=binmode
export CYGWIN
echo "+ Remove stuff"
rm -f src/core/defs.h.in
rm -f configure
rm -f aclocal.m4
echo "+ Check for auto* tools"
# Automake
have_autoconf="no"
if autoconf --version >/dev/null 2>&1;
then
have_autoconf="yes"
fi
if test "${have_autoconf}" = "no"; then
echo "- You need autoconf"
echo "- Unable to continue"
exit 1
fi
echo "+ Generating configure file"
aclocal
autoconf
echo "+ Generating header files"
autoheader 2&> /dev/null
exit 0
This diff is collapsed.
......@@ -501,6 +501,16 @@ then
esac
fi
dnl Extra manager functions
AC_ARG_WITH(extrafunc,
AC_HELP_STRING(--with-extrafunc=FILE, File containing extra functions definitions))
if test "x$with_extrafunc" = x
then
MANAGER_EXTRA_FLAG=""
else
MANAGER_EXTRA_FLAG="-DMANAGER_EXTRA='\"${with_extrafunc}\"'"
fi
dnl
dnl Configuration is finished
......@@ -538,6 +548,7 @@ AC_SUBST(V4LINPUT_CCFLAGS)
AC_SUBST(V4LINPUT_DCFLAGS)
AC_SUBST(V4LINPUT_LCFLAGS)
AC_SUBST(MANAGER_EXTRA_FLAG)
AC_SUBST(VLS_LCFLAGS)
AC_SUBST(VLS_LIB)
......
......@@ -2,7 +2,7 @@
* netchannel.cpp: network channel
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netchannel.cpp,v 1.8 2003/08/05 23:18:19 nitrox Exp $
* $Id: netchannel.cpp,v 1.9 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -76,7 +76,7 @@ C_NetChannel::C_NetChannel(C_Module* pModule,
const C_ChannelConfig& cConfig) : C_Channel(pModule,
cConfig)
{
m_pOutput = NULL;
if(cConfig.m_strDomain == "inet4")
m_pOutput = new C_Net4Output(cConfig);
#ifdef HAVE_IPV6
......
......@@ -2,7 +2,7 @@
* netoutput.cpp: network output
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: netoutput.cpp,v 1.14 2003/08/05 23:18:19 nitrox Exp $
* $Id: netoutput.cpp,v 1.15 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -62,8 +62,16 @@ C_NetOutput::C_NetOutput(const C_ChannelConfig& cConfig)
m_strSrcHost = cConfig.m_strSrcHost;
m_strSrcPort = cConfig.m_strSrcPort;
m_strDstHost = cConfig.m_strDstHost;
m_strDstPort = cConfig.m_strDstPort;
m_strType = cConfig.m_strType;
if(cConfig.m_strDstPort == "")
{
m_strDstPort = "1234";
}
else
{
m_strDstPort = cConfig.m_strDstPort;
}
m_strType = cConfig.m_strStreamType;
m_strInterface = cConfig.m_strInterface;
m_iTTL = cConfig.m_iTTL;
......
......@@ -2,7 +2,7 @@
* admin.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: admin.cpp,v 1.28 2003/08/08 15:57:50 nitrox Exp $
* $Id: admin.cpp,v 1.29 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -506,7 +506,7 @@ int C_Admin::Init()
"deletes a configured broadcast.",
"\"broadcast_del\" deletes a configures broadcast."
"\n");
pStr = new C_String("name");
pStr = new C_String("broadcast");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pStr = new C_String("force");
pCmdDesc->m_vBooleans.Add(pStr);
......@@ -576,17 +576,11 @@ int C_Admin::Init()
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
pCmdDesc = new C_CommandDesc("set",
"",
"\n");
pStr = new C_String("susp");
pCmdDesc->m_vMandatoryArgs.Add(pStr);
pCmdDesc->BuildUsage();
m_cCmdDescriptions.Add(pCmdDesc->m_strName, pCmdDesc);
#ifdef MANAGER_EXTRA
# define EXTRA_DEF
# include MANAGER_EXTRA
# undef EXTRA_DEF
#endif
// Groups
C_Vector<C_Setting> vGroups = pApp->GetSettings("Groups");
......@@ -890,7 +884,7 @@ C_Answer C_Admin::ParseCmdLine(C_AdminSession* pSession,
if(!pCmdDesc)
{
cAnswer.SetStatus(ADMIN_UNKNOWN_COMMAND);
cAnswer.AddMessage(strCmd + ": unknown command.");
cAnswer.AddMessage(strCmd + ": unknown command.");
return cAnswer;
}
......@@ -1044,7 +1038,7 @@ C_Answer C_Admin::ValidateRequest(C_AdminSession* pSession,
if(!pCmdDesc)
{
cAnswer.SetStatus(ADMIN_UNKNOWN_COMMAND);
cAnswer.AddMessage(strCmd + ": unknown command.");
cAnswer.AddMessage(strCmd + ": unknown command.");
return cAnswer;
}
......@@ -1108,7 +1102,7 @@ C_Answer C_Admin::ValidateRequest(C_AdminSession* pSession,
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Admin::HandleRequest(const C_Request& cRequest)
C_Answer C_Admin::HandleRequest(C_Request& cRequest)
{
C_Answer cAnswer("Admin");
......@@ -1119,7 +1113,7 @@ C_Answer C_Admin::HandleRequest(const C_Request& cRequest)
m_cRequestLock.Lock();
C_String strCmd = cRequest.GetCmd();
if(strCmd.Find("help") != GEN_ERR)
if(strCmd.Find("help") != GEN_ERR || strCmd == "help")
{
C_String strArg = cRequest.GetArg("command");
if(strArg.Length() == 0)
......
......@@ -2,7 +2,7 @@
* admin.h: Admin class definition
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: admin.h,v 1.5 2003/02/05 01:25:32 tooney Exp $
* $Id: admin.h,v 1.6 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -170,7 +170,7 @@ class C_Admin : public C_EventHandler, public C_RequestHandler
C_Answer ParseCmdLine(C_AdminSession* pSession, const C_String& strCmdLine,
C_Request& cRequest);
C_Answer ValidateRequest(C_AdminSession* pSession, C_Request& cRequest);
C_Answer HandleRequest(const C_Request& cRequest);
C_Answer HandleRequest(C_Request& cRequest);
// Event handling
void HandleEvent(const C_Event& cEvent);
......
......@@ -2,7 +2,7 @@
* channel.cpp: Channel encapsulation
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: channel.cpp,v 1.6 2003/08/05 23:18:19 nitrox Exp $
* $Id: channel.cpp,v 1.7 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -67,7 +67,7 @@ C_Channel::C_Channel(C_Module* pModule, const C_ChannelConfig& cConfig) :
C_Channel::~C_Channel()
{
ASSERT(m_pOutput);
delete m_pOutput;
if (m_pOutput) delete m_pOutput;
m_pModule->Unref();
}
......
......@@ -2,7 +2,7 @@
* input.cpp: Input streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: input.cpp,v 1.13 2003/06/02 20:48:09 jpsaman Exp $
* $Id: input.cpp,v 1.14 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -209,7 +209,7 @@ C_Answer C_Input::StartStreaming(C_Broadcast* pBroadcast)
pBroadcast->SetStatus(BROADCAST_RUNNING);
// Build the answer
cAnswer.SetStatus(NO_ERR);
cAnswer.SetStatus(ANS_NO_ERR);
cAnswer.AddMessage("Program " + strPgrmName + " started");
}
catch(E_Exception e)
......@@ -499,7 +499,8 @@ C_Answer C_Input::StopStreaming(C_Broadcast* pBroadcast)
// Ask the child to stop the streaming
if((pBroadcast->GetStatus() == BROADCAST_RUNNING) ||
(pBroadcast->GetStatus() == BROADCAST_FORWARD) ||
(pBroadcast->GetStatus() == BROADCAST_REWIND) ) {
(pBroadcast->GetStatus() == BROADCAST_REWIND) ||
(pBroadcast->GetStatus() == BROADCAST_SUSPENDED)) {
LogDbg(m_hLog, "Stopping reception of pgrm "+strPgrmName);
OnStopStreaming(pBroadcast);
pBroadcast->SetStatus(BROADCAST_STOPPED);
......
......@@ -2,7 +2,7 @@
* manager.cpp: Vls manager
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: manager.cpp,v 1.38 2003/08/08 15:57:50 nitrox Exp $
* $Id: manager.cpp,v 1.39 2003/08/13 15:59:31 nitrox Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -60,7 +60,7 @@
#include "repository.cpp"
//TODO change the name
typedef C_Answer (C_Manager::*zzzz)(const C_Request&);
typedef C_Answer (C_Manager::*zzzz)(C_Request&);
#define AddFunction(y,z) \
foo = new zzzz; \
......@@ -259,22 +259,16 @@ void C_Manager::DestroyPgrmTable()
void C_Manager::InitCommands()
{
zzzz *foo;
AddFunction("ls", &C_Manager::Ls);
AddFunction("browse", &C_Manager::Browse);
AddFunction("show", &C_Manager::Show);
AddFunction("config", &C_Manager::Config);
AddFunction("program", &C_Manager::Program);
AddFunction("input", &C_Manager::Input);
AddFunction("channel", &C_Manager::Channel);
AddFunction("start", &C_Manager::Start);
AddFunction("broadcast", &C_Manager::Broadcast);
AddFunction("broadcast_ls", &C_Manager::Broadcast_Ls);
AddFunction("broadcast_add", &C_Manager::Broadcast_Add);
AddFunction("broadcast_del", &C_Manager::Broadcast_Del);
AddFunction("broadcast_start", &C_Manager::Broadcast_Start)
AddFunction("broadcast_resume", &C_Manager::Broadcast_Resume);
AddFunction("broadcast_supend", &C_Manager::Broadcast_Suspend);
AddFunction("broadcast_suspend", &C_Manager::Broadcast_Suspend);
AddFunction("broadcast_forward", &C_Manager::Broadcast_Forward);
AddFunction("broadcast_rewind", &C_Manager::Broadcast_Rewind);
AddFunction("broadcast_stop", &C_Manager::Broadcast_Stop);
......@@ -284,6 +278,13 @@ void C_Manager::InitCommands()
AddFunction("channel_del", &C_Manager::Channel_Del);
AddFunction("program_ls", &C_Manager::Program_Ls);
#ifdef MANAGER_EXTRA
# define EXTRA_INIT
# include MANAGER_EXTRA
# undef EXTRA_INIT
#endif
}
......@@ -508,7 +509,7 @@ void C_Manager::StopPrograms()
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::HandleRequest(const C_Request& cRequest)
C_Answer C_Manager::HandleRequest(C_Request& cRequest)
{
zzzz *foo;
......@@ -519,7 +520,6 @@ C_Answer C_Manager::HandleRequest(const C_Request& cRequest)
C_String strCmd = cRequest.GetCmd();
// We should use a hashtable here
foo = m_cFunctions.Get(strCmd);
if(foo)
{
......@@ -585,50 +585,7 @@ void C_Manager::PrivHandleEvent(const C_Event& cEvent)
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Browse(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
cAnswer.SetStatus(ANS_NO_ERR);
cAnswer.AddMessage("Program Table");
m_cProgramList.Lock();
C_PgrmDirectoryBrowser cBrowser = m_cProgramList.CreateBrowser();
while(cBrowser.HasNext())
{
C_PgrmInfo* pPgrmInfo = cBrowser.GetNext();
ASSERT(pPgrmInfo);
// Build a subanswer with the pgrm description and the list of providers
const C_Program* pPgrm = pPgrmInfo->GetProgram();
C_String strPgrmName = pPgrm->GetName();
ASSERT(strPgrmName != "");
C_Answer cPgrmDescr(strPgrmName);
cPgrmDescr.SetStatus(NO_ERR);
cPgrmDescr.AddMessage(pPgrm->GetDescription());
const C_Vector<C_Input>& cProviders = pPgrmInfo->GetProviders();
C_String strProviders = "Provided by";
for(unsigned int i = 0; i < cProviders.Size(); i++)
{
strProviders += " " + cProviders[i].GetName();
}
cPgrmDescr.AddMessage(strProviders);
// Add it to the answer
cAnswer.Add(cPgrmDescr);
}
m_cProgramList.UnLock();
return cAnswer;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Ls(const C_Request& cRequest)
C_Answer C_Manager::Ls(C_Request& cRequest)
{
C_Answer cAnswer("Manager");
......@@ -658,357 +615,10 @@ C_Answer C_Manager::Ls(const C_Request& cRequest)
return cAnswer;
}
C_Answer C_Manager::Show(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
C_String strCommand = cRequest.GetArg("command");
ASSERT(strCommand != "");
if (strCommand.ToLower() == "broadcast")
{
cAnswer = Broadcast_Ls(cRequest);
}
else if (strCommand.ToLower() == "channel")
{
cAnswer = Channel_Ls(cRequest);
}
else if (strCommand.ToLower() == "program")
{
cAnswer.AddMessage("programs");
m_cProgramList.Lock();
C_PgrmDirectoryBrowser cBrowser = m_cProgramList.CreateBrowser();
while(cBrowser.HasNext())
{
C_PgrmInfo* pPgrmInfo = cBrowser.GetNext();
ASSERT(pPgrmInfo);
// Build a subanswer with the pgrm description and the list of providers
const C_Program* pPgrm = pPgrmInfo->GetProgram();
C_String strPgrmName = pPgrm->GetName();
ASSERT(strPgrmName != "");
C_Answer cPgrmDescr(strPgrmName);
cPgrmDescr.SetStatus(NO_ERR);
cPgrmDescr.AddMessage(pPgrm->GetDescription());
//TODO - What about the optional args ???
// nitrox
const C_Vector<C_Input>& cProviders = pPgrmInfo->GetProviders();
C_String strProviders;
for(unsigned int i = 0; i < cProviders.Size(); i++)
{
strProviders += "provider"+C_String(i)+" "+ cProviders[i].GetName();
}
cPgrmDescr.AddMessage(strProviders);
// Add it to the answer
cAnswer.Add(cPgrmDescr);
cAnswer.SetStatus(ANS_NO_ERR);
}
m_cProgramList.UnLock();
}
else if (strCommand.ToLower() == "input")
{
cAnswer.AddMessage("inputs");
// Lock the input repository
m_cInputList.Lock();
// Get the name of all the inputs
C_Application* pApp = C_Application::GetApp();
ASSERT(pApp);
C_Vector<C_Setting> vInputs = pApp->GetSettings("Inputs");
// Create the corresponding inputs
for(unsigned int i = 0; i < vInputs.Size(); i++)
{
// Get input name and type
C_Setting cCurrentInput = vInputs[i];
C_String strInputName = cCurrentInput.GetName();
C_String strInputType = cCurrentInput.GetValue();
// Get all the specific settings
C_Vector<C_Setting> vSettings = pApp->GetSettings(strInputName);
C_String strSettings="";
for(unsigned int i = 0; i < vSettings.Size(); i++)
{
if(i!=0) strSettings += " ";
strSettings += vSettings[i].GetName()+" "+ vSettings[i].GetValue();
}
// Create answer
C_Answer cInputDescr(strInputName);
cInputDescr.SetStatus(NO_ERR);
if(strSettings!="")
{
cInputDescr.AddMessage("input "+strInputName+
" type "+strInputType+" "+strSettings);
}
else
{
cInputDescr.AddMessage("input "+strInputName+
" type "+strInputType);
}
cAnswer.Add(cInputDescr);
}
cAnswer.SetStatus(ANS_NO_ERR);
// Unlock the input repository
m_cInputList.UnLock();
}
else
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("What to show? Use: broadcast, channel, program or input.");
}
return cAnswer;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Start(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
cAnswer.SetStatus(ANS_NO_ERR);
// Get the mandatory arguments to create the broadcast
C_String strChannel = cRequest.GetArg("channel");
C_String strPgrm = cRequest.GetArg("program");
C_String strInput = cRequest.GetArg("input");
// Create the broadcast
// Since we have just one broadcast per channel, we name it by default
// as the channel name
C_Broadcast* pBroadcast = CreateBroadcast (strChannel, strChannel,
strPgrm, strInput, &cAnswer);
// Set optional arguments and start the streaming
if(pBroadcast)
{
m_cBroadcastsList.Lock();
pBroadcast->SetOptions(cRequest.GetArgs());
C_Answer cInputAnswer = pBroadcast->GetInput()->StartStreaming(pBroadcast);
m_cBroadcastsList.UnLock();
}
return cAnswer;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Program(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
cAnswer.SetStatus(ANS_NO_ERR);
C_String strProgram = cRequest.GetArg("name");
ASSERT(strProgram != "");
C_String strFileName = cRequest.GetArg("filename");
ASSERT(strFileName != "");
C_String strType = cRequest.GetArg("type");
ASSERT(strType != "");
C_String strInput = cRequest.GetArg("input");
C_Input* pInput = m_cInputList.Get(strInput);
if(!pInput)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("input doesn't exist");
return cAnswer;
}
// optional arguments
C_String strAdd = cRequest.GetArg("add");
C_String strDelete = cRequest.GetArg("delete");
if ((strAdd == "1") && (strDelete == "1"))
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Channel does not allow use of --add and --delete at the same time.");
return cAnswer;
}
if (strAdd == "1") // Add Program
{
printf("Adding program name:%s\n", strProgram.GetString());
// Check if program is already present
const C_Program* pProgram = m_cProgramList.GetPgrm(strProgram);
if(pProgram)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Ignoring command program already added.");
m_cProgramList.ReleasePgrm(pProgram->GetName());
return cAnswer;
}
// Lock the input repository and the program list
m_cProgramList.Lock();
m_cInputList.Lock();
// First update C_Settings in pInput
C_Answer cInputAnswer = pInput->UpdateProgram(strProgram,strFileName,strType);
if(cInputAnswer.GetStatus())
{
cAnswer.SetStatus(cInputAnswer.GetStatus());
}
cAnswer.Add(cInputAnswer);
// Then Update m_cProgramList
C_List<C_Program> cInputPgrms = pInput->GetAvailablePgrms();
unsigned int iPgrmNumber = cInputPgrms.Size();
if (iPgrmNumber>0)
m_cProgramList.Add(cInputPgrms[iPgrmNumber-1], pInput);
else
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("ProgramList is empty.");
}
// debug
Log(m_hLog, LOG_NOTE, "Program configuration changed.");
for(unsigned int j = 0; j < iPgrmNumber; j++)
{
Log(m_hLog, LOG_NOTE, "Program: " + cInputPgrms[j].GetName());
}
// Unlock the input repository and the program list
m_cInputList.UnLock();
m_cProgramList.UnLock();
}
else
if (strDelete == "1") // Delete Program
{
Log(m_hLog, LOG_NOTE, "Program being deleted.");
// Check if program is known
const C_Program* pProgram = m_cProgramList.GetPgrm(strProgram);
if(!pProgram)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Cannot delete unknown program.");
return cAnswer;
}
m_cProgramList.ReleasePgrm(pProgram->GetName());
// Lock the input repository and the program list
m_cProgramList.Lock();
m_cInputList.Lock();
// First update C_Settings in pInput
C_Answer cInputAnswer = pInput->DeleteProgram(strProgram);
if(cInputAnswer.GetStatus())
{
cAnswer.SetStatus(cInputAnswer.GetStatus());
cAnswer.AddMessage("Error removing program from input.");
m_cProgramList.UnLock();
m_cInputList.UnLock();
return cAnswer;
}
cAnswer.Add(cInputAnswer);
// Then Delete from m_cProgramList
if(!cInputAnswer.GetStatus())
{
int iRc = m_cProgramList.Remove(*pProgram, pInput);
if(iRc == GEN_ERR)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Error removing program from configuration.");
m_cProgramList.UnLock();
m_cInputList.UnLock();
return cAnswer;
}
}
// Unlock the input repository and the program list
m_cInputList.UnLock();
m_cProgramList.UnLock();
// debug
Log(m_hLog, LOG_NOTE, "Program configuration changed.");
C_List<C_Program> cDebugInputPgrms = pInput->GetAvailablePgrms();
unsigned int iPgrmNumber = cDebugInputPgrms.Size();
if (iPgrmNumber <= 0)
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("ProgramList is empty.");
}
for(unsigned int j = 0; j < iPgrmNumber; j++)
{
Log(m_hLog, LOG_NOTE, "Program: " + cDebugInputPgrms[j].GetName());
}
}
else
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Commaned expects --add or --delete.");
Log(m_hLog, LOG_ERROR, "Command Syntax Error.");
}
return cAnswer;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Channel(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
cAnswer.SetStatus(ANS_NO_ERR);
C_String strAdd = cRequest.GetArg("add");
C_String strDelete = cRequest.GetArg("delete");
if ((strAdd == "1") && (strDelete == "1"))
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Channel does not allow use of --add and --delete at the same time.");
return cAnswer;
}
if (strAdd == "1") // Add Channel
{
Channel_Add(cRequest);
}
else
if (strDelete == "1") // Delete Channel
{
Channel_Del(cRequest);
}
else
{
cAnswer.SetStatus(GEN_ERR);
cAnswer.AddMessage("Command expects --add or --delete.");
Log(m_hLog, LOG_ERROR, "Command Syntax Error.");
}
return cAnswer;
}
//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
C_Answer C_Manager::Broadcast(const C_Request& cRequest)
{
C_Answer cAnswer("Manager");
cAnswer.SetStatus(ANS_NO_ERR);
C_String strAdd = cRequest.GetArg("add");
// Add case
if(strAdd == "1")
{
Broadcast_Add(cRequest);
}
return cAnswer;
}
//------------------------------------------------------------------------------