summaryrefslogtreecommitdiffstats
path: root/isys/isys.c
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2000-02-17 21:00:41 +0000
committerErik Troan <ewt@redhat.com>2000-02-17 21:00:41 +0000
commitf8ac3e20227fb237a2a7d996ba5d6330757ba739 (patch)
tree45495a2078d7105e278ca42f63b6d3b3749e91ac /isys/isys.c
parent0557e1d6c67d6fd8b3e82b2322f643ac2f684282 (diff)
downloadanaconda-f8ac3e20227fb237a2a7d996ba5d6330757ba739.tar.gz
anaconda-f8ac3e20227fb237a2a7d996ba5d6330757ba739.tar.xz
anaconda-f8ac3e20227fb237a2a7d996ba5d6330757ba739.zip
added dhcp/bootp interface
Diffstat (limited to 'isys/isys.c')
-rw-r--r--isys/isys.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/isys/isys.c b/isys/isys.c
index 8dc79bf36..b427c6247 100644
--- a/isys/isys.c
+++ b/isys/isys.c
@@ -44,9 +44,6 @@ static PyObject * getModuleList(PyObject * s, PyObject * args);
static PyObject * makeDevInode(PyObject * s, PyObject * args);
static PyObject * doPciProbe(PyObject * s, PyObject * args);
static PyObject * smpAvailable(PyObject * s, PyObject * args);
-#if 0
-static PyObject * doConfigNetDevice(PyObject * s, PyObject * args);
-#endif
static PyObject * createProbedList(PyObject * s, PyObject * args);
static PyObject * doChroot(PyObject * s, PyObject * args);
static PyObject * doCheckBoot(PyObject * s, PyObject * args);
@@ -63,6 +60,7 @@ static PyObject * doDevSpaceFree(PyObject * s, PyObject * args);
static PyObject * doRaidStart(PyObject * s, PyObject * args);
static PyObject * doRaidStop(PyObject * s, PyObject * args);
static PyObject * doConfigNetDevice(PyObject * s, PyObject * args);
+static PyObject * doPumpNetDevice(PyObject * s, PyObject * args);
static PyObject * doResetResolv(PyObject * s, PyObject * args);
static PyMethodDef isysModuleMethods[] = {
@@ -91,6 +89,7 @@ static PyMethodDef isysModuleMethods[] = {
{ "smpavailable", (PyCFunction) smpAvailable, METH_VARARGS, NULL },
{ "umount", (PyCFunction) doUMount, METH_VARARGS, NULL },
{ "confignetdevice", (PyCFunction) doConfigNetDevice, METH_VARARGS, NULL },
+ { "pumpnetdevice", (PyCFunction) doPumpNetDevice, METH_VARARGS, NULL },
{ "chroot", (PyCFunction) doChroot, METH_VARARGS, NULL },
{ "checkBoot", (PyCFunction) doCheckBoot, METH_VARARGS, NULL },
{ "checkUFS", (PyCFunction) doCheckUFS, METH_VARARGS, NULL },
@@ -765,6 +764,39 @@ static PyObject * doConfigNetDevice(PyObject * s, PyObject * args) {
return Py_None;
}
+static PyObject * doPumpNetDevice(PyObject * s, PyObject * args) {
+ char * device;
+ char * chptr;
+ struct pumpNetIntf cfg;
+ PyObject * rc;
+
+ if (!PyArg_ParseTuple(args, "s", &device))
+ return NULL;
+
+ chptr = pumpDhcpRun(device, 0, 0, NULL, &cfg, NULL);
+ if (chptr) {
+ Py_INCREF(Py_None);
+ return Py_None;
+ }
+
+ if (pumpSetupInterface(&cfg)) {
+ PyErr_SetFromErrno(PyExc_SystemError);
+ return NULL;
+ }
+
+ if (pumpSetupDefaultGateway(&cfg.gateway)) {
+ PyErr_SetFromErrno(PyExc_SystemError);
+ return NULL;
+ }
+
+ if (cfg.numDns)
+ rc = PyString_FromString(inet_ntoa(cfg.dnsServers[0]));
+ else
+ rc = PyString_FromString("");
+
+ return rc;
+}
+
static PyObject * probedListGetAttr(probedListObject * o, char * name) {
return Py_FindMethod(probedListObjectMethods, (PyObject * ) o, name);
}