git-svn-id: http://172.17.0.253/svn/soft_pkgs/sys_nicmonitor@146 09c3743a-b0dd-45d3-b506-aa74c7a2a6ef
67 lines
1.6 KiB
C
67 lines
1.6 KiB
C
#ifndef __MNIC_H
|
|
#define __MNIC_H
|
|
|
|
#define _GNU_SOURCE
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stddef.h>
|
|
#include <unistd.h>
|
|
#include <ctype.h>
|
|
#include <errno.h>
|
|
#include <netinet/in.h>
|
|
#include <net/if.h>
|
|
#include <time.h>
|
|
#include <sys/ioctl.h>
|
|
#include <sys/socket.h>
|
|
#include <sys/sem.h>
|
|
#include <sys/ipc.h>
|
|
#include <sys/param.h>
|
|
#include <linux/types.h>
|
|
#include <glob.h>
|
|
#include <linux/sockios.h>
|
|
#include <linux/ethtool.h>
|
|
#include <arpa/inet.h>
|
|
#include <pthread.h>
|
|
#include <sys/mman.h>
|
|
#include <sys/stat.h>
|
|
#include <fcntl.h>
|
|
#include <syslog.h>
|
|
#include <sys/time.h>
|
|
|
|
#include "sys_netcard.h"
|
|
#include "dotconf.h"
|
|
|
|
#define IPSIZE 16
|
|
#define PATH_SIZE 256
|
|
|
|
DOTCONF_CB(cb_str);
|
|
DOTCONF_CB(cb_int);
|
|
|
|
typedef struct __config_file_st{
|
|
unsigned char domain;
|
|
short serv;
|
|
short event;
|
|
int udpport;
|
|
char sys_netcard_shm_path[PATH_SIZE];
|
|
char sys_netcard_sem_path[PATH_SIZE];
|
|
int monitor_interval;
|
|
int write_interval;
|
|
int flow_interval;
|
|
int flow_limit;
|
|
int flow_peak;
|
|
char udp[NIC_NAME_LEN];
|
|
char nic[MAXNICNUM][NIC_NAME_LEN];
|
|
char ip[IPSIZE] ;
|
|
}CONFIG_FILE_ST;
|
|
|
|
|
|
char *get_name(char *, char *);
|
|
int if_fetch(NETCARD_INFO *);
|
|
int ioc_get_name(NETCARD_INFO *);
|
|
int get_dev_fields(char *p, NETCARD_INFO *);
|
|
void send_alarm(D5000_NIC_ALARM *, int , char *, char *);
|
|
void record_log(void);
|
|
|
|
#endif
|