Skip to content

Commit

Permalink
remove unused old code.
Browse files Browse the repository at this point in the history
  • Loading branch information
keiichi committed Oct 9, 2001
1 parent 1c4c2cd commit 9428fb3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 155 deletions.
132 changes: 1 addition & 131 deletions kame/sys/net/if_hif.c
@@ -1,4 +1,4 @@
/* $KAME: if_hif.c,v 1.7 2001/09/20 10:22:13 keiichi Exp $ */
/* $KAME: if_hif.c,v 1.8 2001/10/09 11:00:00 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -213,12 +213,7 @@ hifattach(dummy)
sc->hif_location = HIF_LOCATION_UNKNOWN;

/* Initialize home prefix list, HA list, BU list */
#ifdef MIP6_OLD
LIST_INIT(&sc->hif_pfx_list);
LIST_INIT(&sc->hif_ha_list);
#endif
LIST_INIT(&sc->hif_bu_list);

TAILQ_INIT(&sc->hif_hs_list_home);
TAILQ_INIT(&sc->hif_hs_list_foreign);
sc->hif_hs_current = NULL;
Expand Down Expand Up @@ -641,131 +636,6 @@ hif_coa_list_find_withifp(hcoa_list, ifp)
return (hcoa);
}

#ifdef MIP6_OLD
struct hif_ha *
hif_ha_create(onhomelink, mha)
u_int8_t onhomelink;
struct mip6_ha *mha;
{
struct hif_ha *hha;

hha = malloc(sizeof(struct hif_ha), M_TEMP, M_NOWAIT);
if (hha) {
hha->hha_onhomelink = onhomelink;
hha->hha_mha = mha;
}

return (hha);
}

int
hif_ha_list_insert(hha_list, hha)
struct hif_ha_list *hha_list;
struct hif_ha *hha;
{
if (hha == NULL)
return (-1);

LIST_INSERT_HEAD(hha_list, hha, hha_entry);

return (0);
}

int
hif_ha_list_remove_withmha(hha_list, mha)
struct hif_ha_list *hha_list;
struct mip6_ha *mha;
{
struct hif_ha *hha;

for (hha = LIST_FIRST(hha_list); hha;
hha = LIST_NEXT(hha, hha_entry)) {
if (hha->hha_mha == mha)
break;
}
if (hha) {
LIST_REMOVE(hha, hha_entry);
free(hha, M_TEMP);
}
return (0);
}

int
hif_ha_list_isonhomelink(hha_list, rtaddr)
struct hif_ha_list *hha_list;
struct in6_addr *rtaddr;
{
struct hif_ha *hha;
int onhomelink = 0;

for (hha = LIST_FIRST(hha_list); hha;
hha = LIST_NEXT(hha, hha_entry)) {
if ((hha->hha_onhomelink)
&& (IN6_ARE_ADDR_EQUAL(&hha->hha_mha->mha_lladdr,
rtaddr)
|| IN6_ARE_ADDR_EQUAL(&hha->hha_mha->mha_gaddr,
rtaddr))) {
onhomelink = 1;
break;
}
}

return (onhomelink);
}

struct hif_ha *
hif_ha_list_find_onhomelink(hha_list)
struct hif_ha_list *hha_list;
{
struct hif_ha *hha;

for (hha = LIST_FIRST(hha_list); hha;
hha = LIST_NEXT(hha, hha_entry)) {
if (hha->hha_onhomelink)
break;
}

return (hha);
}

struct hif_ha *
hif_ha_list_find_preferable(hha_list)
struct hif_ha_list *hha_list;
{
struct hif_ha *hha, *best;

best = LIST_FIRST(hha_list);
for (hha = LIST_FIRST(hha_list); hha;
hha = LIST_NEXT(hha, hha_entry)) {
if ((best) && (best->hha_mha)
&& (hha) && (hha->hha_mha)) {
if (best->hha_mha->mha_pref < hha->hha_mha->mha_pref)
best = hha;
}
}

return (best);
}

struct hif_ha *
hif_ha_list_find_withaddr(hha_list, rtaddr)
struct hif_ha_list *hha_list;
struct in6_addr *rtaddr;
{
struct hif_ha *hha;

for (hha = LIST_FIRST(hha_list);
hha;
hha = LIST_NEXT(hha, hha_entry)) {
if (IN6_ARE_ADDR_EQUAL(&hha->hha_mha->mha_lladdr, rtaddr)
|| IN6_ARE_ADDR_EQUAL(&hha->hha_mha->mha_gaddr, rtaddr))
break;
}

return (hha);
}
#endif /* MIP6_OLD */

static int
hif_ha_list_update_withioctl(sc, data)
struct hif_softc *sc;
Expand Down
25 changes: 1 addition & 24 deletions kame/sys/net/if_hif.h
@@ -1,4 +1,4 @@
/* $KAME: if_hif.h,v 1.3 2001/09/20 10:22:13 keiichi Exp $ */
/* $KAME: if_hif.h,v 1.4 2001/10/09 11:00:00 keiichi Exp $ */

/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
Expand Down Expand Up @@ -152,11 +152,6 @@ struct hif_softc {
TAILQ_ENTRY(hif_softc) hif_entry;
int hif_location; /* cur location */
int hif_location_prev; /* XXX */

#ifdef MIP6_OLD
LIST_HEAD(mip6_pfx_list, mip6_pfx) hif_pfx_list; /* list of pfxes */
LIST_HEAD(hif_ha_list, hif_ha) hif_ha_list; /* list of HAs */
#endif
LIST_HEAD(mip6_bu_list, mip6_bu) hif_bu_list; /* list of BUs */
struct hif_subnet_list hif_hs_list_home;
struct hif_subnet_list hif_hs_list_foreign;
Expand All @@ -170,14 +165,6 @@ struct hif_coa {
struct ifnet *hcoa_ifp;
};

#ifdef MIP6_OLD
struct hif_ha {
LIST_ENTRY(hif_ha) hha_entry;
u_int8_t hha_onhomelink;
struct mip6_ha *hha_mha;
};
#endif

#if defined(__FreeBSD__) && __FreeBSD__ < 3
int hif_ioctl __P((struct ifnet *, int, caddr_t));
#else
Expand Down Expand Up @@ -216,16 +203,6 @@ struct hif_softc *hif_list_find_withhaddr __P((struct in6_addr *));

struct hif_ha *hif_ha_create __P((u_int8_t, struct mip6_ha *));

#if 0
int hif_ha_list_insert __P((struct hif_ha_list *, struct hif_ha *hha));
int hif_ha_list_remove_withmha __P((struct hif_ha_list *, struct mip6_ha *));
int hif_ha_list_isonhomelink __P((struct hif_ha_list *, struct in6_addr *));
struct hif_ha *hif_ha_list_find_onhomelink __P((struct hif_ha_list *));
struct hif_ha *hif_ha_list_find_preferable __P((struct hif_ha_list *));
struct hif_ha *hif_ha_list_find_withaddr __P((struct hif_ha_list *,
struct in6_addr *));
#endif

#endif /* _KERNEL */

#endif /* !_NET_IF_HIF_H_ */

0 comments on commit 9428fb3

Please sign in to comment.