Closed Bug 666726 Opened 14 years ago Closed 14 years ago

request for portable interface for inet_ntop and inet_pton

Categories

(NSPR :: NSPR, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: srinatar, Assigned: wtc)

Details

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30 Build Identifier: NSPR 4.8.3 Our product currently uses NSPR extensively and we are looking for a portable API to convert packed address into dot-notation format (some thing along the lines of inet_ntop and inet_pton) I did take a look at PR_NetAddrToString and this is NOT what I am looking for. This is because inet_ntop allows reading from a input string (which can be greater than 16 bytes) and converts into a 16-byte human readable IPv6 address. APR has a similar interface like apr_inet_ntop. I am looking for some thing similar within NSPR. This will be especially useful since inet_ntop is not available on older versions of Windows Having this API within NSPR will allow programmers to invoke this API without having to worry that inet_ntop is not available on Windows 2003 server etc. thanks Reproducible: Always Steps to Reproduce: 1. Need API equivalent of apr_inet_ntop or inet_ntop 2. 3. Actual Results: this API does not exist. Expected Results: PR_InetNtoP
Thank you for the suggestion. I don't understand this comment of yours: ... inet_ntop allows reading from a input string (which can be greater than 16 bytes) and converts into a 16-byte human readable IPv6 address. For this discussion let's use the inet_ntop man page at http://pubs.opengroup.org/onlinepubs/009695399/functions/inet_ntop.html The src input argument to inet_ntop is an IP address, not a string, and if the af argument is AF_INET6, src should point to a 16-byte IPv6 address. Did I misunderstand something? Thanks.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Thanks. You are right. I was assuming inet_ntop or apr_inet_ntop can convert a packed decimal string to its corresponding IPv6 address. I apologize for wasting your time.
Sriram: no problem. So you're talking about a "packed decimal" string. Is this what you mean? http://en.wikipedia.org/wiki/Binary-coded_decimal#Packed_BCD http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c0925083170.htm I am not familiar with the packed decimal format. It is uncommon to represent an IP address in packed decimal format, which is why there is no NSPR function for converting an IP address in packed decimal format to a string.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.