⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 neighbour.h

📁 一个基于linux的TCP/IP协议栈的实现
💻 H
字号:
/* 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 );int myneigh_add(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);int myneigh_delete(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);int myneigh_dump_info(struct sk_buff *skb, struct netlink_callback *cb);int myneightbl_dump_info(struct sk_buff *skb, struct netlink_callback *cb);int myneightbl_set(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg);int myneigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, u32 flags);struct neighbour *myneigh_event_ns( struct neigh_table *tbl,				u8 *lladdr, void *saddr, struct net_device *dev );int mypneigh_delete(struct neigh_table *tbl, const void *pkey,				struct net_device *dev);struct pneigh_entry * mypneigh_lookup(struct neigh_table *tbl, const void *pkey,				struct net_device *dev, int creat);void *myneigh_seq_start(struct seq_file *seq, loff_t *pos,				struct neigh_table *tbl, unsigned int neigh_seq_flags);void *myneigh_seq_next(struct seq_file *seq, void *v, loff_t *pos);void myneigh_seq_stop(struct seq_file *seq, void *v);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(struct neigh_table *tbl, const void *pkey, struct net_device *dev, int creat){	struct neighbour *n = myneigh_lookup(tbl, pkey, dev);	if( n || !creat )		return n;	n = myneigh_create( tbl, pkey, dev );	return IS_ERR(n) ? NULL : n;}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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -