On Mon, 31 Jan 2005, YOSHIFUJI Hideaki / [iso-2022-jp] µÈÆ£±ÑÌÀ wrote:
> Ok, but basically, we do not export it unless it is really used.
> We may do if it is necessary when you merge it.
>
> BTW, for your purpose, we may export
> ndisc_lookup()
> or something instead of nd_tbl itself.
>
> Anyway, I'd like to know the usage (code).
Your new ndisc_lookup() would need to distinguish the IP address types
(relating to different tables).
Here is roughly what we do:
---
int netbox_neigh_map(struct net_device *dev,
struct lunartarget_s *host,
char *eth)
{
struct neighbour *neigh = 0;
if (TARGET_IS_IPV4(host))
neigh = neigh_lookup_errno(&arp_tbl, (struct
in_addr*)&(host->addr.ipv4), dev);
else if (TARGET_IS_IPV6(host))
neigh = neigh_lookup_errno(&nd_tbl, &host->addr.ipv6, dev);
if (!IS_ERR(neigh)) {
neigh->parms->delay_probe_time = 0;
NEIGH_UPDATE(neigh, eth, NUD_REACHABLE, 1, 0);
neigh_release(neigh);
}
return 0;
}
---
Our other function netbox_neigh_unmap() is basically the same,
with the flag NUD_REACHABLE replaced by NUD_NONE.
best, christian
PS: full code (use guest/guest for username/password) at
https://subversion.cs.unibas.ch/repos/lunar/trunk/lnx/knetbox.c
>
> --yoshfuji
>
|