Browse Source

Rework state machine so that we can goback via "goback" buttons.

r5876
master
Alastair McKinstry 19 years ago
parent
commit
8d42c43b70
  1. 2
      debian/changelog
  2. 150
      netcfg-dhcp.c
  3. 209
      netcfg-static.c
  4. 177
      netcfg.c
  5. 10
      netcfg.h

2
debian/changelog

@ -9,6 +9,8 @@ netcfg (0.30) UNRELEASED; urgency=low
"netcfg/internal-eth" instead of (e.g.) "netcfg/internal-eth0".
- Make multiple network cards work properly, by stripping off the
trailing ", " from the choices list sent to cdebconf.
* Alastair McKinstry
- Enable <goback> button to work. Closes: #212771.
-- Bart Cornelis <cobaco@linux.be> Sat, 8 Nov 2003 03:43:54 +0100

150
netcfg-dhcp.c

@ -34,9 +34,6 @@
#include <debian-installer.h>
#include "netcfg.h"
static char *interface = NULL;
static char *hostname = NULL;
static char *domain = NULL;
static u_int32_t ipaddress = 0;
static u_int32_t nameserver_array[4] = { 0 };
static struct debconfclient *client;
@ -44,42 +41,32 @@ enum {
PUMP,
DHCLIENT,
UDHCPC
} dhcp_client_choices;
} dhcp_client = PUMP;
int dhcp_client = PUMP;
static char *dhcp_hostname = NULL;
static char *none;
static char *my_debconf_input(char *priority, char *template)
static int netcfg_get_dhcp_hostname(struct debconfclient *client, char **dhcp_hostname)
{
debconf_fset(client, template, "seen", "false");
debconf_input(client, priority, template);
debconf_go(client);
debconf_get(client, template);
return client->value;
}
static void netcfg_get_dhcp()
{
if (dhcp_hostname) {
free(dhcp_hostname);
dhcp_hostname = NULL;
}
int ret;
debconf_input(client, "low", "netcfg/dhcp_hostname");
debconf_go(client);
ret = debconf_go(client);
if (ret == 30)
return ret;
if (*dhcp_hostname) {
free(*dhcp_hostname);
*dhcp_hostname = NULL;
}
debconf_get(client, "netcfg/dhcp_hostname");
if (strcmp (client->value, "") != 0)
dhcp_hostname = strdup(client->value);
debconf_subst(client, "netcfg/confirm_dhcp", "dhcp_hostname",
(dhcp_hostname ? dhcp_hostname : none));
*dhcp_hostname = strdup(client->value);
return 0;
}
static void netcfg_write_dhcp()
static void netcfg_write_dhcp(char *interface, char *dhcp_hostname)
{
FILE *fp;
@ -96,11 +83,12 @@ static void netcfg_write_dhcp()
}
static void netcfg_activate_dhcp()
static void netcfg_activate_dhcp(struct debconfclient *client,
char *interface, char *dhcp_hostname)
{
char buf[128];
di_execlog("/sbin/ifconfig lo 127.0.0.1");
di_execlog("/sbin/modprobe af_packet");
di_exec_shell_log("/sbin/ifconfig lo 127.0.0.1");
di_exec_shell_log("/sbin/modprobe af_packet");
switch (dhcp_client) {
case PUMP:
@ -123,18 +111,52 @@ static void netcfg_activate_dhcp()
break;
}
if (di_execlog(buf))
if (di_exec_shell_log(buf))
netcfg_die(client);
}
/*
* Ask a question to confirm all of these settings.
* @return 0 if OK, 30 if we backup.
*/
int netcfg_get_confirm (struct debconfclient *client,
char *interface, char *hostname,
char *domain, char *dhcp_hostname)
{
char *ptr;
int finished = 0;
char *nameservers = NULL;
debconf_subst(client, "netcfg/confirm_dhcp", "interface", interface);
debconf_subst(client, "netcfg/confirm_dhcp", "hostname", hostname);
debconf_subst(client, "netcfg/confirm_dhcp", "domain",
(domain ? domain : none));
netcfg_nameservers_to_array(nameservers, nameserver_array);
debconf_subst(client, "netcfg/confirm_dhcp", "nameservers",
(nameservers ? nameservers : none));
netcfg_get_dhcp_hostname(client, &dhcp_hostname);
debconf_capb(client); // turn off backup, just ask yes/no
my_debconf_input(client, "medium", "netcfg/confirm_dhcp", &ptr);
if (strstr (ptr, "true"))
finished = 1;
debconf_capb(client, "backup");
return (finished ? 0 : 30);
}
int main(int argc, char *argv[])
{
char *ptr;
char *nameservers = NULL;
int finished = 0;
struct stat buf;
client = debconfclient_new();
// client->command(client, "SETTITLE", "netcfg/dhcp-title", NULL);
int num_interfaces;
char *interface = NULL, *hostname = NULL,*domain = NULL, *dhcp_hostname = NULL;
enum { BACKUP, GET_INTERFACE, GET_HOSTNAME, GET_DHCP_HOSTNAME,
GET_CONFIRM, QUIT } state = GET_INTERFACE;
client = debconfclient_new();
debconf_capb(client,"backup");
debconf_metaget(client, "netcfg/internal-none", "description");
none = client->value ? strdup(client->value) : strdup("<none>");
@ -151,41 +173,43 @@ int main(int argc, char *argv[])
exit(1);
}
do {
netcfg_get_interface(client, &interface);
netcfg_get_hostname(client, &hostname);
debconf_subst(client, "netcfg/confirm_dhcp", "interface", interface);
debconf_subst(client, "netcfg/confirm_dhcp", "hostname", hostname);
debconf_subst(client, "netcfg/confirm_dhcp", "domain",
(domain ? domain : none));
netcfg_nameservers_to_array(nameservers, nameserver_array);
debconf_subst(client, "netcfg/confirm_dhcp", "nameservers",
(nameservers ? nameservers : none));
netcfg_get_dhcp();
ptr = my_debconf_input("medium", "netcfg/confirm_dhcp");
if (strstr(ptr, "true"))
finished = 1;
}
while (!finished);
while (state != QUIT) {
switch (state) {
case BACKUP:
exit (10); // Back the whole way out
break;
case GET_INTERFACE:
state = netcfg_get_interface(client, &interface, &num_interfaces) ?
BACKUP : GET_HOSTNAME;
break;
case GET_HOSTNAME:
if (netcfg_get_hostname(client, &hostname))
// if num_interfaces ==1 , interface question won't be asked. Go further back
state = (num_interfaces == 1) ? BACKUP : GET_INTERFACE;
else
state = GET_DHCP_HOSTNAME;
break;
case GET_DHCP_HOSTNAME:
state = netcfg_get_dhcp_hostname(client, &dhcp_hostname) ?
GET_HOSTNAME : GET_CONFIRM;
break;
case GET_CONFIRM:
state = netcfg_get_confirm(client, interface,
hostname, domain, dhcp_hostname) ?
GET_INTERFACE : QUIT;
case QUIT:
break;
}
}
netcfg_write_common("40netcfg-dhcp", ipaddress, domain, hostname,
nameserver_array);
netcfg_write_dhcp();
netcfg_write_dhcp(interface, dhcp_hostname);
debconf_progress_start(client, 0, 1, "netcfg/dhcp_progress");
netcfg_progress_displayed = 1;
debconf_progress_info(client, "netcfg/dhcp_progress_note");
my_debconf_input("medium", "netcfg/do_dhcp");
netcfg_activate_dhcp();
my_debconf_input(client, "medium", "netcfg/do_dhcp", &ptr);
netcfg_activate_dhcp(client, interface, dhcp_hostname);
debconf_progress_step(client, 1);
debconf_progress_stop(client);
netcfg_progress_displayed = 0;

