* 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 rea
| 2045 | * consistent, and those really are as of August 2004. |
| 2046 | */ |
| 2047 | int |
| 2048 | in6_if2idlen(struct ifnet *ifp) |
| 2049 | { |
| 2050 | switch (ifp->if_type) { |
| 2051 | case IFT_ETHER: /* RFC2464 */ |
| 2052 | case IFT_PROPVIRTUAL: /* XXX: no RFC. treat it as ether */ |
| 2053 | case IFT_L2VLAN: /* ditto */ |
| 2054 | case IFT_BRIDGE: /* bridge(4) only does Ethernet-like links */ |
| 2055 | case IFT_INFINIBAND: |
| 2056 | return (64); |
| 2057 | case IFT_PPP: /* RFC2472 */ |
| 2058 | return (64); |
| 2059 | case IFT_FRELAY: /* RFC2590 */ |
| 2060 | return (64); |
| 2061 | case IFT_IEEE1394: /* RFC3146 */ |
| 2062 | return (64); |
| 2063 | case IFT_GIF: |
| 2064 | return (64); /* draft-ietf-v6ops-mech-v2-07 */ |
| 2065 | case IFT_LOOP: |
| 2066 | return (64); /* XXX: is this really correct? */ |
| 2067 | default: |
| 2068 | /* |
| 2069 | * Unknown link type: |
| 2070 | * It might be controversial to use the today's common constant |
| 2071 | * of 64 for these cases unconditionally. For full compliance, |
| 2072 | * we should return an error in this case. On the other hand, |
| 2073 | * if we simply miss the standard for the link type or a new |
| 2074 | * standard is defined for a new link type, the IFID length |
| 2075 | * is very likely to be the common constant. As a compromise, |
| 2076 | * we always use the constant, but make an explicit notice |
| 2077 | * indicating the "unknown" case. |
| 2078 | */ |
| 2079 | printf("in6_if2idlen: unknown link type (%d)\n", ifp->if_type); |
| 2080 | return (64); |
| 2081 | } |
| 2082 | } |
| 2083 | |
| 2084 | struct in6_llentry { |
| 2085 | struct llentry base; |
no test coverage detected