IPv6 is coming -- watch your use of IP addresses
IPv6 is coming -- watch your use of IP addresses
- Subject: IPv6 is coming -- watch your use of IP addresses
- From: Chris Kane <email@hidden>
- Date: Tue, 23 Apr 2002 08:36:50 -0700
On Tuesday, April 23, 2002, at 01:23 AM, Drew Cunningham wrote:
IPAddress = [NSString stringWithFormat:@"%d.%d.%d.%d",
[[[addressFields cells] objectAtIndex:0] intValue],
[[[addressFields cells] objectAtIndex:1] intValue],
[[[addressFields cells] objectAtIndex:2] intValue],
[[[addressFields cells] objectAtIndex:3]
intValue]]; // Forms IP address from text fields
This is just a general heads up note.
In the OS release following 10.1 (not software update), things will be
more IPv6 capable and aware, and developers should begin to anticipate
IPv6 addresses.
Foundation uses NSDatas and NSStrings to hold IP addresses and struct
sockaddrs.
If you don't concoct these datas and strings by hand, or ever examine
their contents, but simply get them from somewhere and pass them along,
you're fine.
Otherwise, it's possible your app may not run properly in a ... while
(could be a year, or three, or five, ...). There are a few problems:
1. A machine might not have an IPv4 address, at some point.
2. Examining the contents includes comparing for equality, which can be
hidden in places like using these datas and strings as dictionary keys
in some lookup table or cache. An IPv6 address can be equivalent to an
IPv4 address but still not be "equal" at data and string types of
equality.
3. Parsing strings expecting them to be 4 dot-separated octets won't
work for IPv6 addresses. Similarly for looking at struct sockaddrs or
datas, expecting the IPv4 address to be in a certain location and a
certain length.
4. Reading addresses from user input is trickier (say, if your UI has
four text cells in a row, or text field has a formatter which restricts
input to dot-separated octets). Of course, any time a user has to type
in a big nasty IPv6 address, that might be a small UE disaster in itself.
5. APIs which returned IPv4 addresses before may now return IPv6
addresses, or a combination thereof. (Presumably, if an API takes IPv4
addresses and begins to take IPv4 or IPv6 addresses, that's not a
problem.)
There may be other issues as well.
There are several RFCs which discuss IPv6 and IPv6 addresses. RFC 2553
also has some advice and talks about new APIs for IPv6-aware
applications. The Cocoa What's New talk at WWDC will be mentioning IPv6.
Heads up!
Chris Kane
Cocoa Frameworks, Apple
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.