Skip to Content
IPv6 Network Administration
book

IPv6 Network Administration

by Niall Richard Murphy, David Malone
March 2005
Intermediate to advanced
308 pages
10h 32m
English
O'Reilly Media, Inc.
Content preview from IPv6 Network Administration

Chapter 8. Programming

If 10 years from now, when you are doing something quick and dirty, you suddenly visualize that I am looking over your shoulders and say to yourself, "Dijkstra would not have liked this," well that would be enough immortality for me.

Edgar Dijkstra

The sockets programming interface is probably the most commonly used interface for writing TCP/IP based applications. The sockets API is largely protocol agnostic, so adding support for IPv6 has proved to be relatively easy. To prevent inconsistencies[1] between the implementations, some standards have been produced to encourage a unified API (RFC 3493 and RFC 3542).

Familiar sockets function calls such as socket, connect, bind, listen and accept all remain unchanged, apart from the introduction of a new address family AF_INET6 that is used instead of AF_INET. IPv6 socket addresses are stored using a struct sockaddr_in6 rather than a struct sockaddr_in; so much is self-explanatory. More interestingly, a struct sockaddr_storage is provided which is large enough to store any protocol address. This is intended to make it easier to write protocol-independent code. Previously, struct sockaddr was sometimes used for this purpose, but the size chosen for this structure was too small on many systems.

Apart from the structures, the main change to the API for IPv6 is the provision of functions for looking up and printing IPv6 hostnames and addresses. The most important of these are getaddrinfo and getnameinfo. These are replacements ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Cisco Self-Study: Implementing IPv6 Networks (IPV6)

Cisco Self-Study: Implementing IPv6 Networks (IPV6)

Régis Desmeules
IPv6 Core Protocols Implementation

IPv6 Core Protocols Implementation

Qing Li, Tatuya Jinmei, Keiichi Shima
Security in an IPv6 Environment

Security in an IPv6 Environment

Daniel Minoli, Jake Kouns

Publisher Resources

ISBN: 0596009348Errata Page