Changeset 13645


Ignore:
Timestamp:
01/17/10 16:13:37 (3 years ago)
Author:
BrainSlayer
Message:

allow lease time setting for static entries

Location:
src/router
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/router/httpd/validate/validators.c

    r13553 r13645  
    22302230        char lease_hostname[32] = "leasexxx_hostname"; 
    22312231        char lease_ip[32] = "leasexxx_ip"; 
     2232        char lease_time[32] = "leasexxx_time"; 
    22322233        char *sln = nvram_safe_get("static_leasenum"); 
    22332234        char *hwaddr; 
     
    22652266                snprintf(lease_ip, 31, "lease%d_ip", i); 
    22662267                char *ip = websGetVar(wp, lease_ip, ""); 
     2268 
     2269                snprintf(lease_time, 31, "lease%d_time", i); 
     2270                char *time = websGetVar(wp, lease_time, ""); 
    22672271 
    22682272                if (hostname == NULL || strlen(hostname) == 0 || ip == NULL 
     
    22732277                strcat(leases, "="); 
    22742278                strcat(leases, ip); 
     2279                strcat(leases, "="); 
     2280                strcat(leases, time); 
    22752281                strcat(leases, " "); 
    22762282        } 
  • src/router/httpd/visuals/dd-wrt.c

    r13636 r13645  
    10081008                          "<td><input name=\"lease%d_hostname\" value=\"%s\" size=\"24\" maxlength=\"24\" onblur=\"valid_name(this,share.hostname,SPACE_NO)\" /></td>", 
    10091009                          i, sep != NULL ? sep : ""); 
     1010                sep = strsep(&leases, "="); 
     1011                websWrite(wp, 
     1012                          "<td><input name=\"lease%d_ip\" value=\"%s\" size=\"15\" maxlength=\"15\" class=\"num\" onblur=\"valid_name(this,share.ip,SPACE_NO)\" /></td></tr>\n", 
     1013                          i, sep != NULL ? sep : ""); 
    10101014                sep = strsep(&leases, " "); 
    10111015                websWrite(wp, 
    1012                           "<td><input name=\"lease%d_ip\" value=\"%s\" size=\"15\" maxlength=\"15\" class=\"num\" onblur=\"valid_name(this,share.ip,SPACE_NO)\" /></td></tr>\n", 
     1016                          "<td><input name=\"lease%d_time\" value=\"%s\" size=\"15\" maxlength=\"15\" class=\"num\" onblur=\"valid_name(this,share.time,SPACE_NO)\" /></td></tr>\n", 
    10131017                          i, sep != NULL ? sep : ""); 
    10141018        } 
  • src/router/services/services/dnsmasq.c

    r13601 r13645  
    383383                                char *mac = strsep(&leasebuf, "="); 
    384384                                char *host = strsep(&leasebuf, "="); 
    385                                 char *ip = strsep(&leasebuf, " "); 
     385                                char *ip = strsep(&leasebuf, "="); 
     386                                char *time = strsep(&leasebuf, " "); 
    386387 
    387388                                if (mac == NULL || host == NULL || ip == NULL) 
    388389                                        continue; 
    389  
     390                                if (!time||strlen(time)==0) 
    390391                                fprintf(fp, "dhcp-host=%s,%s,%s,infinite\n", 
    391392                                        mac, host, ip); 
     393                                else 
     394                                fprintf(fp, "dhcp-host=%s,%s,%s,%sm\n", 
     395                                        mac, host, ip); 
     396                                 
    392397                                addHost(host, ip); 
    393398                        } 
  • src/router/services/services/udhcpd.c

    r12477 r13645  
    333333                        char *mac = strsep(&leasebuf, "="); 
    334334                        char *host = strsep(&leasebuf, "="); 
    335                         char *ip = strsep(&leasebuf, " "); 
     335                        char *ip = strsep(&leasebuf, "="); 
     336                        char *time = strsep(&leasebuf, " "); 
    336337 
    337338                        if (mac == NULL || host == NULL || ip == NULL) 
  • src/router/udhcpd/config/dhcpd.webservices

    r10860 r13645  
    5858                        <th width="34%"><% tran("share.hostname"); %></th> 
    5959                        <th width="33%"><% tran("share.ip"); %></th> 
     60                        <th width="33%"><% tran("idx.dhcp_lease"); %></th> 
    6061                </tr> 
    6162                        <% show_staticleases(); %> 
Note: See TracChangeset for help on using the changeset viewer.