209
netcfg-static.c

@ -46,57 +46,89 @@ static u_int32_t pointopoint = 0;
static struct debconfclient *client;
static char *none;
static char *my_debconf_input(char *priority, char *template)
{
debconf_fset(client, template, "seen", "false");
debconf_input(client, priority, template);
debconf_go(client);
debconf_get(client, template);
return client->value;
}
static void netcfg_get_static()
static int netcfg_get_static()
{
char *ptr;
int ret = 0;
enum { STATE_QUIT, STATE_GET_IPADDR, STATE_GET_POINTTOPOINT, STATE_GET_NETMASK,
STATE_GET_GATEWAY, STATE_GATEWAY_UNREACHABLE } state = STATE_GET_IPADDR;
ipaddress = network = broadcast = netmask = gateway = pointopoint =
0;
ptr = my_debconf_input("critical", "netcfg/get_ipaddress");
dot2num(&ipaddress, ptr);
debconf_subst(client, "netcfg/confirm_static", "ipaddress",
(ipaddress ? num2dot(ipaddress) : none));
if (strncmp(interface, "plip", 4) == 0
|| strncmp(interface, "slip", 4) == 0
|| strncmp(interface, "ctc", 3) == 0
|| strncmp(interface, "escon", 5) == 0
|| strncmp(interface, "iucv", 4) == 0) {
ptr = my_debconf_input("critical", "netcfg/get_pointopoint");
dot2num(&pointopoint, ptr);
dot2num(&netmask, "255.255.255.255");
network = ipaddress;
gateway = pointopoint;
} else {
ptr = my_debconf_input("critical", "netcfg/get_netmask");
dot2num(&netmask, ptr);
gateway = ipaddress & netmask;
debconf_set(client, "netcfg/get_gateway", num2dot(gateway+1));
ptr = my_debconf_input("critical", "netcfg/get_gateway");
dot2num(&gateway, ptr);
network = ipaddress & netmask;
if (gateway && ((gateway & netmask) != network)) {
debconf_input(client, "high", "netcfg/gateway_unreachable");
debconf_go(client);
}
}
/* Simple state machine to handle goback buttons */
while (state != STATE_QUIT) {
switch (state) {
case STATE_GET_IPADDR:
ret = my_debconf_input(client,"critical", "netcfg/get_ipaddress", &ptr);
if (ret == 30) {
/* back the whole way out */
return 30;
} else {
dot2num(&ipaddress, ptr);
debconf_subst(client, "netcfg/confirm_static", "ipaddress",
(ipaddress ? num2dot(ipaddress) : none));
if (strncmp(interface, "plip", 4) == 0
|| strncmp(interface, "slip", 4) == 0
|| strncmp(interface, "ctc", 3) == 0
|| strncmp(interface, "escon", 5) == 0)
state = STATE_GET_POINTTOPOINT;
else
state = STATE_GET_NETMASK;
}
break;
case STATE_GET_POINTTOPOINT:
ret = my_debconf_input(client,"critical", "netcfg/get_pointopoint", &ptr);
if (ret == 30) {
state = STATE_GET_IPADDR;
} else {
dot2num(&pointopoint, ptr);
dot2num(&netmask, "255.255.255.255");
network = ipaddress;
gateway = pointopoint;
state = STATE_QUIT;
}
break;
case STATE_GET_NETMASK:
ret = my_debconf_input(client,"critical", "netcfg/get_netmask", &ptr);
if (ret == 30) {
state = STATE_GET_IPADDR;
} else {
dot2num(&netmask, ptr);
gateway = ipaddress & netmask;
debconf_set(client, "netcfg/get_gateway", num2dot(gateway+1));
state = STATE_GET_GATEWAY;
}
break;
case STATE_GET_GATEWAY:
ret = my_debconf_input(client, "critical", "netcfg/get_gateway", &ptr);
if (ret == 30) {
state = STATE_GET_NETMASK;
} else {
dot2num(&gateway, ptr);
network = ipaddress & netmask;
if (gateway && ((gateway & netmask) != network))
state = STATE_GATEWAY_UNREACHABLE;
else
state = STATE_QUIT;
}
break;
case STATE_GATEWAY_UNREACHABLE:
debconf_input(client, "high", "netcfg/gateway_unreachable");
debconf_go(client);
state = STATE_GET_GATEWAY;
break;
case STATE_QUIT:
break;
}
}
debconf_subst(client, "netcfg/confirm_static", "netmask",
(netmask ? num2dot(netmask) : none));
@ -108,6 +140,7 @@ static void netcfg_get_static()
(pointopoint ? num2dot(pointopoint) : none));
broadcast = (network | ~netmask);
return 0;
}
@ -119,7 +152,7 @@ static int netcfg_write_static()
fprintf(fp, "localnet %s\n", num2dot(network));
fclose(fp);
di_prebaseconfig_append("40netcfg-static", "cp %s %s\n",
di_system_prebaseconfig_append("40netcfg-static", "cp %s %s\n",
NETWORKS_FILE,
"/target" NETWORKS_FILE);
} else
@ -156,8 +189,8 @@ static int netcfg_activate_static()
char buf[256];
#ifdef __GNU__
/* I had to do something like this ? */
/* di_execlog ("settrans /servers/socket/2 -fg"); */
di_execlog("settrans /servers/socket/2 --goaway");
/* di_exec_shell_log ("settrans /servers/socket/2 -fg"); */
di_exec_shell_log("settrans /servers/socket/2 --goaway");
snprintf(buf, sizeof(buf),
"settrans -fg /servers/socket/2 /hurd/pfinet --interface=%s --address=%s",
interface, num2dot(ipaddress));
@ -169,10 +202,10 @@ static int netcfg_activate_static()
snprintf(buf, sizeof(buf), " --gateway=%s",
num2dot(gateway));
rv |= di_execlog(buf);
rv |= di_exec_shell_log(buf);
#else
di_execlog("/sbin/ifconfig lo 127.0.0.1");
di_exec_shell_log("/sbin/ifconfig lo 127.0.0.1");
snprintf(buf, sizeof(buf), "/sbin/ifconfig %s %s",
interface, num2dot(ipaddress));
@ -185,13 +218,13 @@ static int netcfg_activate_static()
di_snprintfcat(buf, sizeof(buf), " pointopoint %s",
num2dot(pointopoint));
rv |= di_execlog(buf);
rv |= di_exec_shell_log(buf);
if (gateway) {
snprintf(buf, sizeof(buf),
"/sbin/route add default gateway %s",
num2dot(gateway));
rv |= di_execlog(buf);
rv |= di_exec_shell_log(buf);
}
#endif
@ -204,41 +237,59 @@ static int netcfg_activate_static()
int main(int argc, char *argv[])
{
int finished = 0;
int ret = 0, goback = 0;
char *ptr;
char *nameservers = NULL;
enum { QUIT, GET_COMMON, GET_STATIC, CONFIRM_STATIC} state = GET_COMMON;
client = debconfclient_new();
// debconf_(client, "SETTITLE", "netcfg/static-title", NULL);
debconf_capb(client, "backup");
debconf_metaget(client, "netcfg/internal-none", "description");
none = client->value ? strdup(client->value) : strdup("<none>");
do {
netcfg_get_common(client, &interface, &hostname, &domain,
&nameservers);
debconf_subst(client, "netcfg/confirm_static", "interface", interface);
debconf_subst(client, "netcfg/confirm_static", "hostname", hostname);
debconf_subst(client, "netcfg/confirm_static", "domain", (domain ? domain : none));
debconf_subst(client, "netcfg/confirm_static", "nameservers",
(nameservers ? nameservers : none));
netcfg_nameservers_to_array(nameservers, nameserver_array);
netcfg_get_static();
ptr = my_debconf_input("medium", "netcfg/confirm_static");
if (strstr(ptr, "true"))
finished = 1;
}
while (!finished);
while (state != QUIT) {
switch (state) {
case GET_COMMON:
ret = netcfg_get_common(client, &interface, &hostname, &domain,
&nameservers, goback);
if (ret == 30) {
exit (10); /* goback the whole way out */
} else {
goback = 0;
state = GET_STATIC;
}
break;
case GET_STATIC:
ret = netcfg_get_static();
if (ret == 30) {
goback = 1;
state = GET_COMMON;
} else {
state = CONFIRM_STATIC;
}
break;
case CONFIRM_STATIC:
debconf_subst(client, "netcfg/confirm_static", "interface", interface);
debconf_subst(client, "netcfg/confirm_static", "hostname", hostname);
debconf_subst(client, "netcfg/confirm_static", "domain", (domain ? domain : none));
debconf_subst(client, "netcfg/confirm_static", "nameservers",
(nameservers ? nameservers : none));
netcfg_nameservers_to_array(nameservers, nameserver_array);
debconf_capb(client); // Turn off backup for yes/no confirmation
my_debconf_input(client, "medium", "netcfg/confirm_static", &ptr);
state = strstr(ptr, "true") ? QUIT : GET_COMMON;
debconf_capb(client, "backup");
break;
case QUIT:
break;
}
}
netcfg_write_common("40netcfg-static", ipaddress, domain, hostname,
nameserver_array);

177
netcfg.c

@ -38,14 +38,16 @@
int netcfg_progress_displayed = 0;
static char *my_debconf_input(struct debconfclient *client, char *priority,
char *template)
int my_debconf_input(struct debconfclient *client, char *priority,
char *template, char **p)
{
int ret = 0;
debconf_fset(client, template, "seen", "false");
debconf_input(client, priority, template);
debconf_go(client);
ret = debconf_go(client);
debconf_get(client, template);
return client->value;
*p = client->value;
return ret;
}
@ -150,15 +152,15 @@ char *get_ifdsc(struct debconfclient *client, const char *ifp)
char template[256];
if (strlen(ifp) < 100) {
/* strip away the number from the interface (eth0 -> eth) */
char *new_ifp = strdup(ifp), *ptr = new_ifp;
/* strip away the number from the interface (eth0 -> eth) */
char *new_ifp = strdup(ifp), *ptr = new_ifp;
while ((*ptr < '0' || *ptr > '9') && *ptr != '\0')
ptr++;
*ptr = '\0';
sprintf(template, "netcfg/internal-%s", new_ifp);
free(new_ifp);
ptr++;
*ptr = '\0';
sprintf(template, "netcfg/internal-%s", new_ifp);
free(new_ifp);
debconf_metaget(client, template, "description");
if (client->value != NULL)
return strdup(client->value);
@ -240,20 +242,28 @@ void netcfg_die(struct debconfclient *client)
{
if (netcfg_progress_displayed)
debconf_progress_stop(client);
debconf_capb(client);
debconf_input(client, "high", "netcfg/error");
debconf_go(client);
exit(1);
}
/**
* @brief Ask which interface to configure
* @param client - client
* @param interface - set to the answer
* @param numif - number of interfaces found.
*/
void
netcfg_get_interface(struct debconfclient *client, char **interface)
int
netcfg_get_interface(struct debconfclient *client, char **interface,
int *numif)
{
char *inter;
int len;
int len, ret;
int num_interfaces = 0;
int newchars;
char *ptr;
int num_interfaces = 0;
char *ifdsc;
if (*interface) {
@ -275,9 +285,8 @@ netcfg_get_interface(struct debconfclient *client, char **interface)
goto error;
len += newchars + 128;
}
di_snprintfcat(ptr, len, "%s: %s, ", inter, ifdsc);
num_interfaces++;
num_interfaces++;
free(ifdsc);
}
getif_end();
@ -288,19 +297,23 @@ netcfg_get_interface(struct debconfclient *client, char **interface)
free(ptr);
exit(1);
} else if (num_interfaces > 1) {
/* remove the trailing ", ", which confuses cdebconf */
ptr[strlen(ptr) - 2] = '\0';
*numif = num_interfaces;
/* remove the trailing ", ", which confuses cdebconf */
ptr[strlen(ptr) - 2] = '\0';
debconf_subst(client, "netcfg/choose_interface", "ifchoices", ptr);
free(ptr);
inter =
my_debconf_input(client, "high",
"netcfg/choose_interface");
ret = my_debconf_input(client, "high",
"netcfg/choose_interface", &inter);
if (ret)
return ret;
if (!inter)
netcfg_die(client);
} else if (num_interfaces == 1)
} else if (num_interfaces == 1) {
inter = ptr;
*numif = 1;
}
/* grab just the interface name, not the description too */
*interface = inter;
@ -311,29 +324,36 @@ netcfg_get_interface(struct debconfclient *client, char **interface)
*interface = strdup(*interface);
return;
return 0;
error:
if (ptr)
free(ptr);
netcfg_die(client);
return 10; /* unreachable */
}
void
/*
* Set the hostname.
* @return 0 on success, 30 on BACKUP being selected.
*/
int
netcfg_get_hostname(struct debconfclient *client, char **hostname)
{
static const char *valid_chars =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-";
size_t len;
int ret;
char *p;
do {
free(*hostname);
*hostname =
strdup(my_debconf_input
(client, "medium", "netcfg/get_hostname"));
ret = my_debconf_input(client, "medium", "netcfg/get_hostname", &p);
if (ret == 30) // backup
return ret;
free(*hostname);
*hostname = strdup(p);
len = strlen(*hostname);
/* Check the hostname for RFC 1123 compliance. */
@ -352,33 +372,86 @@ netcfg_get_hostname(struct debconfclient *client, char **hostname)
}
} while (!*hostname);
return 0;
}
/* @brief Get the domainname.
* @return 0 for success, with *domain = domain, 30 for 'goback',
*/
int netcfg_get_domain(struct debconfclient *client, char **domain)
{
int ret;
char *ptr;
ret = my_debconf_input(client, "medium", "netcfg/get_domain", &ptr);
if (ret)
return ret;
if (*domain)
free(*domain);
*domain = NULL;
if (ptr)
*domain = strdup(ptr);
return 0;
}
void
netcfg_get_common(struct debconfclient *client, char **interface,
char **hostname, char **domain, char **nameservers)
int
netcfg_get_nameservers (struct debconfclient *client, char **nameservers)
{
char *ptr;
char *ptr;
int ret;
netcfg_get_interface(client, interface);
netcfg_get_hostname(client, hostname);
ret = my_debconf_input(client, "medium", "netcfg/get_nameservers", &ptr);
if (*nameservers)
free(*nameservers);
*nameservers = NULL;
if (ptr)
*nameservers = strdup(ptr);
return ret;
}
free(*domain);
*domain = NULL;
if ((ptr = my_debconf_input(client, "medium", "netcfg/get_domain")))
*domain = strdup(ptr);
free(*nameservers);
*nameservers = NULL;
if ((ptr =
my_debconf_input(client, "medium", "netcfg/get_nameservers")))
*nameservers = strdup(ptr);
/*
* @brief Get details common to both static & DHCP net configurations
* @return 0 on success, 30 to goback.
* If ret==0, interface, hostname, domain, nameservers set.
*/
int
netcfg_get_common(struct debconfclient *client, char **interface,
char **hostname, char **domain, char **nameservers, int goback)
{
int num_interfaces =0;
enum { GET_INTERFACE, GET_HOSTNAME, GET_DOMAIN, GET_NAMESERVERS, GOBACK, QUIT }
state;
state = goback ? GET_NAMESERVERS : GET_INTERFACE ;
/* netcfg_get_*() return either 30 to goback, or 0 to continue */
while (state != QUIT) {
switch (state) {
case GOBACK:
return 30;
break;
case GET_INTERFACE:
state = (netcfg_get_interface (client, interface, &num_interfaces)) ? GOBACK: GET_HOSTNAME;
break;
case GET_HOSTNAME:
state = (netcfg_get_hostname (client, hostname)) ? GOBACK: GET_DOMAIN;
break;
case GET_DOMAIN:
state = (netcfg_get_domain (client, domain)) ? GET_HOSTNAME : GET_NAMESERVERS;
break;
case GET_NAMESERVERS:
state = (netcfg_get_nameservers (client, nameservers)) ? GET_DOMAIN : QUIT;
break;
case QUIT:
break;
}
}
return 0;
}
void netcfg_nameservers_to_array(char *nameservers, u_int32_t array[])
{
@ -417,7 +490,7 @@ netcfg_write_common(const char *prebaseconfig, u_int32_t ipaddress,
fprintf(fp, "iface lo inet loopback\n");
fclose(fp);
di_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
di_system_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
INTERFACES_FILE,
"/target" INTERFACES_FILE);
}
@ -438,7 +511,7 @@ netcfg_write_common(const char *prebaseconfig, u_int32_t ipaddress,
fclose(fp);
di_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
di_system_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
HOSTS_FILE, "/target" HOSTS_FILE);
}
@ -453,7 +526,7 @@ netcfg_write_common(const char *prebaseconfig, u_int32_t ipaddress,
fclose(fp);
di_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
di_system_prebaseconfig_append(prebaseconfig, "cp %s %s\n",
RESOLV_FILE, "/target" RESOLV_FILE);
}
}

10
netcfg.h

@ -36,13 +36,15 @@ extern char *num2dot (u_int32_t num);
extern void netcfg_die (struct debconfclient *client);
extern void netcfg_get_interface(struct debconfclient *client, char **interface);
extern int netcfg_get_interface(struct debconfclient *client, char **interface, int *num_interfaces);
extern void netcfg_get_hostname(struct debconfclient *client, char **hostname);
extern int netcfg_get_hostname(struct debconfclient *client, char **hostname);
extern void netcfg_get_common (struct debconfclient *client, char **interface,
extern int netcfg_get_common (struct debconfclient *client, char **interface,
char **hostname, char **domain,
char **nameservers);
char **nameservers, int goback);
extern int my_debconf_input(struct debconfclient *client, char *priority, char *template, char **result);
extern void netcfg_write_common (const char *prebaseconfig,
u_int32_t ipaddress, char *domain,

Loading…
Cancel
Save