MessageChecker

Package: inet.common.misc

MessageChecker

simple module

Module that allows checking fields of messages.

Example of XML configuration:

 <message occurence="i">     # check i successive messages
     <fieldValue name="<fieldname>" value="<fieldvalue>" [ type="<fieldtype>" ]/>
     <fieldObject name="<fieldname>" [ type="<objecttype>" ]>
         ...
     </field>
     <fieldArray name="<fieldname>" [ size="<arraysize>" type="<fieldtype>" ]/>
     <fieldValueInArray name="<fieldname>" index="<arrayindex>" value="<fieldvalue>" [ size="<arraysize>" type="<objecttype>" ]/>
     <fieldObjectInArray name="<fieldname>" [ index="<arrayindex>" size="<arraysize>" type="<objecttype>" ]>
         ...
     </field>
 </message>
 <message occurence="n"/>    # ignore n messages

Optional attributes are surrounded with square brackets. See also validation schema (XSD, DTD)

Parameters

Name Type Default value Description
config xml

Configuration file

Gates

Name Direction Size Description
in input
out output

Incoming messages (observed)

gatemsgkindctrlsrcModuletags
inIndication3 (TcpStatusInd::TCP_I_AVAILABLE)TcpAvailableInfoTcpSocketInd
inIndication4 (TcpStatusInd::TCP_I_ESTABLISHED)TcpConnectInfoTcpSocketInd
inIndication6 (TcpStatusInd::TCP_I_CLOSED)TcpCommandTcpSocketInd
inIndication8 (TcpStatusInd::TCP_I_CONNECTION_RESET)TcpCommandTcpSocketInd
inPacket1 (TcpStatusInd::TCP_I_DATA)TcpSocketInd
inPacket4 (TcpCommandCode::TCP_C_SEND)BgpDispatchProtocolReq, SocketReq
inRequest1 (TcpCommandCode::TCP_C_OPEN_ACTIVE)TcpOpenCommandBgpDispatchProtocolReq, SocketReq
inRequest11 (TcpCommandCode::TCP_C_SETOPTION)TcpSetTimeToLiveCommandBgpDispatchProtocolReq, SocketReq
inRequest2 (TcpCommandCode::TCP_C_OPEN_PASSIVE)TcpOpenCommandBgpDispatchProtocolReq, SocketReq
inRequest3 (TcpCommandCode::TCP_C_ACCEPT)TcpAcceptCommandBgpDispatchProtocolReq, SocketReq
inRequest6 (TcpCommandCode::TCP_C_ABORT)TcpCommandBgpDispatchProtocolReq, SocketReq

Outgoing messages (observed)

gatemsgkindctrldestModuletags
outIndication3 (TcpStatusInd::TCP_I_AVAILABLE)TcpAvailableInfoBgpSocketInd
outIndication4 (TcpStatusInd::TCP_I_ESTABLISHED)TcpConnectInfoBgpSocketInd
outIndication6 (TcpStatusInd::TCP_I_CLOSED)TcpCommandBgpSocketInd
outIndication8 (TcpStatusInd::TCP_I_CONNECTION_RESET)TcpCommandBgpSocketInd
outPacket1 (TcpStatusInd::TCP_I_DATA)BgpSocketInd
outPacket4 (TcpCommandCode::TCP_C_SEND)TcpDispatchProtocolReq, SocketReq
outRequest1 (TcpCommandCode::TCP_C_OPEN_ACTIVE)TcpOpenCommandTcpDispatchProtocolReq, SocketReq
outRequest11 (TcpCommandCode::TCP_C_SETOPTION)TcpSetTimeToLiveCommandTcpDispatchProtocolReq, SocketReq
outRequest2 (TcpCommandCode::TCP_C_OPEN_PASSIVE)TcpOpenCommandTcpDispatchProtocolReq, SocketReq
outRequest3 (TcpCommandCode::TCP_C_ACCEPT)TcpAcceptCommandTcpDispatchProtocolReq, SocketReq
outRequest6 (TcpCommandCode::TCP_C_ABORT)TcpCommandTcpDispatchProtocolReq, SocketReq

Source code

//
// Module that allows checking fields of messages.
//
// Example of XML configuration:
//
// <pre>
//  <message occurence="i">     # check i successive messages
//      <fieldValue name="<fieldname>" value="<fieldvalue>" [ type="<fieldtype>" ]/>
//      <fieldObject name="<fieldname>" [ type="<objecttype>" ]>
//          ...
//      </field>
//      <fieldArray name="<fieldname>" [ size="<arraysize>" type="<fieldtype>" ]/>
//      <fieldValueInArray name="<fieldname>" index="<arrayindex>" value="<fieldvalue>" [ size="<arraysize>" type="<objecttype>" ]/>
//      <fieldObjectInArray name="<fieldname>" [ index="<arrayindex>" size="<arraysize>" type="<objecttype>" ]>
//          ...
//      </field>
//  </message>
//  <message occurence="n"/>    # ignore n messages
// </pre>
//
// Optional attributes are surrounded with square brackets.
// See also validation schema (XSD, DTD)
//
simple MessageChecker
{
    parameters:
        xml config;   // Configuration file
    gates:
        input in;
        output out;
}

File: src/inet/common/misc/MessageChecker.ned