📄 ip_fib.h
字号:
/* ip_fib.h * linqianghe@163.com * 2006-11-07 */#ifndef INCLUDED_IP_FIB_H#define INCLUDED_IP_FIB_H#include <rtnetlink.h>#include <net/ip_fib.h>#define MYFIB_RES_PREFSRC(res) ((res).fi->fib_prefsrc ? : __myfib_res_prefsrc(&res))extern struct fib_table * myfib_tables[RT_TABLE_MAX+1];#define myip_fib_local_table (myfib_tables[RT_TABLE_LOCAL])#define myip_fib_main_table (myfib_tables[RT_TABLE_MAIN])struct fib_table *__myfib_new_table( int id );void myfib_rule_put( struct fib_rule *r );void myfree_fib_info(struct fib_info *fi);int myfib_lookup(const struct flowi *flp, struct fib_result *res);static inline struct fib_table *myfib_new_table(int id){ if( id == 0 ) id = RT_TABLE_MAIN; return myfib_tables[id] ? : __myfib_new_table(id);}static inline void myfib_info_put(struct fib_info *fi){ if( atomic_dec_and_test(&fi->fib_clntref) ) myfree_fib_info(fi);}static inline void myfib_res_put(struct fib_result *res){ if( res->fi ) myfib_info_put( res->fi ); if( res->r ) myfib_rule_put( res->r );}static inline struct fib_table *myfib_get_table(int id){ if (id == 0) id = RT_TABLE_MAIN; return myfib_tables[id];}#endif //INCLUDED_IP_FIB_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -