centralserver.c File Reference

Functions to talk to the central server (auth/send stats/get rules/etc...). More...

Go to the source code of this file.

Functions

t_authcode auth_server_request (t_authresponse *authresponse, char *request_type, char *ip, char *mac, char *token, unsigned long long int incoming, unsigned long long int outgoing)
 Initiates a transaction with the auth server.
int connect_auth_server ()
 Tries really hard to connect to an auth server. Returns a connected file descriptor or -1 on error.
int _connect_auth_server (int level)
 Helper function called by connect_auth_server() to do the actual work including recursion - DO NOT CALL DIRECTLY.

Variables

pthread_mutex_t config_mutex


Detailed Description

Functions to talk to the central server (auth/send stats/get rules/etc...).

Author:
Copyright (C) 2004 Philippe April <papril777@yahoo.com>

Definition in file centralserver.c.


Function Documentation

int _connect_auth_server ( int  level  ) 

Helper function called by connect_auth_server() to do the actual work including recursion - DO NOT CALL DIRECTLY.

Definition at line 201 of file centralserver.c.

Referenced by _connect_auth_server(), and connect_auth_server().

t_authcode auth_server_request ( t_authresponse authresponse,
char *  request_type,
char *  ip,
char *  mac,
char *  token,
unsigned long long int  incoming,
unsigned long long int  outgoing 
)

Initiates a transaction with the auth server.

Initiates a transaction with the auth server, either to authenticate or to update the traffic counters at the server

Parameters:
authresponse Returns the information given by the central server
request_type Use the REQUEST_TYPE_* defines in centralserver.h
ip IP adress of the client this request is related to
mac MAC adress of the client this request is related to
token Authentification token of the client
incoming Current counter of the client's total incoming traffic, in bytes
outgoing Current counter of the client's total outgoing traffic, in bytes

TODO: XXX change the PHP so we can harmonize stage as request_type everywhere.

We don't have to use FD_ISSET() because there was only one fd.

Definition at line 65 of file centralserver.c.

Referenced by authenticate_client(), fw_sync_with_authserver(), and http_callback_auth().

int connect_auth_server (  ) 

Tries really hard to connect to an auth server. Returns a connected file descriptor or -1 on error.

Definition at line 179 of file centralserver.c.

Referenced by auth_server_request(), and ping().


Variable Documentation

pthread_mutex_t config_mutex

Mutex for the configuration file, used by the auth_servers related functions.

Definition at line 56 of file conf.c.


Generated on Sun Apr 13 21:55:00 2008 for WifiDog by  doxygen 1.5.3