OpenVAS Scanner  7.0.1~git
wmi_interface_stub.c File Reference

Stub implementation for a wmi interface. More...

#include "openvas_wmi_interface.h"
#include <string.h>
Include dependency graph for wmi_interface_stub.c:

Go to the source code of this file.

Functions

char * wmi_versioninfo ()
 Return version info for WMI implementation. More...
 
WMI_HANDLE wmi_connect (int argc, char **argv)
 Establish connection to a WMI service. More...
 
int wmi_close (WMI_HANDLE handle)
 Close the connection handle for a WMI service. More...
 
int wmi_query (WMI_HANDLE handle, const char *query, char **result)
 Query WMI service using a WQL query. More...
 
WMI_HANDLE wmi_connect_rsop (int argc, char **argv)
 Establish connection to a WMI RSOP service. More...
 
int wmi_query_rsop (WMI_HANDLE handle, const char *query, char **res)
 WMI RSOP query. More...
 
WMI_HANDLE wmi_connect_reg (int argc, char **argv)
 Establish connection to a WMI Registry service. More...
 
int wmi_reg_get_sz (WMI_HANDLE handle, unsigned int hive, const char *key, const char *key_name, char **res)
 Get Registry string value. More...
 
int wmi_reg_enum_value (WMI_HANDLE handle, unsigned int hive, const char *key, char **res)
 Enumerate Registry values. More...
 
int wmi_reg_enum_key (WMI_HANDLE handle, unsigned int hive, const char *key, char **res)
 Enumerate Registry keys. More...
 
int wmi_reg_get_bin_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry binary value. More...
 
int wmi_reg_get_dword_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry DWORD value. More...
 
int wmi_reg_get_ex_string_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry Expanded string value. More...
 
int wmi_reg_get_mul_string_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry multi-valued strings. More...
 
int wmi_reg_get_qword_val (WMI_HANDLE handle, unsigned int hive, const char *key, const char *val_name, char **res)
 Get Registry QWORD value. More...
 
int wmi_reg_set_dword_val (WMI_HANDLE handle, const char *key, const char *val_name, uint32_t val)
 Set Registry DWORD value. More...
 
int wmi_reg_set_qword_val (WMI_HANDLE handle, const char *key, const char *val_name, uint64_t val)
 Set Registry QWORD value. More...
 
int wmi_reg_set_ex_string_val (WMI_HANDLE handle, const char *key, const char *val_name, const char *val)
 Set Registry Expanded string value. More...
 
int wmi_reg_set_string_val (WMI_HANDLE handle, const char *key, const char *val_name, const char *val)
 Set Registry string value. More...
 
int wmi_reg_create_key (WMI_HANDLE handle, const char *key)
 Create Registry Key. More...
 
int wmi_reg_delete_key (WMI_HANDLE handle, const char *key)
 Delete Registry Key. More...
 

Detailed Description

Stub implementation for a wmi interface.

This file contains an empty implementation that fulfills the wmi interface specfified in openvas_wmi_interface.h

Definition in file wmi_interface_stub.c.

Function Documentation

◆ wmi_close()

int wmi_close ( WMI_HANDLE  handle)

Close the connection handle for a WMI service.

Parameters
[in]handle- WMI service connection handle
Returns
, 0 on success, -1 on failure

Definition at line 71 of file wmi_interface_stub.c.

Referenced by nasl_wmi_close().

72 {
73  (void) handle;
74  return -1;
75 }
Here is the caller graph for this function:

◆ wmi_connect()

WMI_HANDLE wmi_connect ( int  argc,
char **  argv 
)

Establish connection to a WMI service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 56 of file wmi_interface_stub.c.

Referenced by nasl_wmi_connect().

57 {
58  (void) argc;
59  (void) argv;
60  return NULL;
61 }
Here is the caller graph for this function:

◆ wmi_connect_reg()

WMI_HANDLE wmi_connect_reg ( int  argc,
char **  argv 
)

Establish connection to a WMI Registry service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 144 of file wmi_interface_stub.c.

Referenced by nasl_wmi_connect_reg().

145 {
146  (void) argc;
147  (void) argv;
148  return NULL;
149 }
Here is the caller graph for this function:

◆ wmi_connect_rsop()

WMI_HANDLE wmi_connect_rsop ( int  argc,
char **  argv 
)

Establish connection to a WMI RSOP service.

Parameters
[in]argcNumber of arguments.
[in]argvArray of arguments.
Returns
, WMI_HANDLE on success, NULL on failure.

Definition at line 107 of file wmi_interface_stub.c.

Referenced by nasl_wmi_connect_rsop().

108 {
109  (void) argc;
110  (void) argv;
111  return NULL;
112 }
Here is the caller graph for this function:

◆ wmi_query()

int wmi_query ( WMI_HANDLE  handle,
const char *  query,
char **  result 
)

Query WMI service using a WQL query.

Parameters
[in]handle- WMI connection handle
[in]query- The WQL query string
[out]result- Result of query as string
Returns
, 0 on success, -1 on failure

Definition at line 89 of file wmi_interface_stub.c.

Referenced by nasl_wmi_query().

90 {
91  (void) handle;
92  (void) query;
93  (void) result;
94  return -1;
95 }
Here is the caller graph for this function:

◆ wmi_query_rsop()

int wmi_query_rsop ( WMI_HANDLE  handle,
const char *  query,
char **  res 
)

WMI RSOP query.

Parameters
[in]handle- WMI connection handle
[in]query- WQL RSOP query
[in]res- Registry value to be queried
Returns
, 0 on success, -1 on failure

Definition at line 126 of file wmi_interface_stub.c.

Referenced by nasl_wmi_query_rsop().

127 {
128  (void) handle;
129  (void) query;
130  (void) res;
131  return -1;
132 }
Here is the caller graph for this function:

◆ wmi_reg_create_key()

int wmi_reg_create_key ( WMI_HANDLE  handle,
const char *  key 
)

Create Registry Key.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key need to be created
Returns
, 0 on success, -1 on failure

Definition at line 462 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_create_key().

463 {
464  (void) handle;
465  (void) key;
466  return -1;
467 }
Here is the caller graph for this function:

◆ wmi_reg_delete_key()

int wmi_reg_delete_key ( WMI_HANDLE  handle,
const char *  key 
)

Delete Registry Key.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key need to be Deleted
Returns
, 0 on success, -1 on failure

Definition at line 479 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_delete_key().

480 {
481  (void) handle;
482  (void) key;
483  return -1;
484 }
Here is the caller graph for this function:

◆ wmi_reg_enum_key()

int wmi_reg_enum_key ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
char **  res 
)

Enumerate Registry keys.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 218 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_enum_key().

220 {
221  (void) handle;
222  (void) hive;
223  (void) key;
224  (void) res;
225  return -1;
226 }
Here is the caller graph for this function:

◆ wmi_reg_enum_value()

int wmi_reg_enum_value ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
char **  res 
)

Enumerate Registry values.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key name
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 193 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_enum_value().

195 {
196  (void) handle;
197  (void) hive;
198  (void) key;
199  (void) res;
200  return -1;
201 }
Here is the caller graph for this function:

◆ wmi_reg_get_bin_val()

int wmi_reg_get_bin_val ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  val_name,
char **  res 
)

Get Registry binary value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 244 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_bin_val().

246 {
247  (void) handle;
248  (void) hive;
249  (void) key;
250  (void) val_name;
251  (void) res;
252  return -1;
253 }
Here is the caller graph for this function:

◆ wmi_reg_get_dword_val()

int wmi_reg_get_dword_val ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  val_name,
char **  res 
)

Get Registry DWORD value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 271 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_dword_val().

273 {
274  (void) handle;
275  (void) hive;
276  (void) key;
277  (void) val_name;
278  (void) res;
279  return -1;
280 }
Here is the caller graph for this function:

◆ wmi_reg_get_ex_string_val()

int wmi_reg_get_ex_string_val ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  val_name,
char **  res 
)

Get Registry Expanded string value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 298 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_ex_string_val().

300 {
301  (void) handle;
302  (void) hive;
303  (void) key;
304  (void) val_name;
305  (void) res;
306  return -1;
307 }
Here is the caller graph for this function:

◆ wmi_reg_get_mul_string_val()

int wmi_reg_get_mul_string_val ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  val_name,
char **  res 
)

Get Registry multi-valued strings.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 325 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_mul_string_val().

327 {
328  (void) handle;
329  (void) hive;
330  (void) key;
331  (void) val_name;
332  (void) res;
333  return -1;
334 }
Here is the caller graph for this function:

◆ wmi_reg_get_qword_val()

int wmi_reg_get_qword_val ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  val_name,
char **  res 
)

Get Registry QWORD value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry hive
[in]key- Registry key containing the value to be queried
[in]val_name- Registry value to be queried
[out]res- Result string
Returns
, 0 on success, -1 on failure

Definition at line 352 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_qword_val().

354 {
355  (void) handle;
356  (void) hive;
357  (void) key;
358  (void) val_name;
359  (void) res;
360  return -1;
361 }
Here is the caller graph for this function:

◆ wmi_reg_get_sz()

int wmi_reg_get_sz ( WMI_HANDLE  handle,
unsigned int  hive,
const char *  key,
const char *  key_name,
char **  res 
)

Get Registry string value.

Parameters
[in]handle- WMI connection handle
[in]hive- Registry Hive
[in]key- Registry key name
[in]key_name- Registry value name.
[out]res- Result string.
Returns
, 0 on success, -1 on failure

Definition at line 167 of file wmi_interface_stub.c.

Referenced by nasl_wmi_reg_get_sz().

169 {
170  (void) handle;
171  (void) hive;
172  (void) key;
173  (void) key_name;
174  (void) res;
175  return -1;
176 }
Here is the caller graph for this function:

◆ wmi_reg_set_dword_val()

int wmi_reg_set_dword_val ( WMI_HANDLE  handle,
const char *  key,
const char *  val_name,
uint32_t  val 
)

Set Registry DWORD value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 376 of file wmi_interface_stub.c.

References val.

Referenced by nasl_wmi_reg_set_dword_val().

378 {
379  (void) handle;
380  (void) key;
381  (void) val_name;
382  (void) val;
383  return -1;
384 }
const char * val
Definition: nasl_init.c:378
Here is the caller graph for this function:

◆ wmi_reg_set_ex_string_val()

int wmi_reg_set_ex_string_val ( WMI_HANDLE  handle,
const char *  key,
const char *  val_name,
const char *  val 
)

Set Registry Expanded string value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 420 of file wmi_interface_stub.c.

References val.

Referenced by nasl_wmi_reg_set_ex_string_val().

422 {
423  (void) handle;
424  (void) key;
425  (void) val_name;
426  (void) val;
427  return -1;
428 }
const char * val
Definition: nasl_init.c:378
Here is the caller graph for this function:

◆ wmi_reg_set_qword_val()

int wmi_reg_set_qword_val ( WMI_HANDLE  handle,
const char *  key,
const char *  val_name,
uint64_t  val 
)

Set Registry QWORD value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 398 of file wmi_interface_stub.c.

References val.

Referenced by nasl_wmi_reg_set_qword_val().

400 {
401  (void) handle;
402  (void) key;
403  (void) val_name;
404  (void) val;
405  return -1;
406 }
const char * val
Definition: nasl_init.c:378
Here is the caller graph for this function:

◆ wmi_reg_set_string_val()

int wmi_reg_set_string_val ( WMI_HANDLE  handle,
const char *  key,
const char *  val_name,
const char *  val 
)

Set Registry string value.

Parameters
[in]handle- WMI connection handle
[in]key- Registry key containing the value to be set
[in]val_name- Registry value to set
Returns
, 0 on success, -1 on failure

Definition at line 442 of file wmi_interface_stub.c.

References val.

Referenced by nasl_wmi_reg_set_string_val().

444 {
445  (void) handle;
446  (void) key;
447  (void) val_name;
448  (void) val;
449  return -1;
450 }
const char * val
Definition: nasl_init.c:378
Here is the caller graph for this function:

◆ wmi_versioninfo()

char* wmi_versioninfo ( void  )

Return version info for WMI implementation.

Returns
NULL if this the implementation is a non-functional stub, else a arbitrary string that explains the version of the implementation.

Definition at line 41 of file wmi_interface_stub.c.

Referenced by nasl_wmi_versioninfo().

42 {
43  return NULL;
44 }
Here is the caller graph for this function: