HP-UX IPv6 Porting Guide (September 2004)
Table Of Contents
- About This Document
- 1 Introduction
- 2 IPv6 Addressing
- 3 Data Structure Changes
- 4 Migrating Applications from IPv4 to IPv6
- 5 Overview of IPv4 and IPv6 Call Set-up
- 6 Function Calls Converting Names to Addresses
- 7 Function Calls Converting IP addresses to Names
- 8 Reading Error Messages
- 9 Freeing Memory
- 10 Converting Binary and Text Addresses
- 11 Testing for Scope and Type of IPv6 addresses using Macros
- 12 Identifying Local Interface Names and Indexes
- 13 Configuring or Querying an Interface using IPv6 ioctl() Function Calls
- 14 Verifying IPv6 Installation
- 15 Sample Client/Server Programs
- A IPv4 to IPv6 Quick Reference Guide

Data Structure Changes
Socket Address structure for 4.3BSD-based HP-UX
Chapter 3 17
Socket Address structure for 4.3BSD-based HP-UX
Header file
<netinet/in.h>
IPv4 Structure
struct sockaddr_in {
short sin_family; /*AF_INET */
u_short sin_port; /* transport layer port number */
struct in_addr sin_addr; /* IPv4 */
char sin_zero[8]; /* Unused */
};
IPv6 Structure
struct sockaddr_in6 {
sa_family_t sin6_family; /*AF_INET6 */
in_port_t sin6_port; /* transport layer port number.* /
uint32_t sin6_flowinfo; /* traffic class */
struct in6_addr sin6_addr; /* IPv6*/
uint32_t sin6_scope_id;/* Address scope */
}: