|
|
|
@@ -6,7 +6,7 @@ enum scan_table
|
|
|
|
{
|
|
|
|
{
|
|
|
|
PXY_INTERCEPT_IP,
|
|
|
|
PXY_INTERCEPT_IP,
|
|
|
|
PXY_INTERCEPT_DOMAIN,
|
|
|
|
PXY_INTERCEPT_DOMAIN,
|
|
|
|
TSG_OBJ_SUBSCRIBE_ID,
|
|
|
|
TSG_OBJ_SUBSCRIBER_ID,
|
|
|
|
SCAN_TABLE_MAX
|
|
|
|
SCAN_TABLE_MAX
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
@@ -201,7 +201,7 @@ struct kni_maat_handle* kni_maat_init(const char* profile, void *logger, int thr
|
|
|
|
//static maat
|
|
|
|
//static maat
|
|
|
|
const char *table_name[SCAN_TABLE_MAX];
|
|
|
|
const char *table_name[SCAN_TABLE_MAX];
|
|
|
|
char tablename_intercept_compile[] = "PXY_INTERCEPT_COMPILE";
|
|
|
|
char tablename_intercept_compile[] = "PXY_INTERCEPT_COMPILE";
|
|
|
|
char tablename_subscriber_id[] = "TSG_DYN_SUBSCRIBE_IP";
|
|
|
|
char tablename_subscriber_id[] = "TSG_DYN_SUBSCRIBER_IP";
|
|
|
|
int ret, i;
|
|
|
|
int ret, i;
|
|
|
|
handle->static_maat = create_maat_feather("static", profile, "static_maat", logger, thread_count);
|
|
|
|
handle->static_maat = create_maat_feather("static", profile, "static_maat", logger, thread_count);
|
|
|
|
if(handle->static_maat == NULL){
|
|
|
|
if(handle->static_maat == NULL){
|
|
|
|
@@ -209,7 +209,7 @@ struct kni_maat_handle* kni_maat_init(const char* profile, void *logger, int thr
|
|
|
|
}
|
|
|
|
}
|
|
|
|
table_name[PXY_INTERCEPT_IP] = "PXY_INTERCEPT_IP";
|
|
|
|
table_name[PXY_INTERCEPT_IP] = "PXY_INTERCEPT_IP";
|
|
|
|
table_name[PXY_INTERCEPT_DOMAIN] = "PXY_INTERCEPT_DOMAIN";
|
|
|
|
table_name[PXY_INTERCEPT_DOMAIN] = "PXY_INTERCEPT_DOMAIN";
|
|
|
|
table_name[TSG_OBJ_SUBSCRIBE_ID] = "TSG_OBJ_SUBSCRIBE_ID";
|
|
|
|
table_name[TSG_OBJ_SUBSCRIBER_ID] = "TSG_OBJ_SUBSCRIBER_ID";
|
|
|
|
for(i = 0; i < SCAN_TABLE_MAX; i++){
|
|
|
|
for(i = 0; i < SCAN_TABLE_MAX; i++){
|
|
|
|
handle->scan_tableid[i] = Maat_table_register(handle->static_maat, table_name[i]);
|
|
|
|
handle->scan_tableid[i] = Maat_table_register(handle->static_maat, table_name[i]);
|
|
|
|
if(handle->scan_tableid[i] < 0){
|
|
|
|
if(handle->scan_tableid[i] < 0){
|
|
|
|
@@ -318,7 +318,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
|
|
|
source_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, sip);
|
|
|
|
source_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, sip);
|
|
|
|
dest_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, dip);
|
|
|
|
dest_subscribe_id = (char*)Maat_plugin_get_EX_data(handle->dynamic_maat, handle->subscriber_id_tableid, dip);
|
|
|
|
if(source_subscribe_id != NULL){
|
|
|
|
if(source_subscribe_id != NULL){
|
|
|
|
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBE_ID],
|
|
|
|
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBER_ID],
|
|
|
|
CHARSET_UTF8, source_subscribe_id, strlen(source_subscribe_id),
|
|
|
|
CHARSET_UTF8, source_subscribe_id, strlen(source_subscribe_id),
|
|
|
|
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
|
|
|
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
|
|
|
&scan_mid, thread_seq);
|
|
|
|
&scan_mid, thread_seq);
|
|
|
|
@@ -328,7 +328,7 @@ enum kni_action intercept_policy_scan(struct kni_maat_handle* handle, struct ipa
|
|
|
|
free(source_subscribe_id);
|
|
|
|
free(source_subscribe_id);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(dest_subscribe_id != NULL){
|
|
|
|
if(dest_subscribe_id != NULL){
|
|
|
|
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBE_ID],
|
|
|
|
scan_ret = Maat_full_scan_string(handle->static_maat, handle->scan_tableid[TSG_OBJ_SUBSCRIBER_ID],
|
|
|
|
CHARSET_UTF8, dest_subscribe_id, strlen(dest_subscribe_id),
|
|
|
|
CHARSET_UTF8, dest_subscribe_id, strlen(dest_subscribe_id),
|
|
|
|
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
|
|
|
result+hit_policy_cnt, NULL, KNI_MAAT_RULE_NUM_MAX-hit_policy_cnt,
|
|
|
|
&scan_mid, thread_seq);
|
|
|
|
&scan_mid, thread_seq);
|
|
|
|
|