diff options
author | David Cantrell <dcantrell@redhat.com> | 2008-09-15 17:01:49 -1000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2008-09-15 17:01:49 -1000 |
commit | 2ddbc38443bd6979ba72334ad4288f2a603f4f50 (patch) | |
tree | b234e3a75cde9fec850621b5f3c2dfac44c6da21 /isys | |
parent | 369ede365f9c4275746cada13bb71ce62ae0f47e (diff) | |
download | anaconda-2ddbc38443bd6979ba72334ad4288f2a603f4f50.tar.gz anaconda-2ddbc38443bd6979ba72334ad4288f2a603f4f50.tar.xz anaconda-2ddbc38443bd6979ba72334ad4288f2a603f4f50.zip |
Remove code from isys not needed for NetworkManager.
We do not need the old dhcpNetDevice() or
configNetDevice() functions or the resolver code in
isys since we are using NetworkManager now.
Diffstat (limited to 'isys')
-rw-r--r-- | isys/isys.c | 93 | ||||
-rwxr-xr-x | isys/isys.py | 50 |
2 files changed, 0 insertions, 143 deletions
diff --git a/isys/isys.c b/isys/isys.c index 181688fbc..55cc42cd6 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -102,9 +102,6 @@ static PyObject * doGetRaidSuperblock(PyObject * s, PyObject * args); static PyObject * doGetRaidChunkSize(PyObject * s, PyObject * args); static PyObject * doDevSpaceFree(PyObject * s, PyObject * args); static PyObject * doConfigNetDevice(PyObject * s, PyObject * args); -static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args); -static PyObject * doResetResolv(PyObject * s, PyObject * args); -static PyObject * doSetResolvRetry(PyObject * s, PyObject * args); static PyObject * doLoadKeymap(PyObject * s, PyObject * args); static PyObject * doClobberExt2 (PyObject * s, PyObject * args); static PyObject * doReadE2fsLabel(PyObject * s, PyObject * args); @@ -153,12 +150,8 @@ static PyMethodDef isysModuleMethods[] = { { "smpavailable", (PyCFunction) smpAvailable, METH_VARARGS, NULL }, { "htavailable", (PyCFunction) htAvailable, METH_VARARGS, NULL }, { "umount", (PyCFunction) doUMount, METH_VARARGS, NULL }, - { "confignetdevice", (PyCFunction) doConfigNetDevice, METH_VARARGS, NULL }, - { "dhcpnetdevice", (PyCFunction) doDhcpNetDevice, METH_VARARGS, NULL }, { "swapon", (PyCFunction) doSwapon, METH_VARARGS, NULL }, { "swapoff", (PyCFunction) doSwapoff, METH_VARARGS, NULL }, - { "resetresolv", (PyCFunction) doResetResolv, METH_VARARGS, NULL }, - { "setresretry", (PyCFunction) doSetResolvRetry, METH_VARARGS, NULL }, { "loadKeymap", (PyCFunction) doLoadKeymap, METH_VARARGS, NULL }, { "vtActivate", (PyCFunction) doVtActivate, METH_VARARGS, NULL}, { "isPseudoTTY", (PyCFunction) doisPseudoTTY, METH_VARARGS, NULL}, @@ -366,72 +359,6 @@ void init_isys(void) { PyDict_SetItemString(d, "EARLY_SWAP_RAM", PyInt_FromLong(EARLY_SWAP_RAM)); } -static PyObject * doConfigNetDevice(PyObject * s, PyObject * args) { - int i = 0; - char *dev, *ipv4, *netmask, *ipv6, *prefix, *gateway, *gateway6, *ep; - iface_t iface; - struct in_addr tmpaddr; - - if (!PyArg_ParseTuple(args, "ssssss", &dev, &ipv4, &netmask, - &ipv6, &prefix, &gateway, &gateway6)) - return NULL; - - memset(&iface, '\0', sizeof(iface_t)); - strncpy(iface.device, dev, sizeof(iface.device) - 1); - - /* IPv4 */ - if (inet_pton(AF_INET, ipv4, &iface.ipaddr) >= 1) { - if (inet_pton(AF_INET, netmask, &iface.netmask) >= 1) { - /* we have IP and netmask, calculate broadcast */ - memset(&tmpaddr, 0, sizeof(tmpaddr)); - tmpaddr.s_addr = iface.ipaddr.s_addr & iface.netmask.s_addr; - iface.broadcast.s_addr = tmpaddr.s_addr | ~iface.netmask.s_addr; - } - } - - /* IPv6 */ - if (inet_pton(AF_INET6, ipv6, &iface.ip6addr) >= 1) { - if (strlen(prefix)) { - i = strtol(prefix, &ep, 10); - if (i > 0 && i <= 128) { - iface.ip6prefix = i; - } - } - } - - /* Gateways */ - if (strlen(gateway)) { - if (inet_pton(AF_INET, gateway, &iface.gateway) <= 0) { - PyErr_SetFromErrno(PyExc_SystemError); - return NULL; - } - } - - if (strlen(gateway6)) { - if (inet_pton(AF_INET6, gateway6, &iface.gateway6) <= 0) { - PyErr_SetFromErrno(PyExc_SystemError); - return NULL; - } - } - - /* Bring up the interface */ -/* - if (iface_config(&iface)) { - PyErr_SetFromErrno(PyExc_SystemError); - return NULL; - } -*/ - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * doDhcpNetDevice(PyObject * s, PyObject * args) { - /* function returns a nameserver address to the caller */ - /* FIXME: needs to use NetworkManager --dcantrell */ - return PyString_FromString(""); -} - static PyObject * doPrefixToNetmask (PyObject * s, PyObject * args) { int prefix = 0; struct in_addr *mask = NULL; @@ -603,26 +530,6 @@ static PyObject * doLoadKeymap (PyObject * s, PyObject * args) { return Py_None; } -static PyObject * doResetResolv(PyObject * s, PyObject * args) { - if (!PyArg_ParseTuple(args, "")) return NULL; - - res_init(); /* reinit the resolver so DNS changes take affect */ - - Py_INCREF(Py_None); - return Py_None; -} - -static PyObject * doSetResolvRetry(PyObject * s, PyObject * args) { - int count; - - if (!PyArg_ParseTuple(args, "i", &count)) return NULL; - - _res.retry = count; - - Py_INCREF(Py_None); - return Py_None; -} - static PyObject * doClobberExt2 (PyObject * s, PyObject * args) { char * device; ext2_filsys fsys; diff --git a/isys/isys.py b/isys/isys.py index 61521b997..904488d42 100755 --- a/isys/isys.py +++ b/isys/isys.py @@ -725,56 +725,6 @@ def compareNetDevices(first, second): else: return 0 -# called from anaconda (basically rescue mode only) to configure an interface -# when we have collected all of the configuration information from the user -def configNetDevice(device, gateway): - devname = device.get('device') - ipv4 = device.get('ipaddr') - netmask = device.get('netmask') - ipv6 = device.get('ipv6addr') - prefix = device.get('ipv6prefix') - - return _isys.confignetdevice(devname, ipv4, netmask, ipv6, prefix, gateway) - -def resetResolv(): - return _isys.resetresolv() - -def setResolvRetry(count): - return _isys.setresretry(count) - -# called from anaconda to run DHCP (that's DHCP, DHCPv6, or auto neighbor -# discovery) on a particular interface -def dhcpNetDevice(device): - # returns None on failure, "" if no nameserver is found, nameserver IP - # otherwise - devname = device.get('device') - v4 = 0 - v6 = 0 - v4method = '' - v6method = '' - klass = device.get('dhcpclass') - - if device.get('useipv4'): - v4 = 1 - if device.get('bootproto') == 'dhcp': - v4method = 'dhcp' - else: - v4method = 'manual' - - if device.get('useipv6'): - v6 = 1 - if device.get('ipv6_autoconf') == 'yes': - v6method = 'auto' - elif device.get('ipv6_autoconf') == 'no' and device.get('bootproto') == 'dhcp': - v6method = 'dhcp' - else: - v6method = 'manual' - - if klass is None: - klass = '' - - return _isys.dhcpnetdevice(devname, v4, v4method, v6, v6method, klass) - def getDeviceByToken(token, value): return _isys.getdevicebytoken(token, value) |