TCP-based services directly in the Citadel server. Not finished yet.
$Log$
+Revision 1.424 1999/12/08 18:09:10 ajc
+* Added CtdlRegisterServiceHook() and its data type, for implementing arbitrary
+ TCP-based services directly in the Citadel server. Not finished yet.
+
Revision 1.423 1999/11/29 17:39:07 nbryant
* citserver.c: Solaris lacks inet_aton; use inet_addr instead
Fri Jul 10 1998 Art Cancro <ajc@uncnsrd.mt-kisco.ny.us>
* Initial CVS import
+
struct UserFunctionHook *UserHookTable = NULL;
struct XmsgFunctionHook *XmsgHookTable = NULL;
struct MessageFunctionHook *MessageHookTable = NULL;
+struct ServiceFunctionHook *ServiceHookTable = NULL;
struct ProtoFunctionHook {
void (*handler) (char *cmdbuf);
lprintf(5, "Registered a new x-msg function (priority %d)\n", order);
}
+void CtdlRegisterServiceHook(int tcp_port,
+ void (*h_greeting_function) (void),
+ void (*h_command_function) (void) )
+{
+ struct ServiceFunctionHook *newfcn;
+
+ newfcn = (struct ServiceFunctionHook *)
+ mallok(sizeof(struct ServiceFunctionHook));
+ newfcn->next = ServiceHookTable;
+ newfcn->tcp_port = tcp_port;
+ newfcn->h_greeting_function = h_greeting_function;
+ newfcn->h_command_function = h_command_function;
+ ServiceHookTable = newfcn;
+ lprintf(5, "Registered a new service (TCP port %d)\n", tcp_port);
+}
+
+
void PerformSessionHooks(int EventType)
{
void CtdlRegisterUserHook(void (*fcn_ptr)(char*, long), int EventType);
void CtdlRegisterXmsgHook(int (*fcn_ptr)(char *, char *, char *), int order);
void CtdlRegisterMessageHook(int (*handler)(struct CtdlMessage *), int EventType);
+void CtdlRegisterServiceHook(int tcp_port,
+ void (*h_greeting_function) (void),
+ void (*h_command_function) (void) ) ;
int PerformMessageHooks(struct CtdlMessage *, int EventType);
char *Dynamic_Module_Init(void);
+/*
+ * ServiceFunctionHook extensions are used for hooks which implement various
+ * non-Citadel services (on TCP protocols) directly in the Citadel server.
+ */
+struct ServiceFunctionHook {
+ struct ServiceFunctionHook *next;
+ int tcp_port;
+ void (*h_greeting_function) (void) ;
+ void (*h_command_function) (void) ;
+};
+extern struct ServiceFunctionHook *ServiceHookTable;
+
/* Defines the relationship of a user to a particular room */