Lines Matching refs:neigh

53 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb);
72 static bool dn_key_eq(const struct neighbour *neigh, const void *pkey) in dn_key_eq() argument
74 return neigh_key_eq16(neigh, pkey); in dn_key_eq()
110 static int dn_neigh_construct(struct neighbour *neigh) in dn_neigh_construct() argument
112 struct net_device *dev = neigh->dev; in dn_neigh_construct()
113 struct dn_neigh *dn = (struct dn_neigh *)neigh; in dn_neigh_construct()
130 __neigh_parms_put(neigh->parms); in dn_neigh_construct()
131 neigh->parms = neigh_parms_clone(parms); in dn_neigh_construct()
134 neigh->ops = &dn_neigh_ops; in dn_neigh_construct()
135 neigh->nud_state = NUD_NOARP; in dn_neigh_construct()
136 neigh->output = neigh->ops->connected_output; in dn_neigh_construct()
139 memcpy(neigh->ha, dev->broadcast, dev->addr_len); in dn_neigh_construct()
141 dn_dn2eth(neigh->ha, dn->addr); in dn_neigh_construct()
166 static void dn_neigh_error_report(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_error_report() argument
172 static int dn_neigh_output(struct neighbour *neigh, struct sk_buff *skb) in dn_neigh_output() argument
176 struct net_device *dev = neigh->dev; in dn_neigh_output()
183 seq = read_seqbegin(&neigh->ha_lock); in dn_neigh_output()
185 neigh->ha, mac_addr, skb->len); in dn_neigh_output()
186 } while (read_seqretry(&neigh->ha_lock, seq)); in dn_neigh_output()
201 struct neighbour *neigh = rt->n; in dn_neigh_output_packet() local
203 return neigh->output(neigh, skb); in dn_neigh_output_packet()
209 static int dn_long_output(struct neighbour *neigh, struct sock *sk, in dn_long_output() argument
212 struct net_device *dev = neigh->dev; in dn_long_output()
250 &init_net, sk, skb, NULL, neigh->dev, in dn_long_output()
257 static int dn_short_output(struct neighbour *neigh, struct sock *sk, in dn_short_output() argument
260 struct net_device *dev = neigh->dev; in dn_short_output()
291 &init_net, sk, skb, NULL, neigh->dev, in dn_short_output()
300 static int dn_phase3_output(struct neighbour *neigh, struct sock *sk, in dn_phase3_output() argument
303 struct net_device *dev = neigh->dev; in dn_phase3_output()
333 &init_net, sk, skb, NULL, neigh->dev, in dn_phase3_output()
341 struct neighbour *neigh = rt->n; in dn_to_neigh_output() local
342 struct dn_neigh *dn = (struct dn_neigh *)neigh; in dn_to_neigh_output()
347 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_to_neigh_output()
356 return dn_phase3_output(neigh, sk, skb); in dn_to_neigh_output()
358 return dn_long_output(neigh, sk, skb); in dn_to_neigh_output()
360 return dn_short_output(neigh, sk, skb); in dn_to_neigh_output()
385 struct neighbour *neigh; in dn_neigh_router_hello() local
392 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_router_hello()
394 dn = (struct dn_neigh *)neigh; in dn_neigh_router_hello()
396 if (neigh) { in dn_neigh_router_hello()
397 write_lock(&neigh->lock); in dn_neigh_router_hello()
399 neigh->used = jiffies; in dn_neigh_router_hello()
400 dn_db = rcu_dereference(neigh->dev->dn_ptr); in dn_neigh_router_hello()
402 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_router_hello()
403 neigh->updated = jiffies; in dn_neigh_router_hello()
405 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_router_hello()
406 memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_router_hello()
426 dn_db->router = neigh_clone(neigh); in dn_neigh_router_hello()
429 neigh_release(xchg(&dn_db->router, neigh_clone(neigh))); in dn_neigh_router_hello()
432 write_unlock(&neigh->lock); in dn_neigh_router_hello()
433 neigh_release(neigh); in dn_neigh_router_hello()
446 struct neighbour *neigh; in dn_neigh_endnode_hello() local
452 neigh = __neigh_lookup(&dn_neigh_table, &src, skb->dev, 1); in dn_neigh_endnode_hello()
454 dn = (struct dn_neigh *)neigh; in dn_neigh_endnode_hello()
456 if (neigh) { in dn_neigh_endnode_hello()
457 write_lock(&neigh->lock); in dn_neigh_endnode_hello()
459 neigh->used = jiffies; in dn_neigh_endnode_hello()
461 if (!(neigh->nud_state & NUD_PERMANENT)) { in dn_neigh_endnode_hello()
462 neigh->updated = jiffies; in dn_neigh_endnode_hello()
464 if (neigh->dev->type == ARPHRD_ETHER) in dn_neigh_endnode_hello()
465 memcpy(neigh->ha, &eth_hdr(skb)->h_source, ETH_ALEN); in dn_neigh_endnode_hello()
471 write_unlock(&neigh->lock); in dn_neigh_endnode_hello()
472 neigh_release(neigh); in dn_neigh_endnode_hello()
505 static void neigh_elist_cb(struct neighbour *neigh, void *_info) in neigh_elist_cb() argument
510 if (neigh->dev != s->dev) in neigh_elist_cb()
513 dn = (struct dn_neigh *) neigh; in neigh_elist_cb()
526 *(s->rs) = neigh->nud_state & NUD_CONNECTED ? 0x80 : 0x0; in neigh_elist_cb()