Title: inet_ntoa missing from socket
Type: behaviour Severity: normal
Components: Library Versions: 2.5alpha3
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: amak Nosy List: amak, moyix
Priority: Keywords:

Created on 2008-10-18.06:16:42 by moyix, last changed 2008-10-27.18:49:33 by amak.

msg3690 (view) Author: Brendan Dolan-Gavitt (moyix) Date: 2008-10-18.06:18:54
Under OS X, with Jython 2.5a3, inet_ntoa seems to be missing from socket:
azzurra:~ moyix$ jython2.5a3/jython 
Jython 2.5a3 (trunk:5315:5317, Sep 10 2008, 20:54:23) 
[Java HotSpot(TM) Client VM ("Apple Computer, Inc.")] on java1.5.0_13
Type "help", "copyright", "credits" or "license" for more information.
>>> from socket import inet_ntoa
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name inet_ntoa
msg3692 (view) Author: Alan Kennedy (amak) Date: 2008-10-19.14:50:45
The inet_ntoa and inet_aton functions in socket are used to "useful when
conversing with a program that uses the standard C library and needs
objects of type struct in_addr, which is the C type for the 32-bit
packed binary this function returns."

C in_addr structures are not usable by java socket libraries, and thus
not usable from jython.

Perhaps the submitter can illustrate a use case where these functions
are needed? If a use case is presented, I will provide the functions.
msg3693 (view) Author: Brendan Dolan-Gavitt (moyix) Date: 2008-10-19.18:03:45

The specific case I came across is in the forensic memory analysis
framework Volatility. One of the modules reads the network state of the
machine from a memory dump, and hence calls inet_ntoa to interpret the
packed in_addr structures from memory.

msg3710 (view) Author: Alan Kennedy (amak) Date: 2008-10-27.18:49:33
Support for inet_pton, inet_ntop, inet_aton and inet_ntoa has been
checked into trunk at revision 5521 and release_22 at revision 5520.
Date User Action Args
2008-10-27 18:49:33amaksetstatus: open -> closed
resolution: fixed
messages: + msg3710
2008-10-19 18:03:45moyixsetmessages: + msg3693
2008-10-19 14:51:39amaksetassignee: amak
2008-10-19 14:50:45amaksetnosy: + amak
messages: + msg3692
2008-10-18 06:18:55moyixsetmessages: + msg3690
2008-10-18 06:16:42moyixcreate