diff options
-rw-r--r-- | isys/isys.c | 15 | ||||
-rw-r--r-- | isys/isys.py | 3 |
2 files changed, 18 insertions, 0 deletions
diff --git a/isys/isys.c b/isys/isys.c index c0f529056..08813203c 100644 --- a/isys/isys.c +++ b/isys/isys.c @@ -46,6 +46,7 @@ #include "probe.h" #include "smp.h" #include "lang.h" +#include "getmacaddr.h" #ifndef CDROMEJECT #define CDROMEJECT 0x5309 @@ -104,6 +105,7 @@ static PyObject * start_bterm(PyObject * s, PyObject * args); 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 PyMethodDef isysModuleMethods[] = { { "ejectcdrom", (PyCFunction) doEjectCdrom, METH_VARARGS, NULL }, @@ -157,6 +159,7 @@ static PyMethodDef isysModuleMethods[] = { { "getDasdPorts", (PyCFunction) py_getDasdPorts, METH_VARARGS, NULL}, { "isUsableDasd", (PyCFunction) py_isUsableDasd, METH_VARARGS, NULL}, { "isLdlDasd", (PyCFunction) py_isLdlDasd, METH_VARARGS, NULL}, + { "getMacAddress", (PyCFunction) doGetMacAddress, METH_VARARGS, NULL}, { NULL } } ; @@ -1382,6 +1385,18 @@ static PyObject * getLinkStatus(PyObject * s, PyObject * args) { return Py_BuildValue("i", ret); } +static PyObject * doGetMacAddress(PyObject * s, PyObject * args) { + char *dev; + char *ret; + + if (!PyArg_ParseTuple(args, "s", &dev)) + return NULL; + + ret = getMacAddr(dev); + /* returns 1 for link, 0 for no link, -1 for unknown */ + return Py_BuildValue("s", ret); +} + static PyObject * py_getDasdPorts(PyObject * o, PyObject * args) { if (!PyArg_ParseTuple(args, "")) return NULL; diff --git a/isys/isys.py b/isys/isys.py index 09cdc541c..b0ecc9fee 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -589,6 +589,9 @@ def getpagesize(): def getLinkStatus(dev): return _isys.getLinkStatus(dev) +def getMacAddress(dev): + return _isys.getMacAddress(dev) + def startBterm(): return _isys.startBterm() |