Rev 222 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/******************************************************************************** File: DHCPTable.java* Author: Ira W. Snyder (devel@irasnyder.com)* License: GNU General Public License v2* Class: CS380 - Computer Networking** Assignment: Project #3* Date Last Modified: 2006-02-15** Purpose: //FIXME******************************************************************************/import java.util.Vector;public class DHCPTable{private int defaultVectorSize = 10;private Vector table = new Vector (defaultVectorSize);private String lowestIP = "134.71.24.1";private String highestIP = "134.71.24.100";private String lowestFreeIP = lowestIP;public DHCPTable () {}private String getFirstFreeIPAddr (){int i = 0;for (i=0; i<table.size(); i++)}/*** Method: compareIPAddr()* Purpose: Compare two IP Addresses, and figure out which is greater.* Return Values: 0 - Equal Addresses* 1 - IP #1 is greater* 2 - IP #2 is greater*/public int compareIPAddr (String ip1, String ip2){public DHCPTableEntry addEntry (String HWAddr){String freeIPAddr = lowestIP;DHCPTableEntry te;for (Enumeration e = table.elements(); e.hasMoreElements(); ){te = e.nextElement();if (te.getIPAddr() <}DHCPTableEntry dte = new DHCPTableEntry (HWAddr, );table.addEntry (dte);return dte;}}