diff options
author | Mike Fulbright <msf@redhat.com> | 2003-07-07 21:14:20 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2003-07-07 21:14:20 +0000 |
commit | 2bf154fe5f11a87e745434906ff1e7596907bdaf (patch) | |
tree | c95788202b56cb0e0f4b53b09035e90501809829 /isys/isys.c | |
parent | 26cd7f6a9bda813c83c7f8dd79c50f4ceb54a61d (diff) | |
download | anaconda-2bf154fe5f11a87e745434906ff1e7596907bdaf.tar.gz anaconda-2bf154fe5f11a87e745434906ff1e7596907bdaf.tar.xz anaconda-2bf154fe5f11a87e745434906ff1e7596907bdaf.zip |
add binding for getting mac address of nic
Diffstat (limited to 'isys/isys.c')
-rw-r--r-- | isys/isys.c | 15 |
1 files changed, 15 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; |