#include <flowstruct.h>
Collaboration diagram for ARSTable:

Definition at line 78 of file flowstruct.h.
Public Member Functions | |
| ARSTable (int size_=ARS_TABLE_SIZE) | |
| int | findAndClear (int uid, u_int16_t fid) |
| void | insert (int uid, u_int16_t fid, int hopsEarly) |
| ~ARSTable () | |
Private Attributes | |
| int | size |
| ARSTabEnt * | table |
| int | victim |
|
|
Definition at line 261 of file flowstruct.cc. References size, table, and victim. 00261 { 00262 size = size_; 00263 victim = 0; 00264 table = new ARSTabEnt[size_]; 00265 bzero(table, sizeof(ARSTabEnt)*size_); 00266 }
|
|
|
Definition at line 268 of file flowstruct.cc. References table. 00268 { 00269 delete table; 00270 }
|
|
||||||||||||
|
Definition at line 290 of file flowstruct.cc. References ARSTabEnt::hopsEarly, size, and table. 00290 { 00291 int i, retval; 00292 00293 for (i=0; i<size; i++) { 00294 if (table[i].hopsEarly && table[i].uid == uid) { 00295 if (table[i].fid == fid) { 00296 retval = table[i].hopsEarly; 00297 table[i].hopsEarly = 0; 00298 return retval; 00299 } else { 00300 table[i].hopsEarly = 0; 00301 return 0; 00302 } 00303 } 00304 } 00305 00306 return 0; 00307 }
|
|
||||||||||||||||
|
Definition at line 272 of file flowstruct.cc. References ARSTabEnt::fid, ARSTabEnt::hopsEarly, size, table, ARSTabEnt::uid, and victim. 00272 { 00273 int i = victim; 00274 assert(hopsEarly); 00275 00276 do { 00277 if (!table[i].hopsEarly) 00278 break; // we found a victim 00279 i = (i+1)%size; 00280 } while (i != victim); 00281 00282 if (table[i].hopsEarly) // full. need extreme measures. 00283 victim = (victim+1)%size; 00284 00285 table[i].hopsEarly = hopsEarly; 00286 table[i].uid = uid; 00287 table[i].fid = fid; 00288 }
|
|
|
Definition at line 88 of file flowstruct.h. Referenced by ARSTable(), findAndClear(), and insert(). |
|
|
Definition at line 86 of file flowstruct.h. Referenced by ARSTable(), findAndClear(), insert(), and ~ARSTable(). |
|
|
Definition at line 87 of file flowstruct.h. Referenced by ARSTable(), and insert(). |
1.4.6