/* * CCTL Interface Module's Header File * * G. Robert Malan (rmalan@eecs.umich.edu). * 2/18/97 * * This represents the interface library bewteen the Corona suppliers * and clients, and a CCTL server. * * $Id: salamanderInterface.h,v 1.9 1997/08/27 19:17:16 rmalan Exp $ */ #ifndef _SALAMANDER_INTERFACE_H_ #define _SALAMANDER_INTERFACE_H_ 1 #include #include "propertyList.h" #define SALAMANDER_UDP_PORT 8086 #define SAL_INTERFACE_VERSION {'2', '0', '0', '0'} #define SALAMANDER_MAX_UDP_MSGSIZE 1024 /* * UDP Commands: */ #define SALAMANDER_QUERY_TCP_PORT 1 /* * Library Return codes: */ #define SALAMANDER_OK 0 #define SALAMANDER_LOCAL_ERROR 1 #define SALAMANDER_SERVER_TIMEOUT 2 #define SALAMANDER_HOST_UNKNOWN 3 #define SALAMANDER_REMOTE_ERROR 4 #define SALAMANDER_ALREADY_CONNECTED 5 #define SALAMANDER_PUBLISH_GENERIC 6 #define SALAMANDER_SEND_ERROR 7 #define SALAMANDER_PROTOCOL_ERROR 8 #define SALAMANDER_INVALID_PLIST 9 #define SALAMANDER_MEMORY_ERROR 10 /* * Administrative Control Port Commands: */ #define SALAMANDER_QUERY_CONNECTIONS 10 #define SALAMANDER_REMOVE_CONNECTION 11 #define SALAMANDER_EXIT 12 /* Used to construct distributed server tree: */ #define SALAMANDER_REMOTE_PUBLISH 13 #define SALAMANDER_REMOTE_SUBSCRIBE 14 /** * XXX. Make dynamic. Ad hoc maximum to a property key or value length. */ #define MAX_PROP_LEN 1024 /* * Todo list: * * Remotely control archiving. * Remotely view each connection's status: * - queue * - subscription * - publishing record * - qos status * QoS module placement and manipulation * */ /* * For use with specifying query constraints. */ #define EQ "EQ" #define RANGE "RANGE" #define LAST "LAST" #define INFINITY "INFINITY" /**************************************************************************** * Prototypes: ****************************************************************************/ /* * connectToSalamanderServer: * * Given a hostname and a session key, connect to a salamander server. * * IN: hostname string, session key. * * OUT: connection sucess. * */ int connectToSalamanderServer(char * hostname, u_long sskey); /* * disconnectFromSalamanderServer: * * Disconnect from the server. * * IN: nothing (implicit connection). * * OUT: nothing. * */ void disconnectFromSalamanderServer(void); /* * salamanderSendServerData: * * Block and send the next data object to the server. * * IN: plist (a property list), * an opaque data payload, * and the length of the data payload. * * OUT: status of send. * * ERRORS: * SALAMANDER_OK, means that data was written and everything is OK with * the connection. * Anything else means that the connection has been severed, and you * should attempt a reconnect. */ int salamanderSendServerData(plist_t plist, void * data, u_long data_length); /* * salamanderReadServerData: * * Block and Read the next data object from the server. * * IN: nothing (an implicit salamander server connection and outstanding * queries). * * OUT: status of read, * plist (property list), (this must be deallocated using * destroyPropertyList()), * ptr to data object (this must also be deallocated using free), * and the length of the data object. * * ERRORS: * SALAMANDER_OK, means that data was read and everything is OK with * the connection. * Anything else means that the connection has been severed, and you * should attempt a reconnect. */ int salamanderReadServerData(plist_t *plist, void **data, u_long *data_length); #endif /* _SALAMANDER_INTERFACE_H_ */