citadel
About: Citadel is an advanced messaging and collaboration system for groupware and BBS applications (preferred OS: Linux).
  Fossies Dox: citadel.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

serv_extensions.c File Reference
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/stat.h>
#include <libcitadel.h>
#include "sysdep_decls.h"
#include "modules/crypto/serv_crypto.h"
#include "serv_extensions.h"
#include "ctdl_module.h"
#include "config.h"
Include dependency graph for serv_extensions.c:

Go to the source code of this file.

Data Structures

struct  FixedOutputHook
 
struct  SessionFunctionHook
 
struct  UserFunctionHook
 
struct  MessageFunctionHook
 
struct  DeleteFunctionHook
 
struct  XmsgFunctionHook
 
struct  RoomFunctionHook
 
struct  SearchFunctionHook
 
struct  ProtoFunctionHook
 

Macros

#define ERR_PORT   (1 << 1)
 

Typedefs

typedef struct FixedOutputHook FixedOutputHook
 
typedef struct SessionFunctionHook SessionFunctionHook
 
typedef struct UserFunctionHook UserFunctionHook
 
typedef struct MessageFunctionHook MessageFunctionHook
 
typedef struct DeleteFunctionHook DeleteFunctionHook
 
typedef struct XmsgFunctionHook XmsgFunctionHook
 
typedef struct RoomFunctionHook RoomFunctionHook
 
typedef struct SearchFunctionHook SearchFunctionHook
 
typedef struct ProtoFunctionHook ProtoFunctionHook
 

Functions

void LogPrintMessages (long err)
 
void AddPortError (char *Port, char *ErrorMessage)
 
int DLoader_Exec_Cmd (char *cmdbuf)
 
void CtdlRegisterProtoHook (void(*handler)(char *), char *cmd, char *desc)
 
void CtdlRegisterSessionHook (void(*fcn_ptr)(void), int EventType, int Priority)
 
void CtdlUnregisterSessionHook (void(*fcn_ptr)(void), int EventType)
 
void CtdlRegisterUserHook (void(*fcn_ptr)(ctdluser *), int EventType)
 
void CtdlUnregisterUserHook (void(*fcn_ptr)(struct ctdluser *), int EventType)
 
