Пример #1
0
moduleAdmin::moduleAdmin(server	*connectedServer	) : module( connectedServer ) {
	
	_moduleID = modADMIN;

	actionSetup();

}
Пример #2
0
moduleAdmin::moduleAdmin(server	*connectedServer	) : module( connectedServer ) {

    _moduleID = modADMIN;

    actionSetup();

    // Open the admin tab
    _server->mainAppGet()->guiMainGet()->adminOpen();
}
Пример #3
0
moduleAuth::moduleAuth(server	*connectedServer	) : module( connectedServer ) {

	_moduleID		= modAUTH;

	_Authenticated = false;
    _versionOk = true;

	// Setup the packet decode table
	actionSetup();
}
Пример #4
0
static void
deviceAdd( tr_upnp_device_t ** first, const char * id, int idLen,
           const char * url, int urlLen )
{
    tr_upnp_device_t * ii;

    for( ii = *first; NULL != ii; ii = ii->next )
    {
        if( 0 == tr_strncasecmp( ii->id, id, idLen ) )
        {
            /* this device may have gone away and came back, recheck it */
            ii->lastcheck = 0;
            return;
        }
    }

    ii = malloc( sizeof( *ii ) );
    if( NULL == ii )
    {
        return;
    }
    memset( ii, 0, sizeof( *ii ) );
    if( tr_httpParseUrl( url, urlLen, &ii->host, &ii->port, &ii->root ) )
    {
        free( ii );
        return;
    }
    ii->id = tr_dupstr( id, idLen );
    ii->state = UPNPDEV_STATE_ROOT;
    actionSetup( &ii->getcmd, "GetSpecificPortMappingEntry", 8 );
    actionSetup( &ii->addcmd, "AddPortMapping", 8 );
    actionSetup( &ii->delcmd, "DeletePortMapping", 3 );
    ii->next = *first;
    *first = ii;

    tr_inf( "new upnp device %s, port %i, path %s",
            ii->host, ii->port, ii->root );
}
Пример #5
0
IRCBot::IRCBot( smokingman *smokinman ) {
    _smokingman = smokinman;

	_db = new database( _smokingman->dbIPGet(), _smokingman->dbNameGet(), _smokingman->dbPortGet(), _smokingman->dbUsernameGet(), _smokingman->dbPasswordGet(), 0);

	_chansJoined = false;
    _irc = 0;
    _ircThread = new pthread_t();
	_testThread = 0;

	_Miis = 0;

    _quit = false;
	actionSetup();
}
Пример #6
0
moduleAuth::moduleAuth(client	*connectedClient	) : module( connectedClient ) {
	_moduleID		= modAUTH;
	_authenticated	= false;
    _lastPong       = time (NULL);
	_lastSHA		= 0;

    _loginAttempts  = 0;

    _OS             = osUnknown;

	_SHAok			= false;
    _versionOk      = false;

	// Setup the packet decode table
	actionSetup();

    // Get the clients version
    versionRequest();
}
Пример #7
0
HActionsSetupData HAvTransportInfo::actionsSetupData()
{
    HActionsSetupData retVal;

    HStateVariablesSetupData svSetupData = stateVariablesSetupData();

    HActionArguments inArgsSetup, outArgsSetup;

    // SetAVTransportURI
    HActionSetup actionSetup("SetAVTransportURI", InclusionMandatory);
    inArgsSetup.append(HActionArgument("InstanceID", svSetupData.get("A_ARG_TYPE_InstanceID")));
    inArgsSetup.append(HActionArgument("CurrentURI", svSetupData.get("AVTransportURI")));
    inArgsSetup.append(HActionArgument("CurrentURIMetaData", svSetupData.get("AVTransportURIMetaData")));
    actionSetup.setInputArguments(inArgsSetup);
    retVal.insert(actionSetup);

    // SetNextAVTransportURI
    inArgsSetup.clear();
    actionSetup = HActionSetup("SetNextAVTransportURI", InclusionOptional);
    inArgsSetup.append(HActionArgument("InstanceID", svSetupData.get("A_ARG_TYPE_InstanceID")));
    inArgsSetup.append(HActionArgument("NextURI", svSetupData.get("AVTransportURI")));
    inArgsSetup.append(HActionArgument("NextURIMetaData", svSetupData.get("AVTransportURIMetaData")));
    actionSetup.setInputArguments(inArgsSetup);
    retVal.insert(actionSetup);

    // GetMediaInfo
    inArgsSetup.clear();
    outArgsSetup.clear();
    actionSetup = HActionSetup("GetMediaInfo");
    inArgsSetup.append(HActionArgument("InstanceID", svSetupData.get("A_ARG_TYPE_InstanceID")));
    actionSetup.setInputArguments(inArgsSetup);
    outArgsSetup.append(HActionArgument("NrTracks", svSetupData.get("NumberOfTracks")));
    outArgsSetup.append(HActionArgument("MediaDuration", svSetupData.get("CurrentMediaDuration")));
    outArgsSetup.append(HActionArgument("CurrentURI", svSetupData.get("AVTransportURI")));
    outArgsSetup.append(HActionArgument("CurrentURIMetaData", svSetupData.get("AVTransportURIMetaData")));
    outArgsSetup.append(HActionArgument("NextURI", svSetupData.get("NextAVTransportURI")));
    outArgsSetup.append(HActionArgument("NextURIMetaData", svSetupData.get("NextAVTransportURIMetaData")));
    outArgsSetup.append(HActionArgument("PlayMedium", svSetupData.get("PlaybackStorageMedium")));
    outArgsSetup.append(HActionArgument("RecordMedium", svSetupData.get("RecordStorageMedium")));
    outArgsSetup.append(HActionArgument("WriteStatus", svSetupData.get("RecordMediumWriteStatus")));
    actionSetup.setOutputArguments(outArgsSetup);
    retVal.insert(actionSetup);
    //

    // GetMediaInfo_Ext
    actionSetup = HActionSetup("GetMediaInfo_Ext", 2);
    actionSetup.setInputArguments(inArgsSetup);
    outArgsSetup.append(HActionArgument("CurrentType", svSetupData.get("CurrentMediaCategory")));
    actionSetup.setOutputArguments(outArgsSetup);
    retVal.insert(actionSetup);
    //

    // GetTransportInfo
    outArgsSetup.clear();
    actionSetup = HActionSetup("GetTransportInfo");
    actionSetup.setInputArguments(inArgsSetup);
    outArgsSetup.append(HActionArgument("CurrentTransportState", svSetupData.get("TransportState")));
    outArgsSetup.append(HActionArgument("CurrentTransportStatus", svSetupData.get("TransportStatus")));
    outArgsSetup.append(HActionArgument("CurrentSpeed", svSetupData.get("TransportPlaySpeed")));
    actionSetup.setOutputArguments(outArgsSetup);
    retVal.insert(actionSetup);

    // GetPositionInfo
    outArgsSetup.clear();
    actionSetup = HActionSetup("GetPositionInfo");
    actionSetup.setInputArguments(inArgsSetup);
    outArgsSetup.append(HActionArgument("Track", svSetupData.get("CurrentTrack")));
    outArgsSetup.append(HActionArgument("TrackDuration", svSetupData.get("CurrentTrackDuration")));
    outArgsSetup.append(HActionArgument("TrackMetaData", svSetupData.get("CurrentTrackMetaData")));
    outArgsSetup.append(HActionArgument("TrackURI", svSetupData.get("CurrentTrackURI")));
    outArgsSetup.append(HActionArgument("RelTime", svSetupData.get("RelativeTimePosition")));
    outArgsSetup.append(HActionArgument("AbsTime", svSetupData.get("AbsoluteTimePosition")));
    outArgsSetup.append(HActionArgument("RelCount", svSetupData.get("RelativeCounterPosition")));
    outArgsSetup.append(HActionArgument("AbsCount", svSetupData.get("AbsoluteCounterPosition")));
    actionSetup.setOutputArguments(outArgsSetup);
    retVal.insert(actionSetup);

    // GetDeviceCapabilities
    retVal.insert(HActionSetup("GetDeviceCapabilities"));

    // GetTransportSettings
    retVal.insert(HActionSetup("GetTransportSettings"));

    // Stop
    retVal.insert(HActionSetup("Stop"));

    // Play
    retVal.insert(HActionSetup("Play"));

    // Pause
    retVal.insert(HActionSetup("Pause", InclusionOptional));

    // Record
    retVal.insert(HActionSetup("Record", InclusionOptional));

    // Seek
    retVal.insert(HActionSetup("Seek"));

    // Next
    retVal.insert(HActionSetup("Next"));

    // Previous
    retVal.insert(HActionSetup("Previous"));

    // SetPlayMode
    retVal.insert(HActionSetup("SetPlayMode", InclusionOptional));

    // SetRecordQualityMode
    retVal.insert(HActionSetup("SetRecordQualityMode", InclusionOptional));

    // GetCurrentTransportActions
    retVal.insert(HActionSetup("GetCurrentTransportActions", InclusionOptional));

    // GetDRMState
    retVal.insert(HActionSetup("GetDRMState", 2, InclusionOptional));

    // GetStateVariables
    retVal.insert(HActionSetup("GetStateVariables", 2, InclusionOptional));

    // SetStateVariables
    retVal.insert(HActionSetup("SetStateVariables", 2, InclusionOptional));

    return retVal;
}