#include "stdio.h"
#include "c:/ixp1200/include/uclo.h"
#include "c:/ixp1200/include/libd.h"
#include "c:/ixp1200/include/hal_sram.h"


int
policy_add(int entry_no, int srcip)
{
//	#define RESERVATION_TABLE_BASE				0x8000
//	#define TABLE_RECORD_LEN					0x7
//	#define TABLE_COUNT_LOCATION				0x8FFF

	int i;
	int sram_addr = 0x4000;
	static SramUnit*sram = SRAM_Attach();
	sram->write(sram_addr, entry_no);
	sram->write(sram_addr+1, srcip);


	return(1);
}


int 
sad_add(int  entry_no, int dest_ip, int spi, int tunnel_ip, int seq_no, int sa_key )
{
//	- add an entry into the table
	int i;
	int sram_addr = 0x8000;
	static SramUnit*sram = SRAM_Attach();
	sram->write(sram_addr, entry_no);
	sram->write(sram_addr+1, dest_ip);
	sram->write(sram_addr+2, spi);
	sram->write(sram_addr+3, tunnel_ip);
	sram->write(sram_addr+4, seq_no);
	sram->write(sram_addr+5, sa_key);
	return(1);
}

