There are a few precompiler directives that help with messaging.
Messages are represented inside the server with a structure defined as...
typedef struct {
u_int32_t size; /* size of the data sent */
u_int32_t command; /* Which function to call */
char data[MSG_DATA_SIZE];
int fd; /* We'll use the fd to identify the module*/
} dax_message;
The parts of the actual message header are above the data area. The data area is pre-defined to be big enough for the largest message. Everything below the data[] member is information that is helpful to the inner workings of the server but are not sent as part of the actual socket communications. For now the file descriptor of the socket is all that is defined here.
The size will always be sent in network byte order. This saves having to figure out which module sent the message before the message is received. It also saves some complexity for a registration message because we may not know which module sent the registration.