void CtdlRegisterMessageHook (int(*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
 
void CtdlUnregisterMessageHook (int(*handler)(struct CtdlMessage *, struct recptypes *), int EventType)
 
void CtdlRegisterRoomHook (int(*fcn_ptr)(struct ctdlroom *))
 
void CtdlUnregisterRoomHook (int(*fcn_ptr)(struct ctdlroom *))
 
void CtdlRegisterDeleteHook (void(*handler)(char *, long))
 
void CtdlUnregisterDeleteHook (void(*handler)(char *, long))
 
void CtdlRegisterFixedOutputHook (char *content_type, void(*handler)(char *, int))
 
void CtdlUnregisterFixedOutputHook (char *content_type)
 
int PerformFixedOutputHooks (char *content_type, char *content, int content_length)
 
void CtdlRegisterXmsgHook (int(*fcn_ptr)(char *, char *, char *, char *), int order)
 
void CtdlUnregisterXmsgHook (int(*fcn_ptr)(char *, char *, char *, char *), int order)
 
void CtdlRegisterServiceHook (int tcp_port, char *sockpath, void(*h_greeting_function)(void), void(*h_command_function)(void), void(*h_async_function)(void), const char *ServiceName)
 
void CtdlUnregisterServiceHook (int tcp_port, char *sockpath, void(*h_greeting_function)(void), void(*h_command_function)(void), void(*h_async_function)(void))
 
void CtdlShutdownServiceHooks (void)
 
void CtdlRegisterSearchFuncHook (void(*fcn_ptr)(int *, long **, const char *), char *name)
 
void CtdlUnregisterSearchFuncHook (void(*fcn_ptr)(int *, long **, const char *), char *name)
 
void CtdlModuleDoSearch (int *num_msgs, long **search_msgs, const char *search_string, const char *func_name)
 
void PerformSessionHooks (int EventType)
 
void PerformUserHooks (ctdluser *usbuf, int EventType)
 
int PerformMessageHooks (struct CtdlMessage *msg, struct recptypes *recps, int EventType)
 
int PerformRoomHooks (struct ctdlroom *target_room)
 
void PerformDeleteHooks (char *room, long msgnum)
 
int PerformXmsgHooks (char *sender, char *sender_email, char *recp, char *msg)
 
void CtdlModuleStartCryptoMsgs (char *ok_response, char *nosup_response, char *error_response)
 
char * ctdl_module_modules_init (int threading)
 

Variables

FixedOutputHookFixedOutputTable = NULL
 
SessionFunctionHookSessionHookTable = NULL
 
UserFunctionHookUserHookTable = NULL
 
MessageFunctionHookMessageHookTable = NULL
 
DeleteFunctionHookDeleteHookTable = NULL
 
XmsgFunctionHookXmsgHookTable = NULL
 
RoomFunctionHookRoomHookTable = NULL
 
SearchFunctionHookSearchFunctionHookTable = NULL
 
ServiceFunctionHookServiceHookTable = NULL
 
HashList * ProtoHookList = NULL
 
static StrBuf * portlist = NULL
 
static StrBuf * errormessages = NULL
 
long DetailErrorFlags
 
ConstStr Empty = {HKEY("")}
 
char * ErrSubject = "Startup Problems"
 
ConstStr ErrGeneral []
 
ConstStr ErrPortShort = { HKEY("We couldn't bind all ports you configured to be provided by Citadel Server.\n")}
 
ConstStr ErrPortWhere = { HKEY("\"Admin->System Preferences->Network\".\n\nThe failed ports and sockets are: ")}
 
ConstStr ErrPortHint
 

Macro Definition Documentation

◆ ERR_PORT

#define ERR_PORT   (1 << 1)

Definition at line 143 of file serv_extensions.c.

Typedef Documentation

◆ DeleteFunctionHook

Definition at line 88 of file serv_extensions.c.

◆ FixedOutputHook

Definition at line 32 of file serv_extensions.c.

◆ MessageFunctionHook

Definition at line 75 of file serv_extensions.c.

◆ ProtoFunctionHook

Definition at line 133 of file serv_extensions.c.

◆ RoomFunctionHook

Definition at line 115 of file serv_extensions.c.

◆ SearchFunctionHook

Definition at line 123 of file serv_extensions.c.

◆ SessionFunctionHook

Definition at line 47 of file serv_extensions.c.

◆ UserFunctionHook

Definition at line 62 of file serv_extensions.c.

◆ XmsgFunctionHook

Definition at line 102 of file serv_extensions.c.

Function Documentation

◆ AddPortError()

void AddPortError ( char *  Port,
char *  ErrorMessage 
)

Definition at line 221 of file serv_extensions.c.

References DetailErrorFlags, ERR_PORT, errormessages, and portlist.

Referenced by CtdlRegisterServiceHook().

◆ ctdl_module_modules_init()

char * ctdl_module_modules_init ( int  threading)

Definition at line 904 of file serv_extensions.c.

◆ CtdlModuleDoSearch()

void CtdlModuleDoSearch ( int *  num_msgs,
long **  search_msgs,
const char *  search_string,
const char *  func_name 
)

◆ CtdlModuleStartCryptoMsgs()

void CtdlModuleStartCryptoMsgs ( char *  ok_response,
char *  nosup_response,
char *  error_response 
)

◆ CtdlRegisterDeleteHook()

void CtdlRegisterDeleteHook ( void(*)(char *, long)  handler)

◆ CtdlRegisterFixedOutputHook()

void CtdlRegisterFixedOutputHook ( char *  content_type,
void(*)(char *, int)  handler 
)

◆ CtdlRegisterMessageHook()

◆ CtdlRegisterProtoHook()

◆ CtdlRegisterRoomHook()

void CtdlRegisterRoomHook ( int(*)(struct ctdlroom *)  fcn_ptr)

◆ CtdlRegisterSearchFuncHook()

void CtdlRegisterSearchFuncHook ( void(*)(int *, long **, const char *)  fcn_ptr,
char *  name 
)

◆ CtdlRegisterServiceHook()

◆ CtdlRegisterSessionHook()

◆ CtdlRegisterUserHook()

void CtdlRegisterUserHook ( void(*)(ctdluser *)  fcn_ptr,
int  EventType 
)

◆ CtdlRegisterXmsgHook()

void CtdlRegisterXmsgHook ( int(*)(char *, char *, char *, char *)  fcn_ptr,
int  order 
)

◆ CtdlShutdownServiceHooks()

void CtdlShutdownServiceHooks ( void  )

◆ CtdlUnregisterDeleteHook()

void CtdlUnregisterDeleteHook ( void(*)(char *, long)  handler)

◆ CtdlUnregisterFixedOutputHook()

void CtdlUnregisterFixedOutputHook ( char *  content_type)

◆ CtdlUnregisterMessageHook()

void CtdlUnregisterMessageHook ( int(*)(struct CtdlMessage *, struct recptypes *)  handler,
int  EventType 
)

◆ CtdlUnregisterRoomHook()

void CtdlUnregisterRoomHook ( int(*)(struct ctdlroom *)  fcn_ptr)

◆ CtdlUnregisterSearchFuncHook()

void CtdlUnregisterSearchFuncHook ( void(*)(int *, long **, const char *)  fcn_ptr,
char *  name 
)

◆ CtdlUnregisterServiceHook()

void CtdlUnregisterServiceHook ( int  tcp_port,
char *  sockpath,
void(*)(void)  h_greeting_function,
void(*)(void)  h_command_function,
void(*)(void)  h_async_function 
)

◆ CtdlUnregisterSessionHook()

void CtdlUnregisterSessionHook ( void(*)(void)  fcn_ptr,
int  EventType 
)

◆ CtdlUnregisterUserHook()

void CtdlUnregisterUserHook ( void(*)(struct ctdluser *)  fcn_ptr,
int  EventType 
)

◆ CtdlUnregisterXmsgHook()

void CtdlUnregisterXmsgHook ( int(*)(char *, char *, char *, char *)  fcn_ptr,
int  order 
)

◆ DLoader_Exec_Cmd()

int DLoader_Exec_Cmd ( char *  cmdbuf)

Definition at line 240 of file serv_extensions.c.

References ProtoFunctionHook::handler, and ProtoHookList.

Referenced by do_command_loop().

◆ LogPrintMessages()

void LogPrintMessages ( long  err)

◆ PerformDeleteHooks()

void PerformDeleteHooks ( char *  room,
long  msgnum 
)

◆ PerformFixedOutputHooks()

int PerformFixedOutputHooks ( char *  content_type,
char *  content,
int  content_length 
)

◆ PerformMessageHooks()

int PerformMessageHooks ( struct CtdlMessage msg,
struct recptypes recps,
int  EventType 
)

◆ PerformRoomHooks()

int PerformRoomHooks ( struct ctdlroom target_room)

◆ PerformSessionHooks()

◆ PerformUserHooks()

void PerformUserHooks ( ctdluser usbuf,
int  EventType 
)

◆ PerformXmsgHooks()

int PerformXmsgHooks ( char *  sender,
char *  sender_email,
char *  recp,
char *  msg 
)

Variable Documentation

◆ DeleteHookTable

DeleteFunctionHook* DeleteHookTable = NULL

◆ DetailErrorFlags

long DetailErrorFlags

Definition at line 150 of file serv_extensions.c.

Referenced by AddPortError(), initialise_modules(), and LogPrintMessages().

◆ Empty

ConstStr Empty = {HKEY("")}

Definition at line 151 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ ErrGeneral

ConstStr ErrGeneral[]
Initial value:
= {
{HKEY("Citadel had trouble on starting up. ")},
{HKEY(" This means, Citadel won't be the service provider for a specific service you configured it to.\n\n"
"If you don't want Citadel to provide these services, turn them off in WebCit via: ")},
{HKEY("To make both ways actualy take place restart the citserver with \"sendcommand down\"\n\n"
"The errors returned by the system were:\n")},
{HKEY("You can recheck the above if you follow this faq item:\n"
"http://www.citadel.org/doku.php?id=faq:mastering_your_os:net#netstat")}
}

Definition at line 153 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ errormessages

StrBuf* errormessages = NULL
static

Definition at line 147 of file serv_extensions.c.

Referenced by AddPortError(), and LogPrintMessages().

◆ ErrPortHint

ConstStr ErrPortHint
Initial value:
= { HKEY("If you want Citadel to provide you with that functionality, "
"check the output of \"netstat -lnp\" on Linux, or \"netstat -na\" on BSD"
" and disable the program that binds these ports.\n")}

Definition at line 165 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ ErrPortShort

ConstStr ErrPortShort = { HKEY("We couldn't bind all ports you configured to be provided by Citadel Server.\n")}

Definition at line 163 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ ErrPortWhere

ConstStr ErrPortWhere = { HKEY("\"Admin->System Preferences->Network\".\n\nThe failed ports and sockets are: ")}

Definition at line 164 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ ErrSubject

char* ErrSubject = "Startup Problems"

Definition at line 152 of file serv_extensions.c.

Referenced by LogPrintMessages().

◆ FixedOutputTable

FixedOutputHook* FixedOutputTable = NULL

◆ MessageHookTable

MessageFunctionHook* MessageHookTable = NULL

◆ portlist

StrBuf* portlist = NULL
static

Definition at line 146 of file serv_extensions.c.

Referenced by AddPortError(), and LogPrintMessages().

◆ ProtoHookList

HashList* ProtoHookList = NULL

Definition at line 140 of file serv_extensions.c.

Referenced by CtdlRegisterProtoHook(), and DLoader_Exec_Cmd().

◆ RoomHookTable

RoomFunctionHook* RoomHookTable = NULL

◆ SearchFunctionHookTable

SearchFunctionHook* SearchFunctionHookTable = NULL

◆ ServiceHookTable

◆ SessionHookTable

SessionFunctionHook* SessionHookTable = NULL

◆ UserHookTable

UserFunctionHook* UserHookTable = NULL

◆ XmsgHookTable

XmsgFunctionHook* XmsgHookTable = NULL