diff options
author | Matt Wilson <msw@redhat.com> | 1999-06-25 02:13:21 +0000 |
---|---|---|
committer | Matt Wilson <msw@redhat.com> | 1999-06-25 02:13:21 +0000 |
commit | 79babd8fb43cfd0f73633a42f175398fedf5f7a5 (patch) | |
tree | 3cff7ef981549fe3c7454b7bcd81fba16ddf57d9 /isys/isys.c | |
parent | e5805f48c6d95f77afedbce04d1cab6b88d4f05b (diff) | |
download | anaconda-79babd8fb43cfd0f73633a42f175398fedf5f7a5.tar.gz anaconda-79babd8fb43cfd0f73633a42f175398fedf5f7a5.tar.xz anaconda-79babd8fb43cfd0f73633a42f175398fedf5f7a5.zip |
added networking calls to isys
added some newt status stuff to the loader
Diffstat (limited to 'isys/isys.c')
-rw-r--r-- | isys/isys.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c index 0861c4d9e..ac8925c2c 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -7,6 +7,7 @@ #include "Python.h" #include "imount.h" +#include "inet.h" #include "isys.h" #include "pci/pciprobe.h" #include "smp.h" @@ -21,6 +22,7 @@ static PyObject * getModuleList(PyObject * s, PyObject * args); static PyObject * makeDevInode(PyObject * s, PyObject * args); static PyObject * pciProbe(PyObject * s, PyObject * args); static PyObject * smpAvailable(PyObject * s, PyObject * args); +static PyObject * doConfigNetDevice(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "findmoduleinfo", (PyCFunction) doFindModInfo, METH_VARARGS, NULL }, @@ -33,6 +35,7 @@ static PyMethodDef isysModuleMethods[] = { { "mount", (PyCFunction) doMount, METH_VARARGS, NULL }, { "smpavailable", (PyCFunction) smpAvailable, METH_VARARGS, NULL }, { "umount", (PyCFunction) doUMount, METH_VARARGS, NULL }, + { "confignetdevice", (PyCFunction) doConfigNetDevice, METH_VARARGS, NULL }, { NULL } } ; @@ -280,3 +283,29 @@ void init_isys(void) { static void emptyDestructor(PyObject * s) { } +static PyObject * doConfigNetDevice(PyObject * s, PyObject * args) { + char * dev, * ip, * netmask, * broadcast, * network; + int * isPtp, rc; + struct intfInfo device; + + if (!PyArg_ParseTuple(args, "sssssd", &dev, &ip, &netmask, &broadcast, + &network, &isPtp)) return NULL; + + strncpy(device.device, dev, sizeof(device.device) - 1); + device.ip.s_addr = inet_addr(ip); + device.netmask.s_addr = inet_addr(netmask); + device.broadcast.s_addr = inet_addr(broadcast); + device.network.s_addr = inet_addr(network); + device.isPtp = 0; + device.isUp = 0; + + rc = configureNetDevice(&device); + + if (rc == INET_ERR_ERRNO) + PyErr_SetFromErrno(PyExc_SystemError); + else if (rc) + PyErr_SetString(PyExc_SystemError, "net configure failed"); + + Py_INCREF(Py_None); + return Py_None; +} |