Lines Matching full:prefix
40 static void prefix_print(struct prefix *pr);
41 static void prefix_insert(struct phyint *pi, struct prefix *pr);
43 static void prefix_set(struct in6_addr *prefix, struct in6_addr addr,
298 /* Clear link-local prefix (first 10 bits) */
574 struct prefix *pr;
828 struct prefix *pr;
856 struct prefix *pr, *newpr;
906 * set up the new tmp addr, so cobble together a prefix
907 * info option struct based on the existing prefix to pass
988 * Lookup prefix structure that matches the prefix and prefix length.
991 static struct prefix *
992 prefix_lookup(struct phyint *pi, struct in6_addr prefix, int prefixlen)
994 struct prefix *pr;
999 inet_ntop(AF_INET6, (void *)&prefix,
1005 prefix_equal(prefix, pr->pr_prefix, prefixlen))
1012 * Compare two prefixes that have the same prefix length.
1013 * Fails if the prefix length is unreasonable.
1043 * Set a prefix from an address and a prefix length.
1044 * Force all the bits after the prefix length to be zero.
1047 prefix_set(struct in6_addr *prefix, struct in6_addr addr, int prefix_len)
1055 bzero((char *)prefix, sizeof (*prefix));
1058 prefix->s6_addr[j] = addr.s6_addr[j];
1062 prefix->s6_addr[j] = addr.s6_addr[j] & mask;
1066 * Lookup a prefix based on the kernel's interface name.
1068 struct prefix *
1071 struct prefix *pr;
1088 * Search the phyints list to make sure that this new prefix does
1092 struct prefix *
1093 prefix_lookup_addr_match(struct prefix *pr)
1097 struct prefix *otherpr = NULL;
1098 struct in6_addr prefix;
1106 prefix = pr->pr_prefix;
1109 otherpr = prefix_lookup(pi, prefix, prefixlen);
1121 * Initialize a new prefix without setting lifetimes etc.
1123 struct prefix *
1124 prefix_create(struct phyint *pi, struct in6_addr prefix, int prefixlen,
1127 struct prefix *pr;
1132 pi->pi_name, inet_ntop(AF_INET6, (void *)&prefix,
1135 pr = (struct prefix *)calloc(sizeof (struct prefix), 1);
1141 * The prefix might have non-zero bits after the prefix len bits.
1144 prefix_set(&pr->pr_prefix, prefix, prefixlen);
1156 * Create a new named prefix. Caller should use prefix_init_from_k
1159 struct prefix *
1162 struct prefix *pr;
1168 pr = (struct prefix *)calloc(sizeof (struct prefix), 1);
1181 prefix_insert(struct phyint *pi, struct prefix *pr)
1192 * Initialize the prefix from the content of the kernel.
1194 * prefix). However, we cannot derive the lifetime from
1196 * Ignore the prefix if the interface is not IFF_UP.
1200 prefix_init_from_k(struct prefix *pr)
1231 struct prefix *pr2;
1249 * prefix length information.
1293 * Guard against the prefix having non-zero bits after the
1294 * prefix len bits.
1322 /* Prevent ndpd from stepping on this prefix */
1351 /* Pretend that the prefix does not exist in the kernel */
1358 * Delete (unlink and free) and remove from kernel if the prefix
1362 * Removes the ipadm addrobj created for the prefix.
1365 prefix_delete(struct prefix *pr)
1397 * Toggle one or more IFF_ flags for a prefix. Turn on 'onflags' and
1401 prefix_modify_flags(struct prefix *pr, uint64_t onflags, uint64_t offflags)
1458 prefix_update_dhcp(struct prefix *pr)
1478 * Make the kernel state match what is in the prefix structure.
1479 * This includes creating the prefix (allocating a new interface name)
1480 * as well as setting the local address and on-link subnet prefix
1484 prefix_update_k(struct prefix *pr)
1594 * Set local address and set the prefix length to 128.
1618 * addrobj for the prefix in ipmgmtd daemon's aobjmap.
1640 * prefix and prefix len together with the remote token
1775 prefix_timer(struct prefix *pr, uint_t elapsed)
1831 "prefix(%s)\n", pr->pr_name);
1837 /* Might cause prefix to be deleted! */
1839 /* Log a message when an addrconf prefix goes away */
1892 prefix_print(struct prefix *pr)
1897 logmsg(LOG_DEBUG, "Prefix name: %s prefix %s/%u state %s "
1915 * Lookup advertisement prefix structure that matches the prefix and
1916 * prefix length.
1920 adv_prefix_lookup(struct phyint *pi, struct in6_addr prefix, int prefixlen)
1927 pi->pi_name, inet_ntop(AF_INET6, (void *)&prefix,
1934 prefix_equal(prefix, adv_pr->adv_pr_prefix, prefixlen))
1941 * Initialize a new advertisement prefix.
1944 adv_prefix_create(struct phyint *pi, struct in6_addr prefix, int prefixlen)
1951 pi->pi_name, inet_ntop(AF_INET6, (void *)&prefix,
1960 * The prefix might have non-zero bits after the prefix len bits.
1963 prefix_set(&adv_pr->adv_pr_prefix, prefix, prefixlen);
1983 * a corresponding "struct prefix *" which will clean up the kernel
2347 * Sets/removes the ipadm address object name for the given prefix.
2350 prefix_update_ipadm_addrobj(struct prefix *pr, boolean_t add)
2362 * address object name for this prefix.