Subject: Re: Comments on 2292bis (Adv. API)

From: JINMEI Tatuya / 神明達哉<[email-masked]>
Date: Fri, 03 Sep 1999 15:27:24 +0900

>>>>> On Tue, 31 Aug 1999 14:05:08 -0700 (PDT), 
>>>>> Erik Nordmark <[email-masked]> said:

>> Though the meaning does not change, the names defined in the RFC 2292
>> (and 2292bis) are a bit confusing for application programmers.
>> Just FYI, KAME locally defines the following definitions (please note
>> that we don't insist on these local definitions at all):
>> 
>> #define MLD6_LISTENER_QUERY		130 	/* multicast listener query */
>> #define MLD6_LISTENER_REPORT		131	/* multicast listener report */
>> #define MLD6_LISTENER_DONE		132	/* multicast listener done */

> To be consitent with ND_ (and since the protocol is really MLD and
> not MLDv6) it would make sense to use the MLD_ prefix instead of MLD6_.

Okay.

>> I admit that it's hard (even impossible) to catch up all such new
>> protocols, but 2292bis would be a good opportunity. I hope the revised
>> API reflects as much changes as possible.

> I agree that this would make sense.

> Have you guys defined data structures for the above packet/option
> formats in addition to the constants you list below?

Yes, I'll show them below:

MLD related structure (and shortcut macros):
struct mld6_hdr {
	struct icmp6_hdr	mld6_hdr;
	struct in6_addr		mld6_addr; /* multicast address */
};

#define mld6_type	mld6_hdr.icmp6_type
#define mld6_code	mld6_hdr.icmp6_code
#define mld6_cksum	mld6_hdr.icmp6_cksum
#define mld6_maxdelay	mld6_hdr.icmp6_data16[0]
#define mld6_reserved	mld6_hdr.icmp6_data16[1]

============
Router Renumbering related structures:
#if BYTE_ORDER == BIG_ENDIAN /* net byte order */
struct icmp6_router_renum {	/* router renumbering header */
	struct icmp6_hdr	rr_hdr;
	u_int8_t		rr_segnum;
	u_int8_t		rr_test : 1;
	u_int8_t		rr_reqresult : 1;
	u_int8_t		rr_forceapply : 1;
	u_int8_t		rr_specsite : 1;
	u_int8_t		rr_prevdone : 1;
	u_int8_t		rr_flags_reserved : 3;
	u_int16_t		rr_maxdelay;
	u_int32_t		rr_reserved;
};
#elif BYTE_ORDER == LITTLE_ENDIAN
struct icmp6_router_renum {	/* router renumbering header */
	struct icmp6_hdr	rr_hdr;
	u_int8_t		rr_segnum;
	u_int8_t		rr_flags_reserved : 3;
	u_int8_t		rr_prevdone : 1;
	u_int8_t		rr_specsite : 1;
	u_int8_t		rr_forceapply : 1;
	u_int8_t		rr_reqresult : 1;
	u_int8_t		rr_test : 1;
	u_int16_t		rr_maxdelay;
	u_int32_t		rr_reserved;
};
#endif /* BYTE_ORDER */

#define rr_type			rr_hdr.icmp6_type
#define rr_code			rr_hdr.icmp6_code
#define rr_cksum		rr_hdr.icmp6_cksum
#define rr_seqnum 		rr_hdr.icmp6_data32[0]

struct rr_pco_match {		/* match prefix part */
	u_int8_t	rpm_code;
	u_int8_t	rpm_len;
	u_int8_t	rpm_ordinal;
	u_int8_t	rpm_matchlen;
	u_int8_t	rpm_minlen;
	u_int8_t	rpm_maxlen;
	u_int16_t	rpm_reserved;
	struct in6_addr	rpm_prefix;
};

#define RPM_PCO_ADD		1
#define RPM_PCO_CHANGE		2
#define RPM_PCO_SETGLOBAL	3
#define RPM_PCO_MAX		4

#if BYTE_ORDER == BIG_ENDIAN /* net byte order */
struct rr_pco_use {		/* use prefix part */
	u_int8_t	rpu_uselen;
	u_int8_t	rpu_keeplen;
	u_int8_t	rpu_mask_onlink : 1;
	u_int8_t	rpu_mask_autonomous : 1;
	u_int8_t	rpu_mask_reserved : 6;
	u_int8_t	rpu_onlink : 1;
	u_int8_t	rpu_autonomous : 1;
	u_int8_t	rpu_raflags_reserved : 6;
	u_int32_t	rpu_vltime;
	u_int32_t	rpu_pltime;
	u_int32_t	rpu_decr_vltime : 1;
	u_int32_t	rpu_decr_pltime : 1;
	u_int32_t	rpu_flags_reserved : 6;
	u_int32_t	rpu_reserved : 24;
	struct in6_addr rpu_prefix;
};
#elif BYTE_ORDER == LITTLE_ENDIAN
struct rr_pco_use {		/* use prefix part */
	u_int8_t	rpu_uselen;
	u_int8_t	rpu_keeplen;
	u_int8_t	rpu_mask_reserved : 6;
	u_int8_t	rpu_mask_autonomous : 1;
	u_int8_t	rpu_mask_onlink : 1;
	u_int8_t	rpu_raflags_reserved : 6;
	u_int8_t	rpu_autonomous : 1;
	u_int8_t	rpu_onlink : 1;
	u_int32_t	rpu_vltime;
	u_int32_t	rpu_pltime;
	u_int32_t	rpu_flags_reserved : 6;
	u_int32_t	rpu_decr_pltime : 1;
	u_int32_t	rpu_decr_vltime : 1;
	u_int32_t	rpu_reserved : 24;
	struct in6_addr rpu_prefix;
};
#endif /* BYTE_ORDER */

#if BYTE_ORDER == BIG_ENDIAN /* net byte order */
struct rr_result {		/* router renumbering result message */
	u_int8_t	rrr_reserved;
	u_int8_t	rrr_flags_reserved : 6;
	u_int8_t	rrr_outofbound : 1;
	u_int8_t	rrr_forbidden : 1;
	u_int8_t	rrr_ordinal;
	u_int8_t	rrr_matchedlen;
	u_int32_t	rrr_ifid;
	struct in6_addr rrr_prefix;
};
#elif BYTE_ORDER == LITTLE_ENDIAN
struct rr_result {		/* router renumbering result message */
	u_int8_t	rrr_reserved;
	u_int8_t	rrr_forbidden : 1;
	u_int8_t	rrr_outofbound : 1;
	u_int8_t	rrr_flags_reserved : 6;
	u_int8_t	rrr_ordinal;
	u_int8_t	rrr_matchedlen;
	u_int32_t	rrr_ifid;
	struct in6_addr rrr_prefix;
};
#endif /* BYTE_ORDER */

============
ICMPv6 name lookups related structures and macros:
struct icmp6_nodeinfo {
	struct icmp6_hdr icmp6_ni_hdr;
	u_int64_t icmp6_ni_nonce;
	/* could be followed by reply data */
};

#define ni_type		icmp6_ni_hdr.icmp6_type
#define ni_code		icmp6_ni_hdr.icmp6_code
#define ni_cksum	icmp6_ni_hdr.icmp6_cksum
#define ni_qtype	icmp6_ni_hdr.icmp6_data16[0]
#define ni_flags	icmp6_ni_hdr.icmp6_data16[1]

#define NI_QTYPE_NOOP		0 /* NOOP  */
#define NI_QTYPE_SUPTYPES	1 /* Supported Qtypes */
#define NI_QTYPE_FQDN		2 /* FQDN */
#define NI_QTYPE_NODEADDR	3 /* Node Addresses. XXX: spec says 2, but it may be a typo... */

#if BYTE_ORDER == BIG_ENDIAN
#define NI_SUPTYPE_FLAG_COMPRESS	0x1
#define NI_FQDN_FLAG_VALIDTTL		0x1
#define NI_NODEADDR_FLAG_LINKLOCAL	0x1
#define NI_NODEADDR_FLAG_SITELOCAL	0x2
#define NI_NODEADDR_FLAG_GLOBAL		0x4
#define NI_NODEADDR_FLAG_ALL		0x8
#define NI_NODEADDR_FLAG_TRUNCATE	0x10
#elif BYTE_ORDER == LITTLE_ENDIAN
#define NI_SUPTYPE_FLAG_COMPRESS	0x0100
#define NI_FQDN_FLAG_VALIDTTL		0x0100
#define NI_NODEADDR_FLAG_LINKLOCAL	0x0100
#define NI_NODEADDR_FLAG_SITELOCAL	0x0200
#define NI_NODEADDR_FLAG_GLOBAL		0x0400
#define NI_NODEADDR_FLAG_ALL		0x0800
#define NI_NODEADDR_FLAG_TRUNCATE	0x1000
#endif

struct ni_reply_fqdn {
	u_int32_t ni_fqdn_ttl;	/* TTL */
	u_int8_t ni_fqdn_namelen; /* length in octets of the FQDN */
	u_int8_t ni_fqdn_name[3]; /* XXX: alignment */
};

============
macros for IPv6 (HbH and destination) options (some of them might be
unnecessary):

#define IP6OPT_PAD1		0x00	/* 00 0 00000 */
#define IP6OPT_PADN		0x01	/* 00 0 00001 */
#define IP6OPT_JUMBO		0xC2	/* 11 0 00010 = 194 */
#define IP6OPT_JUMBO_LEN	6
#define IP6OPT_TYPE(o)		((o) & 0xC0)
#define IP6OPT_TYPE_SKIP	0x00
#define IP6OPT_TYPE_DISCARD	0x40
#define IP6OPT_TYPE_FORCEICMP	0x80
#define IP6OPT_TYPE_ICMP	0xC0
#define IP6OPT_MUTABLE		0x20

============
Generic structure for IPv6 extension headers:
(this might be unnecessary, but we belive this is useful)
struct	ip6_ext {
	u_char	ip6e_nxt;
	u_char	ip6e_len;
};

============
(end of our definitions)

					JINMEI, Tatuya
					Communication Platform Lab.
					Corporate R&D Center, Toshiba Corp.
					[email-masked]
--------------------------------------------------------------------
IETF IPng Working Group Mailing List
IPng Home Page:                      http://playground.sun.com/ipng
FTP archive:                      ftp://playground.sun.com/pub/ipng
Direct all administrative requests to [email-masked]
--------------------------------------------------------------------

---

From: JINMEI Tatuya / 神明達哉<[email-masked]>
Date: Fri, 03 Sep 1999 15:42:53 +0900

>> Moreover, there are some new protocols that have been defined since
>> RFC 2292 and are about to be standardized, e.g.
>> 
>> Router Renumbering
>> Router Alert Option
>> ICMPv6 name lookups

> Is name lookups moving forward? Is it close to a WG last call?
> (I haven't heard much about it.)

(Sorry, I missed the comment above.) As far as I know, there's been no
action to proceed ICMPv6 name lookups.

					JINMEI, Tatuya