secgateway/Common/commuapinl.h

93 lines
2.4 KiB
C
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef _UAPI__LINUX_COMMNETLINK_H
#define _UAPI__LINUX_COMMNETLINK_H
#include <linux/types.h>
#include <linux/netlink.h>
//#include <uapi/linux/netlink.h>
/* netlink proto*/
#define NETLINK_COMMMAX_MIN_FAMILY 21
#define NETLINK_COMMCFG 22
#define NETLINK_PDELIVERY 23
#define NETLINK_COMMMAX_MAX_FAMILY 24
/*NETLINK_PDELIVERY groups,keep userspace and kernel the same */
#define PDNLGRP_ALLRAW 0x01 /*上送DPI的报文*/
#define PDNLGRP_PKT1 0X02 /*保留*/
#define PDNLGRP_PKT2 0X04 /*保留*/
#define PDNLGRP_PKT3 0X08 /*保留*/
enum pdeliverynetlink_groups {
PDELIVERY_NLGRP_NONE=0,/*代表单播*/
#define PDELIVERY_NLGRP_NONE PDELIVERY_NLGRP_NONE
PDELIVERY_NLGRP_ALLRAW=1,
#define PDELIVERY_NLGRP_ALLRAW PDELIVERY_NLGRP_ALLRAW
PDELIVERY_NLGRP_PKT1,
#define PDELIVERY_NLGRP_PKT1 PDELIVERY_NLGRP_PKT1
PDELIVERY_NLGRP_PKT2,
#define PDELIVERY_NLGRP_PKT2 PDELIVERY_NLGRP_PKT2
PDELIVERY_NLGRP_PKT3,
#define PDELIVERY_NLGRP_PKT3 PDELIVERY_NLGRP_PKT3
__PDELIVERY_NLGRP_MAX,
};
#define PDELIVERY_NLGRP_MAX (__PDELIVERY_NLGRP_MAX - 1)
#define COMMLIBNLGRP_MAX 16 /*支持的最大组数量*/
/*netlink pdelivery msg type*/
enum pdelivmsgtype{
PDNL_BASE = 0x10,/*netlink 保留控制消息*/
PDNLGRP_REQUEST, /*用户态发送给内核态的请求消息用于查看pdiliv模块本身的状态及配置与业务无关*/
NLMSG_RECV_RAW_PKT,/*上送DPI的报文消息*/
NLMSG_DEBUGFS,
NLMGS_PDELIVERY_MAX_TYPE,
};
/* PDELIVERY msg attr */
enum pdelivattr{
PDELIVERY_UNSPEC_ATTR,
PDELIVERY_PKT_ATTR,
PDELIVERY_DUMP_PKTNUM_ATTR,
__PDELIVERY_MAX_ATTR
};
#define PDELIVERY_MAX_MAX (__PDELIVERY_MAX_ATTR - 1)
/**********************************************************************/
/*becareful end :keep userspace and kernel the same . */
/**********************************************************************/
/****
* common cfg messages type.
****/
/* Types of messages */
enum commcfgmsgtype{
//COMMMSGNL_BASE = NLMSG_MIN_TYPE,/*netlink 保留控制消息*/
COMMMSGNL_BASE = 0x10,/*netlink 保留控制消息*/
COMMNMSG_POLICYCONF,
COMMNMSG_USER,
COMMNMSG_DEBUGFS,
/*for trace*/
TRACE_CFG_POLICY = 0x20,
TRACE_CFG_MAX = 0X25,
/*add your msg type here:*/
/*commcfg nsmsg max type,must :add your msg type before this */
COMMCFG_NLMSG_MAX_TYPE,
};
#endif /* _UAPI__LINUX_COMMNETLINK_H */