isismessage.c File Reference
ISIS client message-handling utilties.
More...
#include "isisclient.h"
|
Functions |
int | SplitMessage (char *msgstr, char *fromID, char *destID, MsgType *msgtype, char *msgbody) |
| Split a raw IMPv2 message string into components.
|
char * | ISISMessage (char *fromID, char *destID, MsgType msgtype, char *msgbody) |
| Create an IMPv2 message string.
|
Detailed Description
ISIS client message-handling utilties.
ISIS clients pass messages to each other using the ICIMACS Messaging Protocol version 2 (IMPv2) syntax. These functions are used by ISIS client applications to create a IMPv2-compliant message strings and to decompose IMPv2 messages into their component parts for further handling.
IMPv2 messages take the form
FromID>DestID msg_type msg_body\r
where:
FromID
is the ISIS node name of the message sender (sender address)
DestID
is the ISIS node name of the recipient (destination address)
msg_type
is a message type code identifying the type of message being sent
msg_body
is the message body, terminated with \r (ASCII 13)
msg_body must be one of DONE:, STATUS:, ERROR:, WARNING:, FATAL:, EXEC:, REQ:, with REQ: being implicit if no msg_type is given.
msg_body is a multi-word string that may contain one of the following
-
a command with arguments (requires that the msg_type be REQ: or EXEC:)
-
a set ofkey=value pairs returning information in response to a command or info request (DONE: or STATUS:)
-
human-readable information text (status and error messages).
For more details on the IMPv2 messaging protocol, see ...
Function Documentation
int SplitMessage |
( |
char * |
msgstr, |
|
|
char * |
fromID, |
|
|
char * |
destID, |
|
|
MsgType * |
msgtype, |
|
|
char * |
msgbody |
|
) |
|
|
|
Split a raw IMPv2 message string into components.
- Parameters:
-
| msgstr | Raw IMPv2 message string |
| fromID | Address of the sending ISIS node |
| destID | Address of the destination ISIS node |
| msgtype | IMPv2 message type code (see IMPv2_MsgType) |
| msgbody | Body of the message |
- Returns:
- 0 if message is a valid message (proper format), -1 if invalid
This function decomposes a raw message string into its component parts. If the message does not have a valid format, it returns -1. Note that the validation stages do not include validating the message terminator (\r = ASCII 13). Instead we just assume proper termination and strip off the terminator character if present, but say nothing if absent.
- See also:
- ISISMessage()
|
char* ISISMessage |
( |
char * |
fromID, |
|
|
char * |
destID, |
|
|
MsgType |
msgtype, |
|
|
char * |
msgbody |
|
) |
|
|
|
Create an IMPv2 message string.
- Parameters:
-
| fromID | ISIS node name of the client application |
| destID | ISIS node name of the intended recipient |
| msgtype | IMPv2 message type code (see IMPv2_MsgType) |
| msgbody | Body of the message to create |
- Returns:
- a character pointer to the message string.
Creates a message string in the proper IMPv2 format with the correct termination (\r = ASCII 13).
- See also:
- SplitMessage()
|
Generated on Thu Jul 22 20:28:29 2004 for ISIS Client API by
1.3.7