Lines Matching refs:neigh

54 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb);
73 static bool dn_key_eq(const struct neighbour *neigh, const void *pkey) in dn_key_eq() argument
75 return neigh_key_eq16(neigh, pkey); in dn_key_eq()
111 static int dn_neigh_construct(struct neighbour *neigh) in dn_neigh_construct() argument
113 struct net_device *dev = neigh->dev; in dn_neigh_construct()
114 struct dn_neigh *dn = container_of(neigh, struct dn_neigh, n); in dn_neigh_construct()
131 __neigh_parms_put(neigh->parms); in dn_neigh_construct()
132 neigh->parms = neigh_parms_clone(parms); in dn_neigh_construct()
135 neigh->ops = &dn_neigh_ops; in dn_neigh_construct()
136 neigh->nud_state = NUD_NOARP; in dn_neigh_construct()
137 neigh->output = neigh->ops->connected_output; in dn_neigh_construct()
140 memcpy(neigh->ha, dev->broadcast, dev->addr_len); in dn_neigh_construct()
142 dn_dn2eth(neigh->ha, dn->addr); in dn_neigh_construct()
167 static void dn_neigh_error_report(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_error_report() argument
173 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_output() argument
177 struct net_device *dev = neigh->dev; in dn_neigh_output()
184 seq = read_seqbegin(&neigh->ha_lock); in dn_neigh_output()
186 neigh->ha, mac_addr, skb->len); in dn_neigh_output()
187 } while (read_seqretry(&neigh->ha_lock, seq)); in dn_neigh_output()
202 struct neighbour *neigh = rt->n; in dn_neigh_output_packet() local
204 return neigh->output(neigh, skb); in dn_neigh_output_packet()
210 static int dn_long_output(struct neighbour *neigh, struct sock *sk, in dn_long_output() argument
213 struct net_device *dev = neigh->dev; in dn_long_output()
251 &init_net, sk, skb, NULL, neigh->dev, in dn_long_output()
258 static int dn_short_output(struct neighbour *neigh, struct sock *sk, in dn_short_output() argument
261 struct net_device *dev = neigh->dev; in dn_short_output()
292 &init_net, sk, skb, NULL, neigh->dev, in dn_short_output()
301 static int dn_phase3_output(struct neighbour *neigh, struct sock *sk, in dn_phase3_output() argument
304 struct net_device *dev = neigh->dev; in dn_phase3_output()
334 &init_net, sk, skb, NULL, neigh->dev, in dn_phase3_output()
342 struct neighbour *neigh = rt->n; in dn_to_neigh_output() local
343 struct dn_neigh *dn = container_of(neigh, struct dn_neigh, n); in dn_to_neigh_output()
348 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_to_neigh_output()
357 return dn_phase3_output(neigh, sk, skb); in dn_to_neigh_output()
359 return dn_long_output(neigh, sk, skb); in dn_to_neigh_output()
361 return dn_short_output(neigh, sk, skb); in dn_to_neigh_output()
386 struct neighbour *neigh; in dn_neigh_router_hello() local
393 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_router_hello()
395 dn = container_of(neigh, struct dn_neigh, n); in dn_neigh_router_hello()
397 if (neigh) { in dn_neigh_router_hello()
398 write_lock(&neigh->lock); in dn_neigh_router_hello()
400 neigh->used = jiffies; in dn_neigh_router_hello()
401 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_neigh_router_hello()
403 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_router_hello()
404 neigh->updated = jiffies; in dn_neigh_router_hello()
406 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_router_hello()
407 memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_router_hello()
427 dn_db->router = neigh_clone(neigh); in dn_neigh_router_hello()
430 neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); in dn_neigh_router_hello()
433 write_unlock(&neigh->lock); in dn_neigh_router_hello()
434 neigh_release(neigh); in dn_neigh_router_hello()
447 struct neighbour *neigh; in dn_neigh_endnode_hello() local
453 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_endnode_hello()
455 dn = container_of(neigh, struct dn_neigh, n); in dn_neigh_endnode_hello()
457 if (neigh) { in dn_neigh_endnode_hello()
458 write_lock(&neigh->lock); in dn_neigh_endnode_hello()
460 neigh->used = jiffies; in dn_neigh_endnode_hello()
462 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_endnode_hello()
463 neigh->updated = jiffies; in dn_neigh_endnode_hello()
465 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_endnode_hello()
466 memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_endnode_hello()
472 write_unlock(&neigh->lock); in dn_neigh_endnode_hello()
473 neigh_release(neigh); in dn_neigh_endnode_hello()
506 static void neigh_elist_cb(struct neighbour *neigh, void *_info) in neigh_elist_cb() argument
511 if (neigh->dev != s->dev) in neigh_elist_cb()
514 dn = container_of(neigh, struct dn_neigh, n); in neigh_elist_cb()
527 *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; in neigh_elist_cb()