/**
 * File:	clients/lan.ycp
 * Package:	Network configuration
 * Summary:	Network cards main file
 * Authors:	Michal Svec <msvec@suse.cz>
 *
 * $Id: lan.ycp 21341 2005-02-07 16:15:59Z mvidner $
 *
 * Main file for network card configuration.
 * Uses all other files.
 */

{

/***
 * <h3>Network configuration</h3>
 */

textdomain "network";

/* The main () */
y2milestone("----------------------------------------");
y2milestone("Lan module started");

import "CommandLine";
import "Label";
import "Lan";
import "RichText";

include "network/lan/cmdline.ycp";
include "network/lan/wizards.ycp";

// return LanSequence();

/**
 * Command line definition
 */
map cmdline = $[
    /* Commandline help title */
    "help"	: _("Network Card Configuration"),
    "id"	: "lan",
    "guihandler": LanSequence,
    "initialize": Lan::Read,
    "finish"	: Lan::Write,
    "actions"	: $[
	"list" : $[
	    /* Commandline command help */
	    "help"	: _("Display configuration summary"),
	    "example"	: "lan list configured",
	    "handler"	: ListHandler,
	],
	"add" : $[
	    /* Commandline command help */
	    "help"	: _("Add a network card"),
	    "handler"	: AddHandler,
	],
	"delete" : $[
	    /* Commandline command help */
	    "help"	: _("Delete a network card"),
	    "handler"	: DeleteHandler,
	]
    ],
    "options" : $[
	"propose" : $[
	    /* Commandline option help */
	    "help"	: _("Propose a configuration"),
	    "example"	: "lan add propose",
	    "type"	: ""
	],
	"configured" : $[
	    /* Commandline option help */
	    "help"	: _("List only configured cards")
	],
	"unconfigured" : $[
	    /* Commandline option help */
	    "help"	: _("List only unconfigured cards")
	],
	"device" : $[
	    /* Commandline option help */
	    "help"	: _("Device identifier"),
	    "type"	: "string",
	    "example"	: "lan add device=eth0"
	],
	"bootproto" : $[
	    /* Commandline option help */
	    "help": _("Device boot protocol"),
	    "type": "string"
	],
	"ipaddr" : $[
	    /* Commandline option help */
	    "help": _("Device IP address"),
	    "type": "ip"
	],
	"netmask" : $[
	    /* Commandline option help */
	    "help": _("Network mask"),
	    "type": "netmask"
	],
    ],
    "mappings" : $[
	"list"	: [ "configured", "unconfigured" ],
	"add"	: [ "device", "bootproto", "ipaddr", "netmask" ],
	"delete": [ "device" ],
    ]
];

any ret = CommandLine::Run(cmdline);
y2debug("ret=%1", ret);

/* Finish */
y2milestone("Lan module finished");
y2milestone("----------------------------------------");

/* EOF */
}
