| Anonymous | Login | Signup for a new account | 2013-05-22 21:25 CEST | ![]() |
| Main | My View | View Issues | Change Log | Roadmap |
| View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
| ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
| 0004535 | OCaml | OCaml general | public | 2008-04-16 18:07 | 2009-09-22 10:45 | ||||||
| Reporter | ecc | ||||||||||
| Assigned To | |||||||||||
| Priority | normal | Severity | feature | Reproducibility | always | ||||||
| Status | acknowledged | Resolution | open | ||||||||
| Platform | OS | OS Version | |||||||||
| Product Version | 3.10.1 | ||||||||||
| Target Version | Fixed in Version | ||||||||||
| Summary | 0004535: please add function to distinguish IPv6 inet_addrs | ||||||||||
| Description | Please add a function to the Unix module that allows one to distinguish between IPv4 and IPv6 inet_addrs. For example, when printing a sockaddr, I would like to print 1.2.3.4:666 for an IPv4 host, but [::1]:666 for an IPv6 one. Of course, I can search for ':' in the string returned by string_of_inet_addr, but that's a hack. | ||||||||||
| Tags | No tags attached. | ||||||||||
| Attached Files | |||||||||||
Notes |
|
|
(0005115) dra (reporter) 2009-09-22 10:45 |
This can already be done by using Unix.domain_of_sockaddr which will return Unix.PF_INET for an IPv4 address or Unix.PF_INET6 for an IPv6 address. However, this is tedious as it requires you to create a socket just to determine the address family of an inet_addr. Both win32unix/unix.ml and unix/unix.ml contain a function called is_inet6_addr which is used in Unix.domain_of_sockaddr - could this function be added to unix.mli in the next release of OCaml? |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2008-04-16 18:07 | ecc | New Issue | |
| 2008-09-23 02:51 | doligez | Status | new => acknowledged |
| 2009-09-22 10:45 | dra | Note Added: 0005115 | |
| Copyright © 2000 - 2011 MantisBT Group |