I'll explain the way I've done it: 
```
struct header { short action; int file_size; char *file_name; };
```
To send to server, this currently gets packed into a char array (i.e. string), a bit like this:
```
char *head_string = "0\n326\nthisisthefile.txt\n\0";
```
where 0 is the action (i.e. ADD_FILE, FETCH_FILE, LIST_FILES), 326 is the file size in bytes, and then the file name. The new line characters are used as delimeters to unpack the info. 

The ```unpack_header_string()``` function loops through the three fields to extract each one into a ```struct header```. 

The numbers defined for actions are arbitrary constants. 

So that's how I've been thinking about it. Does that make sense? Do you think there's a better way to do it? Basically the goal is:

* Server needs action descriptor from client
* If server is to write file or read file, it needs file name and size
* I presume it's best to send this all in one message