rename terminology "group" to "object"
This commit is contained in:
@@ -16,7 +16,7 @@ After that, call maat_new to create a maat instance. Next, for the two main usag
|
||||
|
||||
* Call the maat_scan_xx interface to perform the scan task and return the hit rule_id.
|
||||
|
||||
* If you are interested in the hit item, group, or path information, you can call the maat_state_get_xx interface as needed.
|
||||
* If you are interested in the hit item, object, or path information, you can call the maat_state_get_xx interface as needed.
|
||||
|
||||
* Callback Scenario
|
||||
|
||||
@@ -55,7 +55,7 @@ After that, call maat_new to create a maat instance. Next, for the two main usag
|
||||
* [maat_options_set_json_file_decrypt_key](#maat_options_set_json_file_decrypt_key)
|
||||
* [maat_options_set_expr_engine](#maat_options_set_expr_engine)
|
||||
* [maat_options_set_hit_path_enabled](#maat_options_set_hit_path_enabled)
|
||||
* [maat_options_set_hit_group_enabled](#maat_options_set_hit_group_enabled)
|
||||
* [maat_options_set_hit_object_enabled](#maat_options_set_hit_object_enabled)
|
||||
|
||||
## maat instance
|
||||
|
||||
@@ -72,12 +72,12 @@ After that, call maat_new to create a maat instance. Next, for the two main usag
|
||||
* [maat_state_get_hit_paths](#maat_state_get_hit_paths)
|
||||
* [maat_state_get_rule_table_ids](#maat_state_get_rule_table_ids)
|
||||
* [maat_state_get_scan_count](#maat_state_get_scan_count)
|
||||
* [maat_state_get_direct_hit_groups](#maat_state_get_direct_hit_groups)
|
||||
* [maat_state_get_direct_hit_group_cnt](#maat_state_get_direct_hit_group_cnt)
|
||||
* [maat_state_get_indirect_hit_groups](#maat_state_get_indirect_hit_groups)
|
||||
* [maat_state_get_indirect_hit_group_cnt](#maat_state_get_indirect_hit_group_cnt)
|
||||
* [maat_state_get_last_hit_groups](#maat_state_get_last_hit_groups)
|
||||
* [maat_state_get_last_hit_group_cnt](#maat_state_get_last_hit_group_cnt)
|
||||
* [maat_state_get_direct_hit_objects](#maat_state_get_direct_hit_objects)
|
||||
* [maat_state_get_direct_hit_object_cnt](#maat_state_get_direct_hit_object_cnt)
|
||||
* [maat_state_get_indirect_hit_objects](#maat_state_get_indirect_hit_objects)
|
||||
* [maat_state_get_indirect_hit_object_cnt](#maat_state_get_indirect_hit_object_cnt)
|
||||
* [maat_state_get_last_hit_objects](#maat_state_get_last_hit_objects)
|
||||
* [maat_state_get_last_hit_object_cnt](#maat_state_get_last_hit_object_cnt)
|
||||
|
||||
## maat scan
|
||||
|
||||
@@ -86,7 +86,7 @@ After that, call maat_new to create a maat instance. Next, for the two main usag
|
||||
* [maat_scan_ipv4](#maat_scan_ipv4)
|
||||
* [maat_scan_ipv6](#maat_scan_ipv6)
|
||||
* [maat_scan_string](#maat_scan_string)
|
||||
* [maat_scan_group](#maat_scan_group)
|
||||
* [maat_scan_object](#maat_scan_object)
|
||||
* [maat_scan_not_logic](#maat_scan_not_logic)
|
||||
|
||||
## maat stream
|
||||
@@ -500,13 +500,13 @@ By default, maat does not store the hit path, and you can call this interface if
|
||||
**Returns**: success(0), failure(-1)
|
||||
|
||||
|
||||
### maat_options_set_hit_group_enabled
|
||||
### maat_options_set_hit_object_enabled
|
||||
|
||||
```c
|
||||
int maat_options_set_hit_group_enabled(struct maat_options *opts);
|
||||
int maat_options_set_hit_object_enabled(struct maat_options *opts);
|
||||
```
|
||||
|
||||
By default, maat does not store the hit groups, and you can call this interface if you need to get this information.
|
||||
By default, maat does not store the hit objects, and you can call this interface if you need to get this information.
|
||||
|
||||
**Parameters**:
|
||||
* opts - The pointer of maat_options structure.
|
||||
@@ -548,7 +548,7 @@ Destroy a maat instance.
|
||||
struct maat_state *maat_state_new(struct maat *instance, int thread_id);
|
||||
```
|
||||
|
||||
Before performing the actual scanning task, you need to call this interface to create a per-thread maat_state structure, which will be used as an input parameter when calling the maat_scan_xx interface to store the intermediate scanning state. This is especially useful in composite scanning scenarios to accurately provide all hit results from multiple scans. Additionally, hit paths, group_id of hits, and other information generated by the scanning are temporarily stored in it, and can be retrieved through the maat_state_get_xx interface.
|
||||
Before performing the actual scanning task, you need to call this interface to create a per-thread maat_state structure, which will be used as an input parameter when calling the maat_scan_xx interface to store the intermediate scanning state. This is especially useful in composite scanning scenarios to accurately provide all hit results from multiple scans. Additionally, hit paths, object_id of hits, and other information generated by the scanning are temporarily stored in it, and can be retrieved through the maat_state_get_xx interface.
|
||||
|
||||
**Parameters**:
|
||||
* instance - Maat instance created by maat_new().
|
||||
@@ -609,7 +609,7 @@ int maat_state_set_scan_rule_table(struct maat_state *state,
|
||||
int rule_table_id);
|
||||
```
|
||||
|
||||
Maat supports loading multiple rule tables and building their respective runtime. Within the table schema, there is a rule table that has a `default_rule_table` field, indicating that maat will use the runtime of this table to calculate which rule_id will be hit by the hit group_id. If the caller wants to use another rule table runtime for the above calculation, this interface can be invoked to set it up.
|
||||
Maat supports loading multiple rule tables and building their respective runtime. Within the table schema, there is a rule table that has a `default_rule_table` field, indicating that maat will use the runtime of this table to calculate which rule_id will be hit by the hit object_id. If the caller wants to use another rule table runtime for the above calculation, this interface can be invoked to set it up.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
@@ -670,106 +670,106 @@ Gets the number of scans since maat state was created.
|
||||
**Returns**: The number of scans.
|
||||
|
||||
|
||||
### maat_state_get_direct_hit_groups
|
||||
### maat_state_get_direct_hit_objects
|
||||
|
||||
```c
|
||||
int maat_state_get_direct_hit_groups(struct maat_state *state,
|
||||
struct maat_hit_group *group_array,
|
||||
int maat_state_get_direct_hit_objects(struct maat_state *state,
|
||||
struct maat_hit_object *object_array,
|
||||
size_t array_size);
|
||||
```
|
||||
|
||||
Get the direct hit_groups, including the table_id from the scan input, the item_id and its group_id in the corresponding item table.
|
||||
Get the direct hit_objects, including the table_id from the scan input, the item_id and its object_id in the corresponding item table.
|
||||
|
||||
`Note`: hit_groups may be duplicated.
|
||||
`Note`: hit_objects may be duplicated.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
* group_array - Array to store the maat_hit_groups.
|
||||
* object_array - Array to store the maat_hit_objects.
|
||||
* array_size - Size of the array.
|
||||
|
||||
**Returns**: The number of direct hit_groups on success, and -1 is returned on failure.
|
||||
**Returns**: The number of direct hit_objects on success, and -1 is returned on failure.
|
||||
|
||||
|
||||
### maat_state_get_direct_hit_group_cnt
|
||||
### maat_state_get_direct_hit_object_cnt
|
||||
|
||||
```c
|
||||
size_t maat_state_get_direct_hit_group_cnt(struct maat_state *state);
|
||||
size_t maat_state_get_direct_hit_object_cnt(struct maat_state *state);
|
||||
```
|
||||
|
||||
Get the number of direct hit_groups.
|
||||
Get the number of direct hit_objects.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
|
||||
**Returns**: The number of direct hit_groups.
|
||||
**Returns**: The number of direct hit_objects.
|
||||
|
||||
|
||||
### maat_state_get_indirect_hit_groups
|
||||
### maat_state_get_indirect_hit_objects
|
||||
|
||||
```c
|
||||
int maat_state_get_indirect_hit_groups(struct maat_state *state,
|
||||
struct maat_hit_group *group_array,
|
||||
int maat_state_get_indirect_hit_objects(struct maat_state *state,
|
||||
struct maat_hit_object *object_array,
|
||||
size_t array_size);
|
||||
```
|
||||
|
||||
Gets the indirect hit_groups, including the table_id from the scan input, the id of the super groups referencing the hit items.
|
||||
Gets the indirect hit_objects, including the table_id from the scan input, the id of the super objects referencing the hit items.
|
||||
|
||||
`Note`: hit_groups may be duplicated.
|
||||
`Note`: hit_objects may be duplicated.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
* group_array - Array to store the maat_hit_groups.
|
||||
* object_array - Array to store the maat_hit_objects.
|
||||
* array_size - Size of the array.
|
||||
|
||||
**Returns**: The number of indirect hit_groups on success, and -1 is returned on failure.
|
||||
**Returns**: The number of indirect hit_objects on success, and -1 is returned on failure.
|
||||
|
||||
|
||||
### maat_state_get_indirect_hit_group_cnt
|
||||
### maat_state_get_indirect_hit_object_cnt
|
||||
|
||||
```c
|
||||
size_t maat_state_get_indirect_hit_group_cnt(struct maat_state *state);
|
||||
size_t maat_state_get_indirect_hit_object_cnt(struct maat_state *state);
|
||||
```
|
||||
|
||||
Get the number of indirect hit_groups.
|
||||
Get the number of indirect hit_objects.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
|
||||
**Returns**: The number of indirect hit_groups.
|
||||
**Returns**: The number of indirect hit_objects.
|
||||
|
||||
|
||||
### maat_state_get_last_hit_groups
|
||||
### maat_state_get_last_hit_objects
|
||||
|
||||
```c
|
||||
int maat_state_get_last_hit_groups(struct maat_state *state,
|
||||
struct maat_hit_group *group_array,
|
||||
int maat_state_get_last_hit_objects(struct maat_state *state,
|
||||
struct maat_hit_object *object_array,
|
||||
size_t array_size);
|
||||
```
|
||||
|
||||
Get all hit_groups in the latest scan, including the table_id from the scan input, the item_id and its group_id in the corresponding item table, the id of the super groups referencing the hit items.
|
||||
Get all hit_objects in the latest scan, including the table_id from the scan input, the item_id and its object_id in the corresponding item table, the id of the super objects referencing the hit items.
|
||||
|
||||
`Note`: hit_groups is not duplicated.
|
||||
`Note`: hit_objects is not duplicated.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
* group_array - Array to store the maat_hit_groups.
|
||||
* object_array - Array to store the maat_hit_objects.
|
||||
* array_size - Size of the array.
|
||||
|
||||
**Returns**: The number of all hit_groups in the latest scan on success, and -1 is returned on failure.
|
||||
**Returns**: The number of all hit_objects in the latest scan on success, and -1 is returned on failure.
|
||||
|
||||
|
||||
### maat_state_get_last_hit_group_cnt
|
||||
### maat_state_get_last_hit_object_cnt
|
||||
|
||||
```c
|
||||
size_t maat_state_get_last_hit_group_cnt(struct maat_state *state);
|
||||
size_t maat_state_get_last_hit_object_cnt(struct maat_state *state);
|
||||
```
|
||||
|
||||
Get the number of all hit_groups in the latest scan.
|
||||
Get the number of all hit_objects in the latest scan.
|
||||
|
||||
**Parameters**:
|
||||
* state - Pointer to the maat state structure.
|
||||
|
||||
**Returns**: The number of all hit_groups in the latest scan.
|
||||
**Returns**: The number of all hit_objects in the latest scan.
|
||||
|
||||
|
||||
### maat_scan_flag
|
||||
@@ -841,16 +841,16 @@ int maat_scan_string(struct maat *instance, int table_id,
|
||||
|
||||
Same as above, the difference is that the data to be scanned is a string.
|
||||
|
||||
### maat_scan_group
|
||||
### maat_scan_object
|
||||
|
||||
```c
|
||||
int maat_scan_group(struct maat *instance, int table_id,
|
||||
struct maat_hit_group *groups, size_t n_group,
|
||||
int maat_scan_object(struct maat *instance, int table_id,
|
||||
struct maat_hit_object *objects, size_t n_object,
|
||||
long long *results, size_t n_result,
|
||||
size_t *n_hit_result, struct maat_state *state);
|
||||
```
|
||||
|
||||
Different from the above interface, the input to this interface is the hit item_id and group_id. Therefore, there is no need to execute the underlying scanning engine. It only needs to calculate the hit rule_id based on the hit group_id.
|
||||
Different from the above interface, the input to this interface is the hit item_id and object_id. Therefore, there is no need to execute the underlying scanning engine. It only needs to calculate the hit rule_id based on the hit object_id.
|
||||
|
||||
|
||||
### maat_scan_not_logic
|
||||
|
||||
Reference in New Issue
Block a user