Review commit

The overall structure of the project looks like this:

The NDMP server is split into different components, represented as subdirectories of ndmp, which are currently

1. comm
2. docs
3. ndmp
4. utils

In each component the source code is in a src directory. Each component has makefiles for easy execution. comm is reponsible for actual client-server communication. ndmp is responsible for the ndmp server responses to client requests. ndmp consists of xdr management as well. utils provides thread-safe queues and hex dumps. docs provides program documentation.

comm

comm/src/comm.c, comm/src/comm.h:
Structures and functions for listening and management of client connections/requests. Currently listens for connections from multiple clients. New connections are added to a list of sessions. Requests from connected clients are enqueued into a job queue.

comm/src/worker.c, comm/src/worker.h:
Thread creation, shutdown, running jobs from request queue, and processing jobs from response queue.

ndmp

ndmp/src/ndmp.x:
Contains ndmp structures that the NDMP protocol uses. We use rpcgen to generate C structures and the routines for XDR marshaling and unmarshaling. These are contained in ndmp.h and ndmp_xdr.c respectively.

ndmp/src/ndmp_config.c:
Contains functions for responses to NDMP config client requests.

ndmp/src/ndmp_connect.c:
Contains functions for responses to NDMP connect client requests.

ndmp/src/ndmp_data.c:
Contains functions for responses to NDMP config data requests.

ndmp/src/ndmp_msg.c, ndmp/src/ndmp_msg.h:
Structures and functions for XDR message handling and session management. It contains session states and session queues.

utils

utils/src/hexdump.c, utils/sec/hexdump.h:
Hexdump utility.

utils/src/locks.c, utils/src/locks.h:
Provides mutex locks to make queues thread-safe.

utils/src/queue.c, utils/src/queue.h:
Thread-safe queue implementation. Each queue has its own lock. Two queues are used by comm - request_jobs, for client requests and response_jobs, for server responses.