26 #include <spp_alloc.h> 27 #include <spp_byteorder.h> 29 #include <spp_cache.h> 30 #include <spp_interface.h> 32 #include <spp_client_api.h> 35 #include <spp_plugin.h> 66 "\nVA_ADD_NEW: Bucket %d fnd Existng entry [%d, %d] -> [%d, %d]\n",
67 bucket_index, entry_p->src_port,
68 entry_p->dst_port, key->
e.src_port, key->
e.dst_port)
71 entry_p->src_port = key->
e.src_port;
72 entry_p->dst_port = key->
e.dst_port;
76 va_bucket[bucket_index].new_entry_counter)
81 head =
va_bucket[bucket_index].head_entry;
82 next =
va_bucket[bucket_index].next_available_entry;
85 "\nVA_ADD_NEW: Filling bucket %d, index %d with key 0x%llx %x\n",
86 bucket_index, next, key->
k.key64, key->
k.key32)
88 va_bucket[bucket_index].va_entry[next] = key->
e;
98 va_bucket[bucket_index].new_entry_counter++;
101 "VA_ADD_NEW: NEW bucket %d, entry %d counter %d\n",
102 bucket_index, next,
va_bucket[bucket_index].new_entry_counter)
122 index = bucket->head_entry;
123 next = bucket->next_available_entry;
127 "\nVA_DB_LOOKUP: bucket index %d head %d next %d\n",
128 bucket_index, index, next)
131 while( index != next) {
135 entry_p = &bucket->va_entry[index];
158 entry_p->src_ip, entry_p->src_port,
159 entry_p->dst_ip, entry_p->dst_port)
161 entry_p->vrf, entry_p->ip_id)
180 index = bucket->head_entry;
181 next = bucket->next_available_entry;
184 "\nVA_DB_DELETE_ENTRY: bucket index %d head %d next %d\n",
185 bucket_index, index, next);
188 while( index != next) {
193 memset(&bucket->va_entry[index], 0,
sizeof(
va_entry_t));
216 printf(
"no bucket in use\n");
220 printf(
"index head next counter (%d bucket in use)\n", sum);
226 printf(
" %04d %04d %04d %d\n", i,
265 if (argc == 0 )
return;
267 index = (
u32) argv[0];
sll srl srl sll sra u16x4 i
va_entry_t * va_db_lookup(u32 bucket_index, va_lookup_key *key)
#define FRAG_DEBUG_PRINTF3(a, b, c)
#define FRAG_DEBUG_PRINTF1(a)
#define FRAG_DEBUG_PRINTF5(a, b, c, d, e)
int va_db_delete_entry(u32 bucket_index, va_lookup_key *key)
void va_db_add_new_entry(u32 bucket_index, va_lookup_key *key)
void hex_dump(u8 *p, int len)
#define VA_ENTRY_PER_BUCKET
struct _va_entry va_entry_t
#define FRAG_DEBUG_PRINTF6(a, b, c, d, e, f)
struct _va_bucket_t va_bucket_t
void cnat_va_bucket_used(int argc, unsigned long *argv)
void cnat_va_dump(int argc, unsigned long *argv)
#define FRAG_DEBUG_PRINTF4(a, b, c, d)
va_bucket_t va_bucket[VA_BUCKETS]