/** * This method processes cells that are received from the nic * * @param cell the cell that was received * @param nic the nic the cell was received on * @since 1.0 */ public void receiveCell(ATMCell cell, ATMNIC nic) { if (cell.getIsOAM()) { String data = cell.getData(); if (data.startsWith("callpro")) { this.receivedCallProceeding(cell); } else if (data.startsWith("conn")) { this.receivedConnect(cell); int vcNum = this.getIntFromEndOfString(data); this.vcNumber = vcNum; System.out.println("The connection is setup on VC " + this.vcNumber); // send connect ack ATMCell callackCell = new ATMCell(0, "callack", this.getTraceID()); callackCell.setIsOAM(true); nic.sendCell(callackCell, this); this.sentConnectAck(callackCell); } else if (data.startsWith("endack")) { this.receivedEndAck(cell); } else if (data.startsWith("wait")) { this.receivedWait(cell); // send setup again int destAddr = this.getIntFromEndOfString(data); ATMCell setupCell = new ATMCell(0, "setup " + destAddr, this.getTraceID()); setupCell.setIsOAM(true); nic.sendCell(setupCell, this); this.sentSetup(setupCell); } } else { } }