dev.h
来自「一个基于linux的TCP/IP协议栈的实现」· C头文件 代码 · 共 49 行
H
49 行
/* dev.h * linqianghe@163.com * 2006-09-18 */#ifndef INCLUDED_DEV_H#define INCLUDED_DEV_H#include <linux/skbuff.h>#include <asm/percpu.h>#include <linux/netdevice.h>#define HARD_TX_LOCK(dev, cpu) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ spin_lock(&dev->xmit_lock); \ dev->xmit_lock_owner = cpu; \ } \}#define HARD_TX_UNLOCK(dev) { \ if ((dev->features & NETIF_F_LLTX) == 0) { \ dev->xmit_lock_owner = -1; \ spin_unlock(&dev->xmit_lock); \ } \}DECLARE_PER_CPU( struct softnet_data, mysoftnet_data );DECLARE_PER_CPU(struct netif_rx_stats, mynetdev_rx_stat);#define MYNET_TX_SOFTIRQ 30#define MYNET_RX_SOFTIRQ 31int mydev_ioctl(unsigned int cmd, void __user *arg);int myregister_gifconf( unsigned int family, gifconf_func_t * gifconf );static inline int myunregister_gifconf(unsigned int family){ return myregister_gifconf(family, NULL);}int mynetif_rx(struct sk_buff *skb);void mydev_add_pack(struct packet_type *pt);void mydev_remove_pack(struct packet_type *pt);int mydev_queue_xmit(struct sk_buff *skb);int __init mynet_dev_init(void);void __exit mynet_dev_exit(void);#endif //INCLUDED_DEV_H
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?