From 31f1add4879da48efb7af21fc5c575692cc3709d Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Sat, 20 Sep 2003 03:31:26 +0000 Subject: merge from taroon fairly large merge, but all fairly obvious stuff. will test in a tree tomorrow --- isys/isys.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'isys/isys.c') diff --git a/isys/isys.c b/isys/isys.c index 1da28d90d..234115fb1 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -107,6 +107,7 @@ static PyObject * py_getDasdPorts(PyObject * s, PyObject * args); static PyObject * py_isUsableDasd(PyObject * s, PyObject * args); static PyObject * py_isLdlDasd(PyObject * s, PyObject * args); static PyObject * doGetMacAddress(PyObject * s, PyObject * args); +static PyObject * doGetIPAddress(PyObject * s, PyObject * args); static PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -161,6 +162,7 @@ static PyMethodDef isysModuleMethods[] = { { "isUsableDasd", (PyCFunction) py_isUsableDasd, METH_VARARGS, NULL}, { "isLdlDasd", (PyCFunction) py_isLdlDasd, METH_VARARGS, NULL}, { "getMacAddress", (PyCFunction) doGetMacAddress, METH_VARARGS, NULL}, + { "getIPAddress", (PyCFunction) doGetIPAddress, METH_VARARGS, NULL}, { NULL } } ; @@ -1398,6 +1400,18 @@ static PyObject * doGetMacAddress(PyObject * s, PyObject * args) { return Py_BuildValue("s", ret); } +static PyObject * doGetIPAddress(PyObject * s, PyObject * args) { + char *dev; + char *ret; + + if (!PyArg_ParseTuple(args, "s", &dev)) + return NULL; + + ret = getIPAddr(dev); + + return Py_BuildValue("s", ret); +} + static PyObject * py_getDasdPorts(PyObject * o, PyObject * args) { if (!PyArg_ParseTuple(args, "")) return NULL; -- cgit