net.h

来自「软件无线电的平台」· C头文件 代码 · 共 73 行

H
73
字号
#ifndef NET_H__#define NET_H__#include "tcpip.h"#include "buf.h"#ifndef USER_SPACE/* * This structure is private to each device. It is used to pass * packets in and out, so there is place for a packet */#define NET_RX_INTR 1#define NET_TX_INTR 2struct net_priv {  struct net_device_stats stats;  int status;  int rx_packetlen;  u8 *rx_packetdata;  int tx_packetlen;  u8 *tx_packetdata;  struct sk_buff *skb;  spinlock_t lock;  struct buffer_t *buf;};#elsestruct net_priv {  int status;  int rx_packetlen;  u8 *rx_packetdata;  int tx_packetlen;  u8 *tx_packetdata;  struct buffer_t *buf;};struct sk_buff {  int v;};struct net_device {  void *priv;};#endif/* * Generate a packet */int net_tx( struct buffer_t *buf );/** * @short sends a packet to the kernel * * Takes a packet, makes a nice envelope and sends it to * the kernel. * * @param block the packet * @param len the length in bytes */void net_send_to_kernel(struct net_device *dev, char *buf, int len);/** * The initialisation function called by an insmod tcpip */int net_init( void );/** * The cleanup function called when rmmod tcpip */void net_cleanup( void );#endif

⌨️ 快捷键说明

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