neighbour.h

来自「一个基于linux的TCP/IP协议栈的实现」· C头文件 代码 · 共 69 行

H
69
字号
/* neighbout.h * linqianghe@163.com * 2006-09-26 */#ifndef INCLUDED_NEIGHBOUR_H#define INCLUDED_NEIGHBOUR_H#include "log.h"#include <net/neighbour.h>void myneigh_table_init( struct neigh_table *tbl );void myneigh_table_destroy( struct neigh_table *tbl );void myneigh_destroy( struct neighbour *neigh );void myneigh_parms_destroy( struct neigh_parms *parms );int __myneigh_event_send( struct neighbour *neigh, struct sk_buff *skb );int myneigh_connected_output(struct sk_buff *skb);int myneigh_compat_output( struct sk_buff *skb );int myneigh_resolve_output( struct sk_buff *skb );struct neighbour *myneigh_lookup( struct neigh_table *tbl, const void *pkey,				struct net_device *dev );struct neighbour *myneigh_create( struct neigh_table *tbl, const void *pkey,				struct net_device *dev );struct neigh_parms *myneigh_parms_alloc(struct net_device *dev,				struct neigh_table *tbl);void myneigh_parms_release( struct neigh_table *tbl, struct neigh_parms *parms );int myneigh_ifdown( struct neigh_table *tbl, struct net_device *dev );static inline void myneigh_release(struct neighbour *neigh){    if( atomic_dec_and_test(&neigh->refcnt) )        myneigh_destroy( neigh );}static inline void myneigh_parms_put(struct neigh_parms *parms){	if (atomic_dec_and_test(&parms->refcnt))		myneigh_parms_destroy(parms);}static inline int myneigh_event_send(struct neighbour *neigh, struct sk_buff *skb){	neigh->used = jiffies;	if( !(neigh->nud_state & (NUD_CONNECTED | NUD_DELAY | NUD_PROBE)) )		return __myneigh_event_send( neigh, skb );	return 0;}static inline struct neighbour * __myneigh_lookup_errno( struct neigh_table *tbl, 				const void *pkey, struct net_device *dev ){	struct neighbour *n = myneigh_lookup(tbl, pkey, dev);	if (n)		return n;	return myneigh_create( tbl, pkey, dev );}static inline struct neigh_parms *myneigh_parms_clone(struct neigh_parms *parms){	atomic_inc(&parms->refcnt);	return parms;}void __init myarp_init(void);void __exit myarp_exit(void);#endif //INCLUDED_NEIGHBOUR_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?