HP-UX C SIP Stack Programmer's Guide (Novembery 2007)

326 HP-UX C SIP Stack Programmers Guide
Working with IPv6 Addresses
2001:2353:0000:0000:0000::1428:57ab
2001:2353:0:0:0:0:1428:57ab
2001:2353:0::0:1428:57ab
2001:2353::1428:57ab
However, 2001::25de::cade is invalid. Also, leading zeros in all groups can be
omitted, thus 2001:2353:02de::0e13 is the same as 2001:2353:2de::e13.
If the address is an IPv4 address in disguise, the last 32 bits may be written in
decimal. Thus, ::ffff:192.168.89.9 is the same as ::ffff:c0a8:5909, but not the
same as ::192.168.89.9 or ::c0a8:5909.
SCOPE ID The scope ID parameter is required by the operating system. IPv6 addresses may
use a scope ID to resolve the network interface that should be used.
COMPILING THE SIP
STACK WITH IPV6
To compile the SIP Stack with IPv6 support, you can use one of the following
options:
Set the RV_NET_TYPE flag in rvuserconfig.h to
RV_NET_IPV6.
Compile the SIP Stack with the RV_CFLAG_IPV6 flag, or use
ipv6=on in the make command.
Make sure that your system supports IPv6 and that IPv6 is installed.
IPV6 ADDRESSES AND
SIP
The SIP protocol denotes that IPv6 addresses should be included in square
brackets, []. For example, when using the IPv6 local loop address in a To
header, the To header will appear as follows:
To: <sip:[::1]>
INITIALIZING THE SIP
STACK WITH IPV6
Once the SIP Stack is compiled with IPv6, it is possible to initialize the
SIP Stack with IPv6 addresses. To do so, follow the described steps:
1. Create a string that corresponds with an IPv6 address (such as,
fec0::1234:123).
2. Enclose the address in square brackets (such as
[fec0::1234:123]).
3. Add a scope ID to the string. To separate the scope ID from the
string, use the percent sign (%) (such as [fec0::1234:123]%2).
4. Use this string as one of the local addresses in the SIP Stack
configuration structure (such as localTcpAddress).
It is possible to start the SIP Stack with a mixture of IPv6 and IPv4 addresses.