Пример #1
0
CGmObjShape::~CGmObjShape()
{
	LOG( "destructor: %s\n", GetName() );
	Clear();
	m_oLstLink.Clear();
	DELETE_INSTANCE( m_poEffect );
	LIST_DELETE( m_oLstParam, CParam );
}
Пример #2
0
static void req_cl(struct request_p * r)
{
	WRITE_LOCK(&ipct_rpc_udp_lock);
	del_timer(&r->timeout);
	LIST_DELETE(&request_p_list_udp, r);
	WRITE_UNLOCK(&ipct_rpc_udp_lock);
	kfree(r);
	return;
}
Пример #3
0
static void delete_request_p(unsigned long request_p_ul)
{
	struct request_p *p = (void *)request_p_ul;
	
	WRITE_LOCK(&ipct_rpc_udp_lock);
	LIST_DELETE(&request_p_list_udp, p);
	WRITE_UNLOCK(&ipct_rpc_udp_lock);
	kfree(p);
	return;
}
Пример #4
0
void CGmResMan::Clear()
{
	ARRAY_DELETE( m_oArrTex, CGTex2 );
	ARRAY_DELETE( m_oArrWav, TWav );
	ARRAY_DELETE( m_oArrASource, CASource );
	ARRAY_DELETE( m_oArrABuffer, CABuffer );
	ARRAY_DELETE( m_oArrMesh, CGMesh );
	ARRAY_DELETE( m_oArrModelMD5, CGMeshMD5::CModel );
	ARRAY_DELETE( m_oArrAnim3, CGmObjAnim3 );
	ARRAY_DELETE( m_oArrLight, CGLight );
	for( unsigned int i=0; i<m_oArrLstCurve.GetSize(); ++i )
	{
		TLstCurve * poLstCurve = m_oArrLstCurve[i];
		LIST_DELETE( ( *poLstCurve ), CCurvePathBezier3 );
	}
	m_oArrLstCurve.Clear();
	//ARRAY_DELETE( m_oArrLstCurve, TLstCurve );
	//ARRAY_DELETE( m_oArrPhysMaterial, CGmObjPhysMaterial );
	LIST_DELETE( m_oLstFileEntry, CFileEntry );
}
Пример #5
0
/* Noone stores the protocol anywhere; simply delete it. */
void ip_nat_protocol_unregister(struct ip_nat_protocol *proto)
{
	WRITE_LOCK(&ip_nat_lock);
	LIST_DELETE(&protos, proto);
	WRITE_UNLOCK(&ip_nat_lock);

	/* Someone could be still looking at the proto in a bh. */
	br_write_lock_bh(BR_NETPROTO_LOCK);
	br_write_unlock_bh(BR_NETPROTO_LOCK);

	MOD_DEC_USE_COUNT;
}
Пример #6
0
static int check_rpc_packet(const u_int32_t *data, const void *matchinfo,
			int *hotdrop, int dir, struct ip_conntrack *ct,
			int offset, struct list_head request_p_list)
{
	const struct ipt_rpc_info *rpcinfo = matchinfo;
	struct request_p *req_p;
	u_int32_t xid;


	/* Get XID */
	xid = *data;

 	/* This does sanity checking on RPC payloads,
	 * and permits only the RPC "get port" (3)
	 * in authorised procedures in client
	 * communications with the portmapper.
	 */

	data += 5;

	/* Get RPC requestor */
	if (IXDR_GET_INT32(data) != 3) {
		DEBUGP("RPC packet contains an invalid (non \"get\") requestor. [skip]\n");
		if(rpcinfo->strict == 1)
			*hotdrop = 1;
		return 0;
	}
	DEBUGP("RPC packet contains a \"get\" requestor. [cont]\n");

	data++;

	/* Jump Credentials and Verfifier */
	data = data + IXDR_GET_INT32(data) + 2;
	data = data + IXDR_GET_INT32(data) + 2;

	/* Get RPC procedure */
	if (match_rpcs((char *)&rpcinfo->c_procs,
	    rpcinfo->i_procs, IXDR_GET_INT32(data)) == 0) {
		DEBUGP("RPC packet contains illegal procedure request [%u]. [drop]\n",
			(unsigned int)IXDR_GET_INT32(data));

		/* If the RPC conntrack half entry already exists .. */

		switch (ct->tuplehash[0].tuple.dst.protonum) {
			case IPPROTO_UDP:
				WRITE_LOCK(&ipct_rpc_udp_lock);
			case IPPROTO_TCP:
				WRITE_LOCK(&ipct_rpc_tcp_lock);
		}
		req_p = LIST_FIND(&request_p_list, request_p_cmp,
				  struct request_p *, xid,
				  ct->tuplehash[dir].tuple.src.ip,
				  ct->tuplehash[dir].tuple.src.u.all);

		if (req_p) {
			DEBUGP("found req_p for xid=%u proto=%u %u.%u.%u.%u:%u\n",
				xid, ct->tuplehash[dir].tuple.dst.protonum,
				NIPQUAD(ct->tuplehash[dir].tuple.src.ip),
				ntohs(ct->tuplehash[dir].tuple.src.u.all));

			/* .. remove it */
			if (del_timer(&req_p->timeout))
				req_p->timeout.expires = 0;

       			LIST_DELETE(&request_p_list, req_p);
			DEBUGP("RPC req_p removed. [done]\n");

		} else {
			DEBUGP("no req_p found for xid=%u proto=%u %u.%u.%u.%u:%u\n",
				xid, ct->tuplehash[dir].tuple.dst.protonum,
				NIPQUAD(ct->tuplehash[dir].tuple.src.ip),
				ntohs(ct->tuplehash[dir].tuple.src.u.all));

		}
		switch (ct->tuplehash[0].tuple.dst.protonum) {
			case IPPROTO_UDP:
				WRITE_UNLOCK(&ipct_rpc_udp_lock);
			case IPPROTO_TCP:
				WRITE_UNLOCK(&ipct_rpc_tcp_lock);
		}

		if(rpcinfo->strict == 1)
			*hotdrop = 1;
		return 0;
	}
Пример #7
0
bool COrgOp::Load( CStr &roSrc, unsigned int uiIDOffset )
{
	CStr oStrLine;
	CStr oStrToken;
	CList<COp *> oLstPatch;
	unsigned int uiIDIn = 0;
	unsigned int uiIdxIn = 0;
	unsigned int uiCountIn = 0;
	unsigned int uiPortIn = 0;
	unsigned int uiIndexIn = 0;
	unsigned int uiCountOut = 0;
	unsigned int uiPortOut = 0;
	unsigned int uiInteralInt = 0;
	unsigned int uiInteralUInt = 0;
	unsigned int uiInteralFlt = 0;
	unsigned int i = 0;
	unsigned int uiMaxIPortIn = 0;
	unsigned int uiMaxIPortOut = 0;
	unsigned int uiMaxIInternalInt = 0;
	unsigned int uiMaxIInternalUInt = 0;
	unsigned int uiMaxIInternalFlt = 0;
	COp *poOp = 0;
	
	// <mod date="2010-12-07">
	CList<CArray<unsigned int> *> oLstArrID;
	CArray<unsigned int> * poArrID = 0;
	// </mod>
	
	// Alle Operatoren einlesen, erstellen und pseudo-patchen.
	while( 1 )
	{
		if( !Decode_GetNextLine( oStrLine, roSrc ) )
			break;
		i = 0;
		while( 1 )
		{
			if( !Decode_GetNextToken( oStrToken, oStrLine ) )
				break;

			if( !oStrToken.GetSize() )
			{
				if( i > 1 ) // Komprimierung :: -> :0:
					oStrToken = '0';
				else if( i == 0 )
					ORG_OP_LOG( "Fehler: Klassen-Name nicht vorhanden." );
			}

			// class
			if( i == 0 )
			{
				poOp = Create( oStrToken );
				if( poOp == 0 )
				{
					ORG_OP_LOG( "Fehler: Unbekannte Klasse: %s\n", oStrToken.GetData() );
					return false;
				}
				oLstPatch.Append( poOp );
			}
			// instance
			else if( i == 1 )
			{
#ifdef OP_USE_RUNTIME_INFO
				poOp->SetNameInstance( oStrToken );
#endif // OP_USE_RUNTIME_INFO
			}
			// id
			else if( i == 2 )
			{
				unsigned int uiID;
				ORG_OP_SSCANF( oStrToken, "%x", &uiID );
				poOp->SetID( uiID + uiIDOffset ); // Um keinen Konflikt zu erzeugen.
			}
			// flags
			else if( i == 3 )
			{
				unsigned int uiFlags;
				ORG_OP_SSCANF( oStrToken, "%x", &uiFlags );
				poOp->SetFlags( uiFlags );
			}
			// count_input
			else if ( i == 4 )
			{
				ORG_OP_SSCANF( oStrToken, "%x", &uiCountIn );
				if( poOp->GetFlags() & OP_FLAG_DYNAMIC_INPUTS )
				{
					poOp->SetCountIn( uiCountIn );
				}
				else if( poOp->GetCountIn() != uiCountIn )
				{
#ifdef OP_USE_RUNTIME_INFO
					ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d Inputs unterstuetzt! "
						     "Keine dynamischen Inputs!\n", poOp->GetNameClass(), uiCountIn );
#endif // OP_USE_RUNTIME_INFO
					return false;
				}
				uiPortIn = 0;
				uiIndexIn = 0;
				uiMaxIPortIn = 3 * uiCountIn + 4 + 1;
				
				// <mod date="2010-12-07">
				poArrID = new CArray<unsigned int>( uiCountIn );
				oLstArrID.Append( poArrID );
				// </mod>
			}
			// inputs
			else if( i < uiMaxIPortIn )
			{
				unsigned int uiVal;
				ORG_OP_SSCANF( oStrToken.GetData(), "%x", &uiVal );
				switch( uiIndexIn )
				{
				case 0: // id
					uiIDIn = uiVal;
				break;
				case 1: // port
					uiIdxIn = uiVal;
				break;
				case 2: // flags
					if( uiIDIn )
						uiIDIn += uiIDOffset; // Um keinen Konflikt zu erzeugen.
					
					// <mod date="2010-12-07">
					poArrID->At( uiPortIn ) = uiIDIn;
					poOp->In( uiPortIn ) = COp::CLink( 0, uiIdxIn, uiVal );
					//poOp->In( uiPortIn ) = COp::CLink( reinterpret_cast<COp *>( uiIDIn ), uiIdxIn, uiVal );
					// </mod>
					
					++uiPortIn;
				break;
				}
				++uiIndexIn;
				if( uiIndexIn == 3 )
					uiIndexIn = 0;
			}

			// count_output
			else if( i == uiMaxIPortIn )
			{
				ORG_OP_SSCANF( oStrToken, "%x", &uiCountOut );
				if( poOp->GetFlags() & OP_FLAG_DYNAMIC_OUTPUTS )
				{
					poOp->SetCountOut( uiCountOut );
				}
				else if( poOp->GetCountOut() != uiCountOut )
				{
#ifdef OP_USE_RUNTIME_INFO
					ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d Outputs unterstuetzt! "
						     "Keine dynamischen Outputs!\n", poOp->GetNameClass(), uiCountOut );
#endif // OP_USE_RUNTIME_INFO
					return false;
				}
				uiPortOut = 0;
				uiMaxIPortOut = uiCountOut + uiMaxIPortIn + 1;
			}
			// outputs
			else if( i < uiMaxIPortOut )
			{
				double dVal;
				ORG_OP_SSCANF( oStrToken.GetData(), "%lf", &dVal );
				poOp->Out( uiPortOut ) = dVal;
				++uiPortOut;
			}

			// int internal count
			else if( i == uiMaxIPortOut )
			{
				unsigned int uiCountInternalInt;
				ORG_OP_SSCANF( oStrToken, "%x", &uiCountInternalInt );
				if( poOp->GetCountInternalInt() != uiCountInternalInt )
				{
#ifdef OP_USE_RUNTIME_INFO
					ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d Int-Interals unterstuetzt!\n", poOp->GetNameClass(), uiCountIn );
#endif // OP_USE_RUNTIME_INFO
					return false;
				}
				uiInteralInt = 0;
				uiMaxIInternalInt = uiMaxIPortOut + uiCountInternalInt + 1;
			}
			// int internals
			else if( i < uiMaxIInternalInt )
			{
				int iVal;
				ORG_OP_SSCANF( oStrToken.GetData(), "%d", &iVal );
				poOp->SetValueInternalInt( uiInteralInt, iVal );
				++uiInteralInt;
			}
			// uint internal count
			else if( i == uiMaxIInternalInt )
			{
				unsigned int uiCountInternalUInt;
				ORG_OP_SSCANF( oStrToken, "%x", &uiCountInternalUInt );
				if( poOp->GetCountInternalUInt() != uiCountInternalUInt )
				{
#ifdef OP_USE_RUNTIME_INFO
					ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d UInt-Interals unterstuetzt!\n", poOp->GetNameClass(), uiCountIn );
#endif // OP_USE_RUNTIME_INFO
					return false;
				}
				uiInteralUInt = 0;
				uiMaxIInternalUInt = uiMaxIInternalInt + uiCountInternalUInt + 1;
			}
			// uint internals
			else if( i < uiMaxIInternalUInt )
			{
				unsigned int uiVal;
				ORG_OP_SSCANF( oStrToken.GetData(), "%u", &uiVal );
				poOp->SetValueInternalUInt( uiInteralUInt, uiVal );
				++uiInteralUInt;
			}
			// flt internal count
			else if( i == uiMaxIInternalUInt )
			{
				unsigned int uiCountInternalFlt;
				ORG_OP_SSCANF( oStrToken, "%x", &uiCountInternalFlt );
				if( poOp->GetCountInternalFlt() != uiCountInternalFlt )
				{
#ifdef OP_USE_RUNTIME_INFO
					ORG_OP_LOG( "Fehler: Von Klasse %s werden nicht %d Float-Interals unterstuetzt!\n", poOp->GetNameClass(), uiCountIn );
#endif // OP_USE_RUNTIME_INFO
					return false;
				}
				uiInteralFlt = 0;
				uiMaxIInternalFlt = uiMaxIInternalUInt + uiCountInternalFlt + 1;
			}
			// flt internals
			else if( i < uiMaxIInternalFlt )
			{
				double dVal;
				ORG_OP_SSCANF( oStrToken.GetData(), "%lf", &dVal );
				poOp->SetValueInternalFlt( uiInteralFlt, dVal );
				++uiInteralFlt;
			}
			else
				break;
			++i;
		}
	}

	// Pseudo-Patch nun mit echten Verbindungen versehen.
	i = oLstPatch.GetSize();
	/*
	if( i < 2 )
	{
		ORG_OP_LOG( "Fehler: Weniger als 2 Operatoren eingelesen!\n" );
		return false;
	}
	*/

	// Altes Patch löschen.
	//Clear();
	//m_poOpRootL_ = 0;
	//m_poOpRootR_ = 0;
	
	
	// <mod date="2010-12-07">
	oLstArrID.MoveToBack();
	// </mod>
	
	while( i )
	{
		--i;
		poOp = oLstPatch[i];
		
		// <mod date="2010-12-07">
		oLstArrID.GetPrev( &poArrID );
		// </mod>
		
		if( poOp )
		{
			unsigned int uiIn = poOp->GetCountIn();
			while( uiIn )
			{
				--uiIn;
				
				// <mod date="2010-12-07">
				const unsigned int uiTmpIDNext = poArrID->At( uiIn );
				//unsigned int uiTmpIDNext =
				//	reinterpret_cast<unsigned int>( poOp->In( uiIn ).GetOp() );
				// </mod>
				
				if( !uiTmpIDNext ) // ID 0 ist ungültig.
					continue;

				// Ganze Liste durchiterieren, und nach der ID aus dem aktuellen
				// Input-Array Ausschau halten!
				COp *poOpNext;
				oLstPatch.MoveToFront();
				while( oLstPatch.GetNext( &poOpNext ) )
				{
					if( poOpNext->GetID() == uiTmpIDNext )
					{
						poOp->In( uiIn ).SetOp( poOpNext );
					}
				}
			}
		}

		//if( i == 0 )
		//	m_poOpRootL_ = poOp;
		//else if ( i == 1 )
		//	m_poOpRootR_ = poOp;
	}
	
	// <mod date="2010-12-07">
	LIST_DELETE( oLstArrID, CArray<unsigned int> );
	// </mod>
	
	// Alle aufglösten Operatoren in die echte Liste einfügen...
	oLstPatch.MoveToFront();
	while( oLstPatch.GetNext( &poOp ) )
	{
#ifdef OP_USE_USER_DATA
		poOp->m_pvData = 0;
#endif // OP_USE_USER_DATA
		m_oLstOp.Append( poOp );
	}

	//UpdateAll();
	ValidateAll();
	return true;
}
Пример #8
0
void CGmObjShape::ClearJoints()
{
	LIST_DELETE( m_oLstJoint, CGmObjPhysJoint );
}