#include <netinet/ip6.h>

netinet/ip6.h

$KAME: ip6.h,v 1.18 2001/03/29 05:34:30 itojun Exp $
includes: sys/appleapiopts.h, sys/types.h, netinet/in.h
48 macros · 12 structs

structip6_hdr

size 40, align 1 · packed
unnamed union at netinet/ip6.h:106:2ip6_ctlun
struct ip6_hdrctlip6_un1
u_int8_tip6_un2_vfc4 bits version, top 4 bits class
struct in6_addrip6_srcsource address
struct in6_addrip6_dstdestination address

macroip6_vfc

#define ip6_vfc ip6_ctlun.ip6_un2_vfc

macroip6_flow

#define ip6_flow ip6_ctlun.ip6_un1.ip6_un1_flow

macroip6_plen

#define ip6_plen ip6_ctlun.ip6_un1.ip6_un1_plen

macroip6_nxt

#define ip6_nxt ip6_ctlun.ip6_un1.ip6_un1_nxt

macroip6_hlim

#define ip6_hlim ip6_ctlun.ip6_un1.ip6_un1_hlim

macroip6_hops

#define ip6_hops ip6_ctlun.ip6_un1.ip6_un1_hlim

macroIPV6_VERSION

#define IPV6_VERSION 0x60

macroIPV6_VERSION_MASK

#define IPV6_VERSION_MASK 0xf0

macroIPV6_FLOWINFO_MASK

#define IPV6_FLOWINFO_MASK 0xffffff0f
flow info (28 bits)

macroIPV6_FLOWLABEL_MASK

#define IPV6_FLOWLABEL_MASK 0xffff0f00
flow label (20 bits)

macroIPV6_FLOW_ECN_MASK

#define IPV6_FLOW_ECN_MASK 0x00003000
the 2 ECN bits

macroIP6TOS_CE

ECN bits proposed by Sally Floyd
#define IP6TOS_CE 0x01
congestion experienced

macroIP6TOS_ECT

#define IP6TOS_ECT 0x02
ECN-capable transport

macroIP6FLOW_DSCP_MASK

To access the 6 bits of the DSCP value in the 32 bits ip6_flow field
#define IP6FLOW_DSCP_MASK 0x0fc00000

macroIP6FLOW_DSCP_SHIFT

#define IP6FLOW_DSCP_SHIFT 22

structip6_ext

size 2, align 1 · packed
u_int8_tip6e_nxt
u_int8_tip6e_len

structip6_hbh

Hop-by-Hop options header XXX should we pad it to force alignment on an 8-byte boundary?
size 2, align 1 · packed
u_int8_tip6h_nxtnext header
u_int8_tip6h_lenlength in units of 8 octets

structip6_dest

Destination options header XXX should we pad it to force alignment on an 8-byte boundary?
size 2, align 1 · packed
u_int8_tip6d_nxtnext header
u_int8_tip6d_lenlength in units of 8 octets

macroIP6OPT_PAD1

Option types and related macros
#define IP6OPT_PAD1 0x00
00 0 00000

macroIP6OPT_PADN

#define IP6OPT_PADN 0x01
00 0 00001

macroIP6OPT_JUMBO

#define IP6OPT_JUMBO 0xC2
11 0 00010 = 194

macroIP6OPT_NSAP_ADDR

#define IP6OPT_NSAP_ADDR 0xC3
11 0 00011

macroIP6OPT_TUNNEL_LIMIT

#define IP6OPT_TUNNEL_LIMIT 0x04
00 0 00100

macroIP6OPT_RTALERT

#define IP6OPT_RTALERT 0x05
00 0 00101 (KAME definition)

macroIP6OPT_ROUTER_ALERT

#define IP6OPT_ROUTER_ALERT 0x05
00 0 00101 (RFC3542, recommended)

macroIP6OPT_RTALERT_LEN

#define IP6OPT_RTALERT_LEN 4

macroIP6OPT_RTALERT_MLD

#define IP6OPT_RTALERT_MLD 0
Datagram contains an MLD message

macroIP6OPT_RTALERT_RSVP

#define IP6OPT_RTALERT_RSVP 1
Datagram contains an RSVP message

macroIP6OPT_RTALERT_ACTNET

#define IP6OPT_RTALERT_ACTNET 2
contains an Active Networks msg

macroIP6OPT_MINLEN

#define IP6OPT_MINLEN 2

macroIP6OPT_EID

#define IP6OPT_EID 0x8a
10 0 01010

macroIP6OPT_TYPE

#define IP6OPT_TYPE(o) ((o) & 0xC0)

macroIP6OPT_TYPE_SKIP

#define IP6OPT_TYPE_SKIP 0x00

macroIP6OPT_TYPE_DISCARD

#define IP6OPT_TYPE_DISCARD 0x40

macroIP6OPT_TYPE_FORCEICMP

#define IP6OPT_TYPE_FORCEICMP 0x80

macroIP6OPT_TYPE_ICMP

#define IP6OPT_TYPE_ICMP 0xC0

macroIP6OPT_MUTABLE

#define IP6OPT_MUTABLE 0x20

structip6_opt

IPv6 options: common part
size 2, align 1 · packed
u_int8_tip6o_type
u_int8_tip6o_len

structip6_opt_jumbo

Jumbo Payload Option
size 6, align 1 · packed
u_int8_tip6oj_type
u_int8_tip6oj_len
u_int8_t[4]ip6oj_jumbo_len

macroIP6OPT_JUMBO_LEN

#define IP6OPT_JUMBO_LEN 6

structip6_opt_nsap

NSAP Address Option
size 4, align 1 · packed
u_int8_tip6on_type
u_int8_tip6on_len
u_int8_tip6on_src_nsap_len
u_int8_tip6on_dst_nsap_len

structip6_opt_tunnel

Tunnel Limit Option
size 3, align 1 · packed
u_int8_tip6ot_type
u_int8_tip6ot_len
u_int8_tip6ot_encap_limit

structip6_opt_router

Router Alert Option
size 4, align 1 · packed
u_int8_tip6or_type
u_int8_tip6or_len
u_int8_t[2]ip6or_value

macroIP6_ALERT_MLD

Router alert values (in network byte order)
#define IP6_ALERT_MLD 0x0000

macroIP6_ALERT_RSVP

#define IP6_ALERT_RSVP 0x0100

macroIP6_ALERT_AN

#define IP6_ALERT_AN 0x0200

structip6_rthdr

Routing header
size 4, align 1 · packed
u_int8_tip6r_nxtnext header
u_int8_tip6r_lenlength in units of 8 octets
u_int8_tip6r_typerouting type
u_int8_tip6r_segleftsegments left

structip6_rthdr0

Type 0 Routing header, deprecated by RFC 5095.
size 8, align 1 · packed
u_int8_tip6r0_nxtnext header
u_int8_tip6r0_lenlength in units of 8 octets
u_int8_tip6r0_typealways zero
u_int8_tip6r0_segleftsegments left
u_int32_tip6r0_reservedreserved field

structip6_frag

Fragment header
size 8, align 1 · packed
u_int8_tip6f_nxtnext header
u_int8_tip6f_reservedreserved field
u_int16_tip6f_offlgoffset, reserved, and flag
u_int32_tip6f_identidentification

macroIP6F_OFF_MASK

#define IP6F_OFF_MASK 0xf8ff
mask out offset from _offlg

macroIP6F_RESERVED_MASK

#define IP6F_RESERVED_MASK 0x0600
reserved bits in ip6f_offlg

macroIP6F_MORE_FRAG

#define IP6F_MORE_FRAG 0x0100
more-fragments flag

macroIPV6_MAXHLIM

Internet implementation parameters.
#define IPV6_MAXHLIM 255
maximum hoplimit

macroIPV6_DEFHLIM

#define IPV6_DEFHLIM 64
default hlim

macroIPV6_FRAGTTL

#define IPV6_FRAGTTL 60
ttl for fragment packets (seconds)

macroIPV6_HLIMDEC

#define IPV6_HLIMDEC 1
subtracted when forwarding

macroIPV6_MMTU

#define IPV6_MMTU 1280
minimal MTU and reassembly. 1024 + 256

macroIPV6_MAXPACKET

#define IPV6_MAXPACKET 65535
ip6 max packet size without Jumbo payload

macroIPV6_MAXOPTHDR

#define IPV6_MAXOPTHDR 2048
max option header size, 256 64-bit words