Defines | Functions

attempts.c File Reference

Functions for processing attempts entries in the database. 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 attempts.c:

Go to the source code of this file.

Defines

#define FMAP_OVPNATTEMPTS

Functions

xmlDoc * attempts_list (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * attempts_reset (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * attempts_delete (eurephiaCTX *ctx, eDBfieldMap *fmap)
xmlDoc * eDBadminAttemptsLog (eurephiaCTX *ctx, xmlDoc *qryxml)

Detailed Description

Functions for processing attempts entries in the database.

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

Definition in file attempts.c.


Define Documentation

#define FMAP_OVPNATTEMPTS

fieldmapping.h: Include declaration of tbl_sqlite_attempts

Definition at line 50 of file attempts.c.


Function Documentation

xmlDoc* attempts_delete ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Deletes an entry from the attempts log

Parameters:
ctx eurephiaCTX
fmap eDBfieldMap containing the entry/entries to delete
Returns:
Returns a valid eurephia XML document on success, otherwise NULL

< 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 163 of file attempts.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* attempts_list ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Retrieves a list of all registered entries in the attempts 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 61 of file attempts.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* attempts_reset ( eurephiaCTX ctx,
eDBfieldMap fmap 
)

Internal function. Resets the attempts counter for one or more entries in the database

Parameters:
ctx eurephiaCTX
fmap eDBfieldMap defining which records to reset the attempts counter on
Returns:
Returns a valid eurephia XML document on success, otherwise NULL

< 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 128 of file attempts.c.

Here is the call graph for this function:

Here is the caller graph for this function:

xmlDoc* eDBadminAttemptsLog ( 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">
        <attemptslog mode="{search|reset|delete}">
            <fieldMapping table="attempts">
               <{field name}>{field value}</{field field}>
            </fieldMapping>
        </attemptslog>
    </eurephia>

Valid fields are: username, ip, digest, attempts, registered, lastattempt, id

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 189 of file attempts.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines