#ifndef NIC_SHM_H
#define NIC_SHM_H

#include <sys/socket.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef NIC_NAME_LEN
#define NIC_NAME_LEN   64 
#endif
#define SEM_PROJ_ID 's'	
#define MAXNICNUM  32

typedef long	KEYID;
typedef  struct  _net_info
{
	KEYID	ID;	
	char	charname[NIC_NAME_LEN];
	char	descr[128]; 
	struct sockaddr addr;
	struct sockaddr broadaddr;
	struct sockaddr netmask;
	struct sockaddr hwaddr;
	int		time_stamp; 
	short		flags; 	
	int		mtu; 	
	int		tx_queue_len; 
	unsigned long long average_flow;
	unsigned long long rx_packets;
	unsigned long long tx_packets;
	unsigned long long rx_bytes;
	unsigned long long tx_bytes;
	unsigned long rx_errors; 
	unsigned long tx_errors;
	unsigned long rx_dropped; 
	unsigned long tx_dropped; 
	unsigned long rx_multicast; 
	unsigned long collisions; 
	unsigned long rx_fifo_errors;
	unsigned long tx_carrier_errors;
	unsigned long tx_fifo_errors;
}NETCARD_INFO;

int	get_nic_info(char *nic_name, NETCARD_INFO *net_info);


#ifdef __cplusplus
}
#endif
#endif
