asTrapWrite.h

API for monitoring external put operations to an IOC.

The access security subsystem provides an API asTrapWrite that makes put/write requests visible to any facility that registers a listener.

Author

Marty Kraimer

Typedefs

typedef void *asTrapWriteId

An identifier needed to unregister an listener.

typedef void (*asTrapWriteListener)(asTrapWriteMessage *pmessage, int after)

Pointer to a listener function.

Each registered listener function is called twice for every put; once before and once after the write is performed. The listener may set userPvt in the first call and retrieve it in the second call.

Each asTrapWriteMessage can change or may be deleted after the user’s asTrapWriteListener returns

The listener function is called by a server thread so it must not block or do anything that causes a delay.

Functions

asTrapWriteId asTrapWriteRegisterListener(asTrapWriteListener func)

Register function to be called on asTrapWriteListener.

Parameters:

func – The listener function to be called.

Returns:

A listener identifier for unregistering this listener.

void asTrapWriteUnregisterListener(asTrapWriteId id)

Unregister asTrapWriteListener.

Parameters:

id – Listener identifier from asTrapWriteRegisterListener().

struct asTrapWriteMessage
#include <asTrapWrite.h>

The message passed to registered listeners.

Public Members

const char *userid

Userid of whoever originated the request.

const char *hostid

Hostid of whoever originated the request.

struct dbChannel *serverSpecific

A field for use by the server.

Any listener that uses this field must know what type of server is forwarding the put requests. This pointer holds the value the server provides to asTrapWriteWithData(), which for RSRV is the dbChannel pointer for the target field.

void *userPvt

A field for use by the asTrapWriteListener.

When the listener is called before the write, this has the value 0. The listener can give it any value it desires and it will have the same value when the listener gets called again after the write.

int dbrType

Data type from ca/db_access.h, NOT dbFldTypes.h.

int no_elements

Array length

void *data

Might be NULL if no data is available.