Open SCAP Library

Data Structures | Macros | Functions | Variables
sql57.c File Reference

sql57 probe More...

`#include <seap.h>`
`#include <probe-api.h>`
`#include <stdlib.h>`
`#include <string.h>`
`#include <ctype.h>`
`#include <common/assume.h>`
`#include <common/debug_priv.h>`
`#include <common/bfind.h>`
`#include <time.h>`
`#include <errno.h>`
`#include <opendbx/api.h>`

## Data Structures
struct | dbEngineMap_t
struct | dbURIInfo_t

## Macros
#define | SQLPROBE_DEFAULT_CONNTIMEOUT 30
#define | ENGINE_MAP_COUNT (sizeof engine_map / sizeof (dbEngineMap_t))
#define | skipspace(s) while (isspace(*s)) ++s;
#define | matchitem1(tok, first, rest, dst)
#define | matchitem2(tok, first, rest1, dst1, rest2, dst2)
#define | get_string(dst, obj, ent_name)

## Functions
void * | probe_init (void)
void | probe_fini (void *arg)
int | probe_main (probe_ctx *ctx, void *arg)

## Variables
dbEngineMap_t | engine_map []

## Detailed Description

sql57 probe

Author
  "Daniel Kopecek" dkope.nosp@m.cek@.nosp@m.redha.nosp@m.t.co.nosp@m.m

## Macro Definition Documentation

## ◆ get_string

#define get_string | ( |  | dst,
|  |  | obj,
|  |  | ent_name
| ) |  |

Value:
do { \
SEXP_t *__sval; \
\
__sval = probe_obj_getentval (obj, ent_name, 1); \
\
if (__sval == NULL) { \
dE("Missing entity or value: obj=%p, ent=%s", obj, #ent_name); \
err = PROBE_ENOENT; \
goto __exit; \
} \
\
(dst) = SEXP_string_cstr (__sval); \
\
if ((dst) == NULL) { \
SEXP_free(__sval); \
err = PROBE_EINVAL; \
goto __exit; \
} \
\
SEXP_free(__sval); \
} while (0)
PROBE_ENOENT
#define PROBE_ENOENT
Missing entity.
Definition: probe-api.h:460
SEXP_string_cstr
char * SEXP_string_cstr(const SEXP_t *s_exp)
Get a C string from a sexp object.
Definition: sexp-manip.c:757
probe_obj_getentval
SEXP_t * probe_obj_getentval(const SEXP_t *obj, const char *name, uint32_t n)
Get the value of an object&#39;s entity.
Definition: probe-api.c:448
PROBE_EINVAL
#define PROBE_EINVAL
Invalid type/value/format.
Definition: probe-api.h:448

## ◆ matchitem1

#define matchitem1 | ( |  | tok,
|  |  | first,
|  |  | rest,
|  |  | dst
| ) |  |

Value:
case first: \
if (strncasecmp((rest), ++(tok), strlen(rest)) == 0) { \
tok += strlen(rest); \
skipspace(tok); \
if (*(tok) != '=') goto __fail; \
else (dst) = strdup((tok) + 1); \
} \
else dE("Unrecognized token: '%s'", (tok)-1); \
while(0)

## ◆ matchitem2

#define matchitem2 | ( |  | tok,
|  |  | first,
|  |  | rest1,
|  |  | dst1,
|  |  | rest2,
|  |  | dst2
| ) |  |

Value:
case first: \
if (strncasecmp((rest1), (tok)+1, strlen(rest1)) == 0) { \
tok += 1+strlen(rest1); \
skipspace(tok); \
if (*(tok) != '=') goto __fail; \
else (dst1) = strdup((tok) + 1); \
} \
else if (strncasecmp((rest2), (tok)+1, strlen(rest2)) == 0) { \
tok += 1+strlen(rest2); \
skipspace(tok); \
if (*(tok) != '=') goto __fail; \
else (dst2) = strdup((tok) + 1); \
} \
else dE("Unrecognized token: '%s'", (tok)); \
while(0)

## Variable Documentation

## ◆ engine_map

dbEngineMap_t engine_map[]

Initial value:
= {
{ "access", NULL },
{ "db2", NULL },
{ "cache", NULL },
{ "firebird", "firebird" },
{ "firstsql", NULL },
{ "foxpro", NULL },
{ "informix", NULL },
{ "ingres", NULL },
{ "interbase", NULL },
{ "lightbase", NULL },
{ "maxdb", NULL },
{ "monetdb", NULL },
{ "mimer", NULL },
{ "mssql", "mssql" },
{ "mysql", "mysql" },
{ "oracle", "oracle" },
{ "paradox", NULL },
{ "pervasive", NULL },
{ "postgre", "pgsql" },
{ "sqlbase", NULL },
{ "sqlite", "sqlite" },
{ "sqlite3", "sqlite3" },
{ "sqlserver", NULL },
{ "sybase", "sybase" }
}