typedef struct { MacAddr destination; // Mac address of some target int ifnumber; // which interface/port to reach it u_short TTL; // how old is this information } void updateTable(MacAddr src, int inif) { BridgeEntry *b; if (mapResolve(bridgeMap, &src, (void**)&b) == FALSE) { // this address is not in the table if (numEntries < BRIDGE_TAB_SIZE) { // add to the table ... ... numEntries++; } else { // no room. give up! return; } } // reset TTL and use most recently discovered input // interface b->TTL = MAX_TTL; // refresh b->ifnumber = inif; } int getOutputInterface(MacAddr dest) { BridgeEntry b; if (mapResolve(bridgeMap, &dest, (void**)&b) == FALSE) return -1; else return b->ifnumber; }