From 8468bf69b1e4ed1dd23a32092a8baffd62791a73 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Thu, 10 Feb 2005 15:36:35 +0000 Subject: [PATCH] * header file for the IL communication library --- org.glite.lb.common/interface/il_msg.h | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 org.glite.lb.common/interface/il_msg.h diff --git a/org.glite.lb.common/interface/il_msg.h b/org.glite.lb.common/interface/il_msg.h new file mode 100644 index 0000000..7d47aed --- /dev/null +++ b/org.glite.lb.common/interface/il_msg.h @@ -0,0 +1,38 @@ +#ifndef IL_MSG_H +#define IL_MSG_H + +#ident "$Header$" + +/* + * Communication protocol of the interlogger. + * + * The "philosophy" behind is: + * - when sending messages, use 'encode_il_*' to create + * data packet, which can be shipped out at once using write + * (or similar function). The length of the data packet is returned. + * + * - when receiving messages, call read_il_data() supplying pointer to + * function, which can be used to get data from input stream. + * The resulting data packet may be decoded by calling appropriate + * 'decode_il_*' functions. + * + * This is completely independent of the underlying transport protocol. + * By rewriting this (part of) library, you can change the protocol IL + * uses to communicate with event destinations. + * + * Yes, for clean design there should be send_il_data(), which would + * send the 17 byte header first and the data second; in my opinion it would be + * too complicated, so the 17 byte header is included by the encoding functions. + * + * Return values - length of the output data or error code < 0 in case of error. + * No context is used (except by the supplied reader function itself). + * + */ + +int encode_il_msg(char **, const char *); +int encode_il_reply(char **, int, int, const char *); +int decode_il_msg(char **, const char *); +int decode_il_reply(int *, int *, char **, const char *); +int read_il_data(char **, int (*)(char *, const int)) + +#endif -- 1.8.2.3