Subversion Repositories programming

Rev

Rev 222 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
221 ira 1
/*******************************************************************************
2
 * File: DHCPTable.java
3
 * Author: Ira W. Snyder (devel@irasnyder.com)
4
 * License: GNU General Public License v2
5
 * Class: CS380 - Computer Networking
6
 *
7
 * Assignment: Project #3
8
 * Date Last Modified: 2006-02-15
9
 *
10
 * Purpose: //FIXME
11
 ******************************************************************************/
12
 
13
import java.util.Vector;
14
 
15
public class DHCPTable
16
{
17
    private int defaultVectorSize = 10;
18
    private Vector table = new Vector (defaultVectorSize);
19
    private String lowestIP = "134.71.24.1";
20
    private String highestIP = "134.71.24.100";
21
    private String lowestFreeIP = lowestIP;
22
 
23
    public DHCPTable () {}
24
 
25
    private String getFirstFreeIPAddr ()
26
    {
27
        int i = 0;
28
 
29
        for (i=0; i<table.size(); i++)
30
 
31
    }
32
 
33
    /**
34
     * Method: compareIPAddr()
35
     * Purpose: Compare two IP Addresses, and figure out which is greater.
36
     * Return Values: 0 - Equal Addresses
37
     *                1 - IP #1 is greater
38
     *                2 - IP #2 is greater
39
     */
40
    public int compareIPAddr (String ip1, String ip2)
41
    {
42
 
43
 
44
    public DHCPTableEntry addEntry (String HWAddr)
45
    {
46
        String freeIPAddr = lowestIP;
47
        DHCPTableEntry te;
48
 
49
        for (Enumeration e = table.elements(); e.hasMoreElements(); )
50
        {
51
            te = e.nextElement();
52
 
53
            if (te.getIPAddr() < 
54
 
55
        }
56
 
57
 
58
        DHCPTableEntry dte = new DHCPTableEntry (HWAddr, );
59
        table.addEntry (dte);
60
 
61
        return dte;
62
    }
63
}
64