#include	"trust.h"
#include	"repeater.h"
#include	"shm.h"


void	insEntry (void)
{
	int	n;
	int	ret;
	socklen_t addrlen;
	struct	shm_form	Entry;

	addrlen = sizeof(struct sockaddr_in); 
	ret = recvfrom(TrustDB_in, &Entry, sizeof(struct shm_form), 0, (struct sockaddr *)&db_in, &addrlen);
	if (ret > 0)
	{
		for (n = 0 ; n < MAX_SHM ; n++)
		{
			if (shm_msg->shmem[n].mem.type == NoEntry)
			{
				memcpy (&shm_msg->shmem[n], &Entry, sizeof(struct shm_form));
                		gettimeofday (&shm_msg->shmem[n].e_time, NULL);
				break;
			}
		}
	}
}

