secgateway/Common/commuapinl.h

114 lines
3.1 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 MODULE CONFIG:being**************************/
//#define NLDEBUG_ACK_COOKIES
/**********************NETLINK MODULE CONFIG:end****************************/
/* 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 /*支持的最大组数量*/
#define DEBUGFS_PRK_ONOFF 0
/*netlink pdelivery msg type*/
enum pdelivmsgtype{
PDNL_BASE = 0x10,/*netlink 保留控制消息*/
NLMSG_PDELIV_DEBUGFS = 0x11, /*用户态发送给内核态的请求消息用于查看pdiliv模块本身的状态及配置与业务无关*/
NLMSG_RECV_RAW_PKT = 0x12,/*上送DPI的报文消息*/
PDNLGRP_REQUEST,
NK_DEBUGFS_PRK_ONOFF = 0X16,/*DEBUGFS PRINTK ON 0R OFF: 1->ON; 0->OFF */
/*for trace*/
TRACE_CFG_POLICY_REQ = 0x20,
TRACE_CFG_POLICY_REPLY,
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_CFG_DEBUGFS = 0x11,/*keep the same with NLMSG_PDELIV_DEBUGFS */
COMMNMSG_POLICYCONF,
NK_DEBUGFS_PRK_ONOFF_CFG = 0X16,/*keep the same with DEBUGFS PRINTK ON OR OFF */
/*add your msg type here:*/
/*commcfg nsmsg max type,must :add your msg type before this */
COMMCFG_NLMSG_MAX_TYPE,
};
struct netlink_debugfs {
unsigned int rev_total;
unsigned int rev_cb_sucess;
unsigned int rev_cb_fail;
unsigned int rev_drop_total;
unsigned int rev_drop_nodoit;
unsigned int send_succ;
unsigned int send_fail;
int send_fail_reason;
};
#endif /* _UAPI__LINUX_COMMNETLINK_H */