How can resource manager differ clients?

Hi all,

i am developing a resource manager application which can server several (limited) clients. The clients access the resource manager always with the same path.

How can actually the resource manager differ the clients in the function handling devctl() function. Since in my application, the first client has a special permission. Then when handling every request from the clients, the server has to be able to differ the clients sending the request.

I looked at the “resmgr_context_t *ctp” structure:

#include <sys/resmgr.h>

typedef struct _resmgr_context {
    int                         rcvid;
    struct _msg_info     info;
    resmgr_iomsgs_t    *msg;
    dispatch_t              *dpp;
    int                         id;    
    unsigned                tid;
    unsigned                msg_max_size;
    int                         status;
    int                         offset;
    int                         size;
    iov_t                       iov[1];
} resmgr_context_t;

is there any member of the context structure to differ the clients?

thanks for any reply.


there is a per-open data structure for each connection that is created when a client opens a device from your resource manager. It’s called the "open control block (OCB). You can extend this data structure with your own data. This gives you a possibility to identify the different client connections from the resource manager.

You will find more info on this in the “Writing a Resource Manager” tutorial, section “Extending Data Control Structures (DCS)”.

The member “struct _msg_info info;” in the context ctp contains also information about the client.