Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions
ipcCommandModule.cpp File Reference
#include <stdlib.h>
#include <string.h>
#include "ipcLog.h"
#include "ipcCommandModule.h"
#include "ipcModule.h"
#include "ipcClient.h"
#include "ipcMessage.h"
#include "ipcMessageUtils.h"
#include "ipcModuleReg.h"
#include "ipcd.h"
#include "ipcm.h"

Go to the source code of this file.

Classes

struct  ipcCommandModule

Functions

void IPCM_HandleMsg (ipcClient *client, const ipcMessage *rawMsg)

Function Documentation

void IPCM_HandleMsg ( ipcClient client,
const ipcMessage rawMsg 
)

Definition at line 255 of file ipcCommandModule.cpp.

{
    static ipcCommandModule::MsgHandler handlers[] =
    {
        ipcCommandModule::OnPing,
        ipcCommandModule::OnForward,
        ipcCommandModule::OnClientHello,
        ipcCommandModule::OnClientAddName,
        ipcCommandModule::OnClientDelName,
        ipcCommandModule::OnClientAddTarget,
        ipcCommandModule::OnClientDelTarget,
        ipcCommandModule::OnQueryClientByName
    };

    int type = IPCM_GetType(rawMsg);
    LOG(("IPCM_HandleMsg [type=%x]\n", type));

    if (!(type & IPCM_MSG_CLASS_REQ)) {
        LOG(("not a request -- ignoring message\n"));
        return;
    }

    type &= ~IPCM_MSG_CLASS_REQ;
    type--;
    if (type < 0 || type >= (int) (sizeof(handlers)/sizeof(handlers[0]))) {
        LOG(("unknown request -- ignoring message\n")); 
        return;
    }

    (handlers[type])(client, rawMsg);
}

Here is the call graph for this function:

Here is the caller graph for this function: