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

📄 skdrv2nd.h

📁 该软件根据网络数据生成NetFlow记录。NetFlow可用于网络规划、负载均衡、安全监控等
💻 H
📖 第 1 页 / 共 2 页
字号:
/*******************************************************************************                                                                             **   Copyright 2005 University of Cambridge Computer Laboratory.               **                                                                             **   This file is part of Nprobe.                                              **                                                                             **   Nprobe is free software; you can redistribute it and/or modify            **   it under the terms of the GNU General Public License as published by      **   the Free Software Foundation; either version 2 of the License, or         **   (at your option) any later version.                                       **                                                                             **   Nprobe is distributed in the hope that it will be useful,                 **   but WITHOUT ANY WARRANTY; without even the implied warranty of            **   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the             **   GNU General Public License for more details.                              **                                                                             **   You should have received a copy of the GNU General Public License         **   along with Nprobe; if not, write to the Free Software                     **   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA **                                                                             *******************************************************************************//****************************************************************************** * * Name:	skdrv2nd.h * Project:	GEnesis, PCI Gigabit Ethernet Adapter * Version:	$Revision: 1.3 $ * Date:	$Date: 2003/08/12 16:51:18 $ * Purpose:	Second header file for driver and all other modules * ******************************************************************************//****************************************************************************** * *	(C)Copyright 1998-2003 SysKonnect GmbH. * *	This program is free software; you can redistribute it and/or modify *	it under the terms of the GNU General Public License as published by *	the Free Software Foundation; either version 2 of the License, or *	(at your option) any later version. * *	The information in this file is provided "AS IS" without warranty. * ******************************************************************************//****************************************************************************** * * History: * *	$Log: skdrv2nd.h,v $ *	Revision 1.3  2003/08/12 16:51:18  mlindner *	Fix: UDP and TCP Proto checks *	Fix: UDP header offset *	 *	Revision 1.2  2003/08/07 10:50:54  mlindner *	Add: Speed and HW-Csum support for Yukon Lite chipset *	 *	Revision 1.1  2003/07/21 07:25:29  rroesler *	Fix: Re-Enter after CVS crash *	 *	Revision 1.19  2003/07/07 09:53:10  rroesler *	Fix: Removed proprietary RxTx defines and used the ones from skgehw.h instead *	 *	Revision 1.18  2003/06/12 07:54:14  mlindner *	Fix: Changed Descriptor Alignment to 64 Byte *	 *	Revision 1.17  2003/05/26 12:56:39  mlindner *	Add: Support for Kernel 2.5/2.6 *	Add: New SkOsGetTimeCurrent function *	Add: SK_PNMI_HUNDREDS_SEC definition *	Fix: SK_TICKS_PER_SEC on Intel Itanium2 *	 *	Revision 1.16  2003/03/21 14:56:18  rroesler *	Added code regarding interrupt moderation *	 *	Revision 1.15  2003/02/25 14:16:40  mlindner *	Fix: Copyright statement *	 *	Revision 1.14  2003/02/25 13:26:26  mlindner *	Add: Support for various vendors *	 *	Revision 1.13  2002/10/02 12:46:02  mlindner *	Add: Support for Yukon *	 *	Revision 1.12.2.2  2001/09/05 12:14:50  mlindner *	add: New hardware revision int *	 *	Revision 1.12.2.1  2001/03/12 16:50:59  mlindner *	chg: kernel 2.4 adaption *	 *	Revision 1.12  2001/03/01 12:52:15  mlindner *	Fixed ring size * *	Revision 1.11  2001/02/19 13:28:02  mlindner *	Changed PNMI parameter values * *	Revision 1.10  2001/01/22 14:16:04  mlindner *	added ProcFs functionality *	Dual Net functionality integrated *	Rlmt networks added * *	Revision 1.1  2000/10/05 19:46:50  phargrov *	Add directory src/vipk_devs_nonlbl/vipk_sk98lin/ *	This is the SysKonnect SK-98xx Gigabit Ethernet driver, *	contributed by SysKonnect. * *	Revision 1.9  2000/02/21 10:39:55  cgoos *	Added flag for jumbo support usage. * *	Revision 1.8  1999/11/22 13:50:44  cgoos *	Changed license header to GPL. *	Fixed two comments. * *	Revision 1.7  1999/09/28 12:38:21  cgoos *	Added CheckQueue to SK_AC. *	 *	Revision 1.6  1999/07/27 08:04:05  cgoos *	Added checksumming variables to SK_AC. *	 *	Revision 1.5  1999/03/29 12:33:26  cgoos *	Rreversed to fine lock granularity. *	 *	Revision 1.4  1999/03/15 12:14:02  cgoos *	Added DriverLock to SK_AC. *	Removed other locks. *	 *	Revision 1.3  1999/03/01 08:52:27  cgoos *	Changed pAC->PciDev declaration. *	 *	Revision 1.2  1999/02/18 10:57:14  cgoos *	Removed SkDrvTimeStamp prototype. *	Fixed SkGeOsGetTime prototype. *	 *	Revision 1.1  1999/02/16 07:41:01  cgoos *	First version. *	 *	 * ******************************************************************************//****************************************************************************** * * Description: * * This is the second include file of the driver, which includes all other * neccessary files and defines all structures and constants used by the * driver and the common modules. * * Include File Hierarchy: * *	see skge.c * ******************************************************************************/#ifndef __INC_SKDRV2ND_H#define __INC_SKDRV2ND_H#include "h/skqueue.h"#include "h/skgehwt.h"#include "h/sktimer.h"#include "h/ski2c.h"#include "h/skgepnmi.h"#include "h/skvpd.h"#include "h/skgehw.h"#include "h/skgeinit.h"#include "h/skaddr.h"#include "h/skgesirq.h"#include "h/skcsum.h"#include "h/skrlmt.h"#include "h/skgedrv.h"#define SK_PCI_ISCOMPLIANT(result, pdev) {     \    result = SK_FALSE; /* default */     \    /* 3Com (0x10b7) */     \    if (pdev->vendor == 0x10b7) {     \        /* Gigabit Ethernet Adapter (0x1700) */     \        if ((pdev->device == 0x1700)) { \            result = SK_TRUE;     \        }     \    /* SysKonnect (0x1148) */     \    } else if (pdev->vendor == 0x1148) {     \        /* SK-98xx Gigabit Ethernet Server Adapter (0x4300) */     \        /* SK-98xx V2.0 Gigabit Ethernet Adapter (0x4320) */     \        if ((pdev->device == 0x4300) || \            (pdev->device == 0x4320)) { \            result = SK_TRUE;     \        }     \    /* D-Link (0x1186) */     \    } else if (pdev->vendor == 0x1186) {     \        /* Gigabit Ethernet Adapter (0x4c00) */     \        if ((pdev->device == 0x4c00)) { \            result = SK_TRUE;     \        }     \    /* Marvell (0x11ab) */     \    } else if (pdev->vendor == 0x11ab) {     \        /* Gigabit Ethernet Adapter (0x4320) */     \        if ((pdev->device == 0x4320)) { \            result = SK_TRUE;     \        }     \    /* CNet (0x1371) */     \    } else if (pdev->vendor == 0x1371) {     \        /* GigaCard Network Adapter (0x434e) */     \        if ((pdev->device == 0x434e)) { \            result = SK_TRUE;     \        }     \    /* Linksys (0x1737) */     \    } else if (pdev->vendor == 0x1737) {     \        /* Gigabit Network Adapter (0x1032) */     \        /* Gigabit Network Adapter (0x1064) */     \        if ((pdev->device == 0x1032) || \            (pdev->device == 0x1064)) { \            result = SK_TRUE;     \        }     \    } else {     \        result = SK_FALSE;     \    }     \}extern SK_MBUF		*SkDrvAllocRlmtMbuf(SK_AC*, SK_IOC, unsigned);extern void		SkDrvFreeRlmtMbuf(SK_AC*, SK_IOC, SK_MBUF*);extern SK_U64		SkOsGetTime(SK_AC*);extern int		SkPciReadCfgDWord(SK_AC*, int, SK_U32*);extern int		SkPciReadCfgWord(SK_AC*, int, SK_U16*);extern int		SkPciReadCfgByte(SK_AC*, int, SK_U8*);extern int		SkPciWriteCfgDWord(SK_AC*, int, SK_U32);extern int		SkPciWriteCfgWord(SK_AC*, int, SK_U16);extern int		SkPciWriteCfgByte(SK_AC*, int, SK_U8);extern int		SkDrvEvent(SK_AC*, SK_IOC IoC, SK_U32, SK_EVPARA);struct s_DrvRlmtMbuf {	SK_MBUF		*pNext;		/* Pointer to next RLMT Mbuf. */	SK_U8		*pData;		/* Data buffer (virtually contig.). */	unsigned	Size;		/* Data buffer size. */	unsigned	Length;		/* Length of packet (<= Size). */	SK_U32		PortIdx;	/* Receiving/transmitting port. */#ifdef SK_RLMT_MBUF_PRIVATE	SK_RLMT_MBUF	Rlmt;		/* Private part for RLMT. */#endif  /* SK_RLMT_MBUF_PRIVATE */	struct sk_buff	*pOs;		/* Pointer to message block */};/* * Time macros */#if SK_TICKS_PER_SEC == 100#define SK_PNMI_HUNDREDS_SEC(t)	(t)#else#define SK_PNMI_HUNDREDS_SEC(t)	((((unsigned long)t) * 100) / \										(SK_TICKS_PER_SEC))#endif/* * New SkOsGetTime */#define SkOsGetTimeCurrent(pAC, pUsec) {\	struct timeval t;\	do_gettimeofday(&t);\	*pUsec = ((((t.tv_sec) * 1000000L)+t.tv_usec)/10000);\}/* * ioctl definitions */#define		SK_IOCTL_BASE		(SIOCDEVPRIVATE)#define		SK_IOCTL_GETMIB		(SK_IOCTL_BASE + 0)#define		SK_IOCTL_SETMIB		(SK_IOCTL_BASE + 1)#define		SK_IOCTL_PRESETMIB	(SK_IOCTL_BASE + 2)#define		SK_IOCTL_GEN		(SK_IOCTL_BASE + 3)typedef struct s_IOCTL	SK_GE_IOCTL;struct s_IOCTL {	char*		pData;	unsigned int	Len;};/* * define sizes of descriptor rings in bytes */#define		TX_RING_SIZE	(8*1024)#define		RX_RING_SIZE	(24*1024)/* * Buffer size for ethernet packets */#define	ETH_BUF_SIZE	1540#define	ETH_MAX_MTU	1514#define ETH_MIN_MTU	60#define ETH_MULTICAST_BIT	0x01#define SK_JUMBO_MTU	9000/* * transmit priority selects the queue: LOW=asynchron, HIGH=synchron

⌨️ 快捷键说明

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