tables.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER START
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * The contents of this file are subject to the terms of the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Common Development and Distribution License, Version 1.0 only
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * (the "License"). You may not use this file except in compliance
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * with the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * See the License for the specific language governing permissions
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * and limitations under the License.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * When distributing Covered Code, include this CDDL HEADER in each
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * If applicable, add the following below this CDDL HEADER, with the
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * fields enclosed by brackets "[]" replaced with your own identifying
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * information: Portions Copyright [yyyy] [name of copyright owner]
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * CDDL HEADER END
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Use is subject to license terms.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#pragma ident "%Z%%M% %I% %E% SMI"
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic boolean_t tmptoken_isvalid(struct in6_addr *token);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void prefix_insert(struct phyint *pi, struct prefix *pr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic char *prefix_print_state(int state, char *buf, int buflen);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void prefix_set(struct in6_addr *prefix, struct in6_addr addr,
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adv_prefix_print(struct adv_prefix *adv_pr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adv_prefix_insert(struct phyint *pi, struct adv_prefix *adv_pr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void adv_prefix_delete(struct adv_prefix *adv_pr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void router_insert(struct phyint *pi, struct router *dr);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Fortestatic void router_delete_onlink(struct phyint *pi);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte/* 1 week in ms */
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte#define NDP_PREFIX_DEFAULT_LIFETIME (7*24*60*60*1000)
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (pi = phyints; pi != NULL; pi = pi->pi_next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte logmsg(LOG_DEBUG, "phyint_lookup_on_index(%d)\n", ifindex);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte for (pi = phyints; pi != NULL; pi = pi->pi_next) {
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte pi = (struct phyint *)calloc(sizeof (struct phyint), 1);
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte logmsg(LOG_ERR, "phyint_create: out of memory\n");
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte (void) strncpy(pi->pi_name, name, sizeof (pi->pi_name));
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Copy the defaults from the defaults array.
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * Do not copy the cf_notdefault fields since these have not
fcf3ce441efd61da9bb2884968af01cb7c1452ccJohn Forte * been explicitly set for the phyint.
for (i = 0; i < I_IFSIZE; i++)
return (NULL);
return (NULL);
return (pi);
if (phyints)
int fd;
if (newsock) {
goto error;
goto start_over;
goto error;
if (newsock) {
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
if (newsock) {
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
if (newsock) {
return (next);
if (set_needed) {
static boolean_t
return (_B_FALSE);
return (_B_FALSE);
return (_B_FALSE);
return (_B_FALSE);
return (_B_FALSE);
return (_B_TRUE);
goto no_token;
goto no_token;
if (i == max_tries) {
return (_B_FALSE);
return (_B_TRUE);
TMP_TOKEN_BITS))) {
return (TIMER_INFINITY);
return (TIMER_INFINITY);
sizeof (pbuf));
sizeof (tbuf));
sizeof (pbuf));
sizeof (tbuf));
return (TIMER_INFINITY);
return (_B_FALSE);
return (_B_FALSE);
if (tbits == 0)
return (_B_TRUE);
return (_B_FALSE);
return (_B_TRUE);
static struct prefix *
return (pr);
return (NULL);
return (_B_FALSE);
for (j = 0; j < pbytes; j++)
return (_B_FALSE);
if (pbits == 0)
return (_B_TRUE);
return (_B_FALSE);
return (_B_TRUE);
struct prefix *
return (NULL);
return (pr);
return (NULL);
struct prefix *
int prefixlen;
return (otherpr);
return (NULL);
struct prefix *
return (NULL);
return (pr);
struct prefix *
return (NULL);
return (pr);
goto error;
goto error;
goto error;
goto error;
goto error;
goto error;
sizeof (buf1)),
sizeof (buf1)),
sizeof (buf2)));
(char *)&lifr) < 0) {
return (next);
return (next);
char *cp;
return (buf);
return (buf);
return (buf);
return (buf);
return (buf);
return (_B_TRUE);
return (_B_FALSE);
struct adv_prefix *
return (adv_pr);
return (NULL);
struct adv_prefix *
return (NULL);
return (adv_pr);
elapsed);
return (TIMER_INFINITY);
struct router *
sizeof (addr)) == 0)
return (dr);
return (NULL);
struct router *
return (NULL);
return (dr);
struct router *
return (NULL);
return (NULL);
return (NULL);
return (dr);
return (next);
return (next);
int rlen;
if (rlen < 0) {
int rlen;
if (rlen < 0) {
phyint_print_all(void)