/**
 * File:	include/dhcp-server/misc.ycp
 * Package:	Configuration of DHCP server
 * Summary:	Misc. functions
 * Authors:	Jiri Srain <jsrain@suse.cz>
 *
 * $Id: misc.ycp 20635 2005-01-03 16:41:20Z jsrain $
 */

{

textdomain "dhcp-server";

import "Label";
import "Popup";
import "DhcpServer";

boolean UpdateSubnetDeclaration (string old_iface, string new_iface) {
    map old = DhcpServer::GetInterfaceInformation (old_iface);
y2error ("Old: %1", old);
    map new = DhcpServer::GetInterfaceInformation (new_iface);
y2error ("New: %1", new);
    string old_id = old["network"]:"" + " netmask " + old["netmask"]:"";
    string new_id = new["network"]:"" + " netmask " + new["netmask"]:"";
y2error ("Old: %1", old_id);
y2error ("New: %1", new_id);
    if (! DhcpServer::ExistsEntry ("subnet", old_id))
	return true;
    return DhcpServer::ChangeEntry ("subnet", old_id, "subnet", new_id);
}

/* EOF */
}
