+tARP_Cache *ARP_int_CreateCache(unsigned int NumCacheEntries, size_t AddrSize)
+{
+ size_t len = sizeof(tARP_Cache) + NumCacheEntries * (sizeof(tARP_CacheEnt) + AddrSize);
+ tARP_Cache *ret = calloc(len, 1);
+
+ ret->nCacheEnts = NumCacheEntries;
+ ret->AddrSize = AddrSize;
+
+ char *addr_storage_pos = (void*)&ret->Cache[NumCacheEntries];
+
+ for( int i = 0; i < NumCacheEntries; i ++ )
+ {
+ ret->Cache[i].Layer3Addr = addr_storage_pos;
+ addr_storage_pos += AddrSize;
+ }
+
+ return ret;
+}