Skip to content

Commit

Permalink
Add: documentation for LSC IPC data type
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnicola authored and Kraemii committed Oct 13, 2022
1 parent 386556c commit 0c8c8c3
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions doc/openvas_ipc_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ struct ipc_data
{
ipc_user_agent_t *ipc_user_agent;
ipc_hostname_t *ipc_hostname;
ipc_lsc_t *ipc_lsc;
};
};
```

### Data types

Currently, there are 2 supported data types
Currently, the following data types are supported

- **User-Agent:** First time that the User-Agent is used during a scan, it will be sent to the parent process and stored for further usage.
- **Hostname:** Hostnames which are found for a plugin are communicated the parent process and added to the vhost list. Later launched plugins know the updated list.
- **LSC:** The gather-package-list.nasl nasl script gathered the necessary data for running a LSC scan. The parent process is told to run the scan.

The `enum ipc_data_type` has also the IPC_DT_ERROR definition for unknown types.

Expand All @@ -32,12 +34,13 @@ enum ipc_data_type
IPC_DT_ERROR = -1,
IPC_DT_HOSTNAME = 0,
IPC_DT_USER_AGENT,
IPC_DT_LSC,
};
```

### Data

Currently, there are two data holders, which correspond to the supported data types. This data is not directly accessible, and functions must be used to set/get the data.
Currently, there are three data holders, which correspond to the supported data types. This data is not directly accessible, and functions must be used to set/get the data.

- **ipc_hostname:** used to send / retrieve new hostnames.

Expand All @@ -61,6 +64,16 @@ struct ipc_user_agent
};
```

- **ipc_lsc:** used to send/retrieve the LSC data_ready flag.

``` c
struct ipc_lsc
{
gboolean data_ready; // flag indicating that lsc data is in the kb
};
```


## Messages

Before sending a message to another process, the message must be created in the right json format.
Expand All @@ -85,6 +98,15 @@ The following examples show how the Json message looks like for the different da
```

- *ipc_lsc:*
```
{
"type":2,
"data_ready":"True"
}
```

The following code shows how to use the different functions for ipc communication:

``` c
Expand Down

0 comments on commit 0c8c8c3

Please sign in to comment.