@@ -71,7 +71,8 @@ static PyNetlinkIPaddress * get_last_ipv4_address(PyObject *addrlist)
7171
7272 size = PyList_Size (addrlist );
7373 if (size > 0 ) {
74- PyNetlinkIPaddress * item = (PyNetlinkIPaddress * )PyList_GetItem (addrlist , size - 1 );
74+ PyNetlinkIPaddress * item = (PyNetlinkIPaddress * )
75+ PyList_GetItem (addrlist , size - 1 );
7576 if (Py_TYPE (item ) == & ethtool_netlink_ip_address_Type ) {
7677 return item ;
7778 }
@@ -81,7 +82,8 @@ static PyNetlinkIPaddress * get_last_ipv4_address(PyObject *addrlist)
8182}
8283
8384/**
84- * Creates a human readable format of the information when object is being treated as a string
85+ * Creates a human readable format of the information when object is being
86+ * treated as a string
8587 *
8688 * @param self Pointer to the current PyEtherInfo device object
8789 *
@@ -111,14 +113,17 @@ PyObject *_ethtool_etherinfo_str(PyEtherInfo *self)
111113 if (ipv4addrs ) {
112114 Py_ssize_t i ;
113115 for (i = 0 ; i < PyList_Size (ipv4addrs ); i ++ ) {
114- PyNetlinkIPaddress * py_addr = (PyNetlinkIPaddress * )PyList_GetItem (ipv4addrs , i );
116+ PyNetlinkIPaddress * py_addr = (PyNetlinkIPaddress * )
117+ PyList_GetItem (ipv4addrs , i );
115118 PyObject * tmp = PyStr_FromFormat ("\tIPv4 address: " );
116119 tmp = PyStr_Concat (tmp , py_addr -> local );
117- tmp = PyStr_Concat (tmp , PyStr_FromFormat ("/%d" , py_addr -> prefixlen ));
120+ tmp = PyStr_Concat (tmp ,
121+ PyStr_FromFormat ("/%d" , py_addr -> prefixlen ));
118122 if (py_addr -> ipv4_broadcast ) {
119- tmp = PyStr_Concat (tmp ,
120- PyStr_FromFormat ("\tBroadcast: %s\n" ,
121- PyStr_AsString (py_addr -> ipv4_broadcast )));
123+ tmp = PyStr_Concat (
124+ tmp , PyStr_FromFormat ("\tBroadcast: %s\n" ,
125+ PyStr_AsString (
126+ py_addr -> ipv4_broadcast )));
122127 } else {
123128 tmp = PyStr_Concat (tmp , PyStr_FromFormat ("\n" ));
124129 }
@@ -131,7 +136,8 @@ PyObject *_ethtool_etherinfo_str(PyEtherInfo *self)
131136 if (ipv6addrs ) {
132137 Py_ssize_t i ;
133138 for (i = 0 ; i < PyList_Size (ipv6addrs ); i ++ ) {
134- PyNetlinkIPaddress * py_addr = (PyNetlinkIPaddress * )PyList_GetItem (ipv6addrs , i );
139+ PyNetlinkIPaddress * py_addr = (PyNetlinkIPaddress * )
140+ PyList_GetItem (ipv6addrs , i );
135141 PyObject * tmp = PyStr_FromFormat ("\tIPv6 address: [%s] %s/%d\n" ,
136142 PyStr_AsString (py_addr -> scope ),
137143 PyStr_AsString (py_addr -> local ),
@@ -146,12 +152,14 @@ PyObject *_ethtool_etherinfo_str(PyEtherInfo *self)
146152/**
147153 * Returns a tuple list of configured IPv4 addresses
148154 *
149- * @param self Pointer to the current PyEtherInfo device object to extract IPv4 info from
155+ * @param self Pointer to the current PyEtherInfo device object to extract
156+ * IPv4 info from
150157 * @param notused
151158 *
152159 * @return Returns a Python tuple list of NetlinkIP4Address objects
153160 */
154- static PyObject * _ethtool_etherinfo_get_ipv4_addresses (PyEtherInfo * self , PyObject * notused ) {
161+ static PyObject * _ethtool_etherinfo_get_ipv4_addresses (PyEtherInfo * self ,
162+ PyObject * notused ) {
155163 if (!self ) {
156164 PyErr_SetString (PyExc_AttributeError , "No data available" );
157165 return NULL ;
@@ -164,12 +172,14 @@ static PyObject *_ethtool_etherinfo_get_ipv4_addresses(PyEtherInfo *self, PyObje
164172/**
165173 * Returns a tuple list of configured IPv6 addresses
166174 *
167- * @param self Pointer to the current PyEtherInfo device object to extract IPv6 info from
175+ * @param self Pointer to the current PyEtherInfo device object to extract
176+ * IPv6 info from
168177 * @param notused
169178 *
170179 * @return Returns a Python tuple list of NetlinkIP6Address objects
171180 */
172- static PyObject * _ethtool_etherinfo_get_ipv6_addresses (PyEtherInfo * self , PyObject * notused ) {
181+ static PyObject * _ethtool_etherinfo_get_ipv6_addresses (PyEtherInfo * self ,
182+ PyObject * notused ) {
173183 if (!self ) {
174184 PyErr_SetString (PyExc_AttributeError , "No data available" );
175185 return NULL ;
@@ -184,11 +194,15 @@ static PyObject *_ethtool_etherinfo_get_ipv6_addresses(PyEtherInfo *self, PyObje
184194 *
185195 */
186196static PyMethodDef _ethtool_etherinfo_methods [] = {
187- { "get_ipv4_addresses" , (PyCFunction )_ethtool_etherinfo_get_ipv4_addresses , METH_NOARGS ,
188- "Retrieve configured IPv4 addresses. Returns a list of NetlinkIPaddress objects"
197+ { "get_ipv4_addresses" ,
198+ (PyCFunction )_ethtool_etherinfo_get_ipv4_addresses , METH_NOARGS ,
199+ "Retrieve configured IPv4 addresses. "
200+ "Returns a list of NetlinkIPaddress objects"
189201 },
190- { "get_ipv6_addresses" , (PyCFunction )_ethtool_etherinfo_get_ipv6_addresses , METH_NOARGS ,
191- "Retrieve configured IPv6 addresses. Returns a list of NetlinkIPaddress objects"
202+ { "get_ipv6_addresses" ,
203+ (PyCFunction )_ethtool_etherinfo_get_ipv6_addresses , METH_NOARGS ,
204+ "Retrieve configured IPv6 addresses. "
205+ "Returns a list of NetlinkIPaddress objects"
192206 },
193207 {NULL } /**< No methods defined */
194208};
0 commit comments