NAME

IvyInit, IvyStart, IvyStop, IvyBindMsg, IvyUnbindMsg, IvyBindDirectMsg, IvySendMsg, IvySendDirectMsg, IvySendDieMsg, IvySendError, IvyGetApplicationName, IvyGetApplicationHost, IvyGetApplication, IvyGetApplicationList, IvyGetApplicationMessages, IvyDefaultApplicationCallback, IvyClasses, IvyChannelInit, IvyChannelSetUp, IvyMainLoop, IvyChannelClose, IvyChannelDelete, IvyChannelHandleRead, IvyChannelHandleExcpt, IvyXtChannelInit, IvyXtChannelSetUp IvyXtChannelClose, IvyXtHandleChannelRead, IvyXtHandleChannelDelete, IvyXtChannelAppContext,

SYNOPSIS

useful set of library functions for communicating between different processes through a software bus

IvyInit(AppName, ready, callback, data, die_callback, die_data)

void IvyStart(bus)

void IvyStop()

MsgRcvPtr IvyBindMsg(callback, user_data, regexp, ...)

void IvyUnbindMsg(id)

void IvyBindDirectMsg(callback, user_data)

int IvySendMsg(fmt_message, ...)

void IvySendDirectMsg(app, id, msg)

void IvySendDieMsg(app)

void IvySendError(app, id, fmt, ...)

char* IvyGetApplicationName(app)

char* IvyGetApplicationHost(app)

char* IvyGetApplication(name)

char* IvyGetApplicationList()

char** IvyGetApplicationMessages(\fapp)

char* IvyDefaultApplicationCallback(app, user_data, Event) char* IvyClasses(argc, argv)

void IvyChannelInit(void)

Channel IvyChannelSetUp(fd, data, handle_delete, handle_read)

void IvyMainLoop(hook)

void IvyChannelClose(channel)

static void IvyChannelDelete(channel)

static void IvyChannelHandleRead(current)

static void IvyChannelHandleExcpt(current)

static void IvyXtChannelInit(void)

static void IvyXtChannelSetUp(fd, data, handle_delete, handle_read)

void IvyXtChannelClose(channel)

static void IvyXtHandleChannelRead(closure, source, id)

static void IvyXtHandleChannelDelete(closure, source, id)

void IvyChannelAppContext(cntx)

ARGUMENTS

Only main functions are detailed in this section

IvyInit: Initialisation of a connection

const_char *AppName (in)
Application Name
const_char *ready (in)
Ready Message (can be NULL)
IvyApplicationCallback callback (in)
Callback to be called on a connexion/deconnexion of an application
void *data (in)
user data
IvyDieCallback die_callback (in)
last change callback before die
void *die_data (in)
user data

Example:

IvyInit ("PLN-SERVER", "PLN-READY", NULL, NULL, NULL);

IvyStart: Initialisation of TCP/UPD port and sending of a broadcast handshake on every network
const_char *bus (in)
Bus to be used (format : network list followed by broadcast port).

Example:

the given bus can be a string like 123.231,123.123:2000 or 123.231 or :2000. If no argument is specified, then the environment variable IVYBUS is checked, else the default value : 127.255.255.255:2010 is used (broadcast on the local machine).
IvyStart ("143.196.53.255:2001");

IvyBindMsg: Message binding
MsgCallback callback (in)
void *user_data (in)
const_char *regexp (in)
MsgRcvPtr id (out)

Example:

IvyBindMsg (StartTimeCallback, 0, "^CLOCK Start time=(.*)");
In this example the function StartTimeCallback will be called each time the string CLOCK Start time=(.*) will be emitted on the bus.

IvyUnbindMsg: Message unbinding
MsgRcvPtr id (in)
ident of the message to unbind

IvySendMsg: Sending a message
const_char* fmt (in)
String to be sent on the bus

Example:

IvySendMsg ("SECTOR:%s.AIRCRAFT:%s Entered", sectorname, pln->indicatif);

IvyChannelSetUp:
HANDLE fd (in)
void *data (in)
ChannelHandleDelete handle_delete (in)
ChannelHandleRead handle_read (in)
Channel out (out)

Example:

IvyChannelSetUp (0, NULL, NULL, HandleStdin);:

DESCRIPTION

These functions provide facilities for connecting applications on a software bus and managing messages exchanges among them. Each time an application initializes a connection on the bus, a "ready" message is sent to all other applications already connected, and the list of the messages subscribed by this application is dispatched. The format for the messages is free.

EXAMPLE

Connection of the application IVYPROBE on a given bus


#include "ivyloop.h"
#include "ivysocket.h"
#include "ivy.h"

 int main (int argc, char* argv[]){
/* bus domain and port number to be used */
	const char* bus="127.255.255.255:2010";
/* initialisation of the connection */
	IvyInit ("IVYPROBE",
		 bport,
		 "IVYPROBE READY",
		 ApplicationCallback,
		 NULL,
		 NULL,
		 NULL);
/* keyboard's inputs management */
	IvyChannelSetUp(0, NULL, NULL, HandleStdin);
/* starting the connection */
	IvyStart (bus);
/* Main loop */
	IvyMainLoop(0);
};

FILES

/usr/include/ivy.h
/usr/include/ivyloop.h
/usr/include/ivysocket.h

ENVIRONMENT

IVYBUS
IVYDOMAINS

DIAGNOSTICS

error messages displayed

BUGS

none reported yet!

AUTHORS

Francois-Regis Colin <fcolin@cenatoulouse.dgac.fr> Stephane Chatty <chatty@cenatoulouse.dgac.fr>

SEE ALSO

ivyprobe (1)

For further details, please refer to the Ivy html page at http://www.cenatls.cena.dgac.fr/pii/produits/Ivy.html

NOTES

In case of any comment or bug report on this library, please contact fcolin@cenatoulouse.dgac.fr, chatty@cenatoulouse.dgac.fr, jacomi@cenatoulouse.dgac.fr