免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1686 | 回复: 0
打印 上一主题 下一主题

[开发环境] libpm库文件 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2015-08-26 10:13 |只看该作者 |倒序浏览
libpm.so
Pm 模块核心数据结构说明
typedef struct
{
    int (*init_func)();     /*初始化函数*/
    int (*destroy_fun)();   /*销毁函数*/
    char *module_name;   /*模块名*/
    int (*module_proc)(void *,void *);/*性能数据提取*/
    int (*module_stat_start)();  /*老化扫描*/
    int (*module_stat_stop)();  /*老化统计*/
}pm_module;

typedef struct PM_FILTER_CONTROL
{
    uint32_t TaskID;   /* 任务id */
    uint32_t StartTime; /* 开始时间*/
    uint32_t EndTime; /* 结束时间*/
    int32_t  Type;      /*0表示不选,-1表示所有*/
    int32_t  AppType;   /*0表示不选,-1表示所有*/
    int32_t  TransType; /*0表示不选,-1表示所有*/
    int32_t  NetType;   /*0表示不选,-1表示所有*/
    int32_t  LinkType;  /*0表示不选,-1表示所有*/
    int32_t  UserNum;   /*0表示不选,-1表示所有*/
    struct hashtable *ip_table;    /*存放ip*/
    struct PM_FILTER_CONTROL *pre;
    struct PM_FILTER_CONTROL *next;
}pm_filter_control;

typedef struct ip_info
{
    UINT32 ip_a;
    UINT32 prefix_a;
    UINT32 ip_b;
    UINT32 prefix_b;
    struct ip_info *next;
}ip_info;

typedef struct business_para
{
    BUSINESS_PARA_TYPE type;   /*参数类型*/
    uint8_t *para;              /*具体参数*/
    struct business_para *next;
}business_para;

typedef struct
{
    uint32_t type;                       /*协议或者业务类型*/
    Bool     is_output;                  /*是否输出指标*/
    business_para *biz_para[LAYER_MAX_TYPE]; /*该层次每个协议或者
                                              *业务对应的业务参数
                                              */
}layer_info;

/*任务信息*/
typedef struct task_info
{
    /*基本信息*/
    ID id;
    ID device_id;
    ID card_id;
    ID interface_id;
    ID link_id;
   
    uint32_t end_time;

    /*各层次信息*/
    layer_info *biz;
    layer_info *app;
    layer_info *trans;
    layer_info *net;
    layer_info *link;
    layer_info *linfo[LAYER_TYPE_BIZ + 1]; /*上述信息的集合*/

    /*测量对象的ip信息*/
    ip_info *ip;  

    struct task_info *pre;
    struct task_info *next;
}task_info;


typedef struct
{
    BOOL is_start;
    int app_is_start[PM_APP_NULL];
    int trans_is_start[PM_TRANS_NULL];
    int net_is_start[PM_NET_NULL];
    int link_is_start[PM_LINK_NULL];
    pthread_rwlock_t rwlock;/*读写锁*/
   
    task_info *tinfo_head;
    task_info *tinfo_tail;
    task_info *tinfo_aging;
}pm_control;

/*上层下达任务ID*/
typedef struct PMTaskID{
    ID id;
    business_para *biz_para; /*业务的参数信息,NULL表示无*/
    task_info     *tinfo;    /*该任务对应的任务信息*/
   
    Bool     is_output;   /*该任务对应的信息是否输出,
                           *如果TRUE,则该处理模块需要将该任务对应的信息输出
                           */
    Bool     is_pass;     /*
                           *处理模块根据过滤信息,返回该是否属于这次业务
                           */
   
    struct PMTaskID *next;
}PMTaskID;


typedef struct
{
    /*protocol type*/
    PM_PROTO_APP_TYPE     app_type;
    PM_PROTO_TRANS_TYPE   trans_type;
    PM_PROTO_NET_TYPE     net_type;
    PM_PROTO_LINK_TYPE    link_type;
    Bool is_icmp;

    /*protocol task*/
    PMTaskID *app_task;
    PMTaskID *trans_task;
    PMTaskID *net_task;
    PMTaskID *link_task;
    PMTaskID *icmp_task;
}packet_proc_info;

Pm 模块核心核心函数说明
/*====================================================
函数名: PM_ETH_proc
功能:   处理链路层报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/
void PM_ETH_proc(struct PM_packet *packet,char *client_id)

/*====================================================
函数名: PM_IP_module_proc
功能:   处理网络层报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/
PM_IP_module_proc(struct PM_packet *packet,char *client_id)

/*====================================================
函数名: pm_tcp_proc
功能:   处理TCP层报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/
pm_tcp_proc(struct PM_packet *packet,char *client_id)
/*====================================================
函数名: pm_udp_proc
功能:   处理udp层报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/

pm_udp_proc(struct PM_packet *packet,char *client_id)

/*====================================================
函数名: start_module_http
功能:   处理http报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/

start_module_http(struct PM_packet *packet,char *client_id)
/*====================================================
函数名: pm_ftp_module_proc
功能:   处理FTP报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/

pm_ftp_module_proc(struct PM_packet *packet,char *client_id)

/*====================================================
函数名: pm_sip_proc
功能:   处理SIP报文
入参:   struct PM_packet *packet, pm 数据
       char *client_id  客户id
出参:
返回值:  无
======================================================*/

pm_sip_proc(struct PM_packet *packet,char *client_id)
libpm.so.rar (499.44 KB, 下载次数: 5)



您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP