Defines | Functions

blacklist.c File Reference

Functions for administering the blacklist table. More...

#include <string.h>
#include <unistd.h>
#include <assert.h>
#include <libxml/tree.h>
#include <sqlite3.h>
#include <eurephia_nullsafe.h>
#include <eurephia_context.h>
#include <eurephia_log.h>
#include <eurephia_xml.h>
#include <eurephia_values.h>
#include <eurephiadb_session_struct.h>
#include <eurephiadb_mapping.h>
#include <passwd.h>
#include "../sqlite.h"
#include "../fieldmapping.h"
Include dependency graph for blacklist.c:

Go to the source code of this file.

Defines

#define FMAP_OVPNBLACKLIST

Functions

xmlDoc * blacklist_list (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * blacklist_add (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * blacklist_delete (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * eDBadminBlacklist (eurephiaCTX *ctx, xmlDoc *qryxml)

Detailed Description

Functions for administering the blacklist table.

Author:
David Sommerseth <dazo@users.sourceforge.net>
Date:
2009-05-09

Definition in file blacklist.c.


Define Documentation

#define FMAP_OVPNBLACKLIST

fieldmapping.h: Include declaration of tbl_sqlite_blacklist

Definition at line 50 of file blacklist.c.


Function Documentation

xmlDoc* blacklist_add ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Registers a new entry in the blacklist.

Parameters:
ctx eurephiaCTX
fmap eDBfieldMap containing the entry to be registered
Returns:
Returns an eurephia ResultMsg XML document, with success message or an error message

< Alias for LOG_FATAL

< Operation failed and cannot continue. Log level always < 2

Definition at line 127 of file blacklist.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* blacklist_delete ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Deletes an entry from the blacklist

Parameters:
ctx eurephiaCTX
fmap eDBfieldMap containing the entry to be deleted
Returns:
Returns an eurephia ResultMsg XML document, with success message or an error message

< Special field, should be used to indicate primary key of the table

< Alias for LOG_FATAL

< Operation failed and cannot continue. Log level always < 2

Definition at line 159 of file blacklist.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* blacklist_list ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Retrieves a list of all registered entries in the blacklist table

Parameters:
ctx eurephiaCTX
fmap eDBfieldMap containing the search query
Returns:
Returns a valid eurephia XML document on success, otherwise NULL

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

Definition at line 62 of file blacklist.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* eDBadminBlacklist ( eurephiaCTX ctx,
xmlDoc *  qryxml 
)

Query or modify the attempts log.

Version:
API version level 2
Parameters:
ctx eurephiaCTX
qryxml document specifying the operation

The XML format skeleton

    <eurephia format="1">
        <blacklist mode="{list|add|delete}">
            <fieldMapping table="blacklist">
               <{field name}>{field value}</{field field}>
            </fieldMapping>
        </blacklist>
    </eurephia>

For listing and delete mode it be several field tags to limit the search even more. For add mode only username, IP address or certificate digest can be given.

Returns:
Returns a valid XML document on success, otherwise NULL or an XML document with an error message.
See also:
eurephiaXML_CreateDoc(), eurephiaXML_getRoot()

< Messages intended when debugging. Only for log level > 10

< The context is used via the eurephiadm console utility

< The context is used via a web based utility

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

< Alias for LOG_CRITICAL

< Operation failed and might have been aborted. Log level always 0

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

< Alias for LOG_ERROR, in case it is not defined

< API errors but not sever, program can continue to run

Definition at line 185 of file blacklist.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines