src/Cedar/VLanWin32.c
// Write the next received packet to the driver

Write the next received packet to the driver
Write the next received packet to the driver
bool VLanPutPacket(VLAN *v, void *buf, UINT size)
{
	if (v == NULL)
	{
		return false;
	}
	if (v->Halt)
	{
		return false;
	}
	if (size > MAX_PACKET_SIZE)
	{
		return false;
	}
	if ((NEO_NUM_PACKET(v->PutBuffer) >= NEO_MAX_PACKET_EXCHANGE) ||
		(buf == NULL && NEO_NUM_PACKET(v->PutBuffer) != 0))
	{
#ifdef	USE_PROBE
		{
			char tmp[MAX_SIZE];
			snprintf(tmp, sizeof(tmp), "VLanPutPacket: NEO_NUM_PACKET(v->PutBuffer) = %u", NEO_NUM_PACKET(v->PutBuffer));
			PROBE_DATA2(tmp, NULL, 0);
		}
#endif	
		if (VLanPutPacketsToDriver(v) == false)
		{
			return false;
		}
		NEO_NUM_PACKET(v->PutBuffer) = 0;
	}
	if (buf != NULL)
	{
		UINT i = NEO_NUM_PACKET(v->PutBuffer);
		NEO_NUM_PACKET(v->PutBuffer)++;
		NEO_SIZE_OF_PACKET(v->PutBuffer, i) = size;
		Copy(NEO_ADDR_OF_PACKET(v->PutBuffer, i), buf, size);
		Free(buf);
	}
	return true;
}
bool VLanPutPacket ( VLAN * v , void * buf , UINT size ) { if ( v == NULL ) { return false ; } if ( v -> Halt ) { return false ; } if ( size > MAX_PACKET_SIZE ) { return false ; } if ( ( NEO_NUM_PACKET ( v -> PutBuffer ) >= NEO_MAX_PACKET_EXCHANGE ) || ( buf == NULL && NEO_NUM_PACKET ( v -> PutBuffer ) != 0 ) ) { #ifdef USE_PROBE { char tmp [ MAX_SIZE ] ; snprintf ( tmp , sizeof ( tmp ) , " " , NEO_NUM_PACKET ( v -> PutBuffer ) ) ; PROBE_DATA2 ( tmp , NULL , 0 ) ; } #endif if ( VLanPutPacketsToDriver ( v ) == false ) { return false ; } NEO_NUM_PACKET ( v -> PutBuffer ) = 0 ; } if ( buf != NULL ) { UINT i = NEO_NUM_PACKET ( v -> PutBuffer ) ; NEO_NUM_PACKET ( v -> PutBuffer ) ++ ; NEO_SIZE_OF_PACKET ( v -> PutBuffer , i ) = size ; Copy ( NEO_ADDR_OF_PACKET ( v -> PutBuffer , i ) , buf , size ) ; Free ( buf ) ; } return true ; }
Write the next received packet to the driver
Write the next received packet to the driver
// Validate arguments
 // First, examine whether the current buffer is full
 // USE_PROBE
 // Write a packet to the driver
 // Add the next packet to the buffer
