FreeBSD/sys/netinet6/in6.c
/*
 * Provide the length of interface identifiers to be used for the link attached
 * to the given interface.  The length should be defined in "IPv6 over
 * xxx-link" document.  Note that address architecture might also define
 * the length for a particular set of address prefixes, regardless of the
 * link type.  As clarified in rfc2462bis, those two definitions should be
 * consistent, and those really are as of August 2004.
 */
Provide the length of interface identifiers to be used for the link attached
to the given interface.  The length should be defined in "IPv6 over
xxx-link" document.  Note that address architecture might also define
the length for a particular set of address prefixes, regardless of the
link type.  As clarified in rfc2462bis, those two definitions should be
consistent, and those really are as of August 2004.
Provide the length of interface identifiers to be used for the link attached to the given interface . The length should be defined in " IPv6 over xxx - link " document . Note that address architecture might also define the length for a particular set of address prefixes regardless of the link type . As clarified in rfc2462bis those two definitions should be consistent and those really are as of August 2004 .
int
in6_if2idlen(struct ifnet *ifp)
{
	switch (ifp->if_type) {
	case IFT_ETHER:		
	case IFT_PROPVIRTUAL:	
	case IFT_L2VLAN:	
	case IFT_IEEE80211:	
	case IFT_BRIDGE:	
	case IFT_INFINIBAND:
		return (64);
	case IFT_FDDI:		
		return (64);
	case IFT_ISO88025:	
		return (64);
	case IFT_PPP:		
		return (64);
	case IFT_ARCNET:	
		return (64);
	case IFT_FRELAY:	
		return (64);
	case IFT_IEEE1394:	
		return (64);
	case IFT_GIF:
		return (64);	
	case IFT_LOOP:
		return (64);	
	default:
		printf("in6_if2idlen: unknown link type (%d)\n", ifp->if_type);
		return (64);
	}
}
int in6_if2idlen ( struct ifnet * ifp ) { switch ( ifp -> if_type ) { case IFT_ETHER : case IFT_PROPVIRTUAL : case IFT_L2VLAN : case IFT_IEEE80211 : case IFT_BRIDGE : case IFT_INFINIBAND : return ( 64 ) ; case IFT_FDDI : return ( 64 ) ; case IFT_ISO88025 : return ( 64 ) ; case IFT_PPP : return ( 64 ) ; case IFT_ARCNET : return ( 64 ) ; case IFT_FRELAY : return ( 64 ) ; case IFT_IEEE1394 : return ( 64 ) ; case IFT_GIF : return ( 64 ) ; case IFT_LOOP : return ( 64 ) ; default : printf ( " \n " , ifp -> if_type ) ; return ( 64 ) ; } }
Provide the length of interface identifiers to be used for the link attached
 to the given interface.
Provide the length of interface identifiers to be used for the link attached to the given interface .
/* RFC2464 */ /* XXX: no RFC. treat it as ether */ /* ditto */ /* ditto */ /* bridge(4) only does Ethernet-like links */ /* RFC2467 */ /* RFC2470 (IPv6 over Token Ring) */ /* RFC2472 */ /* RFC2497 */ /* RFC2590 */ /* RFC3146 */ /* draft-ietf-v6ops-mech-v2-07 */ /* XXX: is this really correct? */ /*
		 * Unknown link type:
		 * It might be controversial to use the today's common constant
		 * of 64 for these cases unconditionally.  For full compliance,
		 * we should return an error in this case.  On the other hand,
		 * if we simply miss the standard for the link type or a new
		 * standard is defined for a new link type, the IFID length
		 * is very likely to be the common constant.  As a compromise,
		 * we always use the constant, but make an explicit notice
		 * indicating the "unknown" case.
		